# Compartment [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/MaxFreedomPollard/Compartment  
**GitHub Stars:** 569  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/compartment

## Description
Fully offline, encrypted-at-rest vector memory for AI agents. AEAD-encrypted vectors, no cloud.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "compartment": {
    "command": "uvx",
    "args": ["compartment"]
  }
}
```

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/compartment/readme_

