
Compartment
Encrypted, fully offline long-term memory vault shared by every agent on your computer
- Pricing
- Free
- Platforms
- macOS, Windows, Linux
- Runs
- Locally
- Version
- 4.14.0
- Listing updated
- 3 days ago
About Compartment
Compartment is a free MCP server for knowledge and memory. It runs locally on your machine and is started by your AI client.
Each memory is a single claim stored with its source and the date it was learned. The store rejects anything over 200 characters or containing lists, headings or paragraphs, with an error that says how to split it; the author reports that without this rule the median memory an agent wrote on a real vault was 1,938 characters of bulleted session log. A batch tool, memory_store_many, stores several at once, and a compartment atomize command splits oversized memories in an existing vault.
Recall is a hybrid of vector and keyword search over an in-memory index and is stated to answer in about 12 ms. Importance is set by fixed tiers, with decisions and consent highest and small talk lowest, and it multiplies the match score so it can only break ties. A bare reply such as OK is kept together with the question it answered. Memories can expire on a set date, and a changed preference replaces the old one.
Everything on disk is encrypted, vectors included, and only your passphrase opens the vault. The embedding model ships in the package, and a new vault includes about 6,700 reference facts on hardware, operating systems, ports, encodings and shell tools that one switch removes from search. The README compares it with other memory servers on storage, encryption, accounts and network use.
Install
Run in a terminal
claude mcp add compartment -- uvx compartmentAdd to claude_desktop_config.json
{
"mcpServers": {
"compartment": {
"command": "uvx",
"args": [
"compartment"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"compartment": {
"command": "uvx",
"args": [
"compartment"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"compartment": {
"type": "stdio",
"command": "uvx",
"args": [
"compartment"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"compartment": {
"command": "uvx",
"args": [
"compartment"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"compartment": {
"command": "uvx",
"args": [
"compartment"
]
}
}
}Tools this server provides (1)
Taken from the project documentation; the running server may differ.
- memory_store_many
- Stores a batch of memories in one call.
What it does
- Encrypted vault
- One encrypted file on your machine, with embedding vectors encrypted too.
- Offline by design
- No API key, account, network use or telemetry; the project says this is enforced in CI.
- Hybrid recall
- Vector and keyword search over an in-memory index.
- One claim per memory
- Length and format limits keep memories short and searchable.
- Expiry and replacement
- Memories can expire, and a new preference supersedes the old one.
- Agent integration
- Commands wire Claude Code, Claude Desktop, Hermes Agent, OpenClaw, AntiGravity and Codex.
- Memory map GUI
- The site mentions a GUI with a memory map.
Good for
- Keep decisions and preferences across sessions and projects
- Share one memory between several coding agents on the same machine
- Store sensitive context without sending it to a cloud service
- Carry reference facts about your machine into every session
Pricing
Free
No account or API key needed
Prices change. Check maxfreedompollard.github.io before you buy.
Compartment FAQ
Does it need an API key or network?
No. The README says no API key, no account, no network and no telemetry.
How do I connect Claude Code?
After installing and running compartment init, run compartment integrate claude. Equivalent commands exist for hermes, openclaw, antigravity and codex.
How long can a memory be?
200 characters by default (the max_memory_chars setting), with no lists, headings or paragraphs.
How is it installed?
The registry lists it as the compartment package on PyPI.
Is Compartment free?
Yes. Compartment is free to use.
How do I add Compartment to Claude Code?
Run this command in your terminal: claude mcp add compartment -- uvx compartment
What are the best alternatives to Compartment?
The closest alternatives to Compartment are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and note1.
Alternatives to Compartment

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Claude Code Ultimate Guide
MCP serverMCP server for searching the Claude Code Ultimate Guide from any MCP client
Runs locally- Open source
- 6.5K GitHub stars
- AI models and LLM tooling

Nautilus Compass Memory
MCP serverLocal-first long-term memory layer for AI agents, served over MCP
Not checked yet- 5 tools
- Remote
- Open source
- 1.3K GitHub stars
- Knowledge and memory

note1
MCP serverMCP server giving AI assistants search and summaries across your note1 meetings
- 4 tools
- Remote
- Free trial
- 1 GitHub star
- Productivity
MedXpert 图书馆连接器(通用版)
MCP serverLocal MCP server that searches and answers questions over your own Markdown wiki
Runs locally- 4 tools
- Open source
- Knowledge and memory