# ZenBrain Memory

> ZenBrain Memory is an open-source MCP server for knowledge and memory. Local SQLite long-term memory for MCP clients, with five memory layers. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://zensation.ai/en/open-source
- **Repository:** https://github.com/zensation-ai/zenbrain/tree/HEAD/packages/mcp
- **MCP Registry name:** ai.zensation/zenbrain
- **Categories:** knowledge and memory
- **Listing updated:** 2026-11-14

## About

ZenBrain gives an MCP client a memory that outlives the conversation, stored in one local SQLite file with no account and no network call. Storing is routed automatically: text that looks like steps becomes a procedure, an emotional weight above 0.5 an episode, a confidence above 0.9 a pinned core memory, and anything else a semantic fact.

Recall searches the episodic, semantic, procedural and core layers, and working memory only when named, returning scored results with the layer each came from. Forgetting removes a memory together with the facts or episodes consolidation linked to it. A consolidation pass turns emotionally weighted recent episodes into facts and decays working-memory slots.

Tools carry MCP annotations, so recall and health are read-only, store only adds, and forget and consolidate are marked destructive. The README calls this an early release whose tool surface may change before 1.0. It needs Node.js 22 or newer and a ZENBRAIN_DB path.

## Features

- **Layered memory:** Working, episodic, semantic, procedural and core layers behind one store.
- **Automatic routing:** Chooses the layer on store from wording, emotional weight and confidence.
- **Scored recall:** Returns results with a 0 to 1 score and the layer of origin.
- **Linked forgetting:** Deleting a memory also removes what consolidation linked to it.
- **Consolidation pass:** Turns weighted episodes into facts and clears decayed working slots.
- **Tool annotations:** Marks read-only, additive and destructive tools for client prompts.

## Good for

- Give Claude Code a memory of project decisions across sessions
- Keep personal preferences available in Cursor or Claude Desktop
- Store step-by-step procedures an agent should reuse
- Correct a wrong memory by forgetting and re-storing it

## Install

### Claude Code (Terminal)

```sh
claude mcp add zenbrain -- npx -y @zensation/mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "zenbrain": {
      "command": "npx",
      "args": [
        "-y",
        "@zensation/mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "zenbrain": {
      "command": "npx",
      "args": [
        "-y",
        "@zensation/mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "zenbrain": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@zensation/mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "zenbrain": {
      "command": "npx",
      "args": [
        "-y",
        "@zensation/mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "zenbrain": {
      "command": "npx",
      "args": [
        "-y",
        "@zensation/mcp"
      ]
    }
  }
}
```

## Tools

- `zenbrain_store`: Write something into long-term memory with automatic layer routing.
- `zenbrain_recall`: Search the long-term layers for what is relevant to a query.
- `zenbrain_forget`: Delete a memory and what consolidation linked to it.
- `zenbrain_consolidate`: Run one maintenance pass that turns weighted episodes into facts.
- `zenbrain_health`: Show how full each memory layer is.

## FAQ

### Does it send data anywhere?

No. It uses one local SQLite file and makes no network call.

### Where is the memory stored?

At the path in ZENBRAIN_DB, which defaults to ./zenbrain.db; use an absolute or ~/ path since some clients start servers in /.

### What Node version is required?

Node.js 22 or newer.

### Is it stable?

The README calls it an early release whose tools may change before 1.0.

### Is ZenBrain Memory free?

Yes. ZenBrain Memory is open source, so you can use and self-host it for free.

### How do I add ZenBrain Memory to Claude Code?

Run this command in your terminal: claude mcp add zenbrain -- npx -y @zensation/mcp

### What are the best alternatives to ZenBrain Memory?

The closest alternatives to ZenBrain Memory are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and note1.

## Alternatives

- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [note1](https://ai-powered.com/mcp/note1): note1 is an MCP server for productivity.
- [MedXpert 图书馆连接器（通用版）](https://ai-powered.com/mcp/medxpert): MedXpert 图书馆连接器（通用版） is an open-source MCP server for knowledge and memory.
- [Context Nest](https://ai-powered.com/mcp/context-nest): Context Nest is a freemium MCP server for knowledge and memory.
- [Tulsa Ecosystem Map](https://ai-powered.com/mcp/tulsa-ecosystem-map): Tulsa Ecosystem Map is a free MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/zenbrain-memory
