dotmem 0.0.8 → 0.0.9

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.
package/AGENTS.md CHANGED
@@ -17,6 +17,18 @@ When your work establishes something durable that the user's future sessions wou
17
17
 
18
18
  If this file disagrees with those, they win; report the discrepancy.
19
19
 
20
+ ## Quick Start in vscode chat (like copilot, kilo, claude, codex... )
21
+
22
+ ```shell
23
+ npm i -g dotmem memorio
24
+ ```
25
+
26
+ ```chat
27
+ npx dotmem dotmem-mcp
28
+
29
+ Hi Joy!
30
+ ```
31
+
20
32
  ## Activation
21
33
 
22
34
  The activation phrases are `dotmem`, `.mem`, `load dotmem`, `Joy`, and `Jo`. A message that is exactly one
package/JOY.md ADDED
@@ -0,0 +1,55 @@
1
+ # Joy (optional identity integration)
2
+
3
+ Joy/Jo is an optional agent identity and profile hosted by the Dotmem runtime. Dotmem core is model- and persona-independent; the profile is not required for basic memory operations.
4
+
5
+ ## What are Joy and Jo?
6
+
7
+ **Joy** is the canonical AI identity/profile for dotmem — the operational role name that comes from the profile, not from the runtime. **Jo** is an alternative shorthand for the same identity. They represent the assistant's persistent identity in the dotmem system (canonical profile, decision-making behavior, trust model, and relationship style).
8
+
9
+ The canonical profile (`core/profile/`) defines:
10
+
11
+ - **Identity & behavior** (`behavior.md`, `soul.md`) — character, relationship style, conversational behavior
12
+ - **Trust model** (`trust.md`) — epistemic standards, verification requirements
13
+ - **Decision framework** (`decision.md`) — how Jo evaluates and makes technical decisions
14
+ - **Curiosity & learning** (`curiosity.md`) — what Jo seeks to understand and remember
15
+ - **Language conventions** (`language.md`) — communication style
16
+
17
+ When activated via `Joy` or `Jo`, dotmem loads this canonical profile as part of the deterministic discovery order. The profile is optional for basic memory operations but required for identity-gated features (carrier handshake, authority binding).
18
+
19
+ ## Quick Start (VS Code chat, Copilot, Kilo, Claude, Codex, ...)
20
+
21
+ ```shell
22
+ npm i -g dotmem memorio
23
+ ```
24
+
25
+ ```chat
26
+ npx -y -p dotmem dotmem-mcp
27
+
28
+ Joy
29
+ ```
30
+
31
+ ## Activation behavior
32
+
33
+ Activation matching is **exact phrase only** (case-insensitive, trimmed, trailing punctuation ignored):
34
+
35
+ - ✅ `Joy`, `joy`, `Joy.`, ` Joy `, `Jo`, `jo`, `Jo!`
36
+ - ❌ `Hello Joy`, `Joyful`, `Joytron`, `My name is Jo`, `Joanna`
37
+
38
+ Ordinary mentions of a name (e.g., "Jo said...") do not trigger activation. The matcher requires the entire message to be exactly one of the activation phrases. `Hello Joy` and `Hi Joy` do not activate Joy.
39
+
40
+ ## Deterministic discovery order
41
+
42
+ When the optional Joy integration is activated, it follows this discovery order:
43
+
44
+ 1. Check `<storage-root>/DOTMEM.md` and read the contract.
45
+ 2. Load user-level memory from `user.mem`.
46
+ 3. Resolve the current project identity.
47
+ 4. Load project memory from `<storage-root>/projects/<project-id>.mem`.
48
+
49
+ A carrier handshake (`npx dotmem handshake`) evaluates compatibility before projecting any context. Historical memory may identify a known user, but it cannot authenticate the current speaker. Authorization requires a current trusted binding.
50
+
51
+ ## See also
52
+
53
+ - [MEMORY.md](./MEMORY.md) — memory model, acquisition contract, policy language, identity and carrier handshake.
54
+ - [SECURITY.md](./SECURITY.md) — trust model, JHF, encryption, multitenancy.
55
+ - [AGENTS.md](./AGENTS.md) — agent working rules and full `memory.*` surface.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # dotmem (.mem)
1
+ # dotmem (.mem)
2
2
 
