Open Source · v1.0.0

Memory for Claude Code

Entity-anchored graph memory with vector search, salience scoring, and community detection. Runs locally. Zero cloud. Privacy-first.

Terminal
claude mcp add --scope user memory-graph -- npx @memorygraph/server
10Tools
229Tests
100%Local
<200msStore

Why 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.

01

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.

02

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.

03

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

TypeScript
Node.js 20+
better-sqlite3
sqlite-vec
@xenova/transformers
graphology
Zod
Pino

Installation

Get Started in Seconds

Recommended

Claude Code

$claude mcp add --scope user memory-graph -- npx @memorygraph/server

npm

$npm install -g @memorygraph/server
$memorygraph

On first run, the embedding model (~23MB) downloads automatically. After that, everything works offline.

10 MCP Tools

memory_storeStore memory anchored to entities
memory_recallSemantic search with salience ranking
memory_contextFull entity context with graph
memory_relateCreate or strengthen entity relations
memory_reinforceBoost memory salience score
memory_forgetSoft-delete a memory
memory_entitiesList all known entities
memory_clustersShow Louvain communities
memory_statusSystem statistics overview
memory_maintainRun maintenance operations