Class MemoryUpdateTool

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

Methods

  • 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.

Properties

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

Globally unique tool identifier.

name: "memory_update" = 'memory_update'

LLM-facing tool name.

displayName: "Update Memory" = 'Update Memory'

Human-readable display name.

description: string = ...

LLM-facing description.

category: "memory" = 'memory'

Logical category for discovery and grouping.

hasSideEffects: true = true

This tool writes to the database.

inputSchema: JSONSchemaObject = ...

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