--- license: apache-2.0 language: - en tags: - memory - neuroscience - ai-memory-architecture - autonomous-ai - knowledge-management - long-term-memory - episodic-memory - hebbian-learning - spaced-repetition - bayesian - rag - agents pipeline_tag: text-generation --- # ZenBrain: A Neuroscience-Inspired 7-Layer Memory Architecture for Autonomous AI Systems [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.19353663.svg)](https://doi.org/10.5281/zenodo.19353663) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![npm @zensation/algorithms](https://img.shields.io/npm/v/@zensation/algorithms.svg?label=%40zensation%2Falgorithms)](https://www.npmjs.com/package/@zensation/algorithms) [![npm @zensation/core](https://img.shields.io/npm/v/@zensation/core.svg?label=%40zensation%2Fcore)](https://www.npmjs.com/package/@zensation/core) [![GitHub](https://img.shields.io/badge/GitHub-zensation--ai%2Fzenbrain-black?logo=github)](https://github.com/zensation-ai/zenbrain) ## Overview ZenBrain is a 7-layer neuroscience-inspired memory architecture for autonomous AI systems. It bridges the gap between biological memory principles and practical AI system design, delivering measurable performance improvements across long-context recall, memory stability, and knowledge retrieval tasks. **Paper:** [ZenBrain v6 (Zenodo)](https://zenodo.org/records/19481262) | DOI: `10.5281/zenodo.19353663` ## Key Results (10 Experiments) | Experiment | Metric | Result | |------------|--------|--------| | Exp 1 — LoCoMo Retrieval | F1 score | **+21.6%** vs. Flat Store | | Exp 2 — Layer Ablation | Storage efficiency | **+47.4%** vs. single-layer | | Exp 3 — Retention Curves | Retention@30d | **89.9%** (vs. 0% pure Ebbinghaus) | | Exp 4 — Sleep Consolidation | Memory stability | **+37.0%** vs. no-sleep baseline | | Exp 5 — Hebbian Retrieval | Precision@5 | **0.955** | | Exp 6 — Bayesian Confidence | Confidence AUC | **0.797** (+49.5% vs. 0.533) | | Exp 7 — MemoryArena | Retrieval accuracy | **+19.5%** vs. Flat Store | | Exp 8 — Moderate Ablation | 15-algorithm suite | Cooperative redundancy (no single removal matters) | | Exp 9 — Challenging Ablation | 15-algorithm suite | **7 of 15** algorithms individually significant | | Exp 10 — Stress Ablation | 15-algorithm suite | **9 of 15** algorithms individually critical | > The full 15-algorithm ablation reveals a cooperative survival network with a measurable gradient across three difficulty levels. Sleep consolidation acts as a **1.92x multiplier**. 95 reproducible tests across 4 experiment suites, all with Mulberry32 seeded PRNG (10 seeds). ## Architecture: 7 Memory Layers ``` Layer 1: Working Memory — Active task focus (capacity-limited, 7±2 items) Layer 2: Episodic Memory — Concrete experiences with temporal context Layer 3: Semantic Memory — Abstracted facts and relationships Layer 4: Procedural Memory — Skills and how-to knowledge Layer 5: Short-Term Memory — Session context buffer Layer 6: Long-Term Memory — Persistent cross-session knowledge Layer 7: Core Memory — Pinned identity and values (Letta-pattern) ``` **Key algorithms:** - Hebbian Learning (co-activation strengthening, decay, normalization) - FSRS Spaced Repetition (optimal review scheduling) - Bayesian Confidence Propagation (uncertainty quantification) - Sleep Consolidation (Stickgold & Walker 2013 — memory replay simulation) - Ebbinghaus Decay (forgetting curve modeling) - Contextual Retrieval (Anthropic method, +67% retrieval accuracy) ## Installation ```bash # Core algorithms (zero dependencies) npm install @zensation/algorithms # Memory layer orchestration npm install @zensation/core # PostgreSQL + pgvector adapter npm install @zensation/adapter-postgres # SQLite adapter (zero-config) npm install @zensation/adapter-sqlite ``` ## Quick Start ```typescript import { MemoryCoordinator } from '@zensation/core'; import { PostgresAdapter } from '@zensation/adapter-postgres'; const memory = new MemoryCoordinator({ adapter: new PostgresAdapter({ connectionString: process.env.DATABASE_URL }), }); // Store a memory across all relevant layers await memory.store({ content: 'ZenBrain uses Hebbian learning for knowledge graph strengthening', type: 'semantic', importance: 0.9, }); // Recall with confidence scores const results = await memory.recall('Hebbian learning', { topK: 5 }); // Returns facts with 95% confidence intervals ``` ## Links - **Paper (v6):** https://zenodo.org/records/19481262 - **PDF:** https://zenodo.org/records/19481262/files/zenbrain-v6.pdf - **GitHub:** https://github.com/zensation-ai/zenbrain - **Website:** https://zensation.ai/technologie - **npm:** https://www.npmjs.com/package/@zensation/algorithms ## Citation ```bibtex @misc{bering2026zenbrain, title = {ZenBrain: A Neuroscience-Inspired 7-Layer Memory Architecture for Autonomous AI Systems}, author = {Bering, Alexander}, year = {2026}, doi = {10.5281/zenodo.19353663}, url = {https://zenodo.org/records/19481262}, note = {Zenodo Preprint} } ``` ## License Apache 2.0 — see [LICENSE](https://github.com/zensation-ai/zenbrain/blob/main/LICENSE)