SHARED MEMORY FOR AI CODING AGENTS

Your coding agents
share one brain.

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 — bash

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

3.1 ms
Recall p50 (benchmark)
250
Token Budget Cap
0
Cloud Egress (100% Local)
SQLite WAL

Setup in under 30 seconds

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"]
    }
  }
}

One project. One memory. Any agent.

When AI sessions fill their context window, your project knowledge should persist — not disappear.

Without Local Brain

Claude learns
context fills
session ends
knowledge disappears
next agent starts from zero

With Local Brain

Claude learns
brain_learn
Local Brain
local memory
Cursor recalls
knowledge continues

Multiple agents → One shared project memory

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.

Claude Code
Terminal Agent • Active
Cursor
IDE Assistant • Active
Antigravity
Pair Programmer • Active
Local Brain MCP
.git/brain.db
Local SQLite
GitHub Copilot
VS Code Extension • Active
Windsurf
Cascade Agent • Active
Zed & Custom Agents
MCP Context Server • Active

How Local Brain Works

A continuous three-step loop that extracts, persists, and ranks high-signal engineering context without bloat.

01 — LEARN Discovery

An AI agent discovers useful knowledge

During debugging or refactoring, an agent (e.g. Claude Code or Cursor) identifies an architectural decision, edge runtime bug, or team convention.

brain_learn({
  lesson: "Use jose instead of jsonwebtoken on edge runtime",
  category: "fix",
  agent: "claude-code"
})
02 — STORE Persistence

Local Brain persists locally with provenance

Local Brain evaluates signal quality, embeds the lesson into SQLite vector tables, and attaches Git metadata (branch, commit SHA, file scope, agent identity).

INSERT INTO memories (
  quality_score: 1.45,
  git_branch: "main",
  status: "active"
)
03 — RECALL Retrieval

Another coding agent retrieves it later

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.

brain_recall({ query: "jwt auth" })
→ Score: 0.94 | Tokens: 42/250
→ Validated by Antigravity

Model Context Protocol Reference

Exposes 7 standards-compliant MCP tools with complete runtime annotations for idempotency, read-only guarantees, and safety hints.

brain_recall
Semantic multi-factor recall across all agent memories with strict 250-token budget cap.
brain_learn
Store lessons, architecture decisions, and rules with automatic quality scoring.
brain_validate
Confirm memory correctness to boost rank and record cross-agent validation.
brain_status
Inspect memory counts, active/stale breakdown, and multi-agent health status.
brain_trace
Chronological file memory history and agent attribution timeline.
brain_forget
Deprecate or permanently delete specific memory records by ID or query.
brain_prune
Clean up stale or deprecated memories from the brain after major refactors.

Built for serious engineering teams

Engineered from first principles for fast local execution, strict token economics, and multi-agent coordination.

100% Local-First

Your memory stays on your device. Zero external cloud egress, zero foreign databases, and total privacy for proprietary codebases.

Git-Aware Provenance

Every stored memory retains repository root, branch name, commit SHA, file path, and authoring agent metadata with automatic git-diff invalidation.

Multi-Agent Consensus

Cross-agent validation boosts verified memories, while contradiction detection applies an automatic 0.60× penalty to outdated or conflicting guidance.

Embedded SQLite Vector Store

High-concurrency Write-Ahead Logging (WAL) ensures simultaneous agent read/write operations without lock collisions or server dependencies.

Measured, not marketed

Output of npm run benchmark against a local 1,000-memory database. Reproduce it yourself — no cloud in the loop.

3.1 ms
Recall p50 (1k memories)
5.7 ms
Recall p95 (1k memories)
64k /s
Embedding throughput
3.7k /s
Memory insert throughput

Context limits shouldn't erase project knowledge

When an AI session fills its context window or you switch between specialized tools, Local Brain acts as the shared durable memory layer.

1. Claude Code
Discovers Supabase RLS INSERT policy constraint
2. Local Brain
Indexes lesson into project-scoped memory store
3. Session Switch
Claude context resets or work moves to Cursor / Antigravity
4. Recalled & Validated
Next agent recalls the exact fix instantly

Your memory stays local

Local Brain is designed for privacy-conscious developers and sensitive codebases.

Zero Network Egress

All vector embeddings, search calculations, and SQLite operations occur entirely within your local Node.js process.

Project Isolation

Memory stores are scoped deterministically to your repository root. Different projects cannot leak context into one another.

No API Keys Required

Deterministic embedded vectors run offline without external LLM API keys, quotas, rate limits, or billing subscriptions.

Open Source & Community Driven

Local Brain MCP is published under the permissive MIT License. Contributions, issue reports, and integrations are welcome.