Compartment is an MCP server that gives AI agents durable memory. It keeps one encrypted vault on the user's own computer, read and written by Claude Code, Claude Desktop, Hermes Agent, OpenClaw, Cursor, Codex and any other MCP client. There is no API key, no account, no network at runtime and no telemetry. Each memory is a single claim recorded with a required source and the date it was learned, and memories can expire: set expires to a date or a duration such as 14d, 2w, 3m or 1y and the memory is removed after that date. Recall is a hybrid vector and keyword search over an in-memory index; the documented median for a full hybrid search is about 11.6 ms. The embedding model is bundled (384-dimension int8 ONNX) and everything on disk, embedding vectors included, is encrypted under the user's passphrase. A new vault ships with about 6,700 reference facts about hardware, operating systems, ports, encodings and shell tools, removable from search with one switch. Security primitives include XChaCha20-Poly1305 encryption at rest, Argon2id key slots, a key per record, a hash-chained audit log, and a runtime guard that aborts on any network socket attempt (--assert-offline). The project ships a macOS menu bar app, a Windows notification-area app, a Linux window, a read-only browser dashboard bound to 127.0.0.1, memory packs, and a serve command that speaks MCP over stdio. Installation routes include PyPI (pip, pipx, uv), a Claude Code plugin, Docker, and a Compartment.pkg for macOS. Licensed Apache-2.0.
Setup
1) Install with pip: pip install compartment && compartment init (needs Python 3.11 or newer; pipx install compartment or uv tool install compartment also work). 2) compartment init asks you to choose a passphrase, creates the vault, loads the reference facts and connects Claude Code, Hermes Agent or OpenClaw if they are installed. 3) Wire a specific client: compartment integrate claude, compartment integrate hermes, compartment integrate openclaw, or compartment integrate --all for every installed client it knows. 4) For any other MCP client, use the stdio block: {"mcpServers":{"compartment":{"command":"compartment","args":["serve"]}}} (VS Code uses the key servers with "type": "stdio"; Zed uses context_servers; Codex uses TOML under [mcp_servers.compartment]). 5) On a Mac you can instead download Compartment.pkg from the latest release and open it, which needs no command line. 6) Restart your agent and it has a memory.
{"mcpServers":{"compartment":{"command":"compartment","args":["serve"]}}}
Use cases
Share one long-term memory between several AI agents on the same machine
Give agents memory in a fully offline environment with no API key
Store sensitive facts, credential locations and decisions encrypted at rest
Set automatic expiry for facts that stop being true on a known date, such as prices, bookings or door codes
Record and query typed relations in a graph alongside the memory list
Inspect growth, tags, the relation graph and live search read-only in a browser