cogmem 3.6.3 → 3.6.5
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/CHANGELOG.md +19 -0
- package/README.md +67 -16
- package/RELEASE_CHECKLIST.md +12 -4
- package/dist/agent/AgentMemoryBackend.d.ts +6 -1
- package/dist/agent/AgentMemoryBackend.js +51 -1
- package/dist/agent/AgentRecallQueryCompiler.d.ts +1 -1
- package/dist/agent/AgentRecallQueryCompiler.js +12 -0
- package/dist/atlas/MemoryAtlasService.d.ts +1 -0
- package/dist/atlas/MemoryAtlasService.js +39 -5
- package/dist/atlas/MemoryAtlasTypes.d.ts +14 -0
- package/dist/bin/connect.js +115 -31
- package/dist/bin/import-support.d.ts +1 -0
- package/dist/bin/import-support.js +15 -2
- package/dist/bin/mcp.js +2 -1
- package/dist/bin/memory.js +217 -17
- package/dist/episode/EpisodeStore.d.ts +7 -0
- package/dist/episode/EpisodeStore.js +75 -6
- package/dist/factory.d.ts +2 -0
- package/dist/factory.js +38 -18
- package/dist/host/openclaw/AutoMemoryPluginInstaller.js +6 -2
- package/dist/mcp/server.js +1 -1
- package/dist/store/EventStore.d.ts +6 -0
- package/dist/store/EventStore.js +28 -2
- package/dist/types/index.d.ts +3 -0
- package/examples/hermes-backend/AGENTS.md +36 -16
- package/examples/hermes-backend/README.md +25 -13
- package/examples/hermes-backend/SKILL.md +72 -22
- package/examples/hermes-backend/references/operations.md +50 -13
- package/examples/openclaw-backend/AGENTS.md +33 -7
- package/examples/openclaw-backend/README.md +27 -12
- package/examples/openclaw-backend/SKILL.md +65 -19
- package/examples/openclaw-backend/references/operations.md +53 -12
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cogmem 3.6.
|
|
1
|
+
# Cogmem 3.6.5 Operations Reference for OpenClaw
|
|
2
2
|
|
|
3
3
|
Read this file when installing, upgrading, importing, repairing, or operating Cogmem. `SKILL.md` contains the decision rules; this file is the command reference.
|
|
4
4
|
|
|
@@ -14,9 +14,11 @@ Read this file when installing, upgrading, importing, repairing, or operating Co
|
|
|
14
14
|
| Repair empty project scope from old imports | `cogmem repair project-scope` |
|
|
15
15
|
| Import OpenClaw files | `cogmem import-openclaw` |
|
|
16
16
|
| Import generic message JSONL | `cogmem episode import` |
|
|
17
|
+
| Decide the next safe agent operation | `cogmem memory plan` |
|
|
17
18
|
| Answer one direct memory question | `cogmem memory recall` or `cogmem_recall` |
|
|
18
19
|
| See what memory exists or reconstruct history | Atlas `graph-*` commands/tools |
|
|
19
20
|
| Quote exact source | `cogmem memory show` |
|
|
21
|
+
| Audit ledger sequence ranges | `cogmem memory list --since/--until/--order` |
|
|
20
22
|
| Inspect or resolve uncertain candidates | `memory candidates` then `memory review` |
|
|
21
23
|
| Promote ordinary candidates | `memory govern` |
|
|
22
24
|
| Inspect/process sealed episodes | `episode status`, `dream status`, `dream tick` |
|
|
@@ -26,19 +28,32 @@ Read this file when installing, upgrading, importing, repairing, or operating Co
|
|
|
26
28
|
|
|
27
29
|
## Install and connect
|
|
28
30
|
|
|
31
|
+
Recommended workspace-local npm install:
|
|
32
|
+
|
|
29
33
|
```bash
|
|
30
|
-
|
|
31
|
-
cogmem
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
npm install cogmem@latest --save
|
|
35
|
+
COGMEM="./node_modules/.bin/cogmem"
|
|
36
|
+
"$COGMEM" doctor
|
|
37
|
+
"$COGMEM" connect openclaw --workspace . --auto --force --json
|
|
34
38
|
```
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
Use this resolver in agent-run scripts:
|
|
37
41
|
|
|
38
42
|
```bash
|
|
39
|
-
|
|
40
|
-
cogmem
|
|
41
|
-
|
|
43
|
+
if [ -x ./node_modules/.bin/cogmem ]; then
|
|
44
|
+
COGMEM="./node_modules/.bin/cogmem"
|
|
45
|
+
elif command -v cogmem >/dev/null 2>&1; then
|
|
46
|
+
COGMEM="cogmem"
|
|
47
|
+
else
|
|
48
|
+
npm install cogmem@latest --save
|
|
49
|
+
COGMEM="./node_modules/.bin/cogmem"
|
|
50
|
+
fi
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use `npm install -g cogmem@latest` only when the operator wants a global CLI. The one-line installer is still supported with `COGMEM_SKIP_INIT=1`, but do not run `cogmem init` unattended. `cogmem init` is an interactive wizard; run it only with an operator present:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
"$COGMEM" init --agent openclaw --scope project
|
|
42
57
|
```
|
|
43
58
|
|
|
44
59
|
Restart the OpenClaw Gateway after plugin or config changes. `connect --auto` installs the direct OpenClaw hook bridge; OpenClaw does not need MCP for automatic recall, recording, or Atlas navigation.
|
|
@@ -70,7 +85,7 @@ openclaw gateway restart
|
|
|
70
85
|
cogmem openclaw diagnose --workspace . --json
|
|
71
86
|
```
|
|
72
87
|
|
|
73
|
-
The second command upgrades 3.5.2 schema 24, an existing 3.6.0 schema-26 database, or a pre-release schema-25 test database to the 3.6.
|
|
88
|
+
The second command upgrades 3.5.2 schema 24, an existing 3.6.0 schema-26 database, or a pre-release schema-25 test database to the 3.6.5 schema-27 state in one run. It preserves Raw Ledger evidence. Keep the returned `backupPath` until verification passes. `--dry-run` is read-only and does not create `_schema_migrations`.
|
|
74
89
|
|
|
75
90
|
After upgrading the package/database, refresh OpenClaw's generated plugin files. `doctor --plugin-only` avoids opening the Cogmem kernel, so it can repair stale `extensions/cogmem-auto-memory/index.js` and `bridge.mjs` even when an old drainer has SQLite busy. Use `connect --auto --force` when intentionally reinstalling the full integration and patching OpenClaw config:
|
|
76
91
|
|
|
@@ -121,6 +136,24 @@ cogmem import-openclaw --workspace . --project openclaw --dry-run --json
|
|
|
121
136
|
cogmem import-openclaw --workspace . --project openclaw --json
|
|
122
137
|
```
|
|
123
138
|
|
|
139
|
+
After import, verify semantic maintenance in this exact order:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
cogmem memory plan --project openclaw --json
|
|
143
|
+
cogmem memory status --project openclaw --json
|
|
144
|
+
cogmem memory candidates --project openclaw --json
|
|
145
|
+
cogmem episode status --project openclaw --json
|
|
146
|
+
cogmem dream status --project openclaw --json
|
|
147
|
+
cogmem dream tick --project openclaw --mode auto --max-episodes 20 --json
|
|
148
|
+
cogmem memory candidates --project openclaw --status candidate --json
|
|
149
|
+
cogmem memory govern --project openclaw --limit 100 --json
|
|
150
|
+
cogmem memory candidates --project openclaw --status needs_confirmation --json
|
|
151
|
+
cogmem memory review --project openclaw --id <candidate-id> --action approve --actor <operator> --reason "confirmed by user" --confirmation-event <distinct-user-event-id> --json
|
|
152
|
+
cogmem memory recall --query "<verification question>" --project openclaw --agent openclaw --json
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`memory plan` is the first agent-safe health and next-action command. It reports queue state, blocking and non-blocking actions, Dream backlog hints, vector fallback state, and safe commands. Only run `dream_tick` when it appears in `nextActions`; if `nonBlocking` contains `raw_dream_ledger_lag` with `resolvableByDreamTick:false`, inspect raw sources or episode/import boundaries instead of retrying `dream tick`. Default `memory candidates --json` groups ordinary candidates, `needs_confirmation`, and deferred review entries; use `--status` only for one explicit queue. `needs_confirmation` is not a Dream backlog. `memory govern` does not approve it. Use `memory review` with explicit evidence. Cogmem 3.6.4 and later skip import batch sealing for empty episode boundaries and mark legacy empty Dream jobs as skipped so one bad imported episode cannot block the queue. If `episode status` reports `episode_empty_*`, inspect the episode and repair boundaries with the audited episode repair commands.
|
|
156
|
+
|
|
124
157
|
Pass explicit sources when discovery is not enough:
|
|
125
158
|
|
|
126
159
|
```bash
|
|
@@ -140,7 +173,9 @@ Use `--start-line`, `--end-line`, or `--max-lines` to split controlled runs. Pre
|
|
|
140
173
|
## Read-only inspection and JSON
|
|
141
174
|
|
|
142
175
|
```bash
|
|
176
|
+
cogmem memory plan --project openclaw --json
|
|
143
177
|
cogmem memory status --project openclaw --json
|
|
178
|
+
cogmem memory candidates --project openclaw --json
|
|
144
179
|
cogmem memory candidates --project openclaw --status needs_confirmation --json
|
|
145
180
|
cogmem episode status --project openclaw --json
|
|
146
181
|
cogmem dream status --project openclaw --json
|
|
@@ -148,7 +183,7 @@ cogmem dream status --project openclaw --json
|
|
|
148
183
|
|
|
149
184
|
All documented JSON commands emit `schemaVersion: "cogmem.cli.v1"`. Object payload fields are top-level; arrays use `items`. Queue counters `candidate`, `promoted`, `needs_confirmation`, and `beliefs` are top-level. `memory status` explains whether recall remains available when `vectors` is zero.
|
|
150
185
|
|
|
151
|
-
`memory
|
|
186
|
+
`memory plan`, `memory status`, and `memory candidates` use a lightweight read-only SQLite connection. They should remain usable while the OpenClaw plugin has a long-lived connection.
|
|
152
187
|
|
|
153
188
|
## Recall and source drill-down
|
|
154
189
|
|
|
@@ -156,6 +191,7 @@ Use recall for a direct factual question:
|
|
|
156
191
|
|
|
157
192
|
```bash
|
|
158
193
|
cogmem memory recall --query "<question>" --project openclaw --agent openclaw --json
|
|
194
|
+
cogmem memory recall --query "<past discussion question>" --intent historical_discussion --project openclaw --agent openclaw --json
|
|
159
195
|
cogmem explain-recall --query "<question>" --project openclaw --agent openclaw --json
|
|
160
196
|
```
|
|
161
197
|
|
|
@@ -163,8 +199,12 @@ Follow returned evidence, never a summary alone:
|
|
|
163
199
|
|
|
164
200
|
```bash
|
|
165
201
|
cogmem memory show --event <event-id> --before 2 --after 2 --json
|
|
202
|
+
cogmem memory list --project openclaw --since <globalSeq> --order asc --json
|
|
203
|
+
cogmem memory list --project openclaw --since <globalSeq> --until <globalSeq> --order asc --json
|
|
166
204
|
```
|
|
167
205
|
|
|
206
|
+
Use `historical_discussion` for “did we discuss this before?”, “几个月前是不是聊过…”, “记忆黑盒”, and missing prompt-injection cases. Raw list rows include `sourceLocator`; run the locator before quoting exact words or saying the event cannot be found.
|
|
207
|
+
|
|
168
208
|
## Memory Atlas
|
|
169
209
|
|
|
170
210
|
Atlas combines whichever facets the question supplies, like table filters. Supported constraints include project, time range, topic, entity/target, memory kind, action, and ordinary text cues. Do not require a fixed entity + time + action tuple.
|
|
@@ -190,7 +230,7 @@ Use `--no-refresh` during lock incidents and `--refresh` when the operator wants
|
|
|
190
230
|
|
|
191
231
|
Graph reads are pure: overview/search/explore do not brighten what they display. In MCP, call `cogmem_graph_touch` only after the agent actually selects or uses nodes. Activation changes visibility, never evidence or truth. Exact scoped facets may revive cold nodes.
|
|
192
232
|
|
|
193
|
-
Every evidence result distinguishes `evidenceTotal` from `evidenceReturned` and includes an event ID plus
|
|
233
|
+
Every evidence result distinguishes `evidenceTotal` from `evidenceReturned` and includes an event ID plus `sourceLocator.command` and `sourceLocator.contextCommand` drill-down commands. Use those locators before treating an Atlas summary as evidence.
|
|
194
234
|
|
|
195
235
|
## Candidate governance and review
|
|
196
236
|
|
|
@@ -266,6 +306,7 @@ cogmem prospective confirm --project openclaw --id <candidate-id> --evidence <us
|
|
|
266
306
|
## MCP and direct-plugin choice
|
|
267
307
|
|
|
268
308
|
- OpenClaw automatic hooks use the direct bridge installed by `connect --auto`.
|
|
309
|
+
- Start the MCP bridge with `cogmem mcp`; `cogmem-mcp` remains a compatibility bin for older host configs.
|
|
269
310
|
- Use MCP tools when an agent host supports MCP and needs explicit graph/review operations.
|
|
270
311
|
- Broad inventory/history: `cogmem_graph_explore`.
|
|
271
312
|
- Known node: `cogmem_graph_search`, then `cogmem_graph_node`.
|