The Problem
AI coding agents are stateless. Every session starts from scratch — no memory of previous debugging sessions, architectural decisions, or bugfix context. Teams work around this withCLAUDE.md files and manual notes, but these are disconnected from the code graph and cannot be automatically surfaced when relevant.
Development Memories solve this by storing structured knowledge directly in the symbol graph. When an agent builds a slice touching authenticate(), it automatically sees the memory: “Fixed race condition here — added mutex on session map.”
How Memories Work
Every memory exists in two places simultaneously:- Graph Database — a
Memorynode in LadybugDB with edges toRepo,Symbol, andFilenodes. Enables fast querying, ranking, and automatic surfacing inside slices. - Markdown Files —
.sdl-memory/<type>/<memoryId>.mdwith YAML frontmatter. These files can be committed to version control, shared across team members, and survive database rebuilds.
sdl.index.refresh, any .sdl-memory/ files on disk are imported into the graph automatically.
Graph Edges
| Edge | From | To | Purpose |
|---|---|---|---|
HAS_MEMORY | Repo | Memory | Repository owns this memory |
MEMORY_OF | Memory | Symbol | Memory is about this symbol |
MEMORY_OF_FILE | Memory | File | Memory relates to this file |
Memory Types
| Type | Directory | Use Case |
|---|---|---|
decision | .sdl-memory/decisions/ | Architectural decisions, design choices, “why we did it this way” |
bugfix | .sdl-memory/bugfixes/ | Bug context, root cause analysis, regression notes |
task_context | .sdl-memory/task_context/ | In-progress work context, handoff notes between sessions |
Memory File Format
Each memory is stored as a markdown file with YAML frontmatter:Directory Structure
MCP Tools
sdl.memory.store
Store or update a memory with optional symbol and file links.
Repository ID.
Memory type:
"decision", "bugfix", or "task_context".Short title (1–120 characters).
Full memory content (1–50,000 characters).
Up to 20 tags for filtering and cross-cutting queries.
Confidence score from 0.0–1.0 (default:
0.8). Use 0.9+ for verified facts, 0.5–0.7 for hypotheses.Link to up to 100 symbols. Linked memories surface automatically when those symbols appear in slices.
Link to up to 100 files by relative path.
If provided, updates the existing memory in-place and clears the
stale flag.Deduplication: If a memory with the same content hash (SHA-256 of
repoId + type + title + content) already exists, the call returns deduplicated: true with the existing memoryId rather than creating a duplicate.sdl.memory.query
Search and filter memories with flexible criteria.
Repository ID.
Text search matched against the combined title and content. When
semantic.retrieval.mode: "hybrid" is enabled, memories are also retrievable via the FTS index.Filter by memory types.
Filter by tags (OR logic — any match qualifies).
Filter to memories linked to these symbols via
MEMORY_OF edges.Return only stale memories (useful after refactors).
Maximum results, 1–100 (default:
20)."recency" (default) or "confidence".sdl.memory.remove
Soft-delete a memory from the graph with optional file cleanup.
Repository ID.
ID of the memory to remove.
Delete the
.sdl-memory/*.md file from disk (default: true). When false, the file is kept but its deleted frontmatter field is set to true, preserving history in version control while marking it inactive.HAS_MEMORY, MEMORY_OF, MEMORY_OF_FILE) are removed and the Memory node is marked deleted: true (soft delete).
sdl.memory.surface
Explicitly surface relevant memories for a task context. Ranks memories by a composite score of confidence, recency, and symbol overlap.
Repository ID.
Up to 500 symbol IDs for context matching.
Filter by memory type (
"decision", "bugfix", or "task_context").Maximum results, 1–50 (default:
10).Automatic Surfacing in Slices
Whensdl.slice.build is called, memories are automatically surfaced alongside the response — no extra tool call required.
How it works:
- After the slice is built, the system collects all
symbolIds from the slice cards - It queries for memories linked to those symbols plus any repo-level memories
- Memories are ranked using the confidence × recency × overlap algorithm
- The top N memories (default: 5) are embedded in the slice response as
memories[]
sdl.slice.build:
| Field | Type | Default | Description |
|---|---|---|---|
includeMemories | boolean | true | Set to false to disable memory surfacing |
memoryLimit | number | 5 | Max memories to include (0–20) |
Memory surfacing is non-critical. If it fails, the slice is still returned successfully (without memories) and a warning is logged.
Staleness Detection
Whensdl.index.refresh runs, memories linked to changed symbols are automatically flagged as stale.
How it works:
- After indexing, the system identifies all
symbolIds in changed files - It queries for memories linked to those symbols via
MEMORY_OFedges - Each matching memory gets
stale: trueandstaleVersionset to the current version ID - Stale memories are still surfaced, but include the
stale: trueflag as a signal to review
- Review — the linked code changed; does the memory still apply?
- Update — call
sdl.memory.storewith the existingmemoryIdto update content and clear the stale flag - Remove — call
sdl.memory.removeif the memory is no longer relevant
Team Sharing via Version Control
Duringsdl.index.refresh, the indexer scans the .sdl-memory/ directory and imports any files found:
scanMemoryFiles(repoRoot)recursively finds all.mdfiles under.sdl-memory/- Each file is parsed (YAML frontmatter + markdown body)
- Files marked
deleted: truein frontmatter are skipped - For each valid file, a
contentHashis computed and the memory is upserted into the graph
Store a memory
Call
sdl.memory.store to record a debugging insight, architectural decision, or task note. The tool writes both a graph node and a .sdl-memory/ markdown file.Commit the file
Add
.sdl-memory/ to your Git repository and commit the new file alongside your code changes.Best Practices
- Write memories when you learn something non-obvious — if a debugging session took 30 minutes, the root cause is worth a
bugfixmemory - Link memories to specific symbols — unlinked memories only surface via repo-level queries; linked memories appear automatically in relevant slices
- Use tags consistently — tags enable cross-cutting queries like “all auth-related decisions”
- Review stale memories after refactors — query
staleOnly: trueand update or remove outdated knowledge - Commit
.sdl-memory/to Git — shares knowledge across the team and survives database rebuilds - Set confidence intentionally — 0.9+ for verified facts, 0.5–0.7 for hypotheses or temporary notes