English | δΈζ | ζ₯ζ¬θͺ | EspaΓ±ol | Π ΡΡΡΠΊΠΈΠΉ | νκ΅μ΄ | PortuguΓͺs | Deutsch | FranΓ§ais
Persistent memory infrastructure for AI agents.
1,599 memories Β· 34 MCP tools Β· Graph + Vector hybrid retrieval Β· sub-200ms search Β· 1,166 tests
An open-source MCP server that gives any LLM long-term memory using a knowledge graph + vector search hybrid. Store entities, observations, and relationships β then recall them semantically across sessions. Works with any MCP client: Claude Code, Claude Desktop, Cursor, Windsurf, Cline, Gemini CLI, VS Code Copilot, or any LLM that speaks Model Context Protocol.
Unlike flat chat history or simple RAG, Dragon Brain understands relationships between memories β not just similarity. An autonomous agent ("The Librarian") periodically clusters and synthesizes memories into higher-order concepts.
Prerequisites: Docker and Docker Compose. Detailed setup: See docs/SETUP.md for comprehensive instructions including prerequisites, platform-specific notes, and troubleshooting.
docker compose up -dThis spins up 4 containers:
- FalkorDB (knowledge graph) β port 6379
- Qdrant (vector search) β port 6333
- Embedding API (BGE-M3, CPU default) β port 8001
- Dashboard (Streamlit) β port 8501
GPU users:
docker compose --profile gpu up -dfor NVIDIA CUDA acceleration.
Verify everything is healthy:
docker ps --filter "name=claude-memory"Alternative: Install via pip
pip install dragon-brainNote: Dragon Brain requires FalkorDB and Qdrant running as Docker services. The pip package installs the MCP server β run
docker compose up -dfirst for the infrastructure. The embedding model (~1GB) is served via Docker, not downloaded locally.
Claude Code (recommended):
claude mcp add dragon-brain -- python -m claude_memory.serverClaude Desktop / Other MCP Clients
Add to your MCP client config:
{
"mcpServers": {
"dragon-brain": {
"command": "python",
"args": ["-m", "claude_memory.server"],
"env": {
"FALKORDB_HOST": "localhost",
"FALKORDB_PORT": "6379",
"QDRANT_HOST": "localhost",
"QDRANT_PORT": "6333",
"EMBEDDING_API_URL": "http://localhost:8001"
}
}
}
}See mcp_config.example.json for a full template. This server works with any MCP-compatible client via stdio transport.
You: "Remember that I'm building Atlas in Rust and I prefer functional patterns."
AI: [creates entity "Atlas", adds observations about Rust and functional patterns]
You (next session): "What do you know about my projects?"
AI: "You're building Atlas in Rust with a functional approach..." [recalled from graph]
| Capability | How It Works |
|---|---|
| Store memories | Creates entities (people, projects, concepts) with typed observations |
| Semantic search | Finds memories by meaning, not just keywords β "that thing about distributed systems" works |
| Graph traversal | Follows relationships between memories β "what's connected to Project X?" |
| Time travel | Queries your memory graph at any point in time β "what did I know last Tuesday?" |
| Auto-clustering | Background agent discovers patterns and creates concept summaries |
| Relationship discovery | Semantic Radar finds missing connections by comparing vector similarity against graph distance |
| Session tracking | Remembers conversation context and breakthroughs |
| Feature | Dragon Brain | cipher | basic-memory | mcp-knowledge-graph | context-portal | nocturne_memory |
|---|---|---|---|---|---|---|
| Real Graph Database | FalkorDB (Cypher) | β | β | JSON files | β | β |
| Vector Search | Qdrant (HNSW) | β | SQLite FTS | β | SQLite (vectors) | β |
| Hybrid Search (RRF) | β | β | β | β | β | β |
| Autonomous Clustering | β (DBSCAN) | β | β | β | β | β |
| Relationship Discovery | β (Semantic Radar) | β | β | β | β | β |
| Time Travel Queries | β | β | β | β | β | β |
| GPU Acceleration | CUDA (BGE-M3) | β | β | β | β | β |
| Typed Relationships | Weighted edges | β | β | Edges | β | β |
| Session Tracking | β | β | β | β | β | β |
| Model Agnostic | Any MCP client | β | β | β | β | β |
| Test Suite | 1,166 tests | β | β | β | β | β |
| Mutation Testing | β | β | β | β | β | β |
| Dashboard | Streamlit | β | β | β | β | β |
| MCP Tools | 34 | β | β | β | β | β |
Feature comparison based on public READMEs as of March 2026. Open an issue if anything is inaccurate.
Same Dragon Brain, different story. Each demo shows a real scenario with example queries and results. Browse all demos β
βοΈ Legal DiscoveryFind contradictions across depositions. Trace hidden money flows. Surface leads no human found. |
π¬ Research LabTrack your lab's evolving understanding. Replay intellectual journeys. Connect papers to experiments. |
π Startup CTONever lose a design decision. Trace incident root causes. Onboard new engineers instantly. |
Connect the dots across sources. Detect temporal clustering. Find leads you didn't know existed. |
π² Game MasterRemember 50 sessions of campaign history. Trace consequences. Manage dramatic irony. |
Cross-domain connections across millennia. The Zettelkasten that actually thinks. |
π‘οΈ Cybersecurity SOCLink IOCs, TTPs, and actors. Detect emerging campaigns. Threat intel that connects. |
π¦ OSS Maintainer3 years of issues, PRs, and RFCs β instantly searchable. Institutional knowledge preserved. |
π Portfolio ManagerTrack theses, correlations, and lessons. Replay your mental state from 6 months ago. |
π₯ Medical PracticeConnect symptoms, treatments, and outcomes across visits. Context your EHR buries. |
βοΈ Engineering R&DTrace failure modes across subsystems. Link test results to design revisions. |
Track misconceptions across cohorts. Discover cross-course concept connections. |
Every demo uses the exact same Dragon Brain β no plugins, no customization, no domain-specific code. Just data + queries + connections you didn't know existed.
graph TB
Client["Any MCP Client<br/>(Claude, Cursor, Cline, ...)"]
Server["Dragon Brain MCP Server<br/>34 tools Β· FastMCP"]
FalkorDB["FalkorDB<br/>Knowledge Graph Β· Cypher"]
Qdrant["Qdrant<br/>Vector Search Β· HNSW"]
Embeddings["Embedding Service<br/>BGE-M3 Β· 1024d"]
Librarian["The Librarian<br/>Auto-clustering Β· DBSCAN"]
Dashboard["Dashboard<br/>Streamlit Β· Graph Viz"]
Client <-->|"MCP (stdio/SSE)"| Server
Server --> FalkorDB
Server --> Qdrant
Server --> Embeddings
Server -.->|"periodic"| Librarian
Librarian --> FalkorDB
Dashboard --> FalkorDB
Dashboard --> Qdrant
- Graph Layer: FalkorDB stores entities, relationships, and observations as a Cypher-queryable knowledge graph
- Vector Layer: Qdrant stores 1024d embeddings for semantic similarity search
- Hybrid Search: Queries hit both layers, merged via Reciprocal Rank Fusion (RRF) with spreading activation enrichment
- Semantic Radar: Discovers missing relationships by comparing vector similarity against graph distance
- The Librarian: Autonomous agent that clusters memories and synthesizes higher-order concepts
Dragon-Brain/
βββ src/
β βββ claude_memory/ # MCP server β 34 tools, services, repositories
β β βββ server.py # FastMCP entry point
β β βββ tools.py # MCP tool definitions
β β βββ search.py # Hybrid search (vector + graph + RRF)
β β βββ repository.py # FalkorDB graph operations
β β βββ vector_store.py # Qdrant vector operations
β β βββ librarian.py # Autonomous clustering agent
β β βββ search_advanced.py # Semantic radar + associative search
β β βββ temporal.py # Time travel queries
β β βββ ... # Schema, embedding, analysis, etc.
β βββ dashboard/ # Streamlit monitoring dashboard
βββ tests/
β βββ unit/ # 1,027 unit tests (3-evil/1-sad/1-happy per function)
β βββ gauntlet/ # 139 mutation, fuzz, property-based, concurrency tests
βββ docs/ # Architecture, user manual, runbook, ADRs
β βββ adr/ # 7 Architecture Decision Records
βββ scripts/ # Docker, backup, health check, e2e tests
β βββ internal/ # 27 migration, verification, and repair scripts
βββ docker-compose.yml # One-command setup (FalkorDB + Qdrant + Embeddings + Dashboard)
βββ pyproject.toml # Python 3.12+, pip install -e ".[dev]"
| Tool | What It Does |
|---|---|
create_entity |
Store a new person, project, concept, or any typed node |
add_observation |
Attach a fact or note to an existing entity |
search_memory |
Semantic + graph hybrid search across all memories |
get_hologram |
Get an entity with its full connected context (neighbors, observations, relationships) |
create_relationship |
Link two entities with a typed, weighted edge |
get_neighbors |
Explore what's directly connected to an entity |
point_in_time_query |
Query the graph as it existed at a specific timestamp |
record_breakthrough |
Mark a significant learning moment for future reference |
semantic_radar |
Discover missing relationships via vector-graph gap analysis |
graph_health |
Get stats on your memory graph β node counts, edge density, orphans |
All 34 tools are documented in docs/MCP_TOOL_REFERENCE.md.
This isn't a weekend hack. It's tested like production software:
- 1,166 tests across 76 test files, 0 failures, 0 skipped
- Mutation testing β 2,270 mutants, 1,184 killed across 27 source files (3-evil/1-sad/1-happy per function)
- Property-based testing β 38 Hypothesis properties
- Fuzz testing β 30K+ inputs, 0 crashes
- Static analysis β mypy strict mode (0 errors), ruff (0 errors)
- Security audit β Cypher injection audit, credential scanning
- Dead code detection β Vulture (0 findings)
- Dragon Brain Gauntlet β 20-round automated quality audit, A- (95/100)
Full gauntlet results: GAUNTLET_RESULTS.md
Claude is brilliant but forgets everything between conversations. Every new chat starts from scratch β no context, no continuity, no accumulated understanding. I wanted Claude to remember me: my projects, preferences, breakthroughs, and the connections between them. Not a flat chat history dump, but a living knowledge graph that grows richer over time.
| Doc | What's In It |
|---|---|
| User Manual | How to use each tool with examples |
| MCP Tool Reference | API reference: all 34 tools, params, return shapes |
| Architecture | System design, data model, component diagram |
| Maintenance Manual | Backups, monitoring, troubleshooting |
| Runbook | 10 incident response recipes |
| Code Inventory | File-by-file manifest |
| Gotchas | Known traps and edge cases |
Requires Python 3.12+.
# Install
pip install -e ".[dev]"
# Run tests
tox -e pulse
# Run server locally
python -m claude_memory.server
# Run dashboard
streamlit run src/dashboard/app.pyclaude mcp add dragon-brain -- python -m claude_memory.serverFor environment variables, create a .env file or export them:
export FALKORDB_HOST=localhost
export FALKORDB_PORT=6379
export QDRANT_HOST=localhost
export EMBEDDING_API_URL=http://localhost:8001Port 6379 or 6333 already in use
Another service (Redis, another FalkorDB/Qdrant instance) is using the port.
Either stop the conflicting service or change the port mapping in docker-compose.yml:
ports:
- "6380:6379" # Map to a different host portThen update your environment variables to match.
GPU not detected / falling back to CPU
Ensure you're using the GPU profile: docker compose --profile gpu up -d
Requirements:
- NVIDIA GPU with CUDA support
- NVIDIA Container Toolkit installed
- Docker configured for GPU access
CPU mode works fine for most workloads β GPU mainly speeds up bulk embedding operations.
MCP connection timeout in Claude Desktop
- Verify all 4 containers are running:
docker ps --filter "name=claude-memory" - Check the embedding API is healthy:
curl http://localhost:8001/health - Ensure your
claude_desktop_config.jsonpaths are correct (use forward slashes) - Restart Claude Desktop after config changes
"No module named claude_memory" error
Install in development mode: pip install -e .
Or set the PYTHONPATH environment variable to point to the src/ directory:
export PYTHONPATH=/path/to/Dragon-Brain/srcMemories not persisting between sessions
Docker volumes store persistent data. If you used docker-compose down -v, the
volumes were deleted. Use docker-compose down (without -v) to preserve data.
To verify data persistence:
docker exec claude-memory-mcp-graphdb-1 redis-cli GRAPH.QUERY claude_memory \
"MATCH (n) RETURN count(n)"More: docs/GOTCHAS.md Β· docs/RUNBOOK.md
Dragon Brain is under active development. See the CHANGELOG for recent updates.
Current focus areas:
- Semantic Radar β relationship discovery via vector-graph gap analysis
- Drift detection and quality monitoring for long-lived graphs
- Search result ranking improvements
- Performance optimization for large graphs (10K+ nodes)
Have an idea? Open an issue.
See CONTRIBUTING.md for testing policy, code style, and how to submit changes.
- Questions & Discussion: GitHub Discussions
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Issues

