Clarify Complexity. More than just AI.

Apache 2.0TypeScriptNo third-party deps (algorithms, core)

Neuroscience memory
for AI agents.

The cognitive core of our applications — open source, tested, extracted from our production system. 9 foundational algorithms that teach your AI to remember, forget, and sleep.

948Tests (v0.6.1)
9Open-source algorithms
0Third-party deps (algorithms, core)
DOIOpen Access
Hebbian LearningFSRS-style Spaced RepetitionSleep ConsolidationBayesian ConfidenceEbbinghaus DecayEmotional Tagging7-Layer MemoryMemoryCoordinatorCross-Context (experimental)
Quick Start

First memory in 30 seconds.

No account, no cloud, no config file — Node 22+ and two packages.

Install
npm install @zensation/core @zensation/adapter-sqlite
Write code
import { MemoryCoordinator } from '@zensation/core';
import { createMemoryAdapter } from '@zensation/adapter-sqlite';

const memory = new MemoryCoordinator({
  storage: await createMemoryAdapter()
});

await memory.store('Project deadline is Friday');

const recall = await memory.recall(
  'When is the deadline?'
);
console.log(recall);
Result
[
  {
    "id": "4fe78358-ca39-4f21-952a-840eb8463652",
    "content": "Project deadline is Friday",
    "layer": "semantic",
    "score": 0.29525619714283413,
    "confidence": 0.7,
    "metadata": { "source": "user", "accessCount": 0 }
  }
]

In Claude Code it takes no code of your own: the plugin brings five memory tools and one local file, no account. Memory for Claude Code in one line →

The Story

Extracted from over 440,000 lines of production code.

ZenBrain comes out of a production system: we extracted its memory core from ZenAI, our first product with over 12,000 tests (as of August 2026), so you can use the algorithms.

ZenAI440K+ LOC12,000+ Testsformer production system
Extraction20 Modules7 LayersNeuroscience Core
ZenBrainnpm Packages948 Tests (v0.6.1)Open Source Apache 2.0
Algorithms

15 mechanisms. 9 foundational + 6 PMA components.

ZenBrain comprises 15 neuroscience-grounded mechanisms: 9 foundational algorithms, among them FSRS-style scheduling, Hebbian, Sleep Consolidation and Bayesian Confidence; the package @zensation/algorithms ships them as 20 modules, open source (zero dependencies); plus 6 Predictive Memory Architecture (PMA) components that govern memory dynamics; they are described in the paper and are not part of the open-source packages: NeuromodulatorEngine, ReconsolidationEngine, TripleCopyMemory, PriorityMap, StabilityProtector, MetacognitiveMonitor.

9loss when removed6no loss when removed
In the paper's stress simulation (decay = 0.25/day, 60-day aging), 10 of 15 components reach the criterion printed in the paper, a Wilcoxon test over ten seeds with the same p = 5.062 × 10⁻³ for all ten, the smallest value possible with ten seeds: removing nine lowers quality, removing PriorityMap raises it (correction notice of 18 September 2026); the criterion misses the Bonferroni threshold for fifteen contrasts, and the ablation switches off stand-ins in a simulation. What appears redundant under normal conditions is in fact cooperatively redundant.

Hebbian Learning

Strengthen connections through co-activation

Hebb 1949

FSRS-style Spaced Repetition

FSRS-style review scheduling

FSRS project (open-spaced-repetition)

Sleep Consolidation

Simulated replay modelled on sleep

Stickgold & Walker 2013

Ebbinghaus Decay

Forgetting curve with adaptive intervals

Ebbinghaus 1885

Bayesian Confidence

Confidence propagation over a graph (Bayesian-style, noisy-OR)

@zensation/algorithms/bayesian

Emotional Tagging

Emotional content decays more slowly

Cahill & McGaugh 1998

Personalized PageRank

Associative search over a graph

HippoRAG 2 (2025)

Context-Dependent Retrieval

Retrieval by context (encoding specificity)

Tulving 1973

Consolidation

Emotionally weighted episodes become facts

@zensation/core

Uncertainty Bands

For retrievability and propagation (heuristic, Wald-type)

@zensation/algorithms/intervals

Cross-Context (experimental)

Find merge candidates across contexts

@zensation/core

Retention Visualization

Export Ebbinghaus curves as data points

Ebbinghaus 1885

Neuromodulation

Dopamine, NE, 5-HT, ACh — four channels with tonic + phasic dynamics

Schultz 1997 · Aston-Jones 2005

Reconsolidation

Memory becomes labile on retrieval — four PE-gated update modes with rollback

Nader 2000 · Schiller 2010

Triple-Copy Memory

Three traces with divergent dynamics — fast (4h), medium (14d), deep (logarithmic)

Squire & Bayley 2007
Orchestration

One coordinator. 7 memory layers.

The MemoryCoordinator picks the layer when you store, searches up to five layers at once when you recall, and turns emotionally weighted episodes into facts.

