Clarify Complexity. More than just AI.
The cognitive core of ZenAI — open source, tested, and in production use. 9 foundational algorithms that teach your AI to remember, forget, and sleep.
ZenBrain is not an experiment. It's the open-source memory core behind ZenAI — our AI operating system with over 12,000 tests and 7 cognitive pillars. We extracted the memory algorithms so you can use them.
ZenBrain comprises 15 neuroscience-grounded algorithms: 9 foundational mechanisms — FSRS, Hebbian, Sleep Consolidation, Bayesian Confidence, and others — open-source as @zensation/algorithms (zero dependencies); plus 6 Predictive Memory Architecture (PMA) components that govern memory dynamics and run in the production system: NeuromodulatorEngine, ReconsolidationEngine, TripleCopyMemory, PriorityMap, StabilityProtector, MetacognitiveMonitor.
Strengthen connections through co-activation
Hebb 1949Optimal review scheduling
Wozniak 2022Memory replay during sleep — like the brain
Stickgold & Walker 2013Forgetting curve with adaptive intervals
Ebbinghaus 1885Belief updates with prior + evidence
Bayes 1763Emotional markers for better recall
Damasio 1994Associative network activation
Collins & Loftus 1975Time-based memory encoding
Howard & Kahana 2002STM→LTM transfer with importance scoring
McClelland et al. 199595% CI for all probabilistic outputs
Wilson 1927Share knowledge across contexts
Tulving 1972Export Ebbinghaus curves as data points
Ebbinghaus 1885Dopamine, NE, 5-HT, ACh — four channels with tonic + phasic dynamics
Schultz 1997 · Aston-Jones 2005Memory becomes labile on retrieval — four PE-gated update modes with rollback
Nader 2000 · Schiller 2010Three traces with divergent dynamics — fast (4h), medium (14d), deep (logarithmic)
Squire & Bayley 2007The MemoryCoordinator orchestrates all layers — from Working Memory to Sleep Consolidation. One call. The system decides.
import { MemoryCoordinator }
from '@zensation/core';
const memory =
new MemoryCoordinator();
// Store — auto-routes
await memory.store(
'TypeScript has generics',
{ context: 'learning' }
);
// Recall — cross-layer
const results =
await memory.recall(
'What do I know about TypeScript?'
);
// Sleep — consolidate
await memory.consolidate();No setup. No config. No account.
npm install @zensation/algorithms
npm install @zensation/coreimport { MemoryCoordinator } from '@zensation/core';
import { HebbianLearning, FSRS } from '@zensation/algorithms';
const memory = new MemoryCoordinator({
algorithms: [HebbianLearning, FSRS]
});
await memory.store('Project deadline is Friday',
{ context: 'work' });
const recall = await memory.recall(
'When is the deadline?'
);
console.log(recall);{
"content": "Project deadline is Friday",
"confidence": 0.94,
"layer": "short-term",
"decay": 0.87,
"nextReview": "2026-03-28T09:00:00Z"
}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 — the sovereign memory layer for European AI stacks.
@zensation/algorithms is the pure core — zero dependencies. @zensation/core orchestrates everything with the MemoryCoordinator.
npm i @zensation/corenpm i @zensation/algorithms# published with v0.3# published with v0.3Apache 2.0. Contributions welcome. No CLA required.
Source code, issues, discussions
Repository →Questions, ideas, show & tell, release updates
Open →Read CONTRIBUTING.md, pick an issue, open a PR
Read guide →MemoryCoordinator, Sleep Consolidation, 276 tests
March 2026Algorithms expanded & hardened; LoCoMo / LongMemEval benchmarks vs. Mem0, Letta, A-Mem
Q2 2026Persistence adapters on npm (Postgres, SQLite) + IDE / MCP integration
H2 2026API stability, ZenBrain Cloud MVP
Q3 2026ZenBrain is the extracted, open-source core of the memory algorithms. ZenAI is the complete AI operating system built on ZenBrain. Want to build your own system → ZenBrain. Want the finished product → ZenAI.
No. @zensation/algorithms is zero-dependency and runs completely in-memory. Optional persistence adapters — adapter-postgres (pgvector) and adapter-sqlite (zero-config) — are in preview and will be published on npm in a future release.
ZenBrain is LLM-agnostic. The algorithms work on embeddings — whether from OpenAI, Anthropic, Mistral, Ollama, or your own model.
The algorithms come from ZenAI (440K+ LOC, 12,000+ tests, months in production). The extracted package has 528 of its own tests. API stability (Semver 1.0) is planned for Q3 2026.
Mem0 has 2 memory layers and focuses on cloud API. ZenBrain has 7 layers, Sleep Consolidation, FSRS, Hebbian Learning, Confidence Intervals — all self-hosted, zero dependencies, TypeScript-native.
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.