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 (as of August 2026) and 7 cognitive pillars. We extracted the memory algorithms so you can use them.
ZenBrain comprises 15 neuroscience-grounded mechanisms: 9 foundational algorithms, among them FSRS, 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 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';
import { createMemoryAdapter }
from '@zensation/adapter-sqlite';
const memory =
new MemoryCoordinator({
storage: await createMemoryAdapter()
});
// 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 account, no cloud, no config file — Node 22+ and two packages.
npm install @zensation/core @zensation/adapter-sqliteimport { MemoryCoordinator } from '@zensation/core';
import { createMemoryAdapter } from '@zensation/adapter-sqlite';
const memory = new MemoryCoordinator({
storage: await createMemoryAdapter()
});
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",
"layer": "semantic",
"confidence": 0.7,
"score": 0,
"metadata": { "source": "user", "accessCount": 0 }
}
]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 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.
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, over 12,000 tests as of August 2026, 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.