Skip to main content

Class: MemoryUpdateTool

Defined in: packages/agentos/src/memory/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/memory/tools/MemoryUpdateTool.ts:110

Parameters

brain

SqliteBrain

The agent's shared SQLite brain database connection.

Returns

MemoryUpdateTool

Properties

category

readonly category: "memory" = 'memory'

Defined in: packages/agentos/src/memory/tools/MemoryUpdateTool.ts:81

Logical category for discovery and grouping.

Implementation of

ITool.category


description

readonly description: string

Defined in: packages/agentos/src/memory/tools/MemoryUpdateTool.ts:76

LLM-facing description.

Implementation of

ITool.description


displayName

readonly displayName: "Update Memory" = 'Update Memory'

Defined in: packages/agentos/src/memory/tools/MemoryUpdateTool.ts:73

Human-readable display name.

Implementation of

ITool.displayName


hasSideEffects

readonly hasSideEffects: true = true

Defined in: packages/agentos/src/memory/tools/MemoryUpdateTool.ts:84

This tool writes to the database.

Implementation of

ITool.hasSideEffects


id

readonly id: "memory-update-v1" = 'memory-update-v1'

Defined in: packages/agentos/src/memory/tools/MemoryUpdateTool.ts:67

Globally unique tool identifier.

Implementation of

ITool.id


inputSchema

readonly inputSchema: JSONSchemaObject

Defined in: packages/agentos/src/memory/tools/MemoryUpdateTool.ts:87

JSON schema for input validation and LLM tool-call construction.

Implementation of

ITool.inputSchema


name

readonly name: "memory_update" = 'memory_update'

Defined in: packages/agentos/src/memory/tools/MemoryUpdateTool.ts:70

LLM-facing tool name.

Implementation of

ITool.name

Methods

execute()

execute(args, _context): Promise<ToolExecutionResult<MemoryUpdateOutput>>

Defined in: packages/agentos/src/memory/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:

  • content provided → set content = ?, also set embedding = NULL to signal that the cached vector is stale.
  • tags provided → serialise array as JSON and set tags = ?.

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

ToolExecutionContext

Tool execution context (not used by this tool).

Returns

Promise<ToolExecutionResult<MemoryUpdateOutput>>

{ updated } status, or an error result.

Implementation of

ITool.execute