Class MemoryDeleteTool

ITool implementation that soft-deletes a memory trace from the agent's SQLite brain database.

Usage:

const tool = new MemoryDeleteTool(brain);
const result = await tool.execute(
{ traceId: 'mt_1711234567890_0', reason: 'Information is outdated.' },
context,
);
// result.output.deleted → true

Implements

  • ITool<MemoryDeleteInput, MemoryDeleteOutput>

Constructors

Methods

  • Set deleted = 1 on the memory trace matching traceId.

    The WHERE clause filters to deleted = 0 so that attempting to delete an already-deleted trace returns { deleted: false } rather than silently succeeding — this gives callers accurate feedback.

    Parameters

    • args: MemoryDeleteInput

      Delete input (traceId, optional reason).

    • _context: ToolExecutionContext

      Tool execution context (not used by this tool).

    Returns Promise<ToolExecutionResult<MemoryDeleteOutput>>

    { deleted } status, or an error result.

Properties

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

Globally unique tool identifier.

name: "memory_delete" = 'memory_delete'

LLM-facing tool name.

displayName: "Delete Memory" = 'Delete 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.