compartment 1.15.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- compartment-1.15.0/LICENSE +21 -0
- compartment-1.15.0/PKG-INFO +396 -0
- compartment-1.15.0/README.md +373 -0
- compartment-1.15.0/pyproject.toml +45 -0
- compartment-1.15.0/setup.cfg +4 -0
- compartment-1.15.0/src/compartment/__init__.py +7 -0
- compartment-1.15.0/src/compartment/acl.py +92 -0
- compartment-1.15.0/src/compartment/audit.py +54 -0
- compartment-1.15.0/src/compartment/bench.py +94 -0
- compartment-1.15.0/src/compartment/claude_hooks.py +207 -0
- compartment-1.15.0/src/compartment/claude_memory.py +183 -0
- compartment-1.15.0/src/compartment/cli.py +1195 -0
- compartment-1.15.0/src/compartment/crypto.py +229 -0
- compartment-1.15.0/src/compartment/dash.py +672 -0
- compartment-1.15.0/src/compartment/data/hermes-plugin/__init__.py +321 -0
- compartment-1.15.0/src/compartment/data/hermes-plugin/plugin.yaml +7 -0
- compartment-1.15.0/src/compartment/data/menubar.png +0 -0
- compartment-1.15.0/src/compartment/data/menubar@2x.png +0 -0
- compartment-1.15.0/src/compartment/data/starter.mpack +0 -0
- compartment-1.15.0/src/compartment/embed.py +140 -0
- compartment-1.15.0/src/compartment/home.py +53 -0
- compartment-1.15.0/src/compartment/longmemeval.py +286 -0
- compartment-1.15.0/src/compartment/menubar.py +746 -0
- compartment-1.15.0/src/compartment/models/bge-small-en-v1.5-int8/model_quantized.onnx +0 -0
- compartment-1.15.0/src/compartment/models/bge-small-en-v1.5-int8/tokenizer.json +30672 -0
- compartment-1.15.0/src/compartment/offline_guard.py +53 -0
- compartment-1.15.0/src/compartment/packs.py +240 -0
- compartment-1.15.0/src/compartment/platforms.py +189 -0
- compartment-1.15.0/src/compartment/salience.py +128 -0
- compartment-1.15.0/src/compartment/selftest.py +74 -0
- compartment-1.15.0/src/compartment/server.py +327 -0
- compartment-1.15.0/src/compartment/session.py +118 -0
- compartment-1.15.0/src/compartment/store.py +287 -0
- compartment-1.15.0/src/compartment/vault.py +866 -0
- compartment-1.15.0/src/compartment/vaultfile.py +284 -0
- compartment-1.15.0/src/compartment/vindex.py +124 -0
- compartment-1.15.0/src/compartment.egg-info/PKG-INFO +396 -0
- compartment-1.15.0/src/compartment.egg-info/SOURCES.txt +58 -0
- compartment-1.15.0/src/compartment.egg-info/dependency_links.txt +1 -0
- compartment-1.15.0/src/compartment.egg-info/entry_points.txt +4 -0
- compartment-1.15.0/src/compartment.egg-info/requires.txt +18 -0
- compartment-1.15.0/src/compartment.egg-info/top_level.txt +1 -0
- compartment-1.15.0/tests/test_acl_audit_packs.py +99 -0
- compartment-1.15.0/tests/test_claude_hooks_and_integrate.py +345 -0
- compartment-1.15.0/tests/test_claude_memory_and_recent.py +280 -0
- compartment-1.15.0/tests/test_crypto.py +59 -0
- compartment-1.15.0/tests/test_dash.py +89 -0
- compartment-1.15.0/tests/test_instructions.py +73 -0
- compartment-1.15.0/tests/test_macos_bundle.py +115 -0
- compartment-1.15.0/tests/test_menubar.py +245 -0
- compartment-1.15.0/tests/test_offline_selftest_bench.py +81 -0
- compartment-1.15.0/tests/test_ondisk_format.py +97 -0
- compartment-1.15.0/tests/test_platforms.py +27 -0
- compartment-1.15.0/tests/test_relations.py +142 -0
- compartment-1.15.0/tests/test_salience.py +66 -0
- compartment-1.15.0/tests/test_session_lock.py +79 -0
- compartment-1.15.0/tests/test_starter_packs.py +130 -0
- compartment-1.15.0/tests/test_tamper.py +97 -0
- compartment-1.15.0/tests/test_twofa.py +104 -0
- compartment-1.15.0/tests/test_vault_ops.py +168 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Compartment Project
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: compartment
|
|
3
|
+
Version: 1.15.0
|
|
4
|
+
Summary: Compartment - high-security, fully offline, encrypted vector memory for AI agents (MCP)
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: pynacl>=1.5
|
|
10
|
+
Requires-Dist: argon2-cffi>=23.1
|
|
11
|
+
Requires-Dist: onnxruntime>=1.17
|
|
12
|
+
Requires-Dist: tokenizers>=0.15
|
|
13
|
+
Requires-Dist: numpy>=1.26
|
|
14
|
+
Requires-Dist: mcp>=1.0
|
|
15
|
+
Provides-Extra: hnsw
|
|
16
|
+
Requires-Dist: usearch>=2.9; extra == "hnsw"
|
|
17
|
+
Provides-Extra: menubar
|
|
18
|
+
Requires-Dist: pyobjc-framework-Cocoa>=10.0; sys_platform == "darwin" and extra == "menubar"
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
21
|
+
Requires-Dist: usearch>=2.9; extra == "dev"
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# Compartment
|
|
25
|
+
|
|
26
|
+
### Superior agentic memory, encrypted at rest.
|
|
27
|
+
|
|
28
|
+
Compartment is the memory your AI agents plug into. Hermes, Claude, and
|
|
29
|
+
OpenClaw each register in one command; anything that runs a subprocess
|
|
30
|
+
can use the CLI. Every agent can share the same memory - even across
|
|
31
|
+
different machines. Everything is local. The default install never
|
|
32
|
+
touches the network: the embedding model ships inside the package, so
|
|
33
|
+
recall works as soon as the vault is open. Every byte at rest is
|
|
34
|
+
AEAD-encrypted, the vectors included. The vault locks itself on restart
|
|
35
|
+
or power loss and unlocks once per boot.
|
|
36
|
+
|
|
37
|
+
*In intelligence work a **compartment** is a body of knowledge walled off
|
|
38
|
+
from everything around it, opened only by those who need it. This one is
|
|
39
|
+
sealed with a key only you hold, and it is kept in RAM: the whole index
|
|
40
|
+
lives in memory, which is what makes it both the fastest place to search and
|
|
41
|
+
the safest place to hold plaintext, because nothing decrypted is ever
|
|
42
|
+
written to disk.*
|
|
43
|
+
|
|
44
|
+
## Why Compartment
|
|
45
|
+
|
|
46
|
+
Most memory tools ask you to choose: powerful, or private, or easy. Compartment
|
|
47
|
+
refuses the trade, because one design decision delivers all three.
|
|
48
|
+
|
|
49
|
+
**Useful before you teach it anything.** A new vault is not empty: `compartment
|
|
50
|
+
init` seeds **6,718 self-contained reference facts** - hardware, operating
|
|
51
|
+
systems, networking and HTTP, file signatures, character encodings, shell
|
|
52
|
+
and Unix internals, git, regex, SQL, cryptography, dates and number
|
|
53
|
+
formats, physical constants, world geography, and first aid - so an offline
|
|
54
|
+
agent can look things up instead of guessing at them. They are ordinary
|
|
55
|
+
memories in `main`, editable and forgettable like anything else you store.
|
|
56
|
+
|
|
57
|
+
**Better recall.** Compartment does not just store chat, it decides what
|
|
58
|
+
matters. A bare "OK" answering "send this reply to the client?" is
|
|
59
|
+
captured as a consent decision, with its question, at the highest
|
|
60
|
+
priority. What you said about yourself and your machine outranks
|
|
61
|
+
background noise. Search is hybrid (meaning plus keywords) and, at
|
|
62
|
+
personal scale, mathematically exact: the top result is the true top
|
|
63
|
+
result, not an approximation. It learns you first, and forgets nothing.
|
|
64
|
+
|
|
65
|
+
**More secure, by construction.** Every byte at rest is authenticated-
|
|
66
|
+
encrypted, the embedding vectors included (most tools leave those in the
|
|
67
|
+
clear, and vectors can be inverted back toward text). Deletion is
|
|
68
|
+
cryptographic: destroy the record's key and it is gone, unrecoverable.
|
|
69
|
+
Tampering is detected, history is hash-chained, and the vault locks itself
|
|
70
|
+
on restart or power loss. It runs fully offline: a runtime guard aborts on
|
|
71
|
+
any network attempt, and CI proves it on three operating systems.
|
|
72
|
+
|
|
73
|
+
**Not one step harder.** One command installs it, creates the vault, and
|
|
74
|
+
wires your agent. No API key, no cloud account, no daemon. Unlock when you
|
|
75
|
+
want to use it; lock when you want it closed. By default an unlock stays
|
|
76
|
+
open for weeks (until restart or you lock it), like any app you leave
|
|
77
|
+
running. The security is free at the point of use because it falls out of
|
|
78
|
+
the architecture, not out of your patience: keeping plaintext off disk
|
|
79
|
+
forces the index into RAM, and a RAM-resident index is also the fastest
|
|
80
|
+
one there is. Secure and fast are the same choice here, and neither costs
|
|
81
|
+
you a configuration step.
|
|
82
|
+
|
|
83
|
+
## Install
|
|
84
|
+
|
|
85
|
+
**macOS - download and open.**
|
|
86
|
+
[**Compartment.pkg**](https://github.com/MaxFreedomPollard/Compartment/releases/latest)
|
|
87
|
+
from the latest release. The installer asks whether you also want the menu
|
|
88
|
+
bar utility, and everything - the interpreter, the embedding model, every
|
|
89
|
+
dependency - is inside the app, so there is nothing to install first. A
|
|
90
|
+
`.dmg` is there too if you would rather drag it to Applications yourself.
|
|
91
|
+
(The build is not signed with an Apple Developer ID yet. The `.pkg` handles
|
|
92
|
+
that for you; if you take the `.dmg` instead, macOS blocks the first launch
|
|
93
|
+
and you allow it once in System Settings → Privacy & Security → Open Anyway.)
|
|
94
|
+
|
|
95
|
+
Everywhere else, and for the CLI and MCP server on their own, it is one
|
|
96
|
+
command per platform - each installs the package, creates your encrypted
|
|
97
|
+
vault, and wires the agent:
|
|
98
|
+
|
|
99
|
+
**Claude (Code + Desktop)** - macOS / Linux:
|
|
100
|
+
```bash
|
|
101
|
+
pip install compartment && compartment init && compartment integrate claude
|
|
102
|
+
```
|
|
103
|
+
Windows (PowerShell):
|
|
104
|
+
```powershell
|
|
105
|
+
py -m pip install compartment; compartment init; compartment integrate claude
|
|
106
|
+
```
|
|
107
|
+
Registers the MCP server with the Claude Code CLI (user scope, all
|
|
108
|
+
projects), **imports any memories Claude Code already wrote to its own
|
|
109
|
+
file-based memory** (copy-only - the Markdown files are never modified;
|
|
110
|
+
`--no-import` opts out, `compartment import-claude` does it later), and prints
|
|
111
|
+
the Claude Desktop config block. The server describes
|
|
112
|
+
itself over the MCP handshake - it tells the model to recall before answering
|
|
113
|
+
and to store durable facts, credentials, names, and decisions - so Claude
|
|
114
|
+
treats Compartment as its memory with no hand-written instruction; `integrate
|
|
115
|
+
claude` also writes a managed, idempotent block into your CLAUDE.md as backup.
|
|
116
|
+
|
|
117
|
+
**Hermes** - macOS / Linux:
|
|
118
|
+
```bash
|
|
119
|
+
pip install compartment && compartment init && compartment integrate hermes
|
|
120
|
+
```
|
|
121
|
+
Windows (PowerShell):
|
|
122
|
+
```powershell
|
|
123
|
+
py -m pip install compartment; compartment init; compartment integrate hermes
|
|
124
|
+
```
|
|
125
|
+
Installs the provider plugin, wires the Hermes venv, and runs
|
|
126
|
+
`hermes memory setup compartment`. Compartment then appears in the
|
|
127
|
+
`hermes memory setup` picker beside hindsight and mem0, the only entry
|
|
128
|
+
marked **"no setup needed"**: no API key, no cloud account, no daemon.
|
|
129
|
+
Verify with `hermes memory status`. See everything Hermes remembers at
|
|
130
|
+
any time with **`compartment dash`** - one command, and the vault opens in
|
|
131
|
+
your browser (memories by kind, growth, the relation graph, live
|
|
132
|
+
search); Ctrl-C closes it.
|
|
133
|
+
|
|
134
|
+
**OpenClaw** - macOS / Linux:
|
|
135
|
+
```bash
|
|
136
|
+
pip install compartment && compartment init && compartment integrate openclaw
|
|
137
|
+
```
|
|
138
|
+
Windows (PowerShell):
|
|
139
|
+
```powershell
|
|
140
|
+
py -m pip install compartment; compartment init; compartment integrate openclaw
|
|
141
|
+
```
|
|
142
|
+
Writes the `mcpServers` entry into `~/.openclaw/openclaw.json` (with a
|
|
143
|
+
backup), then: `openclaw gateway restart` and confirm with
|
|
144
|
+
`openclaw mcp list`.
|
|
145
|
+
|
|
146
|
+
**Any MCP client** - macOS / Linux / Windows:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pip install compartment && compartment init
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Then add the server to your client's MCP config (stdio transport, no API
|
|
153
|
+
key, no environment variables):
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"mcpServers": {
|
|
158
|
+
"compartment": {
|
|
159
|
+
"command": "compartment",
|
|
160
|
+
"args": ["serve"]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`--vault` and `--caller` are optional (`compartment --vault PATH --caller NAME
|
|
167
|
+
serve`); the defaults use `~/.compartment/memory.vault` with caller `user`.
|
|
168
|
+
Client-by-client walkthroughs in
|
|
169
|
+
[docs/INTEGRATIONS.md](docs/INTEGRATIONS.md).
|
|
170
|
+
|
|
171
|
+
## Measured, on an 8 GB baseline laptop
|
|
172
|
+
|
|
173
|
+
Every number below is reproducible on your machine with `compartment selftest`
|
|
174
|
+
and `compartment bench`.
|
|
175
|
+
|
|
176
|
+
| Metric | Measured |
|
|
177
|
+
|---|---|
|
|
178
|
+
| Fresh install → open vault, offline | seconds, zero network |
|
|
179
|
+
| Vector search, 20k records (HNSW) | p95 0.68 ms |
|
|
180
|
+
| Full hybrid search (embed + vector + BM25 + fuse) | p95 8.8 ms |
|
|
181
|
+
| Peak RSS, model + vault + index resident | 319 MB |
|
|
182
|
+
| Store one memory (embed + encrypt + fsync journal) | ~40 ms |
|
|
183
|
+
| Wheel size, model included | ~30 MB |
|
|
184
|
+
| Test suite (crypto, tamper, crash, offline, concurrency, 2FA, graph, dash, hooks, install path, bundle) | 173 tests, ~60 s |
|
|
185
|
+
|
|
186
|
+
A single network round-trip to a cloud memory API costs more than this
|
|
187
|
+
entire pipeline. The property that makes Compartment secure (no plaintext
|
|
188
|
+
index ever on disk, so all search is RAM-resident) is the same property
|
|
189
|
+
that makes it fast: below 20k records search is exact SIMD matrix math,
|
|
190
|
+
recall = 1.0 by construction; above it, SIMD HNSW at ~99% recall.
|
|
191
|
+
|
|
192
|
+
## The memory logic
|
|
193
|
+
|
|
194
|
+
Full write-path, decision math, and comparisons in
|
|
195
|
+
[docs/MEMORY.md](docs/MEMORY.md). The load-bearing ideas:
|
|
196
|
+
|
|
197
|
+
**Nearly everything is stored; nothing important is buried.** Only empty
|
|
198
|
+
turns are dropped. A bare "OK" is not noise, it is a decision: when the
|
|
199
|
+
agent asks *"Want me to send this reply to the client now?"* and the user
|
|
200
|
+
answers *"OK"*, Compartment resolves the question from the conversation and
|
|
201
|
+
stores
|
|
202
|
+
`[decision 2026-07-20] Approved (answered "OK"): Want me to send this
|
|
203
|
+
reply to the client now?` at the top importance tier. Asking *"did the
|
|
204
|
+
user say to email the client?"* later retrieves exactly that record.
|
|
205
|
+
|
|
206
|
+
**Deterministic importance tiers rank recall**: decisions/consent 0.90,
|
|
207
|
+
personal facts and preferences 0.80, the user's machine and configuration
|
|
208
|
+
0.75, other substantive statements 0.55, pleasantries 0.20 (kept, ranked
|
|
209
|
+
last). The fused score is
|
|
210
|
+
`RRF(vector) + RRF(keyword) + 0.02·cosine + 0.006·importance`: cosine
|
|
211
|
+
magnitude keeps the genuinely best match on top, importance settles
|
|
212
|
+
near-ties in favor of what matters. The agent learns the user and the
|
|
213
|
+
computer first, the world second, and forgets nothing.
|
|
214
|
+
|
|
215
|
+
**One memory, not two.** Agent hosts increasingly ship a memory of their
|
|
216
|
+
own - Claude Code keeps per-project Markdown files with an auto-loaded
|
|
217
|
+
index. Two memories means facts land in whichever one the model happened to
|
|
218
|
+
think of, and neither is complete. Compartment takes over on install: it imports
|
|
219
|
+
what the file memory already holds, and both the MCP handshake and the
|
|
220
|
+
managed CLAUDE.md block tell the model that compartment supersedes it - write
|
|
221
|
+
every new memory here, treat the files as a read-only archive. One vault,
|
|
222
|
+
encrypted, shared by every agent and project on the machine. Nothing is
|
|
223
|
+
deleted; the files stay exactly where they were.
|
|
224
|
+
|
|
225
|
+
**Capture that does not depend on the model.** Instructions are a request,
|
|
226
|
+
and a host that declares its own memory in its system prompt outranks
|
|
227
|
+
anything a tool says. So `compartment integrate claude` also installs a
|
|
228
|
+
`PostToolUse` hook: when Claude Code writes a memory file, the fact lands in
|
|
229
|
+
the vault whether or not the model ever thought about compartment. The hook is
|
|
230
|
+
additive and idempotent (your other hooks are untouched, settings.json is
|
|
231
|
+
backed up first), it exits successfully no matter what - a memory tool must
|
|
232
|
+
never break your editor - and it stays quiet when the vault is locked.
|
|
233
|
+
`compartment hook status | install | uninstall`, or `integrate claude --no-hooks`.
|
|
234
|
+
|
|
235
|
+
<p align="center">
|
|
236
|
+
<img src="docs/images/menubar-panel.png" width="330"
|
|
237
|
+
alt="The Compartment menu bar panel: vault state, the three settings, and the last five memories.">
|
|
238
|
+
</p>
|
|
239
|
+
|
|
240
|
+
**A menu bar app for the Mac.** Download **Compartment.pkg** from the
|
|
241
|
+
[latest release](https://github.com/MaxFreedomPollard/Compartment/releases/latest)
|
|
242
|
+
and open it - the installer asks whether you also want the menu bar utility,
|
|
243
|
+
and everything (Python included) is self-contained, so there is nothing to
|
|
244
|
+
install first. From a checkout, `pip install 'compartment[menubar]'`
|
|
245
|
+
then `compartment menubar` does the same thing. Either way it puts Compartment in the
|
|
246
|
+
status bar: click the icon and a
|
|
247
|
+
popover shows whether the vault is open, how much it has learned, the three
|
|
248
|
+
settings worth changing day to day (capture hook, whether starter facts join
|
|
249
|
+
searches, auto-lock), and the last five things it remembered. It holds no
|
|
250
|
+
vault in memory - state comes from the CLI, so an idle menu bar app costs
|
|
251
|
+
nothing.
|
|
252
|
+
|
|
253
|
+
Can't find the icon? A full menu bar hides whatever does not fit behind the
|
|
254
|
+
notch, so **open Compartment.app again** and the same panel appears as a window
|
|
255
|
+
instead. That works no matter how crowded the bar is, and it is what the
|
|
256
|
+
first launch does by itself.
|
|
257
|
+
|
|
258
|
+
**See what it just learned.** `compartment recent` lists the newest memories,
|
|
259
|
+
newest last, hiding the thousands of seeded starting facts so the handful
|
|
260
|
+
that real use produced are actually visible - and `compartment status` reports
|
|
261
|
+
`organic_records` beside the total, so a vault that has learned nothing can
|
|
262
|
+
never look busy. Same view over MCP as `memory_recent`.
|
|
263
|
+
|
|
264
|
+
**One pinned embedding space.** The model's SHA-256 is recorded in the
|
|
265
|
+
vault and enforced at open; cosine comparisons stay mathematically valid
|
|
266
|
+
forever instead of silently degrading when a model changes. Migration is
|
|
267
|
+
explicit: `compartment reindex --re-embed`.
|
|
268
|
+
|
|
269
|
+
**No LLM inside.** Embeddings run locally (bundled 384-dim int8 ONNX
|
|
270
|
+
model, <300 MB RAM). Judgment belongs to the host model you already run,
|
|
271
|
+
via `compartment_store` / `compartment_forget`; Compartment contributes deterministic
|
|
272
|
+
capture, encryption, and total recall. That split is what makes the
|
|
273
|
+
offline guarantee absolute and every decision reproducible. Pair Compartment
|
|
274
|
+
with an offline LLM and the whole agent stack can run usefully with no
|
|
275
|
+
network at all.
|
|
276
|
+
|
|
277
|
+
## Agent-native by design
|
|
278
|
+
|
|
279
|
+
Compartment is built to sit under agents you already use, not as a separate
|
|
280
|
+
app you babysit.
|
|
281
|
+
|
|
282
|
+
- **Hermes native provider** - shows up in `hermes memory setup` with
|
|
283
|
+
**"no setup needed"**. Turns sync automatically; search injects only
|
|
284
|
+
what is relevant, tagged as data not instructions.
|
|
285
|
+
- **Claude over MCP** - one `integrate claude` step registers the server
|
|
286
|
+
and gives you the Desktop config block plus a managed CLAUDE.md block so memory
|
|
287
|
+
is part of normal work.
|
|
288
|
+
- **OpenClaw and any MCP client** - same stdio server, zero open ports,
|
|
289
|
+
same tools (`memory_search`, `memory_store`, `memory_forget`, lock).
|
|
290
|
+
- **A memory graph, not just a memory pile** - `memory_link` records
|
|
291
|
+
explicit relations (who works where, what belongs to what), with
|
|
292
|
+
optional validity windows; `memory_relations` answers entity,
|
|
293
|
+
predicate, and as-of queries. Deterministic storage, host-model
|
|
294
|
+
judgment - the same split as everything else in Compartment.
|
|
295
|
+
- **CLI for everything else** - scripts, cron, other agents: `compartment
|
|
296
|
+
store`, `compartment search`, `compartment recent`, `compartment forget`, `compartment link`,
|
|
297
|
+
`compartment relations`, `compartment import-claude`, `compartment lock`.
|
|
298
|
+
- **See the vault: `compartment dash`** - one command opens a local page with
|
|
299
|
+
everything at a glance: how many memories of what kind, growth over
|
|
300
|
+
time, the relation graph, tags, per-agent counts, live search. Served
|
|
301
|
+
from RAM, 127.0.0.1-only behind a random URL token, read-only, zero
|
|
302
|
+
outbound requests, zero configuration.
|
|
303
|
+
- **Panic lock from the agent** - `memory_lock` / `compartment lock` clears
|
|
304
|
+
stored credentials instantly when you need the vault closed now.
|
|
305
|
+
- **One vault, many hosts** - Hermes, Claude, and the CLI can share a
|
|
306
|
+
vault at once; each caller gets its own identity and namespace ACLs.
|
|
307
|
+
- **One memory, no sections** - the starting memories seeded at `init`
|
|
308
|
+
live in `main` as ordinary records, editable and forgettable like
|
|
309
|
+
anything the agent stores; older vaults reorganize automatically.
|
|
310
|
+
|
|
311
|
+
Day to day, the point is simple: the agent remembers *you*, your
|
|
312
|
+
decisions, and your machine - encrypted, offline, and fast - without a
|
|
313
|
+
cloud account.
|
|
314
|
+
|
|
315
|
+
## The lock model
|
|
316
|
+
|
|
317
|
+
You lock and unlock the vault yourself whenever you want. Manual control
|
|
318
|
+
is always available:
|
|
319
|
+
|
|
320
|
+
- **`compartment unlock`** - open the vault with YOUR passphrase. You choose
|
|
321
|
+
it; Compartment never auto-generates a password, seed, or recovery phrase,
|
|
322
|
+
and there is no credential it knows that you don't. (Vaults made by
|
|
323
|
+
older versions that received an auto-generated recovery phrase still
|
|
324
|
+
open with it.)
|
|
325
|
+
- **`compartment lock`** - close it again and clear every stored credential.
|
|
326
|
+
Agents can do the same via the `memory_lock` panic tool.
|
|
327
|
+
- **`compartment 2fa enable`** - optional two-factor unlock: your passphrase
|
|
328
|
+
(knowledge) plus a keyfile (possession - keep it on a USB stick).
|
|
329
|
+
Both factors feed Argon2id together, so needing both is enforced by
|
|
330
|
+
arithmetic, not a policy check; a stolen vault file plus your
|
|
331
|
+
passphrase still opens nothing without the keyfile. One command, zero
|
|
332
|
+
configuration: the keyfile's location is remembered, so day-to-day
|
|
333
|
+
unlocking feels exactly the same while the file is present.
|
|
334
|
+
|
|
335
|
+
The default unlock mode is convenience, not a cage: after a normal
|
|
336
|
+
unlock, the vault stays usable across processes, logouts, and logins -
|
|
337
|
+
for weeks or months if you leave it that way - until the next restart or
|
|
338
|
+
power loss, or until you lock it yourself. Restart/power loss always
|
|
339
|
+
locks it: the stored credential is the master key wrapped by a key
|
|
340
|
+
derived from the kernel's boot timestamp plus the stable machine id; a
|
|
341
|
+
new boot can never open the old wrap. That is arithmetic, not a policy
|
|
342
|
+
check.
|
|
343
|
+
|
|
344
|
+
If you prefer reboot-surviving unlock on macOS, that is an explicit
|
|
345
|
+
opt-in (`compartment unlock --keychain`), with the tradeoff documented. At any
|
|
346
|
+
time you can lock, unlock, lock again - on your schedule.
|
|
347
|
+
|
|
348
|
+
## Security, in one paragraph
|
|
349
|
+
|
|
350
|
+
XChaCha20-Poly1305 AEAD on everything at rest including vectors
|
|
351
|
+
(embedding-inversion resistance) · Argon2id keyslots, LUKS-style, opened
|
|
352
|
+
only by the user's own passphrase (no auto-generated credentials),
|
|
353
|
+
optionally two-factor with a keyfile · per-record keys enabling `forget --shred`
|
|
354
|
+
(crypto-shred: key destroyed, content mathematically unrecoverable) ·
|
|
355
|
+
fsync'd sealed journal, atomic compaction, verified kill-9 crash recovery ·
|
|
356
|
+
hash-chained tamper-evident audit log (`compartment audit verify`) · per-caller
|
|
357
|
+
namespace ACLs, quarantine tier for untrusted content, signed vault
|
|
358
|
+
manifests · stdio MCP transport: zero open ports · runtime offline guard
|
|
359
|
+
that aborts on any socket attempt; CI runs the whole suite with it active
|
|
360
|
+
on Linux, macOS, and Windows · no telemetry, ever. Full honest threat
|
|
361
|
+
model, including what Compartment cannot protect against, in
|
|
362
|
+
[SECURITY.md](SECURITY.md).
|
|
363
|
+
|
|
364
|
+
## One vault, many agents
|
|
365
|
+
|
|
366
|
+
Hermes, Claude, and the CLI can share a single vault simultaneously:
|
|
367
|
+
writes are serialized by an advisory file lock, every process detects
|
|
368
|
+
foreign writes and reloads, and each host gets its own caller identity
|
|
369
|
+
and namespace with rw/ro grants. A locked vault is one portable file,
|
|
370
|
+
safe to move over any channel; `compartment lock --sign` seals it with an
|
|
371
|
+
Ed25519 manifest the recipient can verify without any credential.
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
compartment lock
|
|
375
|
+
scp ~/.compartment/memory.vault other-machine:
|
|
376
|
+
compartment --vault memory.vault unlock # your passphrase (+ keyfile if 2FA)
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## Documentation
|
|
380
|
+
|
|
381
|
+
| | |
|
|
382
|
+
|---|---|
|
|
383
|
+
| [docs/MEMORY.md](docs/MEMORY.md) | how memory is stored, what gets remembered, why the math wins |
|
|
384
|
+
| [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md) | selecting Compartment in Hermes, OpenClaw, Claude, everything else |
|
|
385
|
+
| [SECURITY.md](SECURITY.md) | full threat model, honest limits |
|
|
386
|
+
| [FORMAT.md](FORMAT.md) | byte-level `.vault` and `.mpack` specs (language-agnostic) |
|
|
387
|
+
| [PACKS.md](PACKS.md) | authoring and shipping signed memory packs |
|
|
388
|
+
| [RELEASING.md](RELEASING.md) | cutting a release: every download, every time |
|
|
389
|
+
|
|
390
|
+
## License
|
|
391
|
+
|
|
392
|
+
MIT.
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
mcp-name: io.github.MaxFreedomPollard/compartment
|