Skip to main content
Beads provides a persistent memory system for AI agents that survives context compaction, session resets, and account rotations. Use 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 Dolt
2

Persist

Memory survives context compaction and session resets
3

Auto-inject

bd prime includes memories in workflow context
4

Available

Agent has access to memories in every session

Integration with bd prime

Memories are automatically injected when running bd prime:
Output includes:
  • Essential workflow rules
  • Command reference
  • All stored memories (auto-included)

Claude Code Integration

Designed for Claude Code hooks:
This ensures memories are injected:
  • 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

Keys should be memorable and meaningful:
One concept per memory for easy recall:
Use the same key to update existing memories:
Avoid duplicates by searching first:
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 prefix kv.memory.*:
Direct database manipulation is not recommended. Always use bd remember, bd memories, bd recall, and bd forget commands.

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

Verify storage:
Check database access:
Memory commands require direct database access (not RPC mode).
Update with same key:
Search is case-insensitive and matches keys or values:

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