dotmem 0.0.7 → 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 +78 -16
- package/DOTMEM.md +539 -41
- package/JOY.md +55 -0
- package/LICENSE.md +4 -16
- package/MEMORY.md +99 -11
- package/PACKAGE.md +1 -3
- package/README.md +200 -347
- package/SECURITY.md +12 -9
- package/agent.cjs +16 -4
- package/agent.js +16 -4
- package/cli.cjs +3933 -4484
- package/cli.js +3833 -4318
- package/env.cjs +6 -0
- package/env.js +4 -0
- package/global.cjs +225 -99
- package/global.d.ts +13 -14
- package/global.js +217 -80
- package/index.cjs +3287 -21213
- package/index.js +3224 -21180
- package/llms.txt +130 -40
- package/mcp.cjs +1785 -36771
- package/mcp.js +1765 -36747
- package/package.json +5 -7
- package/types/exports.d.ts +297 -304
- package/COPYRIGHT.md +0 -4
- package/types/bun-sqlite.d.ts +0 -14
package/README.md
CHANGED
|
@@ -1,347 +1,200 @@
|
|
|
1
|
-
# dotmem (.mem)
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
AI
|
|
6
|
-
|
|
7
|
-
**Built on:** [memorio](https://
|
|
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
|
-
```typescript
|
|
48
|
-
import { memory } from 'dotmem'
|
|
49
|
-
|
|
50
|
-
// Discover relevant acquired experience for a situation
|
|
51
|
-
const discovery = await memory.discover('User needs a language recommendation for a new project', {
|
|
52
|
-
depth: '
|
|
53
|
-
maxCandidates: 10
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
// Project a bounded context from discovered claims
|
|
57
|
-
const projection = memory.project(discovery, { maxCandidates: 5, maxCharacters: 4000 })
|
|
58
|
-
console.
|
|
59
|
-
|
|
60
|
-
// Acquire durable experience
|
|
61
|
-
await memory.acquire({
|
|
62
|
-
id: 'user.language-preference',
|
|
63
|
-
knowledge: { language: 'TypeScript' },
|
|
64
|
-
applicability: { area: 'language-selection' },
|
|
65
|
-
evidence: [{ id: 'conv-001', source: 'conversation', observedAt: new Date().toISOString() }],
|
|
66
|
-
epistemicType: 'observed'
|
|
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
|
-
# Utilities
|
|
203
|
-
npx dotmem codenames
|
|
204
|
-
npx dotmem render markdown-index --out SUMMARY.md
|
|
205
|
-
npx dotmem verify
|
|
206
|
-
npx dotmem doctor --fix
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Run `npx dotmem --help` for the full command reference.
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Memory Model
|
|
214
|
-
|
|
215
|
-
dotmem uses a **discover → project → acquire** memory model:
|
|
216
|
-
|
|
217
|
-
1. **Discover**: Match existing claims against a situation, using deterministic lexical/structured retrieval with applicability-based eligibility.
|
|
218
|
-
2. **Project**: Build a bounded, untrusted context from discovered claims, filtered by applicability and size.
|
|
219
|
-
3. **Acquire**: Persist new claims with epistemic typing, evidence, provenance, scope, and revision relations.
|
|
220
|
-
|
|
221
|
-
### Memory Types
|
|
222
|
-
|
|
223
|
-
| Type | Purpose |
|
|
224
|
-
|------|---------|
|
|
225
|
-
| `fact` | Observable or verified facts |
|
|
226
|
-
| `preference` | User or agent preferences |
|
|
227
|
-
| `decision` | Architectural or workflow decisions |
|
|
228
|
-
| `task` | Task-related information |
|
|
229
|
-
| `context` | Situational context |
|
|
230
|
-
|
|
231
|
-
### Memory Kinds
|
|
232
|
-
|
|
233
|
-
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).
|
|
234
|
-
|
|
235
|
-
### Scopes
|
|
236
|
-
|
|
237
|
-
| Scope | Storage | Lifecycle |
|
|
238
|
-
|-------|---------|-----------|
|
|
239
|
-
| `hot` | In-memory only | Cleared on process exit |
|
|
240
|
-
| `session` | In-memory | Persists for the active session |
|
|
241
|
-
| `durable` | On disk | Survives process restarts |
|
|
242
|
-
| `local` | In-memory | Node/Bun process-bound |
|
|
243
|
-
|
|
244
|
-
### Discovery Depths
|
|
245
|
-
|
|
246
|
-
| Depth | Meaning |
|
|
247
|
-
|-------|---------|
|
|
248
|
-
| `current` | Only active claims (no superseded/obsolete) |
|
|
249
|
-
| `deep` | All claims including superseded and obsolete |
|
|
250
|
-
|
|
251
|
-
### Policy Enforcement
|
|
252
|
-
|
|
253
|
-
Policies are evaluated at acquisition time against a four-tier enforcement model:
|
|
254
|
-
|
|
255
|
-
| Tier | Behavior |
|
|
256
|
-
|------|----------|
|
|
257
|
-
| **permit** | Allow without additional verification |
|
|
258
|
-
| **advisory** | Allow with warnings; surface to user |
|
|
259
|
-
| **caution** | Allow with explicit acknowledgment |
|
|
260
|
-
| **block** | Prevent the operation |
|
|
261
|
-
|
|
262
|
-
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.
|
|
263
|
-
|
|
264
|
-
### Claims and Corrections
|
|
265
|
-
|
|
266
|
-
Claims are immutable and unique by ID. To change a claim, acquire a new one with exactly one revision relation:
|
|
267
|
-
|
|
268
|
-
- `refines` — narrows or extends
|
|
269
|
-
- `supersedes` — replaces
|
|
270
|
-
- `retracts` — withdraws
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
## Storage
|
|
275
|
-
|
|
276
|
-
dotmem storage is user-anchored and resolved at runtime. The canonical storage root is `<user-home>/.dotmem`, relocatable via the `DOTMEM_STORAGE_ROOT` environment variable.
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
npx dotmem storage # show location + resolved root
|
|
280
|
-
npx dotmem storage relocate /path # migrate to an explicit absolute directory
|
|
281
|
-
npx dotmem storage restore # migrate back to default
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
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.
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## Activation
|
|
289
|
-
|
|
290
|
-
The activation phrases are `dotmem`, `npx dotmem`, `Joy`, and `Jo`. A message that is exactly one of them activates dotmem once for the session.
|
|
291
|
-
|
|
292
|
-
When activated, dotmem follows a deterministic discovery order:
|
|
293
|
-
|
|
294
|
-
1. Check `<storage-root>/DOTMEM.md` and read the contract.
|
|
295
|
-
2. Load user-level memory from `user.mem`.
|
|
296
|
-
3. Resolve the current project identity.
|
|
297
|
-
4. Load project memory from `<storage-root>/projects/<project-id>.mem`.
|
|
298
|
-
|
|
299
|
-
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.
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
## Security
|
|
304
|
-
|
|
305
|
-
- **Encryption is opt-in**, not default. Enable it per context or per scope with an encryption key.
|
|
306
|
-
- **Client-side multitenancy** through isolated memory partitions.
|
|
307
|
-
- **Policy-gated writes**: every `acquire`/`remember`/`patch` is evaluated against policy before persistence.
|
|
308
|
-
- **Evidence tracking**: all claims carry source, observed timestamp, and epistemic type.
|
|
309
|
-
- **Claim immutability**: stored claims are never edited. Corrections are appends with revision relations.
|
|
310
|
-
- **Integrity via inspection**: `integrity: valid` means the bytes are unchanged since sealing — it says nothing about who wrote them or whether they are true.
|
|
311
|
-
|
|
312
|
-
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.
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
## Choosing a Layer
|
|
317
|
-
|
|
318
|
-
| If the data is... | Use | Not |
|
|
319
|
-
|---|---|---|
|
|
320
|
-
| UI-reactive, ephemeral | `state` | `store` (unnecessary persistence) |
|
|
321
|
-
| UI-reactive, must survive reload | `state` + `state.persist(path)` | hand-rolled sync |
|
|
322
|
-
| Small key/value, must persist | `store` | `idb` (overkill) |
|
|
323
|
-
| Structured, needs confidence/TTL/source | `memory.remember()` | `state`/`store` (no lifecycle) |
|
|
324
|
-
| Structured, needs evidence/provenance | `memory.acquire()` | `memory.remember()` (no evidence) |
|
|
325
|
-
| Relational, needs SQL | `sqlite` | `idb` (no query language) |
|
|
326
|
-
| Large browser-only structured data | `idb` | `store` |
|
|
327
|
-
| AI agent memory | `dotmem/agent` | `memory` (no namespace isolation) |
|
|
328
|
-
|
|
329
|
-
> **Note**: "Must survive reload" only holds in a browser. In Node.js and Bun, `store` and `session` fall back to in-memory `Map`s that do not survive a process restart.
|
|
330
|
-
|
|
331
|
-
---
|
|
332
|
-
|
|
333
|
-
## Documentation
|
|
334
|
-
|
|
335
|
-
| Document | Description |
|
|
336
|
-
|----------|-------------|
|
|
337
|
-
| [MEMORY.md](./MEMORY.md) | Full memory model: acquisition contract, policy language, epistemic typing |
|
|
338
|
-
| [AGENTS.md](./AGENTS.md) | AI agent working rules, activation phrases, complete `memory.*` surface |
|
|
339
|
-
| [SECURITY.md](./SECURITY.md) | Encryption, multitenancy, key management, threat model |
|
|
340
|
-
| [PACKAGE.md](./PACKAGE.md) | Package contents, full quick-start, dependency graph |
|
|
341
|
-
| [LICENSE.md](./LICENSE.md) | License |
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
## License
|
|
346
|
-
|
|
347
|
-
(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
|
+
**Built on:** [memorio](https://www.npmjs.com/package/memorio) (state, store, session, IndexedDB, SQLite, cache)
|
|
8
|
+
|
|
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
|
+
|
|
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
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
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
|
|
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
|
|
44
|
+
|
|
45
|
+
The runtime initializes lazily on first call; no explicit `init()` is required.
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { memory } from 'dotmem'
|
|
49
|
+
|
|
50
|
+
// Discover relevant acquired experience for a situation
|
|
51
|
+
const discovery = await memory.discover('User needs a language recommendation for a new project', {
|
|
52
|
+
depth: 'current',
|
|
53
|
+
maxCandidates: 10
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// Project a bounded context from discovered claims
|
|
57
|
+
const projection = memory.project(discovery, { maxCandidates: 5, maxCharacters: 4000 })
|
|
58
|
+
console.info(projection.text)
|
|
59
|
+
|
|
60
|
+
// Acquire durable experience (persists across restarts via .mem files)
|
|
61
|
+
await memory.acquire({
|
|
62
|
+
id: 'user.language-preference',
|
|
63
|
+
knowledge: { language: 'TypeScript' },
|
|
64
|
+
applicability: { area: 'language-selection' },
|
|
65
|
+
evidence: [{ id: 'conv-001', source: 'conversation', observedAt: new Date().toISOString() }],
|
|
66
|
+
epistemicType: 'observed'
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For agent-namespaced memory, use the `dotmem/agent` subpath:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { createAgentMemory } from 'dotmem/agent'
|
|
74
|
+
|
|
75
|
+
const agent = createAgentMemory('support-agent')
|
|
76
|
+
await agent.remember('greeting', 'Hello! How can I help?', {
|
|
77
|
+
type: 'fact',
|
|
78
|
+
confidence: 0.9,
|
|
79
|
+
scope: 'local',
|
|
80
|
+
tags: ['greeting']
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
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.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Core capabilities
|
|
89
|
+
|
|
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`.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Layers
|
|
101
|
+
|
|
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.
|
|
103
|
+
|
|
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 |
|
|
112
|
+
|
|
113
|
+
### Internal / infrastructure
|
|
114
|
+
|
|
115
|
+
| Layer | Purpose | Notes |
|
|
116
|
+
|-------|---------|-------|
|
|
117
|
+
| **seed** | Development-only initial memory seed | `--dev` required |
|
|
118
|
+
| **llm-cache** | LLM response cache types only; no verified runtime implementation | `types/llm-cache.d.ts` |
|
|
119
|
+
|
|
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.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Retrieval model
|
|
125
|
+
|
|
126
|
+
dotmem uses **deterministic, verifiable retrieval** without embedding-model dependencies:
|
|
127
|
+
|
|
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.
|
|
131
|
+
|
|
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.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
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`.
|
|
139
|
+
|
|
140
|
+
Canonical launch command (use this form in all configurations):
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx -y -p dotmem dotmem-mcp
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Example (Claude Desktop, read-only by default):
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"mcpServers": {
|
|
151
|
+
"dotmem": {
|
|
152
|
+
"command": "npx",
|
|
153
|
+
"args": ["-y", "-p", "dotmem", "dotmem-mcp"]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
See [MEMORY.md](./MEMORY.md) for the full tool list and write-gating details.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Optional Joy identity
|
|
164
|
+
|
|
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.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Documentation
|
|
170
|
+
|
|
171
|
+
| Document | Description |
|
|
172
|
+
|----------|-------------|
|
|
173
|
+
| [MEMORY.md](./MEMORY.md) | Full memory model: acquisition contract, policy language, epistemic typing, enforcement, continuity, identity |
|
|
174
|
+
| [AGENTS.md](./AGENTS.md) | AI agent working rules, activation phrases, complete `memory.*` surface |
|
|
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 |
|
|
177
|
+
| [PACKAGE.md](./PACKAGE.md) | Package contents, full quick-start, dependency graph |
|
|
178
|
+
| [LICENSE.md](./LICENSE.md) | License |
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Compatibility
|
|
183
|
+
|
|
184
|
+
**License**: MIT (SPDX: `MIT`)
|
|
185
|
+
|
|
186
|
+
**Supported runtimes**:
|
|
187
|
+
- Node.js >= 18.0.0 (declared in `package.json` engines)
|
|
188
|
+
- Bun >= 1.0 (tested in CI)
|
|
189
|
+
- Browser (ES2020+ with IndexedDB, localStorage, sessionStorage)
|
|
190
|
+
- Deno (compatible, not routinely tested)
|
|
191
|
+
|
|
192
|
+
**Tested in CI**: Node.js 20.x, 22.x; Bun 1.x
|
|
193
|
+
|
|
194
|
+
**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.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT (c) 2026 Dario Passariello.
|
package/SECURITY.md
CHANGED
|
@@ -8,7 +8,7 @@ This document covers dotmem's optional encryption layer, client-side multitenanc
|
|
|
8
8
|
|
|
9
9
|
This applies to every layer: `state`, `store`, `session`, `idb`, `memory`, `sqlite`. Treat browser storage as client-controlled unless you explicitly opt in.
|
|
10
10
|
|
|
11
|
-
Core
|
|
11
|
+
Core declares no production dependencies in package.json. `memorio` is listed under devDependencies, but the built ESM/CJS output imports it as an external runtime module; a published install therefore needs `memorio` available unless packaging changes. No `eval`, no dynamic code execution, no bundled telemetry, sanitized keys, validated inputs, bounded journal entries, UUID-based session identifiers. Independently checkable via Socket.dev / Snyk. (The optional MCP stdio entrypoint is the one declared-dependency surface: `zod` and `@modelcontextprotocol/server`.)
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -191,9 +191,12 @@ machine.
|
|
|
191
191
|
|
|
192
192
|
- `dotmem_acquire` is registered only when the server environment sets
|
|
193
193
|
`DOTMEM_MCP_WRITE=1`.
|
|
194
|
-
-
|
|
195
|
-
`
|
|
196
|
-
|
|
194
|
+
- `dotmem_continuity` write actions (`checkpoint`, `add-open-loop`,
|
|
195
|
+
`resolve-open-loop`) require `DOTMEM_MCP_WRITE=1`. Read actions
|
|
196
|
+
(`status`, `summaries`, `open-loops`, `evaluate`) are always available.
|
|
197
|
+
- Without the flag, the server exposes `dotmem_context`, `dotmem_rules`,
|
|
198
|
+
and `dotmem_continuity` (read actions only). The write tools are not in
|
|
199
|
+
`tools/list`, and calling them by name answers `Tool <name> not found`.
|
|
197
200
|
- The flag is read once, when the server starts. Changing it requires
|
|
198
201
|
restarting the server.
|
|
199
202
|
- The library API (`memory.acquire()`) and the CLI (`npx dotmem acquire`)
|
|
@@ -289,7 +292,7 @@ relaxation *attributable*, not undetectable-by-absence.
|
|
|
289
292
|
|
|
290
293
|
## Supply chain
|
|
291
294
|
|
|
292
|
-
-
|
|
295
|
+
- Declared production dependencies: none in the root package.json; `memorio` is a devDependency. The built output imports `memorio` as an external runtime module, so it must be available to a published install unless packaging changes. Do not infer zero runtime dependencies from package.json alone.
|
|
293
296
|
- Dev dependencies are audited periodically (`npm audit` and equivalent).
|
|
294
297
|
- Package integrity is checkable independently via Socket.dev / Snyk before you adopt a given version.
|
|
295
298
|
|
|
@@ -469,10 +472,10 @@ npx dotmem handshake --bind-hi "<user name>" --scope "<scope>"
|
|
|
469
472
|
### Identity fusion protection
|
|
470
473
|
|
|
471
474
|
dotmem detects attempts to fuse an identity with implementation metadata into
|
|
472
|
-
pseudo-identities (e.g. `Joy`, `HI`, `Jo-profile`). The
|
|
473
|
-
canonical identity is preserved; fused forms
|
|
474
|
-
Host, provider, runtime, and model names are
|
|
475
|
-
become the conversational identity or authority.
|
|
475
|
+
pseudo-identities (e.g. `Joy-profile`, `HI`, `Jo-profile`). The
|
|
476
|
+
canonical identity (`Joy`/`Jo` from the canonical profile) is preserved; fused forms
|
|
477
|
+
are never accepted as an identity. Host, provider, runtime, and model names are
|
|
478
|
+
implementation metadata and never become the conversational identity or authority.
|
|
476
479
|
|
|
477
480
|
### JHF remediation principles
|
|
478
481
|
|
package/agent.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('memorio/global');
|
|
4
3
|
var memorio = require('memorio');
|
|
5
4
|
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
@@ -19,15 +18,27 @@ var __export = (target, all) => {
|
|
|
19
18
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
19
|
};
|
|
21
20
|
|
|
21
|
+
// core/idb.ts
|
|
22
|
+
var idb;
|
|
23
|
+
var init_idb = __esm({
|
|
24
|
+
"core/idb.ts"() {
|
|
25
|
+
idb = {
|
|
26
|
+
db: {},
|
|
27
|
+
table: {},
|
|
28
|
+
data: {},
|
|
29
|
+
_disabled: true,
|
|
30
|
+
_warning: "IndexedDB is not available in this environment. Use dotmem store or session for persistence."
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
22
35
|
// core/global.ts
|
|
23
36
|
var global_exports = {};
|
|
24
37
|
__export(global_exports, {
|
|
25
|
-
DEV: () => memorio.DEV,
|
|
26
|
-
PROD: () => memorio.PROD,
|
|
27
38
|
dispatch: () => memorio.dispatch,
|
|
28
39
|
getPlatform: () => getPlatform,
|
|
29
40
|
hlc: () => memorio.hlc,
|
|
30
|
-
idb: () =>
|
|
41
|
+
idb: () => idb,
|
|
31
42
|
session: () => memorio.session,
|
|
32
43
|
state: () => memorio.state,
|
|
33
44
|
store: () => memorio.store
|
|
@@ -35,6 +46,7 @@ __export(global_exports, {
|
|
|
35
46
|
var getPlatform;
|
|
36
47
|
var init_global = __esm({
|
|
37
48
|
"core/global.ts"() {
|
|
49
|
+
init_idb();
|
|
38
50
|
getPlatform = /* @__PURE__ */ __name(() => {
|
|
39
51
|
const proc = globalThis.process;
|
|
40
52
|
if (proc) {
|