Memory for Claude Code
Entity-anchored graph memory with vector search, salience scoring, and community detection. Runs locally. Zero cloud. Privacy-first.
claude mcp add --scope user memory-graph -- npx @memorygraph/serverWhy MemoryGraph
Persistent, intelligent memory that makes Claude Code genuinely remember your codebase, your decisions, and your preferences.
Semantic Recall
Vector search finds memories by meaning. "deployment issues" surfaces memories about CI/CD failures.
Salience Scoring
Important memories surface first. Time decay, recency boosts, and reinforcement keep the signal strong.
Entity Graph
Named entities form a knowledge graph with typed relations. People, projects, tools — all connected.
Cluster Detection
Louvain community detection reveals hidden groups. Associative recall through entity communities.
Privacy-First
Everything runs locally. SQLite database, local embeddings, zero API calls. Your data never leaves your machine.
Zero Config
One install command. Automatic database creation, model download, and hourly maintenance. Just works.
How It Works
Three phases of intelligent memory management, running continuously in the background.
Store
Claude stores a memory anchored to entities. Content is hashed for deduplication, entities are resolved through 5-level matching, and a 384-dim embedding is generated locally.
Recall
Semantic search finds relevant memories. Query embeddings are compared via vector similarity (60%) combined with salience scoring (40%). Optional cluster expansion adds associative recall.
Evolve
Memories decay naturally over time. Accessed memories get boosted. Reinforced memories persist. Hourly maintenance prunes dead memories and refreshes entity clusters.
Under the hood
Architecture
MCP Server
stdio transport, JSON-RPC routing, 10 registered tools with Zod-validated inputs
Entity Resolver
5-level matching: exact name, alias, vector >0.85, fuzzy range, new entity creation
Recall Engine
Semantic search with combined scoring — similarity 60% + salience 40%
Cluster Engine
Louvain community detection via graphology for associative recall expansion
SQLite + sqlite-vec
WAL mode, 384-dimension vectors, 10 tables, single-file database at ~/.memorygraph/memory.db
Installation
Get Started in Seconds
Claude Code
claude mcp add --scope user memory-graph -- npx @memorygraph/servernpm
npm install -g @memorygraph/servermemorygraphOn first run, the embedding model (~23MB) downloads automatically. After that, everything works offline.
10 MCP Tools
memory_storeStore memory anchored to entitiesmemory_recallSemantic search with salience rankingmemory_contextFull entity context with graphmemory_relateCreate or strengthen entity relationsmemory_reinforceBoost memory salience scorememory_forgetSoft-delete a memorymemory_entitiesList all known entitiesmemory_clustersShow Louvain communitiesmemory_statusSystem statistics overviewmemory_maintainRun maintenance operations