An encrypted vault for your agent’s chronic forgetfulness
Compartment gives AI agents durable, encrypted long-term memory that lives entirely on your machine—no cloud, no API keys, no telemetry.

What it does Compartment is an MCP server that acts as a persistent memory bank for AI agents like Claude, Hermes, and OpenClaw. It stores conversations, decisions, preferences, and machine details in an encrypted local vault, then retrieves them via semantic and keyword search when an agent needs context from past sessions. Everything runs offline, including the embedding model, and it ships with over 6,700 curated “starter facts” covering hardware specs, file signatures, and regex syntax so an offline agent is not flying blind.
The interesting bit
The security architecture doubles as a performance trick: because plaintext is never written to disk, the entire search index stays in RAM, which the README claims delivers vector search in 0.68 ms and a full hybrid pipeline in about 12 ms. It also hijacks the host’s own memory hooks—when Claude Code writes a memory file, a PostToolUse hook intercepts it and banks the fact in the vault regardless of whether the model remembered to call the tool.
Key highlights
- All data at rest is AEAD-encrypted, embedding vectors included; the README notes most rival tools leave vectors in plaintext.
- Deterministic importance tiers rank memories (decisions score 0.90, pleasantries 0.20) so search surfaces what matters instead of random chatter.
- A
/compartmentalizecommand sweeps an entire conversation into the vault before the host compacts or summarizes it away. - Optional keyfile plus passphrase feeds both into Argon2id for two-factor unlocking.
- Cryptographic deletion destroys a record’s key rather than marking it deleted; the vault locks itself on restart or power loss.
Caveats
- The one-click graphical installer is macOS-only.
- Linux deliberately skips the system tray and uses a standalone window, since tray icon behavior is inconsistent across GNOME and Wayland.
Verdict Worth a look if you run local or MCP-connected agents and want memory that survives reboots without shipping your conversation history to a vendor cloud. Skip it if you are happy with your host’s built-in per-project Markdown files or need multi-machine sync, since the vault is strictly local and offline by design.
Frequently asked
- What is MaxFreedomPollard/Compartment?
- Compartment gives AI agents durable, encrypted long-term memory that lives entirely on your machine—no cloud, no API keys, no telemetry.
- Is Compartment open source?
- Yes — MaxFreedomPollard/Compartment is open source, released under the Apache-2.0 license.
- What language is Compartment written in?
- MaxFreedomPollard/Compartment is primarily written in Python.
- How popular is Compartment?
- MaxFreedomPollard/Compartment has 592 stars on GitHub.
- Where can I find Compartment?
- MaxFreedomPollard/Compartment is on GitHub at https://github.com/MaxFreedomPollard/Compartment.