One project. One memory. Any agent.
When AI sessions fill their context window, your project knowledge should persist — not disappear.
Persistent, local-first engineering memory for Claude Code, Cursor, Antigravity, Copilot and other MCP-compatible coding agents.
npm install -g local-brain-mcp
Requires Node.js ≥ 22 · Full setup guide
$ local-brain init
✓ Local Brain initialized successfully
PROJECT retail-gem-quest
MEMORY STORE .git/brain.db
STATUS ● ACTIVE
VERSION 1.3.1
MEMORIES DEMO
LESSONS DEMO
AGENTS DEMO
Ready for AI memory.
Install from npm in seconds. Local Brain auto-detects installed editors and links MCP configurations automatically.
# Install globally from npm (requires Node.js ≥ 22)
npm install -g local-brain-mcp
# Navigate to your project and initialize Local Brain
cd /path/to/your-repo
local-brain init
# Auto-detects Claude Code, Cursor, Antigravity, Copilot, Windsurf & Zed
✓ Local Brain initialized successfully
# Ingest high-signal Git history into your local SQLite memory
local-brain ingest --since "12 months ago" --commits 500
✓ Ingest complete:
Scanned: 348
Ingested: 42
Merged: 18
# Query semantic memory directly from terminal
local-brain query "JWT token refresh edge runtime"
◈> Local Brain Recall
• [src/auth/jwt.ts] (fix [agent: cursor]): Use jose instead of jsonwebtoken for edge runtime
⚡ Recall latency: 1.82 ms | Tokens: 48/250
// Claude Code (.claude.json) or Cursor (.cursor/mcp.json)
{
"mcpServers": {
"local-brain": {
"command": "node",
"args": ["/path/to/local-brain-mcp/dist/mcp-server.js"]
}
}
}
When AI sessions fill their context window, your project knowledge should persist — not disappear.
Coding assistants operate in silos by default. Local Brain unifies them through standard MCP, allowing every agent to read, write, and validate the same project truth.
A continuous three-step loop that extracts, persists, and ranks high-signal engineering context without bloat.
During debugging or refactoring, an agent (e.g. Claude Code or Cursor) identifies an architectural decision, edge runtime bug, or team convention.
Local Brain evaluates signal quality, embeds the lesson into SQLite vector tables, and attaches Git metadata (branch, commit SHA, file scope, agent identity).
When another agent works on the same codebase, it recalls the knowledge in ~3 ms (p50 under our local benchmark conditions) with deterministic multi-factor scoring capped at 250 tokens.
Exposes 7 standards-compliant MCP tools with complete runtime annotations for idempotency, read-only guarantees, and safety hints.
Engineered from first principles for fast local execution, strict token economics, and multi-agent coordination.
Your memory stays on your device. Zero external cloud egress, zero foreign databases, and total privacy for proprietary codebases.
Every stored memory retains repository root, branch name, commit SHA, file path, and authoring agent metadata with automatic git-diff invalidation.
Cross-agent validation boosts verified memories, while contradiction detection applies an automatic 0.60× penalty to outdated or conflicting guidance.
High-concurrency Write-Ahead Logging (WAL) ensures simultaneous agent read/write operations without lock collisions or server dependencies.
Output of npm run benchmark against a local 1,000-memory database. Reproduce it yourself — no cloud in the loop.
When an AI session fills its context window or you switch between specialized tools, Local Brain acts as the shared durable memory layer.
Local Brain is designed for privacy-conscious developers and sensitive codebases.
All vector embeddings, search calculations, and SQLite operations occur entirely within your local Node.js process.
Memory stores are scoped deterministically to your repository root. Different projects cannot leak context into one another.
Deterministic embedded vectors run offline without external LLM API keys, quotas, rate limits, or billing subscriptions.
Local Brain MCP is published under the permissive MIT License. Contributions, issue reports, and integrations are welcome.