consolidate_user
Merge user working memories into compact long-term summaries to retain essential context and streamline memory storage.
Instructions
Consolidate user-scoped working memories into long-term summaries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User identifier | |
| batch | No | Number of memories to consolidate (default 50) | |
| keep | No | Most recent N to leave untouched (default 20) | |
| dryRun | No | Preview without writing (default false) |
Implementation Reference
- src/index.ts:171-183 (registration)Tool registration for 'consolidate_user' within the ListToolsRequestSchema handler. Defines name, description, and inputSchema (userId, batch, keep, dryRun).
name: 'consolidate_user', description: 'Consolidate user-scoped working memories into long-term summaries.', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User identifier' }, batch: { type: 'number', description: 'Number of memories to consolidate (default 50)' }, keep: { type: 'number', description: 'Most recent N to leave untouched (default 20)' }, dryRun: { type: 'boolean', description: 'Preview without writing (default false)' }, }, required: ['userId'], }, }, - src/index.ts:360-367 (handler)Handler for 'consolidate_user' tool. Calls memory.consolidateUser() with userId, batch, keep, and dryRun options, then returns the result as JSON.
case 'consolidate_user': { const result = await memory.consolidateUser(args.userId as string, { batch: args.batch as number | undefined, keep: args.keep as number | undefined, dryRun: args.dryRun as boolean | undefined, }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } - dist/src/index.js:196-196 (registration)Compiled registration of 'consolidate_user' tool name.
name: 'consolidate_user', - dist/src/index.js:349-356 (handler)Compiled handler for 'consolidate_user' tool calling memory.consolidateUser().
case 'consolidate_user': { const result = await memory.consolidateUser(args.userId, { batch: args.batch, keep: args.keep, dryRun: args.dryRun, }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }