ZenBrain
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
The neuroscience-inspired memory system for AI agents.
7 memory layers and a library of 20 neuroscience-inspired algorithm modules: FSRS, Hebbian learning, sleep replay, emotional tagging, plus 10 advanced research modules (vmPFC-FSRS, two-factor Hebbian, simulation-selection sleep, Fiedler-value KG health, IB budget, Hopfield STM, ...). Pure TypeScript. Zero dependencies. 822 tests. Extracted from a production AI platform.
Status: pre-1.0, semver — the public API can still change before 1.0 .
822 tests green in CI, on Node 22, 24 and 26 and against PostgreSQL with pgvector · the current version of every package published to npm with build provenance ·
every change recorded in the CHANGELOG · issues and pull requests are answered; replications and counter-results are especially welcome.
Self-hosted: the library makes no network calls of its own. Memory lives in SQLite or PostgreSQL that you operate; an embedding model or an LLM is optional and your choice.
---
▶ Try the live playground in your browser — runs this published code, no install required.
📄 Paper & Citation — ZenBrain: A Neuroscience-Inspired 7-Layer Memory Architecture for Autonomous AI Systems
- **arXiv preprint** (cs.AI): arxiv.org/abs/2604.23878
- **Open-access archive** (Zenodo / CERN): doi.org/10.5281/zenodo.19353663
- **ORCID**: 0009-0001-1793-012X
- **License**: CC BY 4.0 (paper) · Apache-2.0 (code)
Feedback, replications, and counter-results are explicitly welcome — please open an issue or reach out via research@zensation.ai.
> **Your AI forgets everything after every conversation.** ZenBrain gives it a memory that lasts across sessions, split into layers the way human memory is, and ships the mechanisms memory research describes (spaced repetition, emotional tagging, Hebbian strengthening, forgetting curves, sleep replay) as tested functions. Which of them run on their own and which you call yourself is in one table.
> **Architecture vs. this package.** ZenBrain's architecture is **15 neuroscience-inspired mechanisms — 9 foundational algorithms + 6 Predictive Memory Architecture (PMA) components** (paper). The 6 PMA components are proprietary and run in the production system. **This open-source package ships the algorithm library: 10 core algorithms + 10 advanced research modules (20 modules), zero-dependency.**
---
Benchmark: LongMemEval-500
On LongMemEval-500, **three of nine head-to-head comparisons hold** against
Letta, Mem0 and A-Mem — all three against A-Mem, the remaining six are ties, none lost. Three
competitors x three LLM judges, Bonferroni-corrected (alpha = 0.05/18) and version-matched. It
reaches **91.3% of a full-context oracle's binary-judge accuracy at 1/109.6 of the per-query
token cost** (47.7% vs. 52.2%).
Works out of the box without an embedding provider — lexical ranking, zero
dependencies. With nomic-embed-text as the embedding provider you get the
configuration those figures were measured in.
The paper prints where ZenBrain loses as well: on LoCoMo, substring-based aggregate F1 favours
lexical retrieval (BM25) by metric design, and we do not contest that. The advantage is most
pronounced in the judge-graded comparisons and on cross-session reasoning.
**The mechanism comparison further down re-runs from this repository in under a minute** —
bash scripts/compare-mechanisms.sh, no API keys and nothing to install. It prints a positive
and a negative control before the result, so the instrument can be checked before its output
is trusted. The method, the effect sizes and the ablations behind the numbers above are in the
paper; this repository ships no runner for them. The archived packages below run the significance
tests and effect sizes in full, and the mechanism ablation behind paper Tables 7–9.
- Method, effect sizes and ablations: arXiv:2604.23878
- Open-access archive: 10.5281/zenodo.19353663
---
Reproduction packages
The raw material behind the numbers above is deposited on Zenodo, open access and citable. Both
links are concept DOIs and resolve to the latest version, the same convention this README uses for
the paper archive; each description was measured against the version named after it.
- **Mechanism ablation, paper Tables 7–9** — 10.5281/zenodo.22162063