Zengram MCP
An MCP server and API of shared memory for several agents: facts, decisions and events live in one database with semantic search.
- 64 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Memory records are stored on your server while text goes to an embedding provider.
- Any agent with the key reads and changes the shared memory.
Install
- Works in
Manual install
npm install -g @zensystemai/zengram-mcpInstalls the MCP server; the memory service itself starts through `docker compose up -d`.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Memory records are stored on your server while text goes to an embedding provider.
- Any agent with the key reads and changes the shared memory.
This is third-party code. Review the repository files before installing.
What it does
Zengram gives several agents on different machines one memory: Claude Code on a laptop stores a fact and an autonomous agent on a server recalls it. Memory is typed: events are immutable, facts overwrite by key, statuses track current state and decisions record choices and reasoning. Each type has its own lifecycle and decay rules. All records live in a single Postgres database with pgvector for semantic search. The service runs through Docker Compose and serves REST on port 8084 with an `X-Api-Key` key. The MCP server gives 13 tools, among them `brain_store`, `brain_search`, `brain_briefing` and `brain_query`. There is also a `/sessionend` skill for session wrap-ups and a bash wrapper.
Who it is for. Teams running several agents on different machines who want a shared long-term memory instead of separate context for each.
Good fit when
- A development agent stores a fact about a service port and a task agent on a server finds it by search.
- A new session receives a summary with `brain_briefing`.
- Decisions and their reasons are stored as a separate record type rather than in chat.
- Memory is exported and imported between environments.
Not a fit when
- You need memory for one agent on one machine with no server of your own.
- Postgres and Docker cannot be run.
- Records cannot be sent to an embedding provider.
Example request
Store in Zengram that the API listens on port 8084, then find the record with a semantic search.MCP
- Transport
- stdio
- Authentication
- API key
Environment variables
BRAIN_API_URLrequired- Memory service address, http://localhost:8084 by default.
BRAIN_API_KEYrequired, secret- Access key for the memory service.
Limitations
You need your own server: Docker Compose starts Postgres and the service. `BRAIN_API_KEY` and an embedding provider key are set in `.env`, so record text goes to that provider. The MCP server needs Node.js version 20 or newer and two variables, `BRAIN_API_URL` and `BRAIN_API_KEY`. Shared memory is visible to every agent with the key, so keep secrets out and protect port 8084. The `/sessionend` skill is copied into the project `.claude/skills/` by hand.
How to disable. Remove the `zengram` entry from the MCP configuration, stop the stack with `docker compose down` and delete the database volume with the accumulated memory if needed.
FAQ
How do I connect the MCP server?
Install `npm install -g @zensystemai/zengram-mcp` or set `node` and the path to `mcp-server/src/index.js` in `mcpServers` with `BRAIN_API_URL` and `BRAIN_API_KEY`.
Which memory types exist?
Events, facts, statuses and decisions. Events are immutable and facts under one key replace older ones.
How do I check the service is running?
Run `curl http://localhost:8084/health` after `docker compose up -d`.
Which tools does the MCP server provide?
Thirteen, including `brain_store`, `brain_search`, `brain_briefing`, `brain_query`, `brain_stats` and `brain_export`.
What is the sessionend skill?
Copy `adapters/claude-code/sessionend/` into `.claude/skills/` to get the `/sessionend` ritual that stores session reflections in memory.
Discussion
No questions or reviews yet.
Related
MCP serversSelf-hosted long-term memory for agents: semantic search, a knowledge graph and autonomous consolidation over MCP and a REST API
A self-hosted MCP memory server that keeps preferences and decisions across conversations in Claude Code, Cursor and other clients
Memory for AI agents with three types: facts, events and procedures that learn from failures; cloud by key or a local folder
BrainAPI turns text into a knowledge graph on your server and serves agents over MCP, REST and a console with fact-path answers
A self-hosted MCP server for long-term agent memory: structured records, versioned rollback and a visual dashboard
Engram (getengram.app): cloud memory for agents
Engram (getengram.app)
A remote MCP server that keeps agent conversations verbatim and searches them by meaning across sessions
README in short
The project grew from a working setup where no ready way existed to share agent memory across machines. Memory types, storage, benchmarks and adapters follow.