dotmem 0.0.8 → 0.1.0
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 +13 -1
- package/DOTMEM.md +538 -539
- package/JOY.md +55 -0
- package/MEMORY.md +4 -4
- package/PACKAGE.md +1 -1
- package/README.md +251 -417
- package/agent.cjs +13 -0
- package/agent.js +13 -0
- package/bin/cli.cjs +5 -0
- package/bin/cli.js +5 -0
- package/bin/mcp.cjs +5 -0
- package/bin/mcp.js +5 -0
- package/cli.cjs +207 -61
- package/cli.js +207 -61
- package/global.cjs +206 -60
- package/global.js +206 -60
- package/index.cjs +1897 -68
- package/index.js +1869 -61
- package/llms.txt +94 -10
- package/mcp.cjs +207 -61
- package/mcp.js +207 -61
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,417 +1,251 @@
|
|
|
1
|
-
# dotmem (.mem)
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
AI memory and continuity infrastructure for agents and applications.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
|
299
|
-
|
|
300
|
-
---
|
|
301
|
-
|
|
302
|
-
## Storage
|
|
303
|
-
|
|
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.
|
|
305
|
-
|
|
306
|
-
```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
|
|
310
|
-
```
|
|
311
|
-
|
|
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.
|
|
313
|
-
|
|
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.
|
|
362
|
-
|
|
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.
|
|
364
|
-
|
|
365
|
-
---
|
|
366
|
-
|
|
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) |
|
|
382
|
-
|
|
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.
|
|
384
|
-
|
|
385
|
-
---
|
|
386
|
-
|
|
387
|
-
## Documentation
|
|
388
|
-
|
|
389
|
-
| Document | Description |
|
|
390
|
-
|----------|-------------|
|
|
391
|
-
| [MEMORY.md](./MEMORY.md) | Full memory model: acquisition contract, policy language, epistemic typing |
|
|
392
|
-
| [AGENTS.md](./AGENTS.md) | AI agent working rules, activation phrases, complete `memory.*` surface |
|
|
393
|
-
| [SECURITY.md](./SECURITY.md) | Encryption, multitenancy, key management, threat model |
|
|
394
|
-
| [PACKAGE.md](./PACKAGE.md) | Package contents, full quick-start, dependency graph |
|
|
395
|
-
| [LICENSE.md](./LICENSE.md) | License |
|
|
396
|
-
|
|
397
|
-
---
|
|
398
|
-
|
|
399
|
-
## Compatibility
|
|
400
|
-
|
|
401
|
-
**License**: MIT (SPDX: `MIT`)
|
|
402
|
-
|
|
403
|
-
**Supported runtimes**:
|
|
404
|
-
- Node.js ≥ 18.0.0 (declared in `package.json` engines)
|
|
405
|
-
- Bun ≥ 1.0 (tested in CI)
|
|
406
|
-
- Browser (ES2020+ with IndexedDB, localStorage, sessionStorage)
|
|
407
|
-
- Deno (compatible, not routinely tested)
|
|
408
|
-
|
|
409
|
-
**Tested in CI**: Node.js 20.x, 22.x; Bun 1.x
|
|
410
|
-
|
|
411
|
-
**Note**: The `durable` scope in `memory.remember()` uses IndexedDB and is browser-only. For cross-restart persistence in Node/Bun, use `memory.acquire()` which writes `.mem` package files. The `store` and `session` layers fall back to in-memory `Map`s in Node/Bun/Deno and do not survive process restarts.
|
|
412
|
-
|
|
413
|
-
---
|
|
414
|
-
|
|
415
|
-
## License
|
|
416
|
-
|
|
417
|
-
(c) 2026 Dario Passariello. See [LICENSE.md](./LICENSE.md).
|
|
1
|
+
# dotmem (.mem)
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
AI memory and continuity infrastructure for agents and applications.
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
> **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.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What Dotmem is
|
|
14
|
+
|
|
15
|
+
- **Acquired experience**: evidenced, applicability-scoped claims via `discover`, `project`, and `acquire`.
|
|
16
|
+
- **Application memory**: typed key/value entries via `remember`, `recall`, `update`, `forget`, and `patch`.
|
|
17
|
+
- **Continuity**: snapshots, checkpoints, compaction, and open loops across sessions.
|
|
18
|
+
- **Policy**: separate authority domain with tiered enforcement and privileged out-of-band overrides.
|
|
19
|
+
- **Agent namespaces**: logically partitioned memory via `dotmem/agent`.
|
|
20
|
+
- **Notes and profiles**: short-lived notes and read-only built-in profiles (including the optional Joy profile).
|
|
21
|
+
- **MCP and CLI**: stdio MCP server (`dotmem-mcp`) and command-line tools.
|
|
22
|
+
|
|
23
|
+
---
|
|
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
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm i dotmem
|
|
33
|
+
# or
|
|
34
|
+
bun i dotmem
|
|
35
|
+
# or
|
|
36
|
+
pnpm i dotmem
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Requires Node.js >= 18.0.0.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Quick Start (continuos chat)
|
|
44
|
+
|
|
45
|
+
### Install dotmem global
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
npm i -g dotmem memorio
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
### See MCP section or
|
|
52
|
+
|
|
53
|
+
```chat
|
|
54
|
+
npx -y -p dotmem dotmem-mcp
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Quick Start (coding)
|
|
59
|
+
|
|
60
|
+
The runtime initializes lazily on first call; no explicit `init()` is required.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { memory } from 'dotmem'
|
|
64
|
+
|
|
65
|
+
// Discover relevant acquired experience for a situation
|
|
66
|
+
const discovery = await memory.discover('User needs a language recommendation for a new project', {
|
|
67
|
+
depth: 'current',
|
|
68
|
+
maxCandidates: 10
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// Project a bounded context from discovered claims
|
|
72
|
+
const projection = memory.project(discovery, { maxCandidates: 5, maxCharacters: 4000 })
|
|
73
|
+
console.info(projection.text)
|
|
74
|
+
|
|
75
|
+
// Acquire durable experience (persists across restarts via .mem files)
|
|
76
|
+
await memory.acquire({
|
|
77
|
+
id: 'user.language-preference',
|
|
78
|
+
knowledge: { language: 'TypeScript' },
|
|
79
|
+
applicability: { area: 'language-selection' },
|
|
80
|
+
evidence: [{ id: 'conv-001', source: 'conversation', observedAt: new Date().toISOString() }],
|
|
81
|
+
epistemicType: 'observed'
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
For agent-namespaced memory, use the `dotmem/agent` subpath:
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { createAgentMemory } from 'dotmem/agent'
|
|
89
|
+
|
|
90
|
+
const agent = createAgentMemory('support-agent')
|
|
91
|
+
await agent.remember('greeting', 'Hello! How can I help?', {
|
|
92
|
+
type: 'fact',
|
|
93
|
+
confidence: 0.9,
|
|
94
|
+
scope: 'local',
|
|
95
|
+
tags: ['greeting']
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
> `remember()` with scope `durable` uses IndexedDB and is browser-only. For Node/Bun, use `memory.acquire()`. See [MEMORY.md](./MEMORY.md) for scope details.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Core capabilities
|
|
104
|
+
|
|
105
|
+
- `memory.discover`, `memory.context`, `memory.project` — retrieval and bounded context projection.
|
|
106
|
+
- `memory.acquire`, `memory.acquireStaged` — evidenced acquisition with policy evaluation.
|
|
107
|
+
- `memory.remember`, `memory.recall`, `memory.update`, `memory.forget`, `memory.patch` — application memory.
|
|
108
|
+
- `memory.journal`, `memory.note`, `memory.profile`, `memory.seed`, `memory.policy`, `memory.brain` — sub-facades.
|
|
109
|
+
- `continuity` — snapshots, checkpoints, compaction, open loops.
|
|
110
|
+
- `security`, `encryption` — RBAC/audit/consent and AES-GCM + PBKDF2 helpers.
|
|
111
|
+
- Foundation re-exports: `state`, `store`, `session`, `idb`, `dispatch`, `hlc`.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Layers
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
| Layer | Availability | Purpose |
|
|
120
|
+
|-------|--------------|---------|
|
|
121
|
+
| **memory** | `dotmem` (main) | Key/value memory, acquisition lifecycle, journal, and sub-facades |
|
|
122
|
+
| **continuity** | `dotmem` (main) | USER + PROJECT + TASK context composition, snapshots, open loops |
|
|
123
|
+
| **agent** | `dotmem/agent` (subpath) | Agent-facing memory with logical namespace partitioning |
|
|
124
|
+
| **policy** | `memory.policy` | Policy definition, authority management, three-tier enforcement |
|
|
125
|
+
| **profile** | `memory.profile.get(id)` | Identity and persona documents (read-only built-in profiles, including Joy) |
|
|
126
|
+
| **note** | `memory.note` | Short-lived notes with tags and origins |
|
|
127
|
+
|
|
128
|
+
### Internal / infrastructure
|
|
129
|
+
|
|
130
|
+
| Layer | Purpose | Notes |
|
|
131
|
+
|-------|---------|-------|
|
|
132
|
+
| **seed** | Development-only initial memory seed | `--dev` required |
|
|
133
|
+
| **llm-cache** | LLM response cache types only; no verified runtime implementation | `types/llm-cache.d.ts` |
|
|
134
|
+
|
|
135
|
+
> 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.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Retrieval model
|
|
140
|
+
|
|
141
|
+
dotmem uses **deterministic, verifiable retrieval** without embedding-model dependencies:
|
|
142
|
+
|
|
143
|
+
- Lexical/structured matching with applicability-based eligibility.
|
|
144
|
+
- No embeddings, vector indexes, or semantic similarity search.
|
|
145
|
+
- Results are reproducible given the same store and query.
|
|
146
|
+
|
|
147
|
+
"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.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## MCP server
|
|
152
|
+
|
|
153
|
+
`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`.
|
|
154
|
+
|
|
155
|
+
Canonical launch command (use this form in all configurations):
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
npx -y -p dotmem-mcp
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Claude Desktop
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"dotmem": {
|
|
167
|
+
"command": "npx",
|
|
168
|
+
"args": ["-y", "-p", "dotmem-mcp"],
|
|
169
|
+
"env": { "DOTMEM_MCP_WRITE": "1" }
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Claude Code
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
claude mcp add --env DOTMEM_MCP_WRITE=1 --transport stdio dotmem -- npx -y -p dotmem-mcp
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Kilo / OpenCode
|
|
182
|
+
|
|
183
|
+
```jsonc
|
|
184
|
+
"mcp": {
|
|
185
|
+
"dotmem": {
|
|
186
|
+
"type": "local",
|
|
187
|
+
"command": ["npx", "-y", "-p", "dotmem-mcp"],
|
|
188
|
+
"enabled": true,
|
|
189
|
+
"environment": { "DOTMEM_MCP_WRITE": "1" }
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Windows Command Prompt (cmd.exe)
|
|
195
|
+
|
|
196
|
+
In Windows `cmd.exe`, `npx` may not be directly executable as a command. Use `cmd /c npx`:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"mcpServers": {
|
|
201
|
+
"dotmem": {
|
|
202
|
+
"command": "cmd",
|
|
203
|
+
"args": ["/c", "npx", "-y", "-p", "dotmem-mcp"],
|
|
204
|
+
"env": { "DOTMEM_MCP_WRITE": "1" }
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
See [MEMORY.md](./MEMORY.md) for the full tool list and write-gating details.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Optional Joy identity
|
|
215
|
+
|
|
216
|
+
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.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Documentation
|
|
221
|
+
|
|
222
|
+
| Document | Description |
|
|
223
|
+
|----------|-------------|
|
|
224
|
+
| [MEMORY.md](./MEMORY.md) | Full memory model: acquisition contract, policy language, epistemic typing, enforcement, continuity, identity |
|
|
225
|
+
| [AGENTS.md](./AGENTS.md) | AI agent working rules, activation phrases, complete `memory.*` surface |
|
|
226
|
+
| [SECURITY.md](./SECURITY.md) | Encryption, multitenancy, key management, trust model, JHF, sandbox |
|
|
227
|
+
| [JOY.md](./JOY.md) | Optional Joy identity, activation matching, discovery order |
|
|
228
|
+
| [PACKAGE.md](./PACKAGE.md) | Package contents, full quick-start, dependency graph |
|
|
229
|
+
| [LICENSE.md](./LICENSE.md) | License |
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Compatibility
|
|
234
|
+
|
|
235
|
+
**License**: MIT (SPDX: `MIT`)
|
|
236
|
+
|
|
237
|
+
**Supported runtimes**:
|
|
238
|
+
- Node.js >= 18.0.0 (declared in `package.json` engines)
|
|
239
|
+
- Bun >= 1.0 (tested in CI)
|
|
240
|
+
- Browser (ES2020+ with IndexedDB, localStorage, sessionStorage)
|
|
241
|
+
- Deno (compatible, not routinely tested)
|
|
242
|
+
|
|
243
|
+
**Tested in CI**: Node.js 20.x, 22.x; Bun 1.x
|
|
244
|
+
|
|
245
|
+
**Note**: The `durable` scope in `memory.remember()` uses IndexedDB and is browser-only. For cross-restart persistence in Node/Bun, use `memory.acquire()` which writes `.mem` package files. The `store` and `session` layers fall back to in-memory `Map`s in Node/Bun/Deno and do not survive process restarts.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
MIT (c) 2026 Dario Passariello.
|