dotmem 0.2.9 → 0.3.1
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 +44 -14
- package/CHANGELOG.md +37 -0
- package/MEMORY.md +26 -8
- package/README.md +364 -431
- package/SECURITY.md +1 -1
- package/WHATSNEW.md +30 -0
- package/agent.cjs +106 -94
- package/agent.js +106 -94
- package/built-in-context.json +6 -6
- package/cli.cjs +231 -193
- package/cli.js +231 -193
- package/crew/CREW-CERTIFICATION-REPORT.md +52 -0
- package/crew/PHASE-1-DISCOVERY.md +74 -0
- package/crew/PHASE-2-SURFACE-ANALYSIS.md +74 -0
- package/crew/PHASE-3-IMPLEMENTATION-REPORT.md +40 -0
- package/global.cjs +106 -94
- package/global.js +106 -94
- package/index.cjs +124 -124
- package/index.js +124 -124
- package/llms.txt +8 -4
- package/mcp.cjs +108 -107
- package/mcp.js +108 -107
- package/package.json +6 -7
- package/types/global-types.d.ts +66 -14
- package/types/memory.d.ts +39 -8
package/README.md
CHANGED
|
@@ -1,431 +1,364 @@
|
|
|
1
|
-
# Dotmem
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Contents
|
|
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
|
-
Dotmem
|
|
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
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
- `.mem` files and vault data are **not encrypted at rest**.
|
|
367
|
-
- SHA-256 integrity is not encryption or access control.
|
|
368
|
-
- Filesystem permissions are enforced by the operating system.
|
|
369
|
-
- Retrieval is lexical and structured, not semantic.
|
|
370
|
-
- Dotmem governs context projection, not downstream model behavior.
|
|
371
|
-
- Shared storage coordination is not a distributed transaction system.
|
|
372
|
-
- No formal uptime or scalability SLA is provided.
|
|
373
|
-
|
|
374
|
-
Do not use Dotmem as a replacement for an encrypted backup solution, secrets manager, or database authorization system.
|
|
375
|
-
|
|
376
|
-
See [SECURITY.md](./SECURITY.md).
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
## Build profiles
|
|
381
|
-
|
|
382
|
-
Dotmem core is independent of assistant identity and branding.
|
|
383
|
-
|
|
384
|
-
The product owner selects the assistant profile at build time. Profiles are embedded in the build artifact and cannot be changed by end users at runtime.
|
|
385
|
-
|
|
386
|
-
The default build uses the Joy profile. Joy is a selectable profile, not a mandatory identity of the Dotmem runtime.
|
|
387
|
-
|
|
388
|
-
See [AI.md](./context/templates/AI.md).
|
|
389
|
-
|
|
390
|
-
---
|
|
391
|
-
|
|
392
|
-
## Compatibility
|
|
393
|
-
|
|
394
|
-
| Runtime | Status |
|
|
395
|
-
|---|---|
|
|
396
|
-
| Node.js >= 20 | Supported and tested |
|
|
397
|
-
| Bun >= 1.0 | Supported and tested |
|
|
398
|
-
| Browser | ES2020+ with browser storage APIs |
|
|
399
|
-
| Deno | Compatible, not routinely tested |
|
|
400
|
-
|
|
401
|
-
Persistence behavior differs by runtime. See [MEMORY.md](./MEMORY.md).
|
|
402
|
-
|
|
403
|
-
## Documentation
|
|
404
|
-
|
|
405
|
-
| Document | Description |
|
|
406
|
-
|---|---|
|
|
407
|
-
| [MEMORY.md](./MEMORY.md) | Memory model, acquisition, policy, continuity and MCP |
|
|
408
|
-
| [AGENTS.md](./AGENTS.md) | Agent integration and operating rules |
|
|
409
|
-
| [SECURITY.md](./SECURITY.md) | Security and trust model |
|
|
410
|
-
| [AI.md](./context/templates/AI.md) | Assistant profiles and operating contract |
|
|
411
|
-
| [PACKAGE.md](./PACKAGE.md) | Package contents and dependency details |
|
|
412
|
-
|
|
413
|
-
## Project direction
|
|
414
|
-
|
|
415
|
-
Dotmem is developed as independent memory and continuity infrastructure.
|
|
416
|
-
|
|
417
|
-
Its direction includes reliable cross-session continuity, portable memory, stronger evidence and verification workflows, transparent memory inspection, efficient context projection, and durable lifecycle management.
|
|
418
|
-
|
|
419
|
-
These objectives do not imply that every capability is already implemented.
|
|
420
|
-
|
|
421
|
-
## Disclaimer
|
|
422
|
-
|
|
423
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
424
|
-
|
|
425
|
-
Outputs of AI systems using Dotmem can be wrong or incomplete. Verify critical information independently, and do not store sensitive or confidential data in unencrypted memory.
|
|
426
|
-
|
|
427
|
-
## License
|
|
428
|
-
|
|
429
|
-
MIT - Copyright (c) 2026 Dario Passariello.
|
|
430
|
-
|
|
431
|
-
SPDX-License-Identifier: `MIT`
|
|
1
|
+
# Dotmem
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dotmem)
|
|
6
|
+
[](#license-and-disclaimer)
|
|
7
|
+
[](#quick-start)
|
|
8
|
+
|
|
9
|
+
## A verifiable, local project memory for your AI coding assistant
|
|
10
|
+
|
|
11
|
+
**Persistent project knowledge. Continuous development conversations. Fewer repeated explanations. Less context overhead.**
|
|
12
|
+
|
|
13
|
+
Dotmem is a local-first memory and context engine for AI-powered code editors. Start a new chat, switch editors, restart your machine, or come back weeks later: your assistant can recover project architecture, technical decisions, previous discussions, debugging history, and unfinished work.
|
|
14
|
+
|
|
15
|
+
Type `dotmem` in your AI development chat to retrieve the relevant knowledge and keep working, without rebuilding the whole project context by hand.
|
|
16
|
+
|
|
17
|
+
**You decide what is remembered, where it lives and what gets projected into context, so you can focus on building.**
|
|
18
|
+
|
|
19
|
+
## Contents
|
|
20
|
+
|
|
21
|
+
- [The problem](#the-problem)
|
|
22
|
+
- [Why Dotmem](#why-dotmem)
|
|
23
|
+
- [Using `dotmem` in chat](#using-dotmem-in-chat)
|
|
24
|
+
- [Quick start](#quick-start)
|
|
25
|
+
- [Memory across sessions](#memory-across-sessions)
|
|
26
|
+
- [Token efficiency and progressive context](#token-efficiency-and-progressive-context)
|
|
27
|
+
- [How it works and the trust model](#how-it-works-and-the-trust-model)
|
|
28
|
+
- [What's inside](#whats-inside)
|
|
29
|
+
- [Supported editors](#supported-editors)
|
|
30
|
+
- [CLI and MCP reference](#cli-and-mcp-reference)
|
|
31
|
+
- [Storage, privacy and security](#storage-privacy-and-security)
|
|
32
|
+
- [For developers: use it from code](#for-developers-use-it-from-code)
|
|
33
|
+
- [Roadmap and contributing](#roadmap-and-contributing)
|
|
34
|
+
- [License and disclaimer](#license-and-disclaimer)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## The problem
|
|
39
|
+
|
|
40
|
+
AI coding assistants are powerful, but development conversations have a continuity problem.
|
|
41
|
+
|
|
42
|
+
While you build an application, a conversation accumulates architecture decisions, conventions, implementation details, bugs and their fixes, investigations, unfinished tasks and technical constraints. When the conversation gets too long, a new session starts, or the context is compacted, that knowledge can disappear. You then spend time and tokens explaining again what was already discussed.
|
|
43
|
+
|
|
44
|
+
Dotmem gives the assistant access to persistent, structured development memory instead.
|
|
45
|
+
|
|
46
|
+
## Why Dotmem
|
|
47
|
+
|
|
48
|
+
Most projects already try to solve this in one of two ways. Dotmem is designed to complement both.
|
|
49
|
+
|
|
50
|
+
| Approach | Strength | Limit | What Dotmem adds |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| Static rule files (e.g. `AGENTS.md`, editor rules) | Simple, always loaded | Grow without bound, no history, loaded in full every time | Bounded, progressive context (L0-L3) built from stored claims |
|
|
53
|
+
| Chat history and automatic compaction | Zero setup | Lost on new sessions or editors; summaries drift | Checkpoints and open loops that survive sessions and editors |
|
|
54
|
+
| Dotmem | Local, deterministic retrieval; every claim has provenance and a trust basis | Needs the MCP server and one rule line; retrieval is keyword-based (no embeddings) | n/a |
|
|
55
|
+
|
|
56
|
+
Dotmem is **editor-independent** (it works through MCP), **local-first** (no cloud, no telemetry) and **correctable** (claims are immutable; changes are new claims that refine, supersede or retract).
|
|
57
|
+
|
|
58
|
+
## Using `dotmem` in chat
|
|
59
|
+
|
|
60
|
+
You talk to your assistant as usual and use `dotmem` when you want it to consult or update the project memory:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
dotmem what is the architecture of this app?
|
|
64
|
+
dotmem why did we choose SQLite for the storage layer?
|
|
65
|
+
dotmem resume the login refactor
|
|
66
|
+
dotmem what bugs did we fix in the auth flow?
|
|
67
|
+
dotmem remember: no JSX, we use React.createElement
|
|
68
|
+
dotmem save a checkpoint, I'm stopping for today
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
> **Saving requires write mode.** The last two examples write to your memory store. Dotmem is read-only by default, so they only work after you enable `DOTMEM_MCP_WRITE=1` ([Quick start, step 3](#3-allow-saving-optional)). Reading examples work out of the box.
|
|
72
|
+
|
|
73
|
+
Typical uses:
|
|
74
|
+
|
|
75
|
+
- Recover the architecture of the current application.
|
|
76
|
+
- Recall earlier discussions about a component.
|
|
77
|
+
- Retrieve technical decisions and their rationale.
|
|
78
|
+
- Resume unfinished implementation work.
|
|
79
|
+
- Recall debugging sessions and solutions.
|
|
80
|
+
- Check project conventions, open issues and pending tasks.
|
|
81
|
+
|
|
82
|
+
Illustrative session (output shortened):
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
you: dotmem why did we choose SQLite for the storage layer?
|
|
86
|
+
assistant: [calls dotmem_context] According to the stored decision, SQLite was
|
|
87
|
+
chosen for zero-config local storage. Trust basis: evidenced.
|
|
88
|
+
Related open loop: migrate the legacy JSON store.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The assistant remains responsible for reasoning and writing code. Dotmem supplies the persistent knowledge that lets it work with better context.
|
|
92
|
+
|
|
93
|
+
> `dotmem` in a message is an instruction to the assistant, not a built-in command. It works once the Dotmem MCP server is registered **and** the one-line rule from [Quick start, step 1](#1-register-the-mcp-server-and-add-the-rule) is in place. Without that rule the assistant may sometimes ignore the prefix. Dotmem does not install or configure anything by itself.
|
|
94
|
+
|
|
95
|
+
## Quick start
|
|
96
|
+
|
|
97
|
+
You need Node.js 22.5 or newer (or Bun 1.0 or newer).
|
|
98
|
+
|
|
99
|
+
### 1. Register the MCP server and add the rule
|
|
100
|
+
|
|
101
|
+
**a) Pick a version.** Pinning keeps your setup reproducible and avoids running unreviewed updates:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm view dotmem version
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Use that number in place of `<version>` below.
|
|
108
|
+
|
|
109
|
+
**b) Add Dotmem to your editor's MCP configuration.**
|
|
110
|
+
|
|
111
|
+
macOS / Linux:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"mcpServers": {
|
|
116
|
+
"dotmem": {
|
|
117
|
+
"command": "npx",
|
|
118
|
+
"args": ["-y", "-p", "dotmem@<version>", "dotmem-mcp"]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Windows:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"mcpServers": {
|
|
129
|
+
"dotmem": {
|
|
130
|
+
"command": "cmd",
|
|
131
|
+
"args": ["/c", "npx", "-y", "-p", "dotmem@<version>", "dotmem-mcp"]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Kilo/OpenCode and Claude Code use their own syntax; see [MEMORY.md](./MEMORY.md). A global install (`npm install -g dotmem`) is only needed if you also want the `dotmem` command in your terminal.
|
|
138
|
+
|
|
139
|
+
**c) Add the rule.** Put this in your editor's custom instructions or agent rules so the assistant starts every session with context and understands the `dotmem` prefix:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
At the start of a session call dotmem_bootstrap. When I write "dotmem ...", use the Dotmem tools to answer or save.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Without this rule, the `dotmem` prefix is not reliable. Host-specific hooks are being developed (`npx dotmem hooks --target <host>`, experimental).
|
|
146
|
+
|
|
147
|
+
### 2. Restart and verify
|
|
148
|
+
|
|
149
|
+
Restart the editor and check that `dotmem_context` appears in the MCP tool list. Then type in chat:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
dotmem what do you know about this project?
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
An answer (even "nothing stored yet") confirms the integration works.
|
|
156
|
+
|
|
157
|
+
### 3. Allow saving (optional)
|
|
158
|
+
|
|
159
|
+
Dotmem is **read-only by default**. To let the assistant save knowledge, set `DOTMEM_MCP_WRITE=1` in the MCP server environment:
|
|
160
|
+
|
|
161
|
+
- Claude Desktop and compatible JSON configs: `"env": { "DOTMEM_MCP_WRITE": "1" }`
|
|
162
|
+
- Kilo/OpenCode: `"environment": { "DOTMEM_MCP_WRITE": "1" }`
|
|
163
|
+
- Claude Code: `claude mcp add --env DOTMEM_MCP_WRITE=1 ...`
|
|
164
|
+
|
|
165
|
+
Enable it only for editors and workflows you want writing to your memory store. See [Storage, privacy and security](#storage-privacy-and-security) for the risks of enabling write mode.
|
|
166
|
+
|
|
167
|
+
### Troubleshooting
|
|
168
|
+
|
|
169
|
+
| Problem | Try |
|
|
170
|
+
|---|---|
|
|
171
|
+
| Tools don't appear | Restart the editor; check the JSON; on Windows use the `cmd /c` form. |
|
|
172
|
+
| Install or startup fails with a module error | Check `node -v`: Node.js 22.5 or newer is required (or Bun 1.0+). |
|
|
173
|
+
| Editor can't find `npx` | GUI apps may not inherit your shell `PATH`; use the full path to `npx`. |
|
|
174
|
+
| "Nothing stored" | Normal on first use, or your words don't match the stored note. |
|
|
175
|
+
| Nothing gets saved | Write mode is off (step 3). |
|
|
176
|
+
| The assistant ignores `dotmem ...` | The rule from step 1c is missing or not loaded by your editor. |
|
|
177
|
+
| Terminal and chat see different memory | Set the same `DOTMEM_STORAGE_ROOT` for both. |
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Memory across sessions
|
|
182
|
+
|
|
183
|
+
Stop working, come back later, open a new conversation and continue the same application. The assistant can retrieve what the project is, what has been implemented, which decisions were made, which problems remain and what comes next.
|
|
184
|
+
|
|
185
|
+
Continuity is not a separate engine. It is built on the same discover, project and acquire model described in [How it works](#how-it-works-and-the-trust-model): events and checkpoints are stored as acquired claims, and resuming reads them back as bounded context. On top of that, the continuity layer follows this cycle:
|
|
186
|
+
|
|
187
|
+
`capture -> checkpoint -> compact -> resume -> verify`
|
|
188
|
+
|
|
189
|
+
It keeps checkpoints, summaries and open loops. It restores what was captured: it is a working summary to verify, not a perfect replay of past conversations.
|
|
190
|
+
|
|
191
|
+
## Token efficiency and progressive context
|
|
192
|
+
|
|
193
|
+
Dotmem does not load everything into every conversation. It keeps initial context compact and expands only when the task needs it.
|
|
194
|
+
|
|
195
|
+
| Level | Purpose | Limit |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| L0 | Startup with rules only | 0 claims |
|
|
198
|
+
| L1 | Initial context | 5 claims / 900 characters |
|
|
199
|
+
| L2 | Expanded context | 12 claims / 3,000 characters |
|
|
200
|
+
| L3 | Deep context | 20 claims / 6,000 characters |
|
|
201
|
+
|
|
202
|
+
The session profile sets the maximum level: SHORT up to L1, MEDIUM up to L2, LONG up to L3 from turn 6. The profile is supplied by the host or integration, not inferred from your wording.
|
|
203
|
+
|
|
204
|
+
After a summary restart, progression returns to L1. `--full` returns the complete projection on request.
|
|
205
|
+
|
|
206
|
+
Each response is bounded in size. Dotmem cannot control how often a model decides to call a tool.
|
|
207
|
+
|
|
208
|
+
**Savings should be measured, not claimed.** Run `npx dotmem stats --tokens` to see the real footprint of what Dotmem projects in your project. Measurements stay local.
|
|
209
|
+
|
|
210
|
+
### Finding the right memory
|
|
211
|
+
|
|
212
|
+
By default, retrieval is deterministic: local BM25 plus structured matching on metadata, with applicability-based eligibility. Results are reproducible for the same store and query, and nothing else is needed to run it: no embedding model, GPU or vector database.
|
|
213
|
+
|
|
214
|
+
The default engine does not use embeddings, so synonyms and paraphrases are not guaranteed to match. To get good results, write notes using the terms you will later search for, and use tags and applicability when you save knowledge.
|
|
215
|
+
|
|
216
|
+
Semantic similarity (embeddings) is not part of the current search path. A provider interface exists internally; exposing it as a public extension point is planned (see [Roadmap](#roadmap-and-contributing)).
|
|
217
|
+
|
|
218
|
+
## How it works and the trust model
|
|
219
|
+
|
|
220
|
+
Dotmem follows a **discover, project, acquire** model:
|
|
221
|
+
|
|
222
|
+
1. **Discover**: find stored claims relevant to the situation.
|
|
223
|
+
2. **Project**: build a bounded context from them.
|
|
224
|
+
3. **Acquire**: save new knowledge with evidence, provenance metadata and scope.
|
|
225
|
+
|
|
226
|
+
Session continuity (checkpoints, summaries, open loops) is built on this same model; see [Memory across sessions](#memory-across-sessions).
|
|
227
|
+
|
|
228
|
+
Principles:
|
|
229
|
+
|
|
230
|
+
- **Local-first.** Your memory stays under your control.
|
|
231
|
+
- **Memory is not authority.** A retrieved claim can inform a decision; it cannot authorize an operation or become policy. Projected memory is data, never instructions.
|
|
232
|
+
- **Provenance is not proof.** Every claim has a trust basis:
|
|
233
|
+
|
|
234
|
+
| Trust basis | Meaning |
|
|
235
|
+
|---|---|
|
|
236
|
+
| `declared` | Caller assertion, not validated |
|
|
237
|
+
| `evidenced` | Evidence referenced, not independently validated |
|
|
238
|
+
| `mechanically-checked` | A reproducible check was run and recorded |
|
|
239
|
+
| `externally-attested` | A trusted external attestation was validated |
|
|
240
|
+
|
|
241
|
+
- **Correctable.** Claims are immutable. Changes are new claims that refine, supersede or retract.
|
|
242
|
+
- **Editor-independent.** Dotmem does not depend on a specific editor or AI provider.
|
|
243
|
+
|
|
244
|
+
## What's inside
|
|
245
|
+
|
|
246
|
+
Beyond the basic model, the engine includes these building blocks. For how each one is exposed and configured, see [AGENTS.md](./AGENTS.md) and [MEMORY.md](./MEMORY.md).
|
|
247
|
+
|
|
248
|
+
| Component | What it does | Example |
|
|
249
|
+
|---|---|---|
|
|
250
|
+
| Metadata-first discovery | Matches on claim metadata before loading content. | Finds "storage" decisions without loading every note. |
|
|
251
|
+
| Deterministic calculation | Computes derived values reproducibly instead of leaving them to the model. | Counts or totals come from code, not from the model's guess. |
|
|
252
|
+
| Read-only SQL | Queries stored data without being able to modify it. | Ask "how many open loops per area?" safely. |
|
|
253
|
+
| Epistemic state machine | Tracks the state of each claim and how it changes when evidence changes. | A claim becomes stale when its evidence is superseded. |
|
|
254
|
+
| SSOT | Keeps a single source of truth for each piece of knowledge. | One canonical claim for "which database we use". |
|
|
255
|
+
| Continuous attention | Monitors registered sources and reassesses affected claims. | Flags a claim when a watched file changes. |
|
|
256
|
+
| Privacy gate | Controls what is allowed into the projected context. | Secret-shaped values never reach the prompt. |
|
|
257
|
+
|
|
258
|
+
Python is optional and is not required for normal use.
|
|
259
|
+
|
|
260
|
+
## Supported editors
|
|
261
|
+
|
|
262
|
+
Dotmem works through MCP. Configuration is documented for **VS Code with MCP-capable AI extensions, Kilo/OpenCode, Claude Code and Claude Desktop**. Any other MCP-compatible AI editor or assistant should work with the generic configuration above.
|
|
263
|
+
|
|
264
|
+
## CLI and MCP reference
|
|
265
|
+
|
|
266
|
+
### MCP tools
|
|
267
|
+
|
|
268
|
+
| Tool | Access | Purpose |
|
|
269
|
+
|---|---|---|
|
|
270
|
+
| `dotmem_bootstrap` | Read | Load context and rules in one call |
|
|
271
|
+
| `dotmem_context` | Read | Retrieve claims relevant to a situation |
|
|
272
|
+
| `dotmem_rules` | Read | Retrieve the operating rules |
|
|
273
|
+
| `dotmem_inspect` | Read | Inspect memory packages and stores |
|
|
274
|
+
| `dotmem_continuity` | Read / conditional write | Status, summaries, open loops; checkpoints need write access |
|
|
275
|
+
| `dotmem_search` | Read | Local BM25 search over claims and archives |
|
|
276
|
+
| `dotmem_archive` | Read / conditional write | File-backed `.arch.mem` archive operations |
|
|
277
|
+
| `dotmem_acquire` | Write | Save durable knowledge |
|
|
278
|
+
| `dotmem_verify` | Write | Run supported verification probes |
|
|
279
|
+
|
|
280
|
+
Write tools are registered only with `DOTMEM_MCP_WRITE=1`.
|
|
281
|
+
|
|
282
|
+
### CLI
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npx dotmem # project context (L1 by default)
|
|
286
|
+
npx dotmem --level 2 # expanded context (1, 2 or 3)
|
|
287
|
+
npx dotmem --full # complete projection
|
|
288
|
+
npx dotmem inspect FILE.mem # read-only inspection
|
|
289
|
+
npx dotmem dump
|
|
290
|
+
npx dotmem diff FILE_A.mem FILE_B.mem
|
|
291
|
+
npx dotmem stats --tokens # measure token footprint
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Other commands are experimental and may change (for example `hooks`, `snapshot`, `sync`, `probe`). Run `npx dotmem <command> --help` for the current list.
|
|
295
|
+
|
|
296
|
+
A separate binary, `dotmem-burst-stats`, is a local usage-statistics helper.
|
|
297
|
+
|
|
298
|
+
## Storage, privacy and security
|
|
299
|
+
|
|
300
|
+
Default location (change with `DOTMEM_STORAGE_ROOT=/path/to/folder`):
|
|
301
|
+
|
|
302
|
+
```text
|
|
303
|
+
<user-home>/.dotmem
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
`.mem` files are compressed packages with SHA-256 integrity manifests, atomic writes, backups and directory locking. Do not edit them by hand; use `npx dotmem inspect`. Inspection is read-only and redacts secret-shaped values by default.
|
|
307
|
+
|
|
308
|
+
- `.mem` files are **not encrypted at rest**. SHA-256 is an integrity check, not access control.
|
|
309
|
+
- **Never save** API keys, passwords, tokens, `.env` contents or private customer data.
|
|
310
|
+
- Dotmem is not a secrets manager, an encrypted backup or an authorization system.
|
|
311
|
+
- Dotmem governs what is projected into context, not how the model behaves.
|
|
312
|
+
- No conversation text or project content is sent anywhere for telemetry.
|
|
313
|
+
|
|
314
|
+
**Write mode and prompt injection.** Projected memory is treated as data, but a model can still be influenced by what it reads. If write mode is on, a note saved from untrusted content (a web page, a third-party file, a pasted message) may later be retrieved and steer the assistant. Keep write mode off unless you need it, review what gets saved with `npx dotmem inspect`, and prefer claims with evidence over `declared` ones when it matters.
|
|
315
|
+
|
|
316
|
+
**Supply chain.** Pin the package version in your MCP configuration (see [Quick start, step 1](#1-register-the-mcp-server-and-add-the-rule)) so an editor restart never runs a version you have not reviewed.
|
|
317
|
+
|
|
318
|
+
See [SECURITY.md](./SECURITY.md).
|
|
319
|
+
|
|
320
|
+
## For developers: use it from code
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
npm install dotmem # or: bun add dotmem
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
```typescript
|
|
327
|
+
import { memory } from 'dotmem'
|
|
328
|
+
|
|
329
|
+
await memory.acquire({
|
|
330
|
+
id: 'user.language-preference',
|
|
331
|
+
knowledge: { language: 'TypeScript' },
|
|
332
|
+
applicability: { area: 'language-selection' },
|
|
333
|
+
evidence: [{ id: 'example-001', source: 'application', observedAt: new Date().toISOString() }],
|
|
334
|
+
epistemicType: 'observed'
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
const discovery = await memory.discover('TypeScript', { depth: 'current', maxCandidates: 10 })
|
|
338
|
+
const projection = memory.project(discovery, { maxCandidates: 8, maxCharacters: 4000 })
|
|
339
|
+
|
|
340
|
+
console.info(projection.text)
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
The runtime initializes lazily. On Node.js and Bun, `memory.acquire()` persists claims as `.mem` files. An empty store or a query with no match yields an empty discovery. Full API, policies and persistence details: [MEMORY.md](./MEMORY.md) and [AGENTS.md](./AGENTS.md).
|
|
344
|
+
|
|
345
|
+
| Runtime | Status |
|
|
346
|
+
|---|---|
|
|
347
|
+
| Node.js >= 22.5 | Supported and tested |
|
|
348
|
+
| Bun >= 1.0 | Supported and tested |
|
|
349
|
+
| Browser | ES2020+ with browser storage APIs |
|
|
350
|
+
| Deno | Compatible, not routinely tested |
|
|
351
|
+
|
|
352
|
+
## Roadmap and contributing
|
|
353
|
+
|
|
354
|
+
Direction, in priority order: retrieval quality and relevance, compact and progressive context, seamless interaction from chat, automatic session initialization, persistent project continuity, measured token savings, reliable project and user memory, more editor integrations. These are objectives, not a statement that every capability already exists. Planned (not yet available): end-to-end evidence lineage tracking; public semantic provider extension point.
|
|
355
|
+
|
|
356
|
+
Issues and contributions are welcome; see [CHANGELOG.md](./CHANGELOG.md) for release history.
|
|
357
|
+
|
|
358
|
+
## License and disclaimer
|
|
359
|
+
|
|
360
|
+
MIT - Copyright (c) 2026 Dario Passariello. SPDX-License-Identifier: `MIT`
|
|
361
|
+
|
|
362
|
+
**Outputs of AI systems using Dotmem can be wrong or incomplete.** Verify critical information independently, and do not store sensitive or confidential data in unencrypted memory.
|
|
363
|
+
|
|
364
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|