bao243092078-crypto

Memory Anchor

Updated

Persistent memory for AI coding assistants (Claude Code, Cursor, Windsurf). MCP server with 5-layer memory model, semantic search, and cross-session context recovery. Zero cloud, local-first.

Memory Anchor

Your AI loses its memory every session. This fixes that.

One install. Zero cloud. Every decision remembered.

License: MITPython 3.12+MCP CompatibleTests

The Problem

# Monday โ€” Session 1
You: "Let's use Qdrant for vector search, SQLite for metadata."
AI:  "Great choice. I'll structure the project around that."

# Tuesday โ€” Session 2
You: "Continue where we left off."
AI:  "I don't have any context about previous sessions."
You: ๐Ÿ˜
# Tuesday โ€” Session 2, with Memory Anchor
You: "Continue where we left off."
AI:  [searches memory] "Got it โ€” we decided on Qdrant + SQLite yesterday.
      I also see 3 open bugs from last session. Want to start there?"

Memory Anchor is an MCP server that gives AI coding assistants persistent, searchable memory. No cloud, no API keys, no Docker โ€” just pip install and go.

5-Minute Setup

# Install from GitHub
pip install git+https://github.com/bao243092078-crypto/memory-anchor.git

# Configure Claude Code MCP integration
memory-anchor setup --project my-project

# Restart Claude Code โ€” done!

That's it. SQLite is embedded. Everything stays on your machine.

What Makes This Different

Mem0 Letta Zep Memory Anchor
Memory model Graph+KV Blocks Temporal graph 3 cognitive layers
Identity protection โ€” โ€” โ€” 3-approval governance
Search Graph+Vector Vector Temporal+Vector Hybrid (vector+BM25+token)
Deploy Cloud or self-host Self-host (Postgres) Cloud SQLite embedded (zero setup)
MCP integration Plugin available Plugin available Not yet Native MCP server
Data locality Cloud option On-premise Cloud only 100% local, no data leaves

MCP Tools

Tool What it does
search_memory Semantic + keyword hybrid search across all memories
add_memory Store a memory with auto-classification and confidence scoring
get_constitution Load core identity (protected, requires 3 approvals to change)
propose_constitution_change Propose identity changes (enters approval flow)
delete_memory Delete with governance checks

3-Layer Memory Model

L0  Identity     โ€” Who you are. Protected by 3-approval mechanism.
L2  Events       โ€” What happened. Timestamped, optional TTL.
L3  Facts        โ€” What's true. Verified long-term knowledge.

How It Works

Claude Code <-> MCP (stdio) <-> Memory Kernel <-> SQLite + Full-Text Search
                                      |
                               Cold Storage (JSONL backup)
  • Smart search: Finds what you mean, not just exact words (vector + full-text + keyword overlap)
  • Auto-categorization: Memories are tagged and layered automatically
  • Write safety: Validates confidence before storing โ€” nothing gets lost silently
  • Identity protection: Core identity requires 3 separate approvals to modify
  • Backup: Append-only JSONL log means memories survive even if the database breaks
  • 100% local: Zero data leaves your machine

Use Cases

Long-running projects โ€” After 50+ sessions, your AI still remembers why you chose Qdrant over Pinecone, which auth approach you abandoned, and what the deployment strategy is.

Bug fix tracking โ€” "How did we fix that null pointer last week?" Your AI searches memory and finds the exact commit, root cause, and fix.

Cross-project patterns โ€” Decisions from project A are searchable from project B. Each project has its own namespace, but you can query across them.

Configuration

# Each project gets its own memory namespace
memory-anchor serve --project project-a
memory-anchor serve --project project-b

Manual MCP config (if you prefer not to use memory-anchor setup):

{
  "mcpServers": {
    "memory-anchor": {
      "command": "memory-anchor",
      "args": ["serve", "--project", "my-project"]
    }
  }
}

CLI

memory-anchor setup  --project NAME   # Configure Claude Code MCP
memory-anchor serve  --project NAME   # Start MCP stdio server
memory-anchor doctor --project NAME   # Health check
memory-anchor init   --project NAME   # Initialize project config

Development

git clone https://github.com/bao243092078-crypto/memory-anchor.git
cd memory-anchor
uv sync --all-extras

uv run pytest                         # Run all tests
uv run ruff check backend --fix       # Lint
uv run mypy backend                   # Type check

License

MIT License

AI amnesia isn't a bug โ€” it's a missing feature.

Memory Anchor is the external hippocampus.

Made by baobao

MCP Server ยท Populars

MCP Server ยท New