Neuroscience Memory
for AI Agents.
The cognitive core extracted from ZenAI — tested, proven, open source. 12 algorithms that teach your AI to remember, forget, and sleep.
Extracted from 258,000 lines of production code.
ZenBrain is not an experiment. It's the core of ZenAI — an AI operating system with 9,228 tests and 6 cognitive pillars. We extracted the memory algorithms so you can use them.
12 Algorithms. Peer-reviewed Neuroscience.
Every algorithm is based on published research. No marketing buzzwords — real science.
Hebbian Learning
Strengthen connections through co-activation
Hebb 1949FSRS Spaced Repetition
Optimal review scheduling
Wozniak 2022Sleep Consolidation
Memory replay during sleep — like the brain
Stickgold & Walker 2013Ebbinghaus Decay
Forgetting curve with adaptive intervals
Ebbinghaus 1885Bayesian Confidence
Belief updates with prior + evidence
Bayes 1763Emotional Tagging
Emotional markers for better recall
Damasio 1994Activation Spreading
Associative network activation
Collins & Loftus 1975Temporal Context
Time-based memory encoding
Howard & Kahana 2002Memory Consolidation
STM→LTM transfer with importance scoring
McClelland et al. 1995Confidence Intervals
95% CI for all probabilistic outputs
Wilson 1927Cross-Context Transfer
Share knowledge across contexts
Tulving 1972Retention Visualization
Export Ebbinghaus curves as data points
Ebbinghaus 1885One Coordinator. 7 Memory Layers.
The 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();First memory in 30 seconds.
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"
}What other memory systems don't have.
Four competitors. All solve parts of the problem. None has Sleep Consolidation, 7 layers, or Confidence Intervals.
Feature Comparison at a Glance
| ZenBrain | Mem0 | Letta | Zep | LangMem | |
|---|---|---|---|---|---|
| Memory Layers | 7 | 1 | 2 | 2 | 1 |
| Sleep Consolidation | ✓ | ✗ | ✗ | ✗ | ✗ |
| FSRS Spaced Rep. | ✓ | ✗ | ✗ | ✗ | ✗ |
| Hebbian Learning | ✓ | ✗ | ✗ | ✗ | ✗ |
| Confidence Intervals | ✓ | ✗ | ✗ | ✗ | ✗ |
| Emotional Tagging | ✓ | ✗ | ✗ | ✓ | ✗ |
| Cross-Context | ✓ | ✗ | ✗ | ✗ | ✗ |
| Ebbinghaus Decay | ✓ | ✗ | ✗ | ✓ | ✗ |
| Self-hosted | ✓ | ⚠ | ✓ | ⚠ | ✓ |
| Zero Dependencies | ✓ | ✗ | ✗ | ✗ | ✗ |
| TypeScript-native | ✓ | Python | Python | Python | Python |
| Peer-reviewed Basis | ✓ | ✗ | ⚠ | ✗ | ✗ |
| Algorithms | 12 | 1 | 3 | 2 | 1 |
| Tests | 276 | ? | ? | ? | ? |
As of March 2026. Based on public documentation.
Two Packages. One System.
@zensation/algorithms is the pure core — zero dependencies. @zensation/core orchestrates everything with the MemoryCoordinator.
npm i @zensation/corenpm i @zensation/algorithmsnpm i @zensation/adapter-postgresnpm i @zensation/adapter-sqliteOpen source means: build together.
Apache 2.0. Contributions welcome. No CLA required.
GitHub
Source code, issues, discussions
Repository →Discord
Questions, ideas, show & tell, release updates
Join →Contributing
Read CONTRIBUTING.md, pick an issue, open a PR
Read guide →What's next.
MemoryCoordinator, Sleep Consolidation, 276 tests
March 2026@zensation/mcp-server — IDE integration (Cursor, VS Code, Claude)
May 2026LOCOMO benchmark vs. Mem0/Zep/LangMem
June 2026API stability, ZenBrain Cloud MVP
Q3 2026Frequently asked questions.
What's the difference between ZenBrain and ZenAI?
ZenBrain 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.
Do I need a database?
No. @zensation/algorithms is zero-dependency and runs completely in-memory. For persistence, optional adapters are available: adapter-postgres (pgvector) and adapter-sqlite (zero-config).
Which LLMs are supported?
ZenBrain is LLM-agnostic. The algorithms work on embeddings — whether from OpenAI, Anthropic, Mistral, Ollama, or your own model.
Is ZenBrain production-ready?
The algorithms come from ZenAI (258K LOC, 9,228 tests, months in production). The extracted package has 276 of its own tests. API stability (Semver 1.0) is planned for Q3 2026.
How is ZenBrain different from Mem0?
Mem0 has 1 memory layer and focuses on cloud API. ZenBrain has 7 layers, Sleep Consolidation, FSRS, Hebbian Learning, Confidence Intervals — all self-hosted, zero dependencies, TypeScript-native.
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.
Ready for AI
that remembers?
12 algorithms. 276 tests. Zero dependencies. Apache 2.0 — forever.
v0.2.0TypeScriptApache 2.0