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

FeatureDescription
Citation ExtractionAutomatically extracts and attributes sources from research results
Claim VerificationCross-references claims across sources with confidence scoring
Dossier GenerationProduces structured research dossiers with summaries, evidence, and references
Truth CheckingValidates factual claims against source material
Source RankingRanks sources by relevance, authority, and recency

Research Workflow

  1. Query — Natural language research question or topic
  2. Gather — Collects information from local files, wiki, memory, and web
  3. Analyze — Cross-references, verifies claims, extracts citations
  4. 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

FeatureDescription
Semantic SearchFind memories by meaning, not just keywords — cross-lingual support
Auto-Memory CaptureImportant context is automatically saved during conversation
Memory Age TrackingOlder memories decay in relevance; fresh memories are prioritized
Hybrid RecallCombines local embedding search with LLM-assisted retrieval
Team SyncShare 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:

  1. Text embeddings are computed for the query
  2. Embeddings are compared against stored memory vectors
  3. Top matches are ranked by similarity and recency
  4. 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

PathRole
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