Compartment logo

Compartment

Offline encrypted vector memory for AI agents, with local persistence, hybrid search, expiration, and no API key or network.

Install Compartment

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "compartment": {
      "command": "uvx",
      "args": [
        "compartment"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

uvx compartment

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked Today.

Overview

Compartment MCP server gives AI agents a persistent memory vault stored on the local computer. It records claims with their source and discovery date, then uses hybrid vector and keyword search over an in-memory index for recall. The vault and embedding vectors are encrypted at rest and unlocked with a passphrase, while the bundled embedding model runs locally. Reach for Compartment when agents need shared memory across sessions and projects without cloud services, accounts, or runtime network access.

Use cases

  • Share agent memory across sessions and projects
  • Store private preferences and decisions locally
  • Recall machine configuration without a cloud service
  • Expire temporary facts such as bookings or access codes
  • Audit and replace changing opinions

Key features

  • Encrypted local vault with encrypted embedding vectors
  • Hybrid vector and keyword recall
  • Bundled offline embedding model
  • Source and discovery-date tracking
  • Memory expiration and supersession
  • Batch storage and memory atomization

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

27/29 checks healthy over the last 94d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · compartment (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars569Stargazers on the source repository.
Last commitTodayMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Directory activity7 viewsConfig copies, upvotes, and views on AllMCPs.

How Compartment works

What Compartment does

Compartment provides persistent memory for AI agents through MCP. Memories are stored in one encrypted vault on the user's computer, making information learned in one session available to later sessions, projects, and agents on the same machine. The design fits local-first workflows where memory must remain offline and encrypted at rest.

Each memory represents a single claim and includes a required source plus the date it was discovered. Memories can also have an expiration date or duration. Expired entries are removed after the specified time. New facts accumulate, while opinions can replace or supersede earlier opinions when they change.

How it works

The package includes its embedding model, so creating and searching memories does not require a remote model or API. Recall combines vector similarity with keyword matching over an index held in memory. Importance tiers influence ranking after a memory matches the query, giving more weight to decisions, consent, preferences, and machine configuration without surfacing unmatched records.

Storage enforces a one-claim format. Entries over 200 characters, or entries containing lists, headings, or paragraphs, are rejected with guidance to split them. memory_store_many accepts multiple memories in one call. Existing oversized entries can be processed with compartment atomize; the resulting pieces retain the original dates, while the original remains readable by ID and is marked superseded.

Opinions have additional update behavior. Similar live opinions can be found before insertion, allowing the caller to replace the old record, retain both, or refresh an existing opinion's date. Superseded records leave the search index but remain available through the audit chain.

Setup and configuration

Install Compartment, initialize a vault with compartment init, and then connect an MCP client to the compartment serve command. Client-specific integrations include compartment integrate claude, compartment integrate hermes, and compartment integrate openclaw.

The repository also provides MCP installation links or configurations for Cursor, VS Code, LM Studio, goose, and Kiro. Cursor and VS Code configurations invoke the server with a caller identifier before serve.

A new vault includes roughly 6,700 reference memories covering subjects such as hardware, operating systems, ports, encodings, and shell tools. A setting can remove those reference memories from search.

Tools and capabilities

  • Store individual claims with source and discovery date.
  • Batch-write memories with memory_store_many.
  • Recall relevant entries using hybrid vector and keyword search.
  • Set expiration using dates or durations such as 14d, 2w, 3m, or 1y.
  • Run expiration cleanup with compartment expire.
  • Control expiration behavior with expire_memories.
  • Split oversized existing memories with compartment atomize.
  • Audit overlapping live opinions with compartment opinions audit.

Limitations and notes

The vault is protected by a passphrase, and the embedding vectors are encrypted along with other data on disk. The search index is held in memory while the server runs. Compartment is designed for one local machine: its documented operating model uses a local encrypted file, no account or API key, and no runtime network connection.

Memory quality depends on following the one-claim format. Long session logs, lists, headings, and paragraphs are rejected rather than stored as a single entry. Expiration should be used only for facts with a known end date because an incorrect expiry removes a memory the user may still need.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Compartment

Compartment is an MCP server that connects AI agents and MCP clients to a local encrypted memory vault. Its documented tools include memory_store_many for batch writes and expire_memories for controlling expiration, while recall uses hybrid vector and keyword search. It requires no account, API key, or network.

Install Compartment, run `compartment init`, and configure an MCP client to launch `compartment serve`. Client integrations are also available through `compartment integrate claude`, `compartment integrate hermes`, and `compartment integrate openclaw`.

Yes, Compartment works with Cursor. The repository provides a Cursor installation link, and its configuration launches `compartment` with the `--caller cursor` argument and the `serve` command.

Yes, Compartment encrypts the vault and embedding vectors at rest and operates without a runtime network connection. The embedding model is included in the package, and a passphrase is used to open the vault.

Yes, memories can expire on a specific date or after a duration such as `14d`, `2w`, `3m`, or `1y`. Expiration can be swept with `compartment expire`, and the `expire_memories` capability controls expiration behavior.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCompartment AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/compartment?style=directory)](https://allmcps.com/mcp/compartment)
HTML Embed
<a href="https://allmcps.com/mcp/compartment"><img src="https://allmcps.com/api/badge/compartment?style=directory" alt="Compartment on AllMCPs" /></a>