ClaudeCodeMod

All shelves / MCP servers

ZenBrain Memory

ai.zensation/zenbrain · 27 stars · TypeScript · Apache-2.0

MCP server Seven-layer agent memory: episodic, semantic, procedural and core. Local SQLite, no account.

Install

The repo has no one-line install. Follow its README.

Published as

  • npm@zensation/mcpstdio

From the server's entry in the official MCP Registry.

Open the repo

Configuration

NameSet asWhat it is
ZENBRAIN_DBOptionalEnv varPath to the SQLite file that holds the memory. A leading ~/ means your home directory; a relative path depends on where the client starts the server (some start it in /), so give an absolute or ~/ path. Use ':memory:' for a store that is discarded when the process exits.
ZENBRAIN_CONTEXTSOptionalEnv varComma-separated context domains for cross-context memory.

Files

packages/mcp/README.md

@zensation/mcp

Status: early release. The tool surface is small on purpose and may still change before 1.0. The memory layers underneath it are the same ones the ZenBrain paper describes and the benchmarks measure.

An MCP server that gives any MCP client — Claude Desktop, Claude Code, Cursor, or your own — a memory that survives the conversation.

Five tools, one local SQLite file, no account and no network call.

Tool What it does
zenbrain_store Write something into long-term memory. Routing is automatic: steps or instructions become a procedure, content with an emotional weight above 0.5 an episode, a confidence above 0.9 a pinned core memory, anything else a semantic fact. Each call adds a memory; the same core memory stored again is updated.
zenbrain_recall Search the episodic, semantic, procedural and core layers for what is relevant to a query; working memory only when you name it. Results come back ranked, each with its id and the layer it came from.
zenbrain_forget Delete one memory for good, by the id and layer zenbrain_recall returned. Nothing else is touched. To correct a memory, forget it and store the corrected version.
zenbrain_consolidate One maintenance pass: episodes with an emotional weight above 0.5 become semantic facts, each only once, and stale working-memory slots decay. Deletes nothing from long-term memory.
zenbrain_health How full each layer is: slots in use, episodes, facts and how many are due for review, procedures, core blocks.

Install

Requires Node.js 22 or newer.

npm install -g @zensation/mcp

Configure your client

{
  "mcpServers": {
    "zenbrain": {
      "command": "npx",
      "args": ["-y", "@zensation/mcp"],
      "env": {
        "ZENBRAIN_DB": "~/.zenbrain/memory.db"
      }
    }
  }
}
Variable Default Meaning
ZENBRAIN_DB ./zenbrain.db Path to the SQLite file. A leading ~/ means your home directory. A relative path is relative to the directory your client starts the server in — some clients, Claude Desktop among them, may start it in /, where nothing can be written — so give an absolute or ~/ path. :memory: gives a store that is discarded when the process exits.
ZENBRAIN_CONTEXTS personal,work,learning,creative Comma-separated context domains for cross-context memory.

The server speaks MCP over stdio. Stdout carries protocol traffic only; diagnostics go to stderr.

The seven layers

Storing is not filing. Which layer a memory lands in decides how it decays, how it is retrieved, and whether it survives consolidation.

Layer Holds
7 Cross-Context Memory Shared knowledge across domains
6 Core Memory Pinned facts
5 Procedural Memory "How to do X" — skills and workflows
4 Long-Term Semantic Facts, with FSRS scheduling
3 Episodic Memory Concrete experiences and events
2 Short-Term / Session Current conversation context
1 Working Memory Active task focus, 7±2 items

Each layer has its own retention, consolidation and retrieval rules. Review scheduling follows a forgetting curve rather than a fixed timer, and emotionally weighted content consolidates more strongly; both are implemented in @zensation/algorithms and can be read line by line.

This server configures no LLM provider, so nothing in it calls a model: routing on store is a content heuristic, and consolidation runs without generated summaries.

What this release does not do

Worth knowing before you wire it in:

  • No embedding provider is configured by default, so recall is lexical, not semantic. Without vectors, recall ranks by folded token overlap — umlauts and accents are folded, rarer words weigh more, and an adjacent phrase beats the same words scattered. It will find "Kieler Foerde" in a note about the "Kieler Förde"; it will not connect "car" to "automobile". Ranking runs over the most recent 500 entries per layer, and a query that matches nothing falls back to recency with score: 0. Pass an EmbeddingProvider through the library for true semantic matching — that is the configuration the published benchmarks were measured with.
  • SQLite similarity search is a full scan. Fine for one person's memory; use @zensation/adapter-postgres for larger volumes.
  • Consolidation is a tool call, not a schedule. Nothing runs it for you.
  • The store is a plain file. It is not encrypted. Put it somewhere you would put a notebook.

Using it as a library

The server factory is exported, so you can mount ZenBrain's tools on a server of your own or drive them in tests. The package is ESM; require() loads it on Node 22.12 and later (on 22.0–22.11, use import).

import { createZenBrainServer } from '@zensation/mcp/server';
import { MemoryCoordinator } from '@zensation/core';
import { SqliteAdapter } from '@zensation/adapter-sqlite';

const coordinator = new MemoryCoordinator({
  storage: new SqliteAdapter({ filename: './memory.db' }),
});

const server = createZenBrainServer(coordinator);
// connect it to any transport you like — the caller owns the coordinator's lifecycle

Zero-dependency, and where that stops

@zensation/algorithms and @zensation/core pull nothing but each other. That claim is checked in CI on every push against the packed tarballs, not against the source tree.

This package is deliberately outside that boundary. An MCP server needs the protocol SDK, so it carries one. Keeping it in its own package is what lets the core stay clean: installing @zensation/core never pulls the MCP SDK, and installing this never weakens the claim the core makes.

About ZenBrain

ZenBrain is a seven-layer, neuroscience-derived memory architecture for LLM agents, built as zero-dependency TypeScript and published under Apache-2.0. The benchmark results, and the configuration they were measured in, are reported in the paper; the reproduction packages are on Zenodo.

Works out of the box without an embedding provider — lexical ranking, zero dependencies. The paper's measurements used nomic-embed-text as the embedding provider.

License: Apache-2.0

Facts

Kind
MCP server
Repo
zensation-ai/zenbrain
Group
Uncategorized
Stars
27
License
Apache-2.0
Language
TypeScript
Last push
2026-10-11
Forks
7
MCP Registry
ai.zensation/zenbrain
Homepage
zensation.ai/open-source
Topics
fsrs, hebbian-learning, neuroscience, spaced-repetition, agent-memory, long-term-memory, ai-memory, cognitive-architecture, forgetting-curve, llm-memory, zero-dependencies, ebbinghaus, episodic-memory, longmemeval, memory-consolidation, memory-layer, procedural-memory, semantic-memory, stateful-agents, working-memory

More on this shelf

  1. 1REAio.github.morluto/reaReverse engineer anything from your terminal or agent with one CLI and MCP server.125.3k
  2. 2com.browser-use/browser-usecom.browser-use/browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.117.7k
  3. 3World Monitorapp.worldmonitor/mcpLive markets, conflicts, country risk, chokepoints, energy, and China decision signals. 93 tools.88.3k
  4. 4Scrapling MCP Serverd4vinci/scrapling🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scraplingdev86.9k
  5. 5Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  6. 6Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k