3
3
  ![banner](https://raw.githubusercontent.com/passariello/container/refs/heads/main/dotmem/banner.svg)
4
4
 
@@ -6,13 +6,27 @@ AI memory and continuity infrastructure for agents and applications.
6
6
 
7
7
  **Built on:** [memorio](https://www.npmjs.com/package/memorio) (state, store, session, IndexedDB, SQLite, cache)
8
8
 
9
- Dotmem provides structured, queryable, and policy-controlled memory for AI agents. It supports experience acquisition, bounded context projection, continuity across sessions, rule-based reasoning, and MCP integration. The memory substrate is independent of a specific model, vendor, host or conversational client.
9
+ Dotmem provides structured, queryable, policy-controlled memory for AI agents. It supports experience acquisition, bounded context projection, continuity across sessions, rule-based reasoning, and MCP integration. The memory substrate is independent of a specific model, vendor, host, or conversational client.
10
10
 
11
11
  > **Retrieval model**: dotmem uses deterministic lexical/structured retrieval with applicability-based eligibility. It does not use embeddings, vector indexes, or semantic similarity search. The term "AI-oriented" refers to the memory lifecycle and API design (acquisition with evidence/provenance, applicability scoping, policy-gated writes, context projection for LLM consumption), not the underlying retrieval algorithm. For semantic/vector search, pair dotmem with a dedicated embedding store.
12
12
 
13
13
  ---
14
14
 
15
- ## Installation
15
+ ## What Dotmem is
16
+
17
+ - **Acquired experience**: evidenced, applicability-scoped claims via `discover`, `project`, and `acquire`.
18
+ - **Application memory**: typed key/value entries via `remember`, `recall`, `update`, `forget`, and `patch`.
19
+ - **Continuity**: snapshots, checkpoints, compaction, and open loops across sessions.
20
+ - **Policy**: separate authority domain with tiered enforcement and privileged out-of-band overrides.
21
+ - **Agent namespaces**: logically partitioned memory via `dotmem/agent`.
22
+ - **Notes and profiles**: short-lived notes and read-only built-in profiles (including the optional Joy profile).
23
+ - **MCP and CLI**: stdio MCP server (`dotmem-mcp`) and command-line tools.
24
+
25
+ Dotmem is the active owner of memory, continuity, profiles, agents, and MCP capabilities. It is not a wrapper around an external memory service. MCP is an access interface, not the core.
26
+
27
+ ---
28
+
29
+ ## Install
16
30
 
17
31
  ```bash
18
32
  npm i dotmem
@@ -22,10 +36,14 @@ bun i dotmem
22
36
  pnpm i dotmem
23
37
  ```
24
38
 
39
+ Requires Node.js >= 18.0.0.
40
+
25
41
  ---
26
42
 
27
43
  ## Quick Start
28
44
 
45
+ The runtime initializes lazily on first call; no explicit `init()` is required.
46
+
29
47
  ```typescript
30
48
  import { memory } from 'dotmem'
31
49
 
@@ -47,340 +65,104 @@ await memory.acquire({
47
65
  evidence: [{ id: 'conv-001', source: 'conversation', observedAt: new Date().toISOString() }],
48
66
  epistemicType: 'observed'
49
67
  })
50
-
51
- // Remember a key/value entry with confidence and scope
52
- // `remember()` with scope `durable` uses IndexedDB and is browser-only. For Node/Bun, use memory.acquire().
53
- await memory.remember('user.pref.theme', 'dark', {
54
- type: 'preference',
55
- confidence: 0.9,
56
- scope: 'local',
57
- tags: ['ui', 'user']
58
- })
59
-
60
- // Recall by key
61
- const theme = await memory.recall<string>('user.pref.theme')
62
68
  ```
63
69
 
64
- > **Scope reference**: See [MEMORY.md#application-memory-scopes-rememberrecall](./MEMORY.md#application-memory-scopes-rememberrecall) for a detailed comparison of `hot`, `session`, `local`, and `durable` scopes across runtimes.
65
-
66
- ### Agent API
67
-
68
- Each agent gets a logically partitioned memory namespace via `dotmem/agent`:
70
+ For agent-namespaced memory, use the `dotmem/agent` subpath:
69
71
 
70
72
  ```typescript
71
73
  import { createAgentMemory } from 'dotmem/agent'
72
74
 
73
75
  const agent = createAgentMemory('support-agent')
74
-
75
- // Keys are automatically namespaced: agent:support-agent:<key>
76
- // `remember()` with scope `durable` uses IndexedDB and is browser-only. For Node/Bun, use memory.acquire().
77
76
  await agent.remember('greeting', 'Hello! How can I help?', {
78
77
  type: 'fact',
79
78
  confidence: 0.9,
80
79
  scope: 'local',
81
80
  tags: ['greeting']
82
81
  })
83
-
84
- // Context retrieval is automatically filtered to this agent's tags
85
- const context = await agent.context({ tags: ['greeting'], minConfidence: 0.5 })
86
-
87
- // Temporal history and branching
88
- await agent.enable() // enable temporal tracking
89
- const entry = await agent.history('greeting')
90
- const branch = await agent.branch() // isolated "what-if" branch
91
- ```
92
-
93
- ---
94
-
95
- ## MCP Server
96
-
97
- `dotmem-mcp` is the stdio MCP server. It runs on the operator's machine so a connected AI host and the terminal share the same store. Write access is gated by an environment flag.
98
-
99
- | Tool | Direction | Registered when | Use it when |
100
- |------|-----------|-----------------|-------------|
101
- | `dotmem_context` | read | always | You need acquired experience relevant to the current situation. |
102
- | `dotmem_rules` | read | always | You need the iron rules that constrain every session. |
103
- | `dotmem_acquire` | write | `DOTMEM_MCP_WRITE=1` | The work produced reusable, project-specific experience worth keeping. |
104
- | `dotmem_continuity` | read / write | Always registered; write actions require `DOTMEM_MCP_WRITE=1` | Read continuation status, summaries and open loops; optionally create checkpoints and manage open loops. |
105
- | `dotmem_note_read` | read | always | Read a user note by id. |
106
- | `dotmem_note_write` | write | `DOTMEM_MCP_WRITE=1` | Add or update a user note. |
107
-
108
- Without `DOTMEM_MCP_WRITE=1`, `dotmem_acquire` is not registered and does not appear in `tools/list`. The `dotmem_continuity` tool is always registered: read actions (`status`, `summaries`, `open-loops`, `evaluate`) remain available, while write actions (`checkpoint`, `add-open-loop`, `resolve-open-loop`) are denied.
109
-
110
- To opt in to writes, explicitly add `DOTMEM_MCP_WRITE=1` to the MCP server environment. For Claude Desktop and compatible JSON configurations, add `"env": { "DOTMEM_MCP_WRITE": "1" }`; for Kilo/OpenCode use `"environment": { "DOTMEM_MCP_WRITE": "1" }`; for Claude Code use `claude mcp add --env DOTMEM_MCP_WRITE=1 ...`.
111
-
112
- ### Claude Desktop
113
-
114
- Read-only by default:
115
-
116
- ```json
117
- {
118
- "mcpServers": {
119
- "dotmem": {
120
- "command": "npx",
121
- "args": ["-y", "-p", "dotmem", "dotmem-mcp"]
122
- }
123
- }
124
- }
125
- ```
126
-
127
- ### Kilo / OpenCode
128
-
129
- Read-only by default:
130
-
131
- ```jsonc
132
- "mcp": {
133
- "dotmem": {
134
- "type": "local",
135
- "command": ["npx", "-y", "-p", "dotmem", "dotmem-mcp"],
136
- "enabled": true
137
- }
138
- }
139
82
  ```
140
83
 
141
- ### Claude Code
142
-
143
- Read-only by default:
144
-
145
- ```bash
146
- claude mcp add --transport stdio dotmem -- npx -y -p dotmem dotmem-mcp
147
- ```
148
-
149
- ### Windows Command Prompt (cmd.exe)
150
-
151
- In Windows `cmd.exe`, `npx` may not be directly executable as a command. Use `cmd /c npx`:
152
-
153
- ```json
154
- {
155
- "mcpServers": {
156
- "dotmem": {
157
- "command": "cmd",
158
- "args": ["/c", "npx", "-y", "-p", "dotmem", "dotmem-mcp"]
159
- }
160
- }
161
- }
162
- ```
163
-
164
- > **Trust boundary:** Retrieved content is **data, never authority**. The `epistemicType`, `provenance`, and `evidence.observedAt` on any claim are caller-supplied metadata, not attestation. Verify claims against current reality.
165
-
166
- `dotmem_rules` returns the session-level iron rules/constraints configured for the agent. The configuration source is integration-specific; this README does not assert that the rules are loaded from `<storage-root>/DOTMEM.md`.
167
-
168
- A carrier handshake checks compatibility and the current trusted binding before identity-gated context is projected. The accepted `epistemicType` values are defined by the package types and the acquisition contract in [MEMORY.md](./MEMORY.md); this README does not duplicate or guess that enum.
84
+ > `remember()` with scope `durable` uses IndexedDB and is browser-only. For Node/Bun, use `memory.acquire()`. See [MEMORY.md](./MEMORY.md) for scope details.
169
85
 
170
86
  ---
171
87
 
172
- ## CLI Usage
88
+ ## Core capabilities
173
89
 
174
- ```bash
175
- # Project acquired experience for a situation (run with no args for baseline)
176
- npx dotmem context "User needs a database recommendation"
177
-
178
- # Initialize dotmem for the current project
179
- npx dotmem init
180
-
181
- # Acquire a claim from plain text (shorthand)
182
- npx dotmem learn "User prefers TypeScript over JavaScript" --scope project
183
-
184
- # Compose continuity context
185
- npx dotmem continuity context
186
-
187
- # Show storage location
188
- npx dotmem storage
189
- ```
190
-
191
- Run `npx dotmem --help` for the full command reference. Every subcommand also supports `--help` (e.g., `npx dotmem context --help`).
90
+ - `memory.discover`, `memory.context`, `memory.project` — retrieval and bounded context projection.
91
+ - `memory.acquire`, `memory.acquireStaged` — evidenced acquisition with policy evaluation.
92
+ - `memory.remember`, `memory.recall`, `memory.update`, `memory.forget`, `memory.patch` — application memory.
93
+ - `memory.journal`, `memory.note`, `memory.profile`, `memory.seed`, `memory.policy`, `memory.brain` — sub-facades.
94
+ - `continuity` — snapshots, checkpoints, compaction, open loops.
95
+ - `security`, `encryption` — RBAC/audit/consent and AES-GCM + PBKDF2 helpers.
96
+ - Foundation re-exports: `state`, `store`, `session`, `idb`, `dispatch`, `hlc`.
192
97
 
193
98
  ---
194
99
 
195
100
  ## Layers
196
101
 
197
- A layer is **public** when it is part of the documented API or CLI contract and carries a semver stability expectation. Internal implementation details do not become public APIs merely because they have names or persisted representations. `profile` is exposed through `memory.profile.get(id)`; its inclusion in the public-layer count therefore depends on that export being covered by the package semver contract, not merely on the existence of the profile files.
198
-
199
- Dotmem exposes **8 user-facing layers** and **2 internal/infrastructure layers** in the grouping below. The journal is a component of `memory`, not a separate layer.
200
-
201
- ### User-Facing Layers (Public API)
102
+ Dotmem exposes **6 user-facing layers** through its public entry points. `knowledge` and `logic` are not public runtime exports (`logic` is experimental/unverified and not exported; `knowledge` is internal). `profile` is available via `memory.profile.get(id)` and its stability depends on the package semver contract.
202
103
 
203
- | Layer | Purpose | Notes |
204
- |-------|---------|-------|
205
- | **memory** | Key/value memory, acquisition lifecycle, journal and sync | Core facade: `discover`, `context`, `project`, `acquire`, `acquireStaged`, `remember`, `recall`, `update`, `forget`, `patch`, `stats`, `clear`; journal exposed as `memory.journal` |
206
- | **knowledge** | Claim evaluation, policy enforcement, applicability matching | Runtime: `evaluatePolicies`, `resolveEffectiveTier`, `matchApplicability`, `deriveSituationApplicability`; see [MEMORY.md](./MEMORY.md) for acquisition and policy contracts |
207
- | **logic** | Logic engine: rule learning, precedent matching, context measurement | API: `experience`, `precedents`, `context`, `measure`, `learn`, `clear`; see [PACKAGE.md](./PACKAGE.md) for package surface and contents |
208
- | **continuity** | USER + PROJECT + TASK context composition, snapshots, open loops | CLI: `continuity` `context` `snapshot` `forget` `loop management` |
209
- | **agent** | Agent-facing memory with logical namespace partitioning | `dotmem/agent` — `createAgentMemory(agentId)` |
210
- | **policy** | Policy definition, authority management, four-tier enforcement | CLI: `dotmem policy`, `dotmem handshake`, `dotmem guard`; see [MEMORY.md](./MEMORY.md) and [SECURITY.md](./SECURITY.md) |
211
- | **profile** | Identity and persona documents | `memory.profile.get(id)`; optional agent profile, including Joy |
212
- | **note** | Short-lived notes with tags and origins | CLI: `dotmem note`; `memory.note` |
104
+ | Layer | Availability | Purpose |
105
+ |-------|--------------|---------|
106
+ | **memory** | `dotmem` (main) | Key/value memory, acquisition lifecycle, journal, and sub-facades |
107
+ | **continuity** | `dotmem` (main) | USER + PROJECT + TASK context composition, snapshots, open loops |
108
+ | **agent** | `dotmem/agent` (subpath) | Agent-facing memory with logical namespace partitioning |
109
+ | **policy** | `memory.policy` | Policy definition, authority management, three-tier enforcement |
110
+ | **profile** | `memory.profile.get(id)` | Identity and persona documents (read-only built-in profiles, including Joy) |
111
+ | **note** | `memory.note` | Short-lived notes with tags and origins |
213
112
 
214
- ### Internal / Infrastructure Layers
113
+ ### Internal / infrastructure
215
114
 
216
115
  | Layer | Purpose | Notes |
217
116
  |-------|---------|-------|
218
117
  | **seed** | Development-only initial memory seed | `--dev` required |
219
- | **llm-cache** | LLM response cache types only; no verified runtime implementation in the current package | `types/llm-cache.d.ts` |
118
+ | **llm-cache** | LLM response cache types only; no verified runtime implementation | `types/llm-cache.d.ts` |
220
119
 
221
- > Dotmem re-exports its foundational infrastructure: `state` (reactive state), `store` (key/value storage), `idb` (IndexedDB) and `sqlite` (SQL database integration). These are lower-level utilities, not additional AI memory layers. See the foundation package documentation for their detailed contracts.
120
+ > Dotmem re-exports foundational infrastructure: `state` (reactive state), `store` (key/value storage), `idb` (IndexedDB), and `sqlite` (SQL database integration). These are lower-level utilities, not additional AI memory layers.
222
121
 
223
122
  ---
224
123
 
225
- ## Memory Model
226
-
227
- dotmem uses a **discover → project → acquire** memory model:
228
-
229
- 1. **Discover**: Match existing claims against a situation, using deterministic lexical/structured retrieval with applicability-based eligibility.
230
- 2. **Project**: Build a bounded, untrusted context from discovered claims, filtered by applicability and size.
231
- 3. **Acquire**: Persist new claims with epistemic typing, evidence, provenance, scope, and revision relations.
232
-
233
- ### Continuity Lifecycle
234
-
235
- The continuity layer helps an agent resume work across sessions by capturing the current state, creating checkpoints, compacting older context into summaries, and restoring relevant context when work resumes. The lifecycle is:
236
-
237
- `capture → checkpoint → compact → resume → verify`
238
-
239
- | Provides | Does not guarantee |
240
- |----------|--------------------|
241
- | Persisted checkpoints, summaries, and tracked open loops for later retrieval | A perfect reconstruction of every message or detail from the original conversation |
242
- | Bounded context composition from the available continuity records | That information never captured or persisted can be recovered |
243
- | A resumable record of the objective, progress, and outstanding work when those details were captured | That a model will interpret every retrieved item correctly or behave identically across models and clients |
244
- | A verification step so the resumed agent can check the restored state before continuing | Infinite context, zero information loss, or automatic correctness of historical claims |
124
+ ## Retrieval model
245
125
 
246
- Continuity quality depends on what the agent captures, checkpoint quality, storage availability, and retrieval of the relevant records. Treat a resumed context as a working reconstruction to verify, not as a verbatim replay of the entire conversation. See the `continuity` layer and the `dotmem_continuity` MCP tool above for the available operations.
126
+ dotmem uses **deterministic, verifiable retrieval** without embedding-model dependencies:
247
127
 
248
- ### Memory Types
128
+ - Lexical/structured matching with applicability-based eligibility.
129
+ - No embeddings, vector indexes, or semantic similarity search.
130
+ - Results are reproducible given the same store and query.
249
131
 
250
- | Type | Purpose |
251
- |------|---------|
252
- | `fact` | Observable or verified facts |
253
- | `preference` | User or agent preferences |
254
- | `decision` | Architectural or workflow decisions |
255
- | `task` | Task-related information |
256
- | `context` | Situational context |
257
-
258
- ### Memory Kinds
259
-
260
- Acquired claims carry a `kind`: `experience` (project/user learnings), `agent` (agent-specific notes), `relationship` (cross-agent or cross-project relationships), `logic` (rule-based knowledge), `note` (short-lived notes).
261
-
262
- ### Scopes
263
-
264
- | Scope | Storage (Browser) | Storage (Node/Bun) | Lifecycle |
265
- |-------|-------------------|---------------------|-----------|
266
- | `hot` | `state` (memory) | `state` (memory) | Cleared on process exit / navigation |
267
- | `session` | `session` (sessionStorage) | `session` (in-memory Map) | Persists for active session / tab; lost on restart |
268
- | `local` | `store` (localStorage) | `store` (in-memory Map) | Survives reload in browser; lost on process restart in Node/Bun |
269
- | `durable` | `idb` (IndexedDB) | *Not available via this path* | Survives restarts in browser only |
270
-
271
- > For durable persistence in Node/Bun, use `memory.acquire()` which writes to `.mem` package files on disk. The `memory.remember()` `durable` scope uses IndexedDB and is browser-only.
272
-
273
- ### Discovery Depths
274
-
275
- | Depth | Meaning |
276
- |-------|---------|
277
- | `current` | Only active claims (no superseded/obsolete) |
278
- | `deep` | All claims including superseded and obsolete |
279
-
280
- ### Policy Enforcement
281
-
282
- Policies are evaluated at acquisition time against a four-tier enforcement model:
283
-
284
- | Tier | Behavior |
285
- |------|----------|
286
- | **context** | Supplies contextual information; does not itself impose a blocking precondition |
287
- | **precondition** | Blocks the governed operation when the condition is violated or unresolved |
288
- | **hard-precondition** | Retains the stronger enforcement semantics defined by the policy contract |
289
-
290
- Policy conditions match against situation vectors, epistemic types, evidence sources, and content topics. Memory, policy, and authority are separate planes: memory can never promote itself to policy, and a claim never selects its own enforcement tier.
291
-
292
- ### Claims and Corrections
293
-
294
- Claims are immutable and unique by ID. To change a claim, acquire a new one with exactly one revision relation:
295
-
296
- - `refines` — narrows or extends
297
- - `supersedes` — replaces
298
- - `retracts` — withdraws
132
+ "AI-oriented" refers to the memory lifecycle and API design (acquisition with evidence/provenance, applicability scoping, policy-gated writes, context projection for LLM consumption), not the underlying retrieval algorithm. For semantic/vector search, pair dotmem with a dedicated embedding store.
299
133
 
300
134
  ---
301
135
 
302
- ## Storage
136
+ ## MCP server
137
+
138
+ `dotmem-mcp` is the stdio MCP server. It runs on the operator's machine so a connected AI host and the terminal share the same store. Write access is gated by `DOTMEM_MCP_WRITE=1`.
303
139
 
304
- dotmem storage is user-anchored and resolved at runtime. The canonical storage root is `<user-home>/.mem`, relocatable via the `DOTMEM_STORAGE_ROOT` environment variable.
140
+ Canonical launch command (use this form in all configurations):
305
141
 
306
142
  ```bash
307
- npx dotmem storage # show location + resolved root
308
- npx dotmem storage relocate /path # migrate to an explicit absolute directory
309
- npx dotmem storage restore # migrate back to default
143
+ npx -y -p dotmem dotmem-mcp
310
144
  ```
311
145
 
312
- Project experience is stored under `<storage-root>/projects/<project-id>.mem`. User experience uses `user.mem`, agent memory uses `agent.mem`, and logic data uses `logic.mem`. These are `.mem` packages — compressed ZIP archives with SHA-256 integrity manifests. Read them through `npx dotmem inspect`, never by byte-searching.
146
+ Example (Claude Desktop, read-only by default):
313
147
 
314
- ---
315
-
316
- ## Optional Joy Identity Integration
317
-
318
- Dotmem core is model- and persona-independent. Joy/Jo is an optional agent identity/profile integration, not a requirement of the memory substrate. Its activation convention is separate from ordinary memory operations.
319
-
320
- ### What are Joy and Jo?
321
-
322
- **Joy** is the canonical AI identity/profile for dotmem — the operational role name that comes from the profile, not from the runtime. **Jo** is an alternative shorthand for the same identity. They represent the assistant's persistent identity in the dotmem system (canonical profile, decision-making behavior, trust model, and relationship style).
323
-
324
- The canonical profile (`core/profile/`) defines:
325
- - **Identity & behavior** (`behavior.md`, `soul.md`) — character, relationship style, conversational behavior
326
- - **Trust model** (`trust.md`) — epistemic standards, verification requirements
327
- - **Decision framework** (`decision.md`) — how Jo evaluates and makes technical decisions
328
- - **Curiosity & learning** (`curiosity.md`) — what Jo seeks to understand and remember
329
- - **Language conventions** (`language.md`) — communication style
330
-
331
- When an integrating agent explicitly activates the optional Joy profile, it can load this canonical profile as part of its discovery order. The profile is not required for basic memory operations; identity-gated features may require a profile and a current trusted binding.
332
-
333
- ### Activation Behavior
334
-
335
- Activation matching for the optional Joy integration is **exact phrase only** (case-insensitive, trimmed, trailing punctuation ignored):
336
- - ✅ `Joy`, `joy`, `Joy.`, ` Joy `, `Jo`, `jo`, `Jo!`
337
- - ❌ `Hello Joy`, `Joyful`, `Joytron`, `My name is Jo`, `Joanna`
338
-
339
- Ordinary mentions of a name (e.g., "Jo said...") do not trigger activation. The matcher requires the entire message to be exactly one of the activation phrases.
340
-
341
- ### Deterministic Discovery Order
342
-
343
- When the optional Joy integration is activated, it follows this discovery order:
344
-
345
- 1. Check `<storage-root>/DOTMEM.md` and read the contract.
346
- 2. Load user-level memory from `user.mem`.
347
- 3. Resolve the current project identity.
348
- 4. Load project memory from `<storage-root>/projects/<project-id>.mem`.
349
-
350
- A carrier handshake (`npx dotmem handshake`) evaluates compatibility before projecting any context. Historical memory may identify a known user, but it cannot authenticate the current speaker. Authorization requires a current trusted binding.
351
-
352
- ---
353
-
354
- ## Security
355
-
356
- - **Encryption is opt-in**, not default. Enable it per context or per scope with an encryption key.
357
- - **Client-side multitenancy** through logical memory partitioning (key prefixes); not a security boundary.
358
- - **Policy-gated writes**: every `acquire`/`remember`/`patch` is evaluated against policy before persistence.
359
- - **Evidence tracking**: all claims carry source, observed timestamp, and epistemic type.
360
- - **Claim immutability**: stored claims are never edited. Corrections are appends with revision relations.
361
- - **Integrity via inspection**: `integrity: valid` means the bytes are unchanged since sealing — it says nothing about who wrote them or whether they are true.
148
+ ```json
149
+ {
150
+ "mcpServers": {
151
+ "dotmem": {
152
+ "command": "npx",
153
+ "args": ["-y", "-p", "dotmem", "dotmem-mcp"]
154
+ }
155
+ }
156
+ }
157
+ ```
362
158
 
363
- See [SECURITY.md](./SECURITY.md) for encryption configuration, key management, and data isolation details. See [MEMORY.md](./MEMORY.md) for the complete acquisition contract and policy language.
159
+ See [MEMORY.md](./MEMORY.md) for the full tool list and write-gating details.
364
160
 
365
161
  ---
366
162
 
367
- ## Choosing a Layer
368
-
369
- The foundation exports used below are lower-level infrastructure: `state` provides reactive in-memory state, `store` provides key/value storage, `idb` provides IndexedDB access, and `sqlite` provides SQL storage. They are re-exported for application infrastructure; the Dotmem memory model is exposed through `memory`, `knowledge`, `logic`, `continuity`, `agent`, `policy`, `profile` and `note`.
370
-
371
- | If the data is... | Use | Not |
372
- |---|---|---|
373
- | UI-reactive, ephemeral | `state` | `store` (unnecessary persistence) |
374
- | UI-reactive, must survive reload (browser) | `state` + `state.persist(path)` | hand-rolled sync |
375
- | Small key/value, must survive reload (browser) | `store` | `idb` (overkill) |
376
- | Durable acquired experience across process restarts (Node/Bun) | `memory.acquire()` | `memory.remember(scope: 'durable')` (browser-only) |
377
- | Structured, needs confidence/TTL/source | `memory.remember()` | `state`/`store` (no lifecycle) |
378
- | Structured, needs evidence/provenance | `memory.acquire()` | `memory.remember()` (no evidence) |
379
- | Relational, needs SQL | `sqlite` | `idb` (no query language) |
380
- | Large browser-only structured data | `idb` | `store` |
381
- | AI agent memory | `dotmem/agent` | `memory` (no logical namespace partitioning) |
163
+ ## Optional Joy identity
382
164
 
383
- > **Note**: `remember({ scope: 'durable' })` uses IndexedDB and is available through this path in browsers only. It does not switch to `.mem` package storage in Node.js or Bun. For durable acquired experience across process restarts in Node.js and Bun, use `memory.acquire()`. `store` and `session` fall back to in-memory `Map`s in those runtimes.
165
+ Dotmem core is model- and persona-independent. Joy/Jo is an optional agent identity and profile. See [docs/JOY.md](./JOY.md) for activation (exact phrase only), discovery order, and the optional profile.
384
166
 
385
167
  ---
386
168
 
@@ -388,9 +170,10 @@ The foundation exports used below are lower-level infrastructure: `state` provid
388
170
 
389
171
  | Document | Description |
390
172
  |----------|-------------|
391
- | [MEMORY.md](./MEMORY.md) | Full memory model: acquisition contract, policy language, epistemic typing |
173
+ | [MEMORY.md](./MEMORY.md) | Full memory model: acquisition contract, policy language, epistemic typing, enforcement, continuity, identity |
392
174
  | [AGENTS.md](./AGENTS.md) | AI agent working rules, activation phrases, complete `memory.*` surface |
393
- | [SECURITY.md](./SECURITY.md) | Encryption, multitenancy, key management, threat model |
175
+ | [SECURITY.md](./SECURITY.md) | Encryption, multitenancy, key management, trust model, JHF, sandbox |
176
+ | [JOY.md](./JOY.md) | Optional Joy identity, activation matching, discovery order |
394
177
  | [PACKAGE.md](./PACKAGE.md) | Package contents, full quick-start, dependency graph |
395
178
  | [LICENSE.md](./LICENSE.md) | License |
396
179
 
@@ -401,8 +184,8 @@ The foundation exports used below are lower-level infrastructure: `state` provid
401
184
  **License**: MIT (SPDX: `MIT`)
402
185
 
403
186
  **Supported runtimes**:
404
- - Node.js ≥ 18.0.0 (declared in `package.json` engines)
405
- - Bun ≥ 1.0 (tested in CI)
187
+ - Node.js >= 18.0.0 (declared in `package.json` engines)
188
+ - Bun >= 1.0 (tested in CI)
406
189
  - Browser (ES2020+ with IndexedDB, localStorage, sessionStorage)
407
190
  - Deno (compatible, not routinely tested)
408
191
 
@@ -414,4 +197,4 @@ The foundation exports used below are lower-level infrastructure: `state` provid
414
197
 
415
198
  ## License
416
199
 
417
- (c) 2026 Dario Passariello. See [LICENSE.md](./LICENSE.md).
200
+ MIT (c) 2026 Dario Passariello.