Skip to main content

Overview

The bd memories command lists all stored memories or searches them by keyword. It helps you discover what knowledge has been saved and find specific insights quickly. Added in: v0.58.0

Syntax

Arguments

string
Optional keyword or phrase to filter memories. Searches both memory keys and content (case-insensitive).

How It Works

The command queries the key-value store for all entries with the kv.memory. prefix. When a search term is provided, it filters memories where either:
  • The memory key contains the search term
  • The memory content contains the search term
Matching is case-insensitive for better usability.

Output Format

Memories are displayed in alphabetical order by key with:
  • Key - The memory identifier (shown on its own line)
  • Content - The stored insight (indented, truncated at 120 characters)
The output includes a count of total memories found.

Examples

List All Memories

View everything you’ve stored:
Output:

Search by Keyword

Find memories about a specific topic:
Output:

Search by Phrase

Use quotes for multi-word searches:
Output:

Search Matches Content

Search finds matches in both keys and content:
Output:
Note: The key doesn’t contain “JWT” (lowercase), but the content does, so it matches.

No Results

When no memories match:
Output:
When no memories exist at all:
Output:

JSON Output

For programmatic access, add the --json flag:
Output:
With search:
Output:
Empty results:
Output:

Use Cases

Quick Reference

Find that configuration detail you stored weeks ago:

Knowledge Discovery

Browse all stored knowledge before starting work:

Preventing Duplicates

Check if you’ve already stored similar knowledge:

Agent Context Building

AI agents can use this to gather project-specific knowledge:

Audit Trail

Review what knowledge has been accumulated:

Agent Workflow

AI agents should use bd memories to:
  1. Check existing knowledge before asking questions
  2. Avoid duplicate storage by searching first
  3. Build context for unfamiliar projects
  4. Validate assumptions against stored insights
Example agent pattern:

Sorting and Display

Memories are always sorted alphabetically by key for consistency. The content is truncated at 120 characters to keep the list readable. To see full content, use:
  • bd remember - Store a new memory
  • bd recall - Retrieve full content of a specific memory
  • bd forget - Delete a memory
  • bd prime - Inject all memories into AI context (auto-called by hooks)

Tips

Run bd memories at the start of each session to refresh your knowledge of project-specific details.
Use broad search terms first, then narrow down:
Memories are sorted alphabetically by key, not by creation date. Use descriptive key prefixes to group related memories:
  • test-* for testing insights
  • deploy-* for deployment notes
  • api-* for API details
Search is case-insensitive but matches substrings. Searching for “test” will match “test-race”, “latest-build”, and “contest-winner”.