Skip to main content

Overview

The bd recall command retrieves the complete content of a stored memory by its key. Unlike bd memories which truncates long content, recall shows everything. Added in: v0.58.0

Syntax

bd recall <key>

Arguments

key
string
required
The exact key of the memory to retrieve. Keys are case-sensitive.

How It Works

The command queries the key-value store for the entry matching kv.memory.<key> and returns the full content without truncation. This is useful for:
  • Reading long, multi-line memories
  • Copying content for reference
  • Verifying exact stored text
  • Piping to other commands

Examples

Basic Recall

Retrieve a simple memory:
bd recall test-race
Output:
always run tests with -race flag to catch concurrency bugs

Multi-line Memory

Recall complex, structured information:
bd recall auth-jwt
Output:
Auth module uses JWT not sessions.
Token expiry is 24h.
Refresh tokens stored in Redis.
Refresh endpoint: POST /api/v1/auth/refresh
Requires: Bearer token in Authorization header

Long Content

Get full text that was truncated in bd memories:
bd recall deployment-checklist
Output:
Pre-deployment checklist:
1. Run full test suite with race detector
2. Update CHANGELOG.md with new version
3. Run bd doctor to check for issues
4. Tag release in git: git tag v1.2.3
5. Push tags: git push --tags
6. Verify CI passes on tag
7. Run deploy script: ./scripts/deploy.sh production
8. Monitor logs for 10 minutes
9. Check health endpoint: curl https://api.example.com/health
10. Update status page if needed

Memory Doesn’t Exist

When the key is not found:
bd recall nonexistent-key
Output (stderr):
No memory with key "nonexistent-key"
Exit code: 1

JSON Output

For programmatic use, add --json:
bd recall auth-jwt --json
Success output:
{
  "key": "auth-jwt",
  "value": "Auth module uses JWT not sessions.\nToken expiry is 24h.\nRefresh tokens stored in Redis.",
  "found": true
}
Not found output:
{
  "key": "nonexistent-key",
  "value": "",
  "found": false
}
Exit code: 1 when not found, 0 when found.

Use Cases

Copy to Clipboard

On macOS:
bd recall api-staging | pbcopy
On Linux:
bd recall api-staging | xclip -selection clipboard

Use in Scripts

Extract configuration from memories:
#!/bin/bash
S3_BUCKET=$(bd recall s3-staging)
aws s3 ls "$S3_BUCKET"

Verify Memory Content

Check exact wording before updating:
# See what's currently stored
bd recall deploy-checklist

# Update if needed
bd remember "$(bd recall deploy-checklist)
New step: Notify team in Slack" --key deploy-checklist

Pipe to Editor

Edit long memories:
bd recall deployment-checklist > /tmp/checklist.txt
$EDITOR /tmp/checklist.txt
bd remember "$(cat /tmp/checklist.txt)" --key deployment-checklist

Compare Versions

If you’re tracking similar info in git:
bd recall deployment-notes > /tmp/bd-notes.txt
cat docs/DEPLOYMENT.md > /tmp/doc-notes.txt
diff /tmp/bd-notes.txt /tmp/doc-notes.txt

Agent Context Retrieval

AI agents can fetch specific knowledge:
# Agent discovers it needs to know about auth
bd recall auth-jwt
# Gets full details to inform implementation

Finding Keys

If you don’t know the exact key:
# Search first
bd memories auth
# Output shows: auth-jwt, auth-config, etc.

# Then recall the right one
bd recall auth-jwt
Or use JSON for parsing:
bd memories auth --json | jq 'keys[]'
# Lists all keys matching "auth"

Exit Codes

  • 0: Memory found and retrieved successfully
  • 1: Memory key not found
This makes it easy to check in scripts:
if bd recall staging-api-key >/dev/null 2>&1; then
  echo "Found staging API key"
else
  echo "No staging API key stored"
  bd remember "abc123xyz" --key staging-api-key
fi

Tips

Use bd recall when you need the full, untruncated content. Use bd memories <search> when you’re browsing or don’t know the exact key.
Pipe output to tools:
bd recall code-style | less  # Page through long content
bd recall api-endpoints | grep POST  # Search within memory
bd recall config --json | jq -r .value  # Extract value only
Keys are case-sensitive. bd recall Auth-JWT won’t find auth-jwt. Use bd memories to find the correct key if unsure.
Output goes to stdout. Error messages go to stderr. This allows safe piping:
config=$(bd recall my-config)  # Works even if not found (empty string)

Build docs developers (and LLMs) love