Class: MemoryReflectTool
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:54
ITool implementation that triggers one full memory consolidation cycle via ().
Usage:
const tool = new MemoryReflectTool(brain, consolidationLoop);
const result = await tool.execute({}, context);
// result.output → { pruned: 3, merged: 1, derived: 0, compacted: 2, durationMs: 42 }
Implements
ITool<MemoryReflectInput,MemoryConsolidationResult>
Constructors
Constructor
new MemoryReflectTool(
brain,consolidation):MemoryReflectTool
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:101
Parameters
brain
The agent's shared SQLite brain database connection. Accepted for symmetry with other memory tools and for future direct consolidation calls.
consolidation
The ConsolidationLoop instance to invoke.
Returns
MemoryReflectTool
Properties
category
readonlycategory:"memory"='memory'
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:75
Logical category for discovery and grouping.
Implementation of
description
readonlydescription:string
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:68
Description shown to the LLM. The consolidation steps are described explicitly so the model understands what "reflect" means operationally.
Implementation of
displayName
readonlydisplayName:"Reflect on Memory"='Reflect on Memory'
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:62
Human-readable display name.
Implementation of
hasSideEffects
readonlyhasSideEffects:true=true
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:81
Consolidation writes to the database (pruning, merging, inserting insights). Mark as having side effects so callers may request confirmation if needed.
Implementation of
id
readonlyid:"memory-reflect-v1"='memory-reflect-v1'
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:56
Globally unique tool identifier.
Implementation of
inputSchema
readonlyinputSchema:JSONSchemaObject
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:84
JSON schema for input validation and LLM tool-call construction.
Implementation of
name
readonlyname:"memory_reflect"='memory_reflect'
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:59
LLM-facing tool name.
Implementation of
Methods
execute()
execute(
_args,_context):Promise<ToolExecutionResult<MemoryConsolidationResult>>
Defined in: packages/agentos/src/memory/tools/MemoryReflectTool.ts:121
Run one full consolidation cycle and return the statistics.
If a consolidation cycle is already in progress (mutex guard in
ConsolidationLoop), run() returns immediately with zero counts —
this is surfaced as a successful result with all-zero statistics.
Parameters
_args
MemoryReflectInput
Reflect input (optional topic hint, currently unused).
_context
Tool execution context (not used by this tool).
Returns
Promise<ToolExecutionResult<MemoryConsolidationResult>>
ConsolidationResult on success, or an error result.