bd remember, bd recall, bd forget, and bd memories to store knowledge that should persist across conversations.
Why Agent Memory?
AI agents face a fundamental challenge: context doesn’t persist.The Problem
- Context compaction loses history
- Session resets forget decisions
- Account rotations start from scratch
- Manual notes in conversation are lost
The Solution
- Knowledge stored in database
- Auto-injected at session start
- Survives all resets
- Searchable and queryable
Core Commands
Store a Memory
Save knowledge that should persist:Keys are auto-generated from content using the first ~8 words, lowercased, with non-alphanumeric chars replaced by hyphens.
List All Memories
View stored memories:Retrieve a Memory
Recall full content by key:Delete a Memory
Remove outdated knowledge:How Memory Works
Memories are stored in the Dolt database using the key-value store:1
Store
bd remember writes to kv.memory.* namespace in Dolt2
Persist
Memory survives context compaction and session resets
3
Auto-inject
bd prime includes memories in workflow context4
Available
Agent has access to memories in every session
Integration with bd prime
Memories are automatically injected when running bd prime:
- Essential workflow rules
- Command reference
- All stored memories (auto-included)
Example prime output with memories
Example prime output with memories
Claude Code Integration
Designed for Claude Code hooks:- At session start
- Before context compaction
- After account rotation
Memory Patterns
Architecture Decisions
Store key architectural choices:Testing Requirements
Configuration Quirks
Deployment Details
Debugging Techniques
Best Practices
Use descriptive keys
Use descriptive keys
Keys should be memorable and meaningful:
Keep memories focused
Keep memories focused
One concept per memory for easy recall:
Update, don't duplicate
Update, don't duplicate
Use the same key to update existing memories:
Search before creating
Search before creating
Avoid duplicates by searching first:
Clean up stale memories
Clean up stale memories
Remove outdated knowledge:
Memory vs Issues
Understand when to use each:Rule of thumb: If it’s knowledge, use memory. If it’s work, use an issue.
Storage Details
Memories are stored in the key-value store with the prefixkv.memory.*:
Backup and Migration
Memories are included in Dolt commits:JSON API
All memory commands support--json for programmatic use:
Example: Multi-Session Workflow
See how memory helps across sessions:1
Session 1: Discovery
2
Session 2: Different task
3
Session 3: Account rotation
Troubleshooting
Memory not showing in bd prime
Memory not showing in bd prime
Verify storage:
Can't remember (write error)
Can't remember (write error)
Check database access:Memory commands require direct database access (not RPC mode).
Key collision
Key collision
Update with same key:
Search not finding memory
Search not finding memory
Search is case-insensitive and matches keys or values:
Related Documentation
Architecture
Understand the Dolt storage backend
Workflows
Learn about agent session protocols
Prime Command
Deep dive into bd prime integration
Key-Value Store
Advanced key-value store usage