Research & Memory
Claude Code includes a built-in deep research system for source-grounded investigations and a semantic memory layer for cross-session knowledge retention.
Deep Research
The research system (src/research/) enables thorough, source-grounded investigations across local files, wiki content, and memory.
Capabilities
| Feature | Description |
|---|---|
| Citation Extraction | Automatically extracts and attributes sources from research results |
| Claim Verification | Cross-references claims across sources with confidence scoring |
| Dossier Generation | Produces structured research dossiers with summaries, evidence, and references |
| Truth Checking | Validates factual claims against source material |
| Source Ranking | Ranks sources by relevance, authority, and recency |
Research Workflow
- Query — Natural language research question or topic
- Gather — Collects information from local files, wiki, memory, and web
- Analyze — Cross-references, verifies claims, extracts citations
- Synthesize — Produces a structured report with evidence and sources
/research "What are the current performance bottlenecks in the API layer?"
# Result: structured dossier with citations, evidence, and ranked sources
Semantic Memory
The memory system (src/memdir/) provides persistent, cross-session knowledge retention using text embedding search.
Features
| Feature | Description |
|---|---|
| Semantic Search | Find memories by meaning, not just keywords — cross-lingual support |
| Auto-Memory Capture | Important context is automatically saved during conversation |
| Memory Age Tracking | Older memories decay in relevance; fresh memories are prioritized |
| Hybrid Recall | Combines local embedding search with LLM-assisted retrieval |
| Team Sync | Share memories across sessions and team members |
Memory Commands
/memory # Edit Claude memory files
/memory-search "deployment config" # Semantic search across memories
/research "auth patterns" # Research across files + wiki + memory
How Memory Works
Memories are stored as markdown files in the user's Claude memory directory. When a query is made:
- Text embeddings are computed for the query
- Embeddings are compared against stored memory vectors
- Top matches are ranked by similarity and recency
- Matched memories are injected as context for the LLM
Note: Memory is distinct from session history. Session history records raw conversation turns; memory captures curated facts, preferences, and project context for long-term retention.
Architecture Files
| Path | Role |
|---|---|
src/research/ | Deep research: citation extraction, dossier generation, truth checking, source ranking |
src/memdir/ | Semantic memory: text embedding search, memory age tracking, cross-session recall |