forget_user
Delete user-scoped memories from persistent semantic storage by specifying user ID, optional memory ID, or date range.
Instructions
Delete user-scoped memories.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User identifier | |
| id | No | Specific memory ID (optional) | |
| before | No | ISO date — delete entries before this date (optional) |
Implementation Reference
- src/index.ts:291-297 (handler)Handler for 'forget_user' tool that processes the request, builds options object with optional id and before parameters, calls memory.forgetUser(), and returns a formatted response with the count of deleted memories
case 'forget_user': { const opts: Parameters<typeof memory.forgetUser>[1] = {}; if (args.id) opts.id = args.id as string; if (args.before) opts.before = new Date(args.before as string); const deleted = await memory.forgetUser(args.userId as string, opts); return { content: [{ type: 'text', text: `Deleted ${deleted} user memor${deleted === 1 ? 'y' : 'ies'}.` }] }; } - src/index.ts:158-168 (schema)Tool registration with name 'forget_user', description, and input schema defining userId (required), id (optional), and before (optional ISO date) parameters
name: 'forget_user', description: 'Delete user-scoped memories.', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User identifier' }, id: { type: 'string', description: 'Specific memory ID (optional)' }, before: { type: 'string', description: 'ISO date — delete entries before this date (optional)' }, }, required: ['userId'], }, - src/index.ts:21-28 (helper)Initialization of the Engram memory instance from @cartisien/engram package, which provides the forgetUser() method used by the handler
const memory = new Engram({ dbPath: DB_PATH, embeddingUrl: EMBEDDING_URL, semanticSearch: true, graphMemory: process.env.ENGRAM_GRAPH === '1', graphModel: GRAPH_MODEL, consolidateModel: CONSOLIDATE_MODEL, });