Hooks extract facts, decisions, and guardrails from every conversation. Six retrieval strategies inject relevant context back into every future prompt. Knowledge persists across sessions, across projects, across time.
curl -fsSL .../install-remote.sh | bash
click to copy
Install once, restart Claude Code. The system runs silently from that point forward.
Long-term facts, guardrails, and decisions are injected as system context. Claude begins every session knowing what it learned before.
Six retrieval strategies run in parallel — semantic, BM25, graph, temporal, file-path, code — fused via Reciprocal Rank Fusion. Relevant context appears in <30ms.
At 40%, 70%, and 90% context usage, Claude Sonnet extracts structured knowledge: facts, entities, relationships, decisions, guardrails, error solutions.
The extraction pipeline processes your conversations and stores structured knowledge. Here's a real debugging session.
Next session: when someone edits ecs.tf, the guardrail surfaces automatically. If a similar timeout occurs, the error solution is recalled. The port fact is injected as context. Nobody has to explain any of this again.
Manual context files are static. This is automatic, structured, and retrieval-aware.
| CLAUDE.md | Cursor | Windsurf | ai-memory-db | |
|---|---|---|---|---|
| Auto-extraction | Manual | Partial | Yes | 3 passes/session |
| Knowledge types | Free text | Key-value | Rules | 8 structured types |
| Semantic search | No | Basic | No | 6-way + RRF |
| Temporal decay | No | No | No | 3-class exponential |
| Project isolation | Per file | Global | Workspace | Per-repo + promote |
| Entity graph | No | No | No | 2-hop BFS |
| Code graph | No | No | No | 5 languages |
| Guardrail enforcement | Manual | No | Rules | Auto + git stash |
| Data stays local | File | Cloud | Local | DuckDB on disk |
| Dashboard | No | No | No | Full CRUD + graphs |
Semantic, BM25, entity graph, temporal, file-path, and code symbol search — fused via Reciprocal Rank Fusion in <30ms.
Facts, decisions, guardrails, procedures, error solutions, observations, entities, relationships — each with distinct recall priority.
PostToolUse hook detects edits to guardrailed files and auto-stashes via git. Correction detection supersedes bad facts.
Multi-language AST parsing via tree-sitter. Python, TypeScript, JavaScript, Go, Rust — symbols, imports, and dependency chains.
Short-term facts fade at 0.18/day. Reinforced items promote through medium to long-term. Items in 3+ projects go global.
Next.js + Cytoscape.js. Full CRUD, entity graph, code dependency view, live polling, per-scope filtering, PNG export.
Database snapshot on every session end, rotating last 5. Export to JSON, import from JSON, restore from any snapshot.
Knowledge is isolated per git repo. Facts from project A never leak into project B. Cross-project items auto-promote to global.
/remember, /forget, /reflect, /knowledge, /audit-memory, /export-memory — full control over what's stored and recalled.
Two injection layers, three extraction triggers, six retrieval strategies — all converging on a single DuckDB knowledge base.
systemMessage (~3000 tokens). Triggers incremental code graph parse.additionalContext (~4000 tokens). Includes defensive guardrail/procedure/error_solution lookup.The memory system exposes an MCP server (stdio JSON-RPC 2.0) that any compatible client can use — not just Claude Code hooks.
| Tool | Description | Input |
|---|---|---|
| memory_search | Semantic search across facts, guardrails, procedures, error solutions, decisions | query, types[], limit |
| memory_store | Store a fact, decision, guardrail, procedure, or error solution | text, type, importance, file_paths[] |
| memory_guardrail | Create a guardrail with warning, rationale, and consequence | warning, rationale, consequence, file_paths[] |
| memory_check_file | Get all memory (guardrails, procedures, facts) linked to a file path | file_path |
The FastAPI backend serves the web dashboard and exposes full CRUD on all knowledge types. Run locally on port 9111.
One command installs the memory package, hook scripts, and 22 slash commands into ~/.claude/. Restart Claude Code. That's it.
Everything runs locally. DuckDB stores your knowledge. Ollama (or ONNX Runtime) generates embeddings. Your data never leaves your machine.