You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document data directory layout, store resolution priority chain,
isolation boundary (DB isolated, prompts shared), automatic migration
strategy, and the lightweight design principle. EN/ZH synced.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
└── data/ # Each store has its own isolated directory
321
+
├── default/
322
+
│ └── mnemon.db # SQLite database (WAL mode)
323
+
├── work/
324
+
│ └── mnemon.db
325
+
└── <name>/
326
+
└── mnemon.db
327
+
```
328
+
329
+
**Isolation boundary**: Each store contains an independent `mnemon.db` — insights, edges, and oplog are fully isolated. Prompt files (`guide.md`, `skill.md`) are shared — behavioral rules are universal, memory data is private.
330
+
331
+
### 4.2 Store Isolation
332
+
333
+
Mnemon supports named stores for lightweight data isolation between different agents, projects, or scenarios.
334
+
335
+
**Why named stores instead of just `--data-dir`?**
336
+
337
+
`--data-dir` overrides the entire base directory — a blunt instrument that requires the caller to manage full paths. Named stores provide semantic clarity (`MNEMON_STORE=work` vs `--data-dir ~/.mnemon-work`) and work naturally with environment variables, which are the standard isolation mechanism for concurrent processes.
338
+
339
+
**Resolution priority** (highest to lowest):
340
+
341
+
```
342
+
--store flag > MNEMON_STORE env > ~/.mnemon/active file > "default"
343
+
```
344
+
345
+
This layered design serves different scenarios:
346
+
347
+
| Mechanism | Scenario |
348
+
|-----------|----------|
349
+
|`--store` flag | One-off CLI override, scripting |
350
+
|`MNEMON_STORE` env | Per-process isolation — different agents use different stores |
351
+
|`active` file | Persistent user preference — `mnemon store set work`|
352
+
|`"default"`| Zero-config — works out of the box |
353
+
354
+
**Automatic migration**: When the new `data/` directory doesn't exist but a legacy `~/.mnemon/mnemon.db` does, mnemon automatically moves it to `data/default/mnemon.db`. Users upgrading from older versions experience a seamless transition.
355
+
356
+
**Design principle — lightweight and bounded**: Store isolation addresses a necessary data separation concern without growing into a multi-tenant system. There are no access controls, no cross-store queries, no store metadata beyond the name. This keeps the feature bounded — Mnemon is a memory daemon, not a knowledge base platform.
0 commit comments