100%0%t →DeeplogMedium14 dFast4 h
Shown here is TripleCopyMemory, one of the six Predictive Memory Architecture (PMA) components from the paper. The PMA is not part of the open-source packages; the MemoryCoordinator creates the seven layers and works on five of them directly.
Auto-Routingstore() picks the layer by fixed rules
Cross-Layer RecallOne query, up to five layers at once
ConsolidationEmotionally weighted episodes become facts, once each
DecayEbbinghaus decay in working memory
Review QueueAn FSRS-style scheduler plans reviews, your application reports the outcome
import { MemoryCoordinator }
  from '@zensation/core';
import { createMemoryAdapter }
  from '@zensation/adapter-sqlite';

const memory =
  new MemoryCoordinator({
    storage: await createMemoryAdapter()
  });

// Store — auto-routes
await memory.store(
  'TypeScript has generics'
);

// Recall — cross-layer
const results =
  await memory.recall(
    'What do I know about TypeScript?'
  );

// Consolidate — episodes to facts
await memory.consolidate();
Working
Short-Term
Episodic
Semantic
Procedural
Core
Cross-Context

Sovereign — runs in your stack

ZenBrain is the memory core, not the model and not the infrastructure — it runs in your stack: your LLM (Mistral, Llama, or whatever you choose), your inference (vLLM, Ollama), your database (PostgreSQL/SQLite), your infrastructure. No cloud lock-in, no vendor lock-in — a sovereign memory layer for European AI stacks.

How it compares

How ZenBrain relates to other open memory systems is set out on separate pages. Every figure there carries its method and source.

Architecture

Two core packages. One system.

@zensation/algorithms is the pure core — zero dependencies, every function importable on its own. @zensation/core ties the layers together in the MemoryCoordinator and uses FSRS-style scheduling and emotional tagging from it.

Your Application
uses
@zensation/core
MemoryCoordinatorstore() · recall() · consolidate() · decay()
Working
Short-Term
Episodic
Semantic
Procedural
Core
Cross-Context
npm i @zensation/core
uses
@zensation/algorithms
0 deps
FSRS-style
Emotional
Similarity
npm i @zensation/algorithms
required by core
adapter-postgres+ pgvector# published with v0.3
adapter-sqlitezero-config# published with v0.3
Community

Open source means: build together.

Apache 2.0. Contributions welcome. No CLA required.

What's next.

v0.2.0

MemoryCoordinator, Sleep Consolidation, 276 tests

March 2026
v0.3.0

Ten more algorithms (20 modules), 429 tests

Q2 2026
v0.4.0

Node 22+, MCP server and AI SDK middleware on npm

August 2026
v0.5.0

Forgetting by id (also over MCP), PostgreSQL with pgvector in CI, README separates the system from the algorithm library

October 2026
v0.6.0current

Forgetting follows consolidation, one score from 0 to 1 in every layer, ai-sdk injects only memories scoring above 0

October 2026 · patch v0.6.1 on 31 October
v1.0.0

API stability (Semver 1.0). Tagged once two consecutive minor releases have shipped without a breaking change to the public API of @zensation/algorithms and @zensation/core.

No calendar date.
FAQ

Frequently asked questions.

What's the difference between ZenBrain and Eigenraum?

ZenBrain is the extracted, open-source core of the memory algorithms. Eigenraum by ZenSation is our AI workspace built on it, the extended version of our first product, ZenAI. Want to build your own system → ZenBrain.

Do I need a database?

No database server. @zensation/algorithms is zero-dependency and runs completely in-memory. For persistence, both adapters are published on npm: adapter-sqlite (zero-config, also runs fully in memory) and adapter-postgres (pgvector). MemoryCoordinator requires a storage adapter — adapter-sqlite is the smallest one.

Which LLMs are supported?

ZenBrain is LLM-agnostic and also runs without an embedding provider, using lexical ranking. Embeddings can come from OpenAI, Mistral, Ollama or your own model.

Is ZenBrain production-ready?

The algorithms come from ZenAI (440K+ LOC, over 12,000 tests as of August 2026), where they ran in production. The extracted packages have 948 tests of their own (as of v0.6.1). API stability (Semver 1.0) is planned. The packages are pre-1.0 and the public API can still change; v1.0.0 will be tagged once two consecutive minor releases have shipped without a breaking change. We do not promise a calendar date.

How is ZenBrain different from Mem0?

Mem0 describes itself as a memory layer for AI assistants and agents, self-hosted or as a cloud service. ZenBrain separates seven layers and ships FSRS-style scheduling, Hebbian learning, sleep replay and uncertainty bands as functions you import one by one, self-hosted and TypeScript-native; no third-party dependencies in algorithms and core. The detailed comparison is on “ZenBrain vs Mem0”.

Can I use @zensation/algorithms without core?

Yes. The algorithms package is completely standalone with zero dependencies. You can import individual algorithms and integrate them into existing systems without using the MemoryCoordinator.