ZenBrain: A Neuroscience-Inspired 7-Layer Memory Architecture for Autonomous AI Systems

arXiv DOI Code: Apache-2.0 Paper: CC BY 4.0 npm @zensation/algorithms npm @zensation/core GitHub Website Live Demo

Head-to-head: On LongMemEval-500, three of nine comparisons hold against Letta, Mem0 and A-Mem β€” all three against A-Mem, the remaining six are ties, none lost (3 competitors x 3 LLM judges, Bonferroni-corrected, version-matched). The measured ZenBrain arm (per the correction notice a Python port of a test-harness class, not the seven-layer system) reaches 91.3% of the binary-judge accuracy of a full-context comparison arm (whose answer model reads the whole history) with 1/109.6 of its input tokens in the answer step (ingesting each question's history is not counted). These figures follow the correction notice (18 Sep 2026) to v8 and arXiv v3.

Built by: Alexander Bering β€” Division Manager in a mid-sized company and Principal Investigator. What is researched here has to survive a Monday morning, not just a review.

⭐ If this is useful, a star on GitHub helps other agent developers find it.

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, evaluated on long-context recall, memory stability, and knowledge retrieval tasks with an experiment suite on LoCoMo and LongMemEval-S and a 15-component ablation study (results below).

Paper: ZenBrain v8 (Zenodo) | DOI: 10.5281/zenodo.19353663 (concept DOI β€” always resolves to the latest version) | Correction notice: 10.5281/zenodo.22831086

Status: arXiv preprint (April 2026). Independent replications, counter-results, and reviewer feedback welcome β€” contact: research@zensation.ai

Key Results

Experiment Metric Result
Sleep consolidation (simulation) Stability / storage +37% stability with 47.4% storage reduction; the one run on real data shows a loss in retrieval precision (correction notice Β§6)
Hebbian retrieval Precision@5 0.955 (vs. 0.200 with uniform edges)
Bayesian confidence Pairwise AUC 0.797 (+49.5% vs. 0.533)
Moderate ablation 15-component suite 14 of 15 single removals look costless; removing sleep costs βˆ’34.4%
Challenging ablation 15-component suite 7 of 15 components reach the printed criterion in the simulation, all with a loss (the same p = 5.062 Γ— 10⁻³ for every starred row, correction notice)
Stress ablation (decay 0.25/day, 60 days) 15-component suite 10 of 15 components reach the printed criterion in the simulation β€” nine with a loss, PriorityMap with a gain (correction notice)

Removing mechanisms one at a time under rising load reveals a cooperative survival network with a measurable gradient across three difficulty levels. In the integration cascade (synthetic, decay 0.30/day, 60 days), sleep acts as a 1.92Γ— retention multiplier. 95 reproducible tests across 4 experiment suites, all with Mulberry32 seeded PRNG (10 seeds).

Architecture: 7 Memory Layers

Layer 7: Cross-Context Memory    ← Entity links across domains (experimental)
Layer 6: Core Memory             ← Pinned facts (Letta-style)
Layer 5: Procedural Memory       ← "How to do X" (skills & workflows)
Layer 4: Long-Term Semantic      ← Facts with FSRS scheduling
Layer 3: Episodic Memory         ← Concrete experiences & events
Layer 2: Short-Term / Session    ← Current conversation context
Layer 1: Working Memory          ← Active task focus (7Β±2 items)

Key algorithms (in @zensation/algorithms; the coordinator in @zensation/core calls only a few of them):

  • Hebbian Learning (co-activation strengthening, decay, normalization)
  • FSRS Spaced Repetition (review scheduling)
  • Bayesian Confidence Propagation (noisy-OR updates along a knowledge graph you keep)
  • Sleep Consolidation (Stickgold & Walker 2013 β€” memory replay simulation; the coordinator's consolidate() does not run it)
  • Ebbinghaus Decay (forgetting curve modeling)
  • Context-Dependent Retrieval (Tulving 1973 β€” a context match boosts a score by up to 1.3, a design constant)

Installation

Requires Node.js 22 or newer.

# 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

import { MemoryCoordinator } from '@zensation/core';
import { SqliteAdapter } from '@zensation/adapter-sqlite';

const memory = new MemoryCoordinator({ storage: new SqliteAdapter({ filename: './my-memory.db' }) });

// Auto-routes to one layer (semantic, episodic, procedural, or core)
await memory.store('User prefers TypeScript', { type: 'auto' });

// Cross-layer search with ranked, deduplicated results
// (without an embedding provider, recall ranks by wording)
const results = await memory.recall('programming preferences', { limit: 5 });

Links

Citation

@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://doi.org/10.5281/zenodo.19353663},
  note    = {Zenodo Preprint}
}

@misc{bering2026zenbrainarxiv,
  title         = {ZenBrain: A Neuroscience-Inspired 7-Layer Memory Architecture for Autonomous AI Systems},
  author        = {Bering, Alexander},
  year          = {2026},
  eprint        = {2604.23878},
  archivePrefix = {arXiv},
  primaryClass  = {cs.AI},
  url           = {https://arxiv.org/abs/2604.23878}
}

License

Code (the @zensation/* npm packages and the GitHub repository) β€” Apache-2.0, see LICENSE.

Paper and preprint records (zenbrain-v8.pdf, the arXiv preprint, Zenodo record v8) β€” CC BY 4.0. Reproduction packages carry their own licence, stated on each record (CC BY 4.0 or Apache-2.0).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Paper for zensation-ai/zenbrain