forget
Delete specific memories by ID or content match to manage stored information and prevent outdated data from persisting in AI systems.
Instructions
Explicitly delete a memory by ID or content match.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Memory ID | |
| content | No | Content to match (partial match) |
Implementation Reference
- index.js:237-254 (handler)The handler function for the 'forget' tool, which filters out memories by ID or content and saves the updated list.
function handleForget(args) { const { id, content } = args; if (!id && !content) return { error: 'Provide "id" or "content" to forget' }; let memories = loadMemories(); const before = memories.length; if (id) { memories = memories.filter(m => m.id !== id); } else { const c = content.toLowerCase(); memories = memories.filter(m => !m.content.toLowerCase().includes(c)); } saveMemories(memories); const removed = before - memories.length; return { removed, remaining: memories.length }; } - index.js:398-405 (schema)Definition and input schema for the 'forget' tool.
name: 'forget', description: 'Explicitly delete a memory by ID or content match.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Memory ID' }, content: { type: 'string', description: 'Content to match (partial match)' } } - index.js:463-463 (registration)The switch statement in the main tool dispatch logic that routes the 'forget' request to handleForget.
case 'forget': result = handleForget(args); break;