A hierarchical, file-system memory that decays on an Ebbinghaus curve, strengthens through recall, and consolidates during sleep. One hosted MCP connector reaches Claude Code, Codex CLI, OpenCode, Copilot CLI, Kilo, Antigravity, and the Claude & ChatGPT apps — one brain, any model, every agent.
The directory tree is the semantic structure. Browse memory in any file explorer — no opaque embeddings.
Memories fade along an exponential forgetting curve. Recall arrests decay and pushes strength back up.
Weighted edges link related memories. Recalling one activates its neighbours via spreading activation.
Longer intervals between recalls produce larger, more durable boosts. The spacing effect, by design.
Episodic, semantic, and procedural memories each carry their own decay rate and consolidation rules.
Claude Code, Codex CLI, OpenCode, Copilot CLI, Kilo, and Antigravity share one store — plus the Claude and ChatGPT apps via the hosted MCP connector, OpenClaw and Hermes as native memory engines, and any LLM underneath. Switch model or agent, keep your memory. Identical scoring, deterministic recall everywhere.
A nine-phase nightly cycle: replay, consolidation, pruning, reorganization, REM-style recombination.
Plain files in a folder. Point BRAIN_DIR at Google Drive, Dropbox, or iCloud — or sync via git or encrypted export. No account required.
Agents write decisions, learnings, and preferences as Markdown with YAML frontmatter. Initial strength is set by type and impact.
Strength decays exponentially at each memory's own rate. Episodic fades fast; procedural is sticky.
Deterministic scoring: TF-IDF × decayed-strength + spreading-activation × context-match. Identical results across every agent.
Recalled memories strengthen via spaced reinforcement. Longer gaps → larger boosts; the decay rate itself improves with each recall.
The nine-phase cycle runs maintenance: replay, synaptic homeostasis, knowledge propagation, semantic crystallization, pruning, REM recombination, expertise detection.
Grounded in 2025–2026 long-term-memory evaluation methodology — LongMemEval, MemoryAgentBench, SWE-Bench-CL, Mem0, BEAM. DeepSeek V4 Pro under test, graded by a cross-family judge panel (Gemini + Gemma-4 + Qwen-3.5, majority vote), distractor haystacks, floor-to-oracle arm matrix. Methodology → Live results →
| Scenario | What it tests |
|---|---|
| A Noisy Project Folder“200 memories from 6 projects — does brain find the 3 relevant ones?” | Retrieval under distractors · LongMemEval-S analog |
| B Three Sessions, One Decision“Postgres Monday, gRPC rewrite Wednesday, new resource Friday — still Postgres?” | Multi-session continuity · pinned-tier ablation |
| C The Contradiction Test“Tabs, then spaces, then tabs again — which version wins?” | Decay-weighted recency · contradiction handling |
| D Skill Progressive Disclosure“Five skills indexed, one needed — does brain load just the one?” | Procedural skills (L0/L1/L2) token efficiency |
| E Continual Coding“Five bugs in order — does bug 5 finish faster than bug 1?” | Forward transfer · agent writes its own memories |
| F Abstention“No deployment target in memory — does the agent ask or invent?” | Confabulation resistance · stale-fact rejection |
| arm | tok / success | recall@5 | pass |
|---|---|---|---|
| no-memory (floor) | — | — | 0% |
| vector (embeddings) | — | 0.00 | 0% |
| keyword (BM25) | — | 0.33 | 0% |
| brain-full | 3,199 | 0.67 | 100% |
| brain-no-pin | 5,135 | 0.33 | 67% |
| oracle (ceiling) | 3,572 | 1.00 | 100% |
| context-dump 8k | 5,856 | — | 100% |
| context-dump 60k | 20,689 | — | 100% |
Brain is the only retriever whose memories let the model succeed under heavy noise — BM25 (R@5 0.33) and vector embeddings (R@5 0.00) both fail outright — and it passes at the lowest tokens-per-success of any passing arm. Turning the pinned tier off drops it to 67%.
Agent under test: DeepSeek V4 Pro (single-shot) · graded by a cross-family panel — Gemini + Gemma-4 + Qwen-3.5, majority vote · 3 runs per arm. At n=3 the token gaps are directional, not yet statistically significant; the pass-rate gradient is the result.
| Mechanism | Implementation in Brain Memory |
|---|---|
| Spreading activation | Recalling memory A automatically surfaces its linked neighbours B and C along weighted edges. |
| Hebbian learning | Memories recalled together strengthen their mutual link — neurons that fire together, wire together. |
| Context-dependent recall | Memories encoded in a similar context score higher at retrieval time. |
| Spacing effect | Longer recall intervals produce larger, longer-lasting strength boosts. |
| Ebbinghaus decay | Exponential forgetting with per-memory decay rates set by cognitive type. |
| Synaptic homeostasis | Global strength down-scaling during sleep prevents runaway inflation. |
Brain Memory's architecture and benchmark methodology draw on the academic literature on language-agent memory and evaluation. Selected citations below.
Sumers, Yao, Narasimhan, Griffiths — the agent-memory model Brain Memory implements. Pinned tier, procedural skills, and budget-aware working memory map to CoALA's semantic / procedural / episodic decomposition.
Packer et al. — paging-style memory management that motivated budget-bounded working memory.
Park et al. — recency · importance · relevance retrieval that inspired the recall scoring weights.
The original forgetting curve. Brain Memory's exponential decay and spaced-reinforcement boosts follow it directly.
Distractor-haystack design (Scenario A) and the rubric-based LLM judge.
Four competencies — accurate retrieval, test-time learning, long-range understanding, selective forgetting. FactConsolidation inspired Scenario C (The Contradiction Test).
Forward transfer in continual coding — basis for Scenario E.
Tokens-per-query co-reported with accuracy — source of the tokens-per-successful-task metric.
Structured memory beats a 10M-token context window, and the gap widens with scale — memory still matters past long context.
Same-family judging inflates scores (~24% leakage vs ~3% cross-family). The benchmark judges DeepSeek with a panel of non-DeepSeek families.
A panel of smaller, disjoint-family judges beats a single large judge on human agreement, with less intra-model bias — the basis for the Gemini + Gemma-4 + Qwen-3.5 panel.
Documents position, verbosity, and self-enhancement bias; origin of the swap-consistency check the benchmark applies to pairwise judgments.
Judge verdicts carry large unexplained variance — report uncertainty rather than aggregate it away. Why results are published with n=3 error bars, not bare point estimates.
Synthetic, decay-driven scenarios guard against memorised public-set answers.
The universal path is the hosted MCP connector — one streamable-HTTP + OAuth endpoint that reaches every host below. Prefer to stay local? The free native plugin writes to~/.brain/ for the current CLIs.
npm i -g brain-memory@beta && brain installs the free native plugin — slash commands and prompt sections wired into the agent's own config, all pointing at a single~/.brain/.
* Antigravity native support is experimental. For everything else — the Claude.ai apps and ChatGPT included — use the MCP connector above.
Then run brain --claude (or --codex / --opencode / --antigravity, or --all) to configure your runtime(s). For the Claude and ChatGPT apps, add the MCP connector instead. One store, deterministic recall, every agent.