Class: MemoryUpdateTool
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:65
ITool implementation that applies partial updates to an existing memory trace stored in the agent's SQLite brain database.
Usage:
const tool = new MemoryUpdateTool(brain);
const result = await tool.execute(
{ traceId: 'mt_1711234567890_0', content: 'Updated content here.' },
context,
);
// result.output.updated → true
Implements
ITool<MemoryUpdateInput,MemoryUpdateOutput>
Constructors
Constructor
new MemoryUpdateTool(
brain):MemoryUpdateTool
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:110
Parameters
brain
The agent's shared SQLite brain database connection.
Returns
MemoryUpdateTool
Properties
category
readonlycategory:"memory"='memory'
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:81
Logical category for discovery and grouping.
Implementation of
description
readonlydescription:string
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:76
LLM-facing description.
Implementation of
displayName
readonlydisplayName:"Update Memory"='Update Memory'
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:73
Human-readable display name.
Implementation of
hasSideEffects
readonlyhasSideEffects:true=true
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:84
This tool writes to the database.
Implementation of
id
readonlyid:"memory-update-v1"='memory-update-v1'
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:67
Globally unique tool identifier.
Implementation of
inputSchema
readonlyinputSchema:JSONSchemaObject
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:87
JSON schema for input validation and LLM tool-call construction.
Implementation of
name
readonlyname:"memory_update"='memory_update'
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:70
LLM-facing tool name.
Implementation of
Methods
execute()
execute(
args,_context):Promise<ToolExecutionResult<MemoryUpdateOutput>>
Defined in: packages/agentos/src/cognition/memory/io/tools/MemoryUpdateTool.ts:134
Update a memory trace identified by traceId.
The method builds a dynamic SET clause based on which optional fields are provided:
contentprovided → setcontent = ?, also setembedding = NULLto signal that the cached vector is stale.tagsprovided → serialise array as JSON and settags = ?.
If neither content nor tags is specified, the method returns
{ updated: false } immediately without touching the database.
A trace that does not exist or has deleted = 1 returns { updated: false }.
Parameters
args
MemoryUpdateInput
Update input (traceId, optional content/tags).
_context
Tool execution context (not used by this tool).
Returns
Promise<ToolExecutionResult<MemoryUpdateOutput>>
{ updated } status, or an error result.