Delete Memory
delete_memoryDelete a single memory by its ID or bulk-remove all memories matching specified tags. Use for correcting errors, removing duplicates, or cleaning up test data.
Instructions
Delete a memory by ID (memory_id) or bulk-delete by tag (tags). Use sparingly — consider update_memory instead.
Mode 1 — Single (default): pass memory_id to delete one memory and its embedding. Idempotent: re-running on the same ID is a no-op.
Mode 2 — Bulk-by-tag: pass tags: [...] to delete ALL memories tagged with ANY of these tags. Tag matching is exact (case-insensitive), any-of mode. There is NO dry-run. This can delete thousands of memories in one call. NOT idempotent in practice — re-running may catch new memories that were tagged the same way after the first call. Verify with recall_memory({ tags, exhaustive: true }) first if uncertain.
When to use:
Memory contains incorrect information that can't be corrected (Mode 1)
Memory is a duplicate (Mode 1)
Cleanup of benchmark/test data scoped by tag (Mode 2)
Removing all memories under a deprecated tag namespace (Mode 2)
Examples:
delete_memory({ memory_id: "abc123" }) // Mode 1
delete_memory({ tags: ["benchmark-test"] }) // Mode 2, bulk by tag
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | No | Single-delete mode (XOR with `tags`). ID of the memory to delete (from store_memory or recall results). | |
| tags | No | Bulk-delete mode (XOR with `memory_id`). Bulk-deletes ALL memories tagged with ANY of these tags. Exact match, case-insensitive. No dry-run. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | No | Single-delete result: ID of the deleted memory. | |
| deleted_count | No | Bulk-delete result: number of memories deleted. | |
| tags | No | Bulk-delete result: tags that were used for the bulk delete. | |
| message | Yes | Confirmation message |