ZenBrain
The neuroscience-inspired memory system for AI agents.
Memory for agents that lasts across sessions: seven layers, from working memory to long-term facts and procedures, and 20 tested algorithm modules for what memory research describes, such as spaced repetition, Hebbian strengthening, sleep replay and emotional tagging.
Pure TypeScript. No third-party dependencies in algorithms and core. 1020 tests as of v0.7.0. Extracted from ZenAI, the AI platform we ran in our own operation.
npm install @zensation/algorithms # the library, Node 22 or newer
claude mcp add --scope user zenbrain -e ZENBRAIN_DB=~/.zenbrain/memory.db -- npx -y @zensation/mcp # memory for Claude Code
The same MCP server runs in Claude Desktop and Cursor (configuration) and comes as a Claude Code plugin · Vercel AI SDK middleware: @zensation/ai-sdk
Status: pre-1.0, semver — the public API can still change before 1.0.
1020 tests green in CI as of v0.7.0: 1007 on each of Node 22, 24 and 26, and 13 more against PostgreSQL with pgvector · the current version of every package published to npm with build provenance ·
every change recorded in the CHANGELOG · issues and pull requests are answered; replications and counter-results are especially welcome.
Self-hosted: the library makes no network calls of its own. Memory lives in SQLite or PostgreSQL that you operate; an embedding model or an LLM is optional and your choice.
Versions at a glance (checked 4 November 2026)
▶ Try the live playground in your browser — runs this published code, no install required.
Three ways in
- In the browser: the playground above runs this published code; nothing to install.
- Across Claude Code sessions: the Claude Code plugin starts
@zensation/mcp 0.3.1. A note stored in one
session comes back in the next when the question shares words with it, as the top semantic result with a score above 0;
recall is lexical until you add an embedding provider. Checked on 4 November 2026 at the protocol level: two server
processes, one memory file, Node 22.23.3.
- Re-running the numbers: first what was measured, then the
reproduction packages with the raw material and the scripts that check it.
📄 Paper & Citation — ZenBrain: A Neuroscience-Inspired 7-Layer Memory Architecture for Autonomous AI Systems