Skip to main content

Overview

The bd remember command stores knowledge permanently in a key-value store. Memories are automatically injected at bd prime time, making them available in every session without manual loading. Added in: v0.58.0

Syntax

Arguments

string
required
The knowledge or insight to store permanently. Must not be empty.

Options

string
Explicit key for the memory. If not provided, a key is auto-generated from the first ~8 words of the content using slugification (lowercase, hyphenated, max 60 chars).

How It Works

Storage

Memories are stored in the Dolt-backed key-value configuration store with the prefix kv.memory.. This ensures they:
  • Persist across CLI sessions
  • Survive account rotations
  • Sync via Dolt push/pull
  • Are versioned with your project

Auto-Injection

When you run bd prime (typically called automatically by AI tool hooks), all stored memories are injected into the context. This happens:
  • At session start (via SessionStart hooks)
  • After context compaction (via PreCompact hooks)
  • Whenever you manually run bd prime
The memories appear in the output under a “Persistent Memories” section, making them available to AI agents automatically.

Key Generation

If you don’t specify --key, the system generates one by:
  1. Converting to lowercase
  2. Replacing non-alphanumeric characters with hyphens
  3. Taking the first ~8 words (hyphen-separated segments)
  4. Capping total length at 60 characters
  5. Trimming trailing hyphens

Examples

Basic Usage

Store a simple insight:
Output:

Custom Key

Use a memorable key for easier retrieval:
Output:

Multi-line Memories

Store detailed information:

Project-Specific Knowledge

Updating Existing Memories

If you store a memory with a key that already exists, it updates the existing value:

Use Cases for Agents

Configuration Details

Gotchas and Edge Cases

Team Conventions

Tool Quirks

Agent Workflow

AI agents should use bd remember to store knowledge that:
  1. Persists across sessions - Don’t lose hard-won insights
  2. Applies project-wide - Not specific to one file or task
  3. Prevents repeated mistakes - Learn from bugs and gotchas
  4. Documents decisions - Why certain patterns exist
Anti-pattern: Creating MEMORY.md files that fragment across accounts and get lost. Best practice: Use bd remember so memories sync with your Dolt database and inject automatically.

JSON Output

Add --json flag for programmatic use:
Output:
For updates:
  • bd memories - List or search all stored memories
  • bd recall - Retrieve a specific memory by key
  • bd forget - Delete a memory
  • bd prime - Output context including all memories (auto-called by hooks)

Error Handling

Empty Content

Key Generation Failure

In this case, provide an explicit key:

Tips

Use descriptive keys that you’ll remember. Keys like auth-jwt, dolt-phantoms, and api-staging are better than auto-generated dolt-phantom-dbs-hide-in.
Search your memories before creating new ones: bd memories <keyword> to avoid duplicates.
Memories are stored in the database. Don’t store secrets or credentials. Use environment variables or secret managers for sensitive data.
Memories automatically sync when you push to your Dolt remote, making them available to team members and other machines.