B12
Local-first persistent memory for your AI coding assistant — across every tool you use.


One local SQLite database. One MCP server. Lifecycle hooks/plugins where the
host supports them. Memory you store in Claude Code, Codex, OpenCode, Cursor,
or any MCP-capable assistant is searchable from the next tool you open — same
project, same DB.
- Cross-tool memory — the same DB powers Claude Code, Codex CLI, Grok CLI, Google Antigravity, Cursor, Cline, Zed, Continue, Gemini, Kimi, Windsurf, OpenCode, VS Code/Copilot, Amp, JetBrains AI
- Local by default at runtime — memory data and BGE-M3 inference stay on-device with SQLite + sqlite-vec. With the default
B12_LLM_PROVIDER=none, there are no cloud API calls, API keys, or telemetry after setup. Opt-in remote LLM extraction sends selected transcript content to the configured provider. Installing dependencies and acquiring model artifacts still use the network (see the first-run note below)
- Hybrid retrieval — FTS5 BM25 + 1024-dim BGE-M3 vector + importance- and reinforcement-weighted FSRS decay (important & frequently re-accessed memories rise, stale trivia fades)
- Automatic importance scoring — at write time, content is scored into importance bands with no manual tagging via a language-agnostic signal taxonomy (save-cues, commitments, deadlines, people, numeric values, identifiers) plus native remember/decision/trivial lexicons in 11 languages (en, tr, zh, hi, es, fr, ar, ru, pt, id, de) with script-aware matching. Credential-bearing content is held at baseline so secrets are never amplified
- Exact-duplicate collapse + NLI contradiction detection — identical memories collapse at storage time; conflicting memories flag for review
- Hook automation — session-end micro-extraction, sprint handoffs, working-memory restore through compaction, classifier-driven tagging
- Comparison vs alternatives — full matrix vs Mem0 / Letta / Cursor memory / Claude Projects / ChatGPT memory in
docs/comparison.md
Install (one command)
git clone https://github.com/dorukardahan/B12.git && cd B12 && chmod +x install.sh && ./install.sh --full
One-time model download: ./install.sh --full installs the Python
dependencies, but the default BGE-M3 weights are fetched on the first
SessionStart. Keep network access and approximately 2.2 GB of disk space
available for the model weights until this finishes. The memory database and
embedding inference stay local afterward; opt-in remote LLM extraction is the
exception described below. For an offline first session or a smaller
download, prepare a GGUF model in advance; see the
embedding model setup guide.
Restart your AI tool, then follow the
post-install verification steps for your host.
The B12 server should be connected and expose its memory tools. --full
installs the venv, configures the MCP server, and deploys lifecycle hooks
where the platform supports them.
For a fresh install, plain ./install.sh auto-promotes to full setup;
use --minimal only when you want the legacy hooks without the venv or
MCP server.
Jump to: Supported Platforms · Features · Architecture · Security · Comparison · Releases
For a deeper walkthrough of the demo above, see docs/demo.md.
How It Works
The diagram below shows Claude Code, which has the richest lifecycle hook surface. Codex, Gemini, OpenCode, Grok, Cline, and other hosts use adapters/plugins where available; MCP-only platforms still share the same server and database — see Supported Platforms.
Architecture (click to expand)