Overview
Thebd forget command permanently deletes a stored memory from the key-value store. Use this to remove outdated, incorrect, or no longer relevant knowledge.
Added in: v0.58.0
Syntax
Arguments
string
required
The exact key of the memory to delete. Keys are case-sensitive.
How It Works
The command:- Looks up the memory by key (
kv.memory.<key>) - Verifies it exists (fails if not found)
- Deletes it from the database
- Confirms deletion with the deleted content (truncated)
Examples
Basic Deletion
Remove a single memory:Long Content Confirmation
When forgetting a long memory:Key Not Found
Attempting to delete a non-existent memory:JSON Output
For programmatic use:Use Cases
Remove Outdated Information
Clean up memories that are no longer accurate:bd remember with the same key. Use forget when you want to completely remove the memory, not replace it.
Cleanup Test Data
Remove memories created during testing:Remove Sensitive Info
If you accidentally stored something sensitive:Bulk Deletion Script
Delete multiple memories at once:Safe Deletion with Confirmation
Verify before deleting:Agent Cleanup
AI agents can clean up after themselves:Exit Codes
- 0: Memory deleted successfully
- 1: Memory key not found (nothing to delete)
Finding Keys to Delete
If you don’t remember the exact key:Undo Deletion
There’s no built-in undo forbd forget, but if you have Dolt history:
Related Commands
bd memories- List all memories to find keys to deletebd recall- View full content before deletingbd remember- Store or update a memory (alternative to delete + recreate)
Tips
Deletion is permanent in your local database. However, Dolt tracks all changes. If you need to recover a deleted memory, you can query historical commits.