Compartment

Tools & Infrastructure 💻 Python ⚖️ Apache-2.0 🟢 Actively maintained
591 stars

Compartment is an encrypted, fully offline memory server for AI agents, storing memories in a single encrypted file on your own computer. It solves the problem of agents lacking persistent memory across sessions and projects, without requiring any network, API keys, or accounts. It is for developers using MCP-compatible AI agents like Claude Code, Cursor, or Codex who want private, persistent memory.

✨ Key features

  • Fully offline, encrypted vault with no network or telemetry
  • Hybrid vector and keyword search with ~12ms recall
  • Memories with source, date, and optional expiration
  • Automatic capture via hooks for Claude Code and others
  • Built-in reference facts (~6,700) about technical topics
  • Graph relations and tag propagation for richer context

🎯 Use cases

  • Give AI agents persistent memory across sessions and projects
  • Store user preferences and decisions securely offline
  • Recall technical facts about hardware, OS, and tools
  • Track project-specific knowledge with tags and relations
  • Audit and manage memory with CLI tools and dashboard

📦 Installation

🧰 Requirements: Python 3.x, pip install, and a passphrase to create a vault; no API keys or network required.

pip install compartment
compartment init

Then integrate with your agent, e.g., compartment integrate claude.

🚀 Usage

from compartment import Vault
vault = Vault.open('path/to/vault', passphrase='your-passphrase')
vault.store('The client prefers figures before conclusions.', source='chat', kind='fact')
results = vault.recall('What does the client prefer?')

⚠️ Good to know

The README is truncated, but it notes that memories are limited to 200 characters each (configurable) and that the project is as of September 2026; no other limitations are stated.

❓ FAQ

How does Compartment ensure privacy?

All data is stored in an encrypted file on your own computer, including embedding vectors, and there is no network access, API keys, or telemetry.

Can I use Compartment with any AI agent?

Yes, it works with any MCP client, including Claude Code, Claude Desktop, Hermes Agent, OpenClaw, Cursor, and Codex.

How are memories stored and retrieved?

Each memory is a single claim with source and date, stored encrypted. Recall uses hybrid vector and keyword search over an in-memory index, returning relevant results in about 12 ms.

Can memories expire?

Yes, you can set an expiration date or duration, and the memory is automatically removed after that date.

📊 Repository

Stars★ 591
Forks🍴 3
Open issues🐛 0
Last commit🕒 Sep 3, 2026
Created📅 Jul 2026
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.