cogmem 3.6.4 → 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.
@@ -75,7 +75,9 @@ cogmem import-hermes --workspace . --project hermes
75
75
  After import:
76
76
 
77
77
  ```bash
78
+ cogmem memory plan --project hermes --json
78
79
  cogmem memory status --project hermes --json
80
+ cogmem memory candidates --project hermes --json
79
81
  cogmem episode status --project hermes --json
80
82
  cogmem dream status --project hermes --json
81
83
  cogmem dream tick --project hermes --mode auto --max-episodes 20 --json
@@ -101,13 +103,13 @@ cogmem import-hermes --workspace . --project hermes --session ./one.md --session
101
103
  The import command is idempotent. Re-running it against the same database skips records already processed by the cursor store. Imported raw records enter the same Episode Assembler used by live turns and are sealed at the explicit import batch boundary.
102
104
  Imported records are embedded through the configured kernel embedder during import.
103
105
 
104
- MCP recall JSON includes `decisionTrace`. Check its selected lane, reason, and candidate counts before concluding that a memory is absent, and use `sourceContext.locator.command` for exact wording. Raw text fallback searches the fully scoped ledger and prefers original user anchors over later assistant retellings when cue scores tie.
106
+ MCP recall JSON includes `decisionTrace`. Check its selected lane, reason, and candidate counts before concluding that a memory is absent, and use `sourceContext.locator.command` for exact wording. Raw text fallback searches the fully scoped ledger and prefers original user anchors over later assistant retellings when cue scores tie. For old-discussion questions, run `cogmem memory recall --query "<past discussion>" --intent historical_discussion --project hermes --agent hermes --json`, then follow `sourceLocator` or inspect `cogmem memory list --project hermes --since <globalSeq> --order asc --json`.
105
107
 
106
108
  Dream stores explicit user clarification as organizational correction evidence rather than an automatic contradiction. Assistant self-correction and negative-form questions do not create user-owned corrections. Resolve `needs_confirmation` with `cogmem_candidate_review` or `cogmem memory review`; maintenance only supersedes entries left stale past the default 30-day TTL.
107
109
 
108
- After upgrades, reload MCP. Rerun `cogmem connect hermes --workspace . --auto --force` when MCP wiring, allow-listed tools, or the installed skill bundle changed.
110
+ After upgrades, reload MCP. Rerun `cogmem connect hermes --workspace . --auto --force --json` when MCP wiring, allow-listed tools, or the installed skill bundle changed. Follow only JSON `nextCommands` for unattended agent work; operator/host actions are in `nextSteps` with `safeForAutomation=false`.
109
111
 
110
- Cogmem 3.6.4 exposes seven read-only/idempotent Memory Atlas query tools plus explicit `cogmem_graph_touch`, installs from npm by default, and prevents empty imported episodes from blocking Dream. Use explore for broad memory inventory/history, search and node for a known concept, path/neighbors for relations, timeline for ordered reconstruction, and normal recall for a direct fact. Query facets combine the user's actual project, time, topic, entity/target, memory-kind, action, and keyword conditions like table filters, so cold memory can be revived without requiring an entity-time-action tuple. Touch only nodes actually used, and follow returned event IDs to raw evidence before quoting exact wording.
112
+ Cogmem 3.6.5 exposes seven read-only/idempotent Memory Atlas query tools plus explicit `cogmem_graph_touch`, installs from npm by default, prevents empty imported episodes from blocking Dream, and adds an agent-safe operations protocol. Use `memory plan` for the next safe command, grouped `memory candidates --json` for queue state, `historical_discussion` recall for old-discussion questions, and returned `sourceLocator` commands for exact evidence. Only run `dream_tick` when it appears in `memory plan.nextActions`; `raw_dream_ledger_lag` in `nonBlocking` has `resolvableByDreamTick:false` and is not fixed by looping `dream tick`. Use explore for broad memory inventory/history, search and node for a known concept, path/neighbors for relations, timeline for ordered reconstruction, and normal recall for a direct fact. Query facets combine the user's actual project, time, topic, entity/target, memory-kind, action, and keyword conditions like table filters, so cold memory can be revived without requiring an entity-time-action tuple. Touch only nodes actually used, and follow returned event IDs or `sourceLocator` commands to raw evidence before quoting exact wording.
111
113
 
112
114
  ## Runtime
113
115
 
@@ -180,12 +180,14 @@ cogmem import-hermes --workspace . --project hermes --session ./hermes.normalize
180
180
 
181
181
  The importer is idempotent. Re-running it skips records already imported into the same memory database.
182
182
 
183
- Cogmem 3.6.4 skips import batch sealing for empty episode boundaries and Dream skips legacy empty episode jobs instead of blocking the whole queue. If `episode status` shows `dreamError` beginning with `episode_empty`, inspect the source events and use episode repair instead of editing SQLite rows.
183
+ Cogmem 3.6.4 and later skip import batch sealing for empty episode boundaries and Dream skips legacy empty episode jobs instead of blocking the whole queue. If `episode status` shows `dreamError` beginning with `episode_empty`, inspect the source events and use episode repair instead of editing SQLite rows.
184
184
 
185
185
  Run the maintenance loop under host supervision after import and during normal use. `needs_confirmation` is a human review queue, not the Dream backlog, and `memory govern` promotes only ordinary `candidate` rows:
186
186
 
187
187
  ```bash
188
+ cogmem memory plan --project hermes --json
188
189
  cogmem memory status --project hermes --json
190
+ cogmem memory candidates --project hermes --json
189
191
  cogmem episode status --project hermes --json
190
192
  cogmem dream status --project hermes --json
191
193
  cogmem dream tick --project hermes --mode auto --max-episodes 20 --json
@@ -196,6 +198,8 @@ cogmem memory review --project hermes --id <candidate-id> --action approve --act
196
198
  cogmem memory recall --query "<verification question>" --project hermes --agent hermes --json
197
199
  ```
198
200
 
201
+ `memory plan` is the first agent-safe health and next-action command. It explains which queues block release, which work is non-blocking, whether vectors are empty but fallback recall is available, and what command should run next. 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 when the operator asks for one queue.
202
+
199
203
  A host timer may run this bounded tick periodically. The tick exits after inspecting the backlog and performs no work when no sealed episode is ready.
200
204
 
201
205
  ## Active Memory Search
@@ -233,9 +237,25 @@ cogmem memory show --event <event-id> --before 2 --after 2 --json
233
237
 
234
238
  `sourceContext` entries include stable `label` values, optional `charRange` / `sourceRange`, and `sourceContext.window` metadata. Use `window.before.requestedCount`, `window.before.count`, `window.after.requestedCount`, `window.after.count`, `excludesAnchor`, `ordering`, `roleFilter`, and `overlapHandling` to understand the before/after replay. `memory show --json` returns the same contract, so the labels in MCP recall can be matched to the local CLI output.
235
239
 
240
+ For “did we discuss this before?”, “几个月前是不是聊过…”, “记忆黑盒”, MCP memory gaps, or other old-discussion questions, force the historical-discussion lane before saying memory is absent:
241
+
242
+ ```bash
243
+ cogmem memory recall --query "<past discussion question>" --intent historical_discussion --project hermes --agent hermes --json
244
+ ```
245
+
246
+ If the answer depends on exact wording or nearby context, run the returned `sourceLocator` or use a Raw Ledger cursor:
247
+
248
+ ```bash
249
+ cogmem memory show --event <eventId> --project hermes --before 2 --after 2 --json
250
+ cogmem memory list --project hermes --since <globalSeq> --order asc --json
251
+ ```
252
+
253
+ In 3.6.5, raw list rows and Atlas search/explore evidence include `sourceLocator.command` and a deeper `sourceLocator.contextCommand`. Use those commands before claiming an event ID is missing, before quoting exact words, or before treating an Atlas summary as the source.
254
+
236
255
  `vectors: 0` does not mean memory is unavailable. It means dense vector search has no hot index yet; `memory recall` still has governed raw-ledger fallback. Broad inventory questions are expanded into structured cues such as `库存管理`, `在库`, `产品コード`, and `数量`; when compiled candidates miss those cues, prefer the raw ledger result and use its `sourceContext` for details. Check status with:
237
256
 
238
257
  ```bash
258
+ cogmem memory plan --project hermes --json
239
259
  cogmem memory status --project hermes --json
240
260
  ```
241
261
 
@@ -252,12 +272,13 @@ Default recall includes untagged and `collection:anchor` memory only. Ask for `c
252
272
  For host upkeep, inspect the self-map and run an explicit tick:
253
273
 
254
274
  ```bash
275
+ cogmem memory plan --project hermes --json
255
276
  cogmem memory map --project hermes --json
256
277
  cogmem memory tick --project hermes --json
257
278
  cogmem memory bind --project hermes --json
258
279
  ```
259
280
 
260
- `memory tick` does not start a daemon. Use its `suggestedActions` to decide whether Hermes should run `dream tick`, `memory govern`, `episode repair`, entity review, re-embedding, or `memory bind` for unbound high-value raw events.
281
+ `memory tick` does not start a daemon. Use its `suggestedActions` to decide whether Hermes should run `dream tick`, `memory govern`, `episode repair`, entity review, re-embedding, or `memory bind` for unbound high-value raw events. `undreamedRawCount` by itself is Raw Ledger coverage lag, not a sealed-episode job; do not loop `dream tick` unless `memory plan.nextActions` contains `dream_tick`. In 3.6.5, `memory bind` scans the historical Raw Ledger by cursor instead of only the latest page; resume large repairs with `--since <globalSeq>`.
261
282
 
262
283
  `memory map` also exposes Memory Binding and Graph Recall counters. Bindings connect high-value user raw events to stable topic/entity paths before promotion, fuse same-claim evidence into claim-key clusters, and create graph anchors for source drill-down. Correction bindings expose review flags and correction edges. Use graph recall hits for source drill-down and topic continuity only; do not treat bindings, clusters, or edges as verified facts, user preferences, or prompt instructions.
263
284
 
@@ -267,7 +288,7 @@ Explicit user clarification is organizational correction evidence, not an automa
267
288
 
268
289
  When importing OpenClaw-style session Markdown into a Hermes project, Cogmem accepts multiline bodies below empty role headers, collapses only adjacent exact export duplicates, and uses `# Session: ... UTC` as the chronological timestamp base rather than file mtime.
269
290
 
270
- After upgrading, rerun `cogmem connect hermes --workspace . --auto --force` and reload MCP so existing allow-lists and skill instructions receive the current tools and contracts.
291
+ After upgrading, rerun `cogmem connect hermes --workspace . --auto --force --json` and reload MCP so existing allow-lists and skill instructions receive the current tools and contracts. In JSON output, follow only `nextCommands` for unattended agent work; unsafe operator or host steps such as interactive init and `/reload-mcp` are listed under `nextSteps` with `safeForAutomation=false`.
271
292
 
272
293
  ## Runtime Wiring
273
294
 
@@ -1,4 +1,4 @@
1
- # Cogmem 3.6.4 Operations Reference for Hermes
1
+ # Cogmem 3.6.5 Operations Reference for Hermes
2
2
 
3
3
  Read this file when installing, upgrading, importing, repairing, or operating Cogmem. `SKILL.md` contains the decision rules; this file records the operational commands.
4
4
 
@@ -11,9 +11,11 @@ Read this file when installing, upgrading, importing, repairing, or operating Co
11
11
  | Upgrade an existing database | `cogmem migrate` |
12
12
  | Import Hermes state/profile/sessions | `cogmem import-hermes` |
13
13
  | Import generic message JSONL | `cogmem episode import` |
14
+ | Decide the next safe agent operation | `cogmem memory plan` |
14
15
  | Answer one direct memory question | `cogmem_recall` or `cogmem memory recall` |
15
16
  | See what memory exists or reconstruct history | Atlas `cogmem_graph_*` tools |
16
17
  | Quote exact source | `cogmem memory show` |
18
+ | Audit ledger sequence ranges | `cogmem memory list --since/--until/--order` |
17
19
  | Resolve uncertain candidates | `cogmem_candidate_review` or `memory review` |
18
20
  | Promote ordinary candidates | `memory govern` |
19
21
  | Correct episode boundaries | `cogmem_episode_repair` or episode repair CLI |
@@ -74,7 +76,7 @@ cogmem doctor
74
76
  cogmem connect hermes --workspace . --auto --force --json
75
77
  ```
76
78
 
77
- The backed-up 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.4 schema-27 state in one run and preserves Raw Ledger evidence. `--dry-run` is read-only and does not create `_schema_migrations`. Reload MCP after reconnecting.
79
+ The backed-up 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 and preserves Raw Ledger evidence. `--dry-run` is read-only and does not create `_schema_migrations`. Reload MCP after reconnecting.
78
80
 
79
81
  ## Import Hermes memory
80
82
 
@@ -114,7 +116,9 @@ Use stable `externalMessageId` values for MCP append/import. If an MCP batch war
114
116
  After import, verify semantic maintenance in this exact order:
115
117
 
116
118
  ```bash
119
+ cogmem memory plan --project hermes --json
117
120
  cogmem memory status --project hermes --json
121
+ cogmem memory candidates --project hermes --json
118
122
  cogmem episode status --project hermes --json
119
123
  cogmem dream status --project hermes --json
120
124
  cogmem dream tick --project hermes --mode auto --max-episodes 20 --json
@@ -125,23 +129,27 @@ cogmem memory review --project hermes --id <candidate-id> --action approve --act
125
129
  cogmem memory recall --query "<verification question>" --project hermes --agent hermes --json
126
130
  ```
127
131
 
128
- `needs_confirmation` is not a Dream backlog. `memory govern` does not approve it. Use `memory review` with explicit evidence. Cogmem 3.6.4 skips import batch sealing for empty episode boundaries and marks 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.
132
+ `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.
129
133
 
130
134
  ## Inspect, recall, and drill down
131
135
 
132
136
  ```bash
137
+ cogmem memory plan --project hermes --json
133
138
  cogmem memory status --project hermes --json
139
+ cogmem memory candidates --project hermes --json
134
140
  cogmem memory candidates --project hermes --status needs_confirmation --json
135
141
  cogmem episode status --project hermes --json
136
142
  cogmem dream status --project hermes --json
137
143
  cogmem memory recall --query "<question>" --project hermes --agent hermes --json
144
+ cogmem memory recall --query "<past discussion question>" --intent historical_discussion --project hermes --agent hermes --json
138
145
  cogmem explain-recall --query "<question>" --project hermes --agent hermes --json
139
146
  cogmem memory show --event <event-id> --before 2 --after 2 --json
147
+ cogmem memory list --project hermes --since <globalSeq> --order asc --json
140
148
  ```
141
149
 
142
150
  JSON uses `cogmem.cli.v1`: object fields are top-level, arrays use `items`, and queue counters remain top-level. `vectors: 0` is not a recall failure; inspect `vectorState`.
143
151
 
144
- Read-only status/candidates use a lightweight SQLite path and should not require stopping the MCP server.
152
+ Use `historical_discussion` for “did we discuss this before?”, “几个月前是不是聊过…”, “记忆黑盒”, and missing MCP memory cases. Raw list rows include `sourceLocator`; run the locator before quoting exact words or saying the event cannot be found. Read-only plan/status/candidates use a lightweight SQLite path and should not require stopping the MCP server.
145
153
 
146
154
  ## Memory Atlas as composable filters
147
155
 
@@ -166,7 +174,7 @@ Use MCP by question shape:
166
174
  - Direct fact: `cogmem_recall`.
167
175
  - Exact source: follow `evidenceEventIds` with `memory show`.
168
176
 
169
- Graph reads are pure and declared read-only/idempotent. Call `cogmem_graph_touch` only after using selected nodes. Overview display alone must not change future ranking. `evidenceTotal` is all known evidence; `evidenceReturned` is the bounded payload.
177
+ Graph reads are pure and declared read-only/idempotent. Call `cogmem_graph_touch` only after using selected nodes. Overview display alone must not change future ranking. `evidenceTotal` is all known evidence; `evidenceReturned` is the bounded payload. Search/explore evidence includes `sourceLocator.command` and `sourceLocator.contextCommand`; use those locators before treating an Atlas summary as evidence.
170
178
 
171
179
  ## Candidate governance and review
172
180
 
@@ -97,12 +97,14 @@ cogmem import-openclaw --workspace . --project openclaw --json
97
97
  ```
98
98
 
99
99
  Real non-JSON imports print source-level and embedding+ingest progress to stderr. Use `--json --progress` to keep JSON on stdout while streaming progress to stderr, or `--no-progress` when a wrapper needs quiet stderr.
100
- Cogmem 3.6.4 skips import batch sealing for empty episode boundaries and skips legacy empty Dream jobs so one bad imported episode cannot block the queue.
100
+ Cogmem 3.6.4 and later skip import batch sealing for empty episode boundaries and skip legacy empty Dream jobs so one bad imported episode cannot block the queue.
101
101
 
102
102
  After import, use this order:
103
103
 
104
104
  ```bash
105
+ cogmem memory plan --project openclaw --json
105
106
  cogmem memory status --project openclaw --json
107
+ cogmem memory candidates --project openclaw --json
106
108
  cogmem episode status --project openclaw --json
107
109
  cogmem dream status --project openclaw --json
108
110
  cogmem dream tick --project openclaw --mode auto --max-episodes 20 --json
@@ -110,9 +112,10 @@ cogmem memory candidates --project openclaw --status candidate --json
110
112
  cogmem memory govern --project openclaw --limit 100 --json
111
113
  cogmem memory candidates --project openclaw --status needs_confirmation --json
112
114
  cogmem memory review --project openclaw --id <candidate-id> --action approve --actor <operator> --reason "confirmed by user" --confirmation-event <user-event-id> --json
115
+ cogmem memory recall --query "<verification question>" --project openclaw --agent openclaw --json
113
116
  ```
114
117
 
115
- `needs_confirmation` is not the Dream backlog. `memory govern` does not approve it; use `memory review` with explicit evidence.
118
+ `memory plan` is the first agent-safe health and next-action command. 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, `needs_confirmation`, and deferred review queues; use `--status` only when a human asks for one queue. `needs_confirmation` is not the Dream backlog. `memory govern` does not approve it; use `memory review` with explicit evidence.
116
119
 
117
120
  Import scope:
118
121
 
@@ -180,6 +183,8 @@ Recall behavior:
180
183
  - For each item with `sourceContext`, use event `label` values, optional `charRange` / `sourceRange`, and `sourceContext.window` to understand before/after semantics. Windows are chronological, exclude the anchor, and report overlap handling instead of relying on guesswork.
181
184
  - Use `cogmem memory map --project openclaw --json` to inspect Memory Binding and Graph Recall counters. Bindings attach high-value user raw events to stable topic/entity paths, fuse same-claim evidence into claim-key clusters, and create graph anchors for source drill-down only; they are not verified facts, user preferences, or instructions. Correction bindings expose review flags and `CORRECTS` / `CONTRADICTS` edges; inspect the raw ledger before relying on them.
182
185
  - If `cogmem memory tick --project openclaw --json` suggests `bind_raw_events`, run `cogmem memory bind --project openclaw --json` to backfill imported or adapter-written raw user events into the binding graph.
186
+ - For “did we discuss this before?”, “几个月前是不是聊过…”, “记忆黑盒”, or missing injection cases, run `cogmem memory recall --query "<past discussion question>" --intent historical_discussion --project openclaw --agent openclaw --json` before claiming no memory.
187
+ - For ledger audits or resumable checks, use `cogmem memory list --project openclaw --since <globalSeq> --order asc --json`; list rows and Atlas search/explore evidence include `sourceLocator` commands in 3.6.5.
183
188
 
184
189
  Installing the workspace skill makes the kernel procedure discoverable to OpenClaw agents. Installing the local auto wrapper makes future turns call the memory kernel automatically:
185
190
 
@@ -187,7 +192,7 @@ Installing the workspace skill makes the kernel procedure discoverable to OpenCl
187
192
  cogmem connect openclaw --workspace . --auto --force
188
193
  ```
189
194
 
190
- This writes `<workspace>/extensions/cogmem-auto-memory/`, patches OpenClaw `plugins.load.paths`, and enables `before_prompt_build` and `agent_end` hooks. The wrapper calls `KernelAgentMemoryBackend` through `cogmem` public API via a Bun bridge; core does not import OpenClaw.
195
+ This writes `<workspace>/extensions/cogmem-auto-memory/`, patches OpenClaw `plugins.load.paths`, and enables `before_prompt_build` and `agent_end` hooks. The wrapper calls `KernelAgentMemoryBackend` through `cogmem` public API via a Bun bridge; core does not import OpenClaw. In JSON output, follow only `nextCommands` for unattended agent work; unsafe operator or host steps such as interactive init and gateway restart are listed under `nextSteps` with `safeForAutomation=false`.
191
196
 
192
197
  The auto wrapper keeps OpenClaw native prompt/tool/skill context untouched. It prepends only Cogmem-owned context blocks:
193
198
 
@@ -78,20 +78,23 @@ The Dream Worker processes sealed episodes and proposes candidate memories only.
78
78
  For host-owned inspection and upkeep:
79
79
 
80
80
  ```bash
81
+ cogmem memory plan --project openclaw --json
81
82
  cogmem memory map --project openclaw --json
82
83
  cogmem memory tick --project openclaw --json
83
84
  cogmem memory bind --project openclaw --json
84
85
  ```
85
86
 
86
- Cogmem 3.6.4 keeps the 3.6.x Memory Atlas and OpenClaw reliability work, makes npm the default install and update channel, and prevents empty imported episodes from blocking Dream. The auto plugin uses one shared bridge/kernel lifecycle for graph exploration, evidence-bearing node/timeline drill-down, and recall, so OpenClaw does not need MCP for broad inventory/history questions. Atlas combines the query's actual project, time, topic, entity/target, memory-kind, action, and keyword conditions like table filters; no fixed entity-time-action tuple is required.
87
+ Cogmem 3.6.5 keeps the 3.6.x Memory Atlas and OpenClaw reliability work, makes npm the default install and update channel, prevents empty imported episodes from blocking Dream, and adds an agent-safe operations protocol. Use `memory plan` for the next safe command, grouped `memory candidates --json` for queue state, `historical_discussion` recall for old-discussion questions, and returned `sourceLocator` commands for exact evidence. Only run `dream_tick` when it appears in `memory plan.nextActions`; `raw_dream_ledger_lag` in `nonBlocking` has `resolvableByDreamTick:false` and is not fixed by looping `dream tick`. The auto plugin uses one shared bridge/kernel lifecycle for graph exploration, evidence-bearing node/timeline drill-down, and recall, so OpenClaw does not need MCP for broad inventory/history questions. Atlas combines the query's actual project, time, topic, entity/target, memory-kind, action, and keyword conditions like table filters; no fixed entity-time-action tuple is required.
87
88
 
88
89
  ```bash
90
+ cogmem memory plan --project openclaw --json
89
91
  cogmem memory graph-explore --project openclaw --query "去年与 Hermes 有关的决定" --json
90
92
  cogmem memory graph-node --project openclaw --id <node-id> --include-evidence --json
91
93
  cogmem memory graph-path --project openclaw --from <node-id> --to <node-id> --json
94
+ cogmem memory recall --query "几个月前我们是不是讨论过 Cogmem 的记忆黑盒" --intent historical_discussion --project openclaw --agent openclaw --json
92
95
  ```
93
96
 
94
- Use Atlas to locate a bounded source-backed slice, then use `memory show` for exact evidence. Graph reads do not change activation; explicitly touch only nodes the agent actually uses. Activation controls default visibility and decays during explicit maintenance; exact scoped facets can still revive cold memory without promoting or rewriting it.
97
+ Use Atlas to locate a bounded source-backed slice, then use `memory show` or the returned `sourceLocator` for exact evidence. Graph reads do not change activation; explicitly touch only nodes the agent actually uses. Activation controls default visibility and decays during explicit maintenance; exact scoped facets can still revive cold memory without promoting or rewriting it.
95
98
 
96
99
  `memory tick` returns activation decay results and `suggestedActions`; it does not start a hidden daemon. If it reports `bind_raw_events`, run `memory bind` to attach imported or adapter-written raw user events to Memory Binding.
97
100
 
@@ -126,7 +129,9 @@ cogmem import-openclaw --workspace . --project openclaw
126
129
  After import:
127
130
 
128
131
  ```bash
132
+ cogmem memory plan --project openclaw --json
129
133
  cogmem memory status --project openclaw --json
134
+ cogmem memory candidates --project openclaw --json
130
135
  cogmem episode status --project openclaw --json
131
136
  cogmem dream status --project openclaw --json
132
137
  cogmem dream tick --project openclaw --mode auto --max-episodes 20 --json
@@ -176,12 +176,14 @@ cogmem import-openclaw --workspace . --project openclaw --json
176
176
 
177
177
  The importer is idempotent. Re-running it skips records already imported into the same memory database.
178
178
  Real non-JSON imports print source-level and embedding+ingest progress to stderr. Use `--json --progress` to keep JSON on stdout while streaming progress to stderr, or `--no-progress` when a wrapper needs quiet stderr.
179
- Cogmem 3.6.4 skips import batch sealing for empty episode boundaries and Dream skips legacy empty episode jobs instead of blocking the whole queue. If `episode status` shows `dreamError` beginning with `episode_empty`, inspect the source events and use episode repair instead of editing SQLite rows.
179
+ Cogmem 3.6.4 and later skip import batch sealing for empty episode boundaries and Dream skips legacy empty episode jobs instead of blocking the whole queue. If `episode status` shows `dreamError` beginning with `episode_empty`, inspect the source events and use episode repair instead of editing SQLite rows.
180
180
 
181
181
  After import, run the maintenance loop in this order. `needs_confirmation` is a human review queue, not the Dream backlog, and `memory govern` promotes only ordinary `candidate` rows:
182
182
 
183
183
  ```bash
184
+ cogmem memory plan --project openclaw --json
184
185
  cogmem memory status --project openclaw --json
186
+ cogmem memory candidates --project openclaw --json
185
187
  cogmem episode status --project openclaw --json
186
188
  cogmem dream status --project openclaw --json
187
189
  cogmem dream tick --project openclaw --mode auto --max-episodes 20 --json
@@ -192,6 +194,8 @@ cogmem memory review --project openclaw --id <candidate-id> --action approve --a
192
194
  cogmem memory recall --query "<verification question>" --project openclaw --agent openclaw --json
193
195
  ```
194
196
 
197
+ `memory plan` is the first agent-safe health and next-action command. It explains which queues block release, which work is non-blocking, whether vectors are empty but fallback recall is available, and what command should run next. 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 when the operator asks for one queue.
198
+
195
199
  Imported sources:
196
200
 
197
201
  - `USER.md` as user profile memory.
@@ -288,15 +292,17 @@ Useful intents:
288
292
  ```bash
289
293
  cogmem memory recall --query "上个会话我们聊了什么" --intent previous_session_summary --project openclaw --agent openclaw --session "$OPENCLAW_SESSION_ID" --exclude-session "$OPENCLAW_SESSION_ID" --json
290
294
  cogmem memory recall --query "我关于记忆黑盒问题的原话是什么" --intent forensic_quote --project openclaw --agent openclaw --json
295
+ cogmem memory recall --query "几个月前我们是不是讨论过 Cogmem 的记忆黑盒" --intent historical_discussion --project openclaw --agent openclaw --json
291
296
  ```
292
297
 
293
298
  Use `items[].sourceContext` to understand what the user asked, how the agent answered, and nearby context. If the item has `sourceContext.locator.command`, run that command for a fuller local replay:
294
299
 
295
300
  ```bash
296
301
  cogmem memory show --event <eventId> --before 2 --after 2 --json
302
+ cogmem memory list --project openclaw --since <globalSeq> --order asc --json
297
303
  ```
298
304
 
299
- For old memories, a `raw_ledger` result may come from full scoped ledger text fallback even when Chinese FTS has no direct hit. Equal matches prefer the original user event; use `sourceContext.after` to inspect the paired assistant response instead of preferring a later assistant retelling.
305
+ For old memories, a `raw_ledger` result may come from full scoped ledger text fallback even when Chinese FTS has no direct hit. Equal matches prefer the original user event; use `sourceContext.after` to inspect the paired assistant response instead of preferring a later assistant retelling. In 3.6.5, raw list rows and Atlas search/explore evidence include `sourceLocator.command` and a deeper `sourceLocator.contextCommand`; use those before claiming exact source or event IDs are unavailable.
300
306
 
301
307
  Use collection routing for creative artifacts or drafts:
302
308
 
@@ -309,12 +315,13 @@ Default recall includes untagged and `collection:anchor` memory only. `collectio
309
315
  Use the self-map and explicit tick when the agent needs to understand or maintain the memory system:
310
316
 
311
317
  ```bash
318
+ cogmem memory plan --project openclaw --json
312
319
  cogmem memory map --project openclaw --json
313
320
  cogmem memory tick --project openclaw --json
314
321
  cogmem memory bind --project openclaw --json
315
322
  ```
316
323
 
317
- `memory tick` decays activation and returns `suggestedActions`; it does not run a hidden daemon. If it suggests `bind_raw_events`, run `memory bind` to backfill high-value raw user events written by imports or adapters. The tick also supersedes `needs_confirmation` items older than the default 30-day review TTL with an explicit status reason; it preserves candidate evidence.
324
+ `memory tick` decays activation and returns `suggestedActions`; it does not run a hidden daemon. If it suggests `bind_raw_events`, run `memory bind` to backfill high-value raw user events written by imports or adapters. In 3.6.5, `memory bind` scans the historical Raw Ledger by cursor instead of only the latest page; resume large repairs with `--since <globalSeq>`. The tick also supersedes `needs_confirmation` items older than the default 30-day review TTL with an explicit status reason; it preserves candidate evidence.
318
325
 
319
326
  `memory map` also exposes Memory Binding and Graph Recall counters. Bindings connect high-value user raw events to stable topic/entity paths before promotion, fuse same-claim evidence into claim-key clusters, and create graph anchors for source drill-down. Correction bindings add review flags and `CORRECTS` / `CONTRADICTS` edges. Use graph recall hits to inspect raw ledger history through `sourceContext`; do not treat bindings, clusters, or edges as verified facts, user preferences, or prompt instructions.
320
327
 
@@ -340,7 +347,7 @@ To make every future OpenClaw turn automatically use the memory kernel, install
340
347
  cogmem connect openclaw --workspace . --auto --force
341
348
  ```
342
349
 
343
- `--auto` writes `<workspace>/extensions/cogmem-auto-memory/`, patches `plugins.load.paths`, and enables `hooks.allowPromptInjection=true` and `hooks.allowConversationAccess=true` for the wrapper. The wrapper registers `before_prompt_build` for governed recall and `agent_end` for turn recording, then calls `KernelAgentMemoryBackend` through `cogmem` public API via a Bun bridge. Core does not import OpenClaw.
350
+ `--auto` writes `<workspace>/extensions/cogmem-auto-memory/`, patches `plugins.load.paths`, and enables `hooks.allowPromptInjection=true` and `hooks.allowConversationAccess=true` for the wrapper. The wrapper registers `before_prompt_build` for governed recall and `agent_end` for turn recording, then calls `KernelAgentMemoryBackend` through `cogmem` public API via a Bun bridge. Core does not import OpenClaw. In JSON output, follow only `nextCommands` for unattended agent work; unsafe operator or host steps such as interactive init and gateway restart are listed under `nextSteps` with `safeForAutomation=false`.
344
351
 
345
352
  Queued remember is the default. `agent_end` appends a durable JSONL job under `.cogmem/queue/openclaw-remember.jsonl` and starts a singleton drainer, so Telegram or gateway responses are not blocked by embeddings, SQLite writes, or slow local models. Plugin 0.6.3 acquires the queue lock before opening Cogmem, recovers stale lock directories and stale `.processing` queue files older than `rememberDrainTimeoutMs`, writes `owner.json` lock metadata, and processes bounded batches controlled by `rememberDrainBatchSize` (default `20`). If a drain fails, the job is retried and then moved to a dead-letter file instead of being silently discarded.
346
353
 
@@ -409,7 +416,7 @@ For periodic curation, let the host timer wake one bounded tick:
409
416
  cogmem dream tick --project openclaw --mode auto --max-episodes 10 --json
410
417
  ```
411
418
 
412
- The timer does not force a full Dream run. `dream tick` inspects sealed episode jobs, chooses no work, micro, normal, or deep mode, then exits. Run `cogmem memory govern` separately; candidates stay pending until governance evaluates them.
419
+ The timer does not force a full Dream run. `dream tick` inspects sealed episode jobs, chooses no work, micro, normal, or deep mode, then exits. `undreamedRawCount` by itself is Raw Ledger coverage lag, not a sealed-episode job; do not loop `dream tick` unless `memory plan.nextActions` contains `dream_tick`. Run `cogmem memory govern` separately; candidates stay pending until governance evaluates them.
413
420
 
414
421
  Episode classification is contextual but remains CPU-owned in the live hook. Short user replies are interpreted against whether the previous assistant turn was a proposal, question, or factual statement. Unknown turns default to an ambiguous review boundary; continuation needs explicit continuation language or topic/entity/project overlap. Background import or repair may use hybrid review, but normalized reviewer fields are allow-listed and cannot write belief, entity, temporal, prospective, topic, or governance state.
415
422
 
@@ -437,7 +444,8 @@ After package updates or config drift, repair the host wiring:
437
444
 
438
445
  ```bash
439
446
  cogmem connect openclaw --workspace . --auto --force
440
- cogmem doctor --fix --agent openclaw --workspace .
447
+ cogmem doctor --fix --agent openclaw --workspace . --plugin-only --json
448
+ openclaw gateway restart
441
449
  ```
442
450
 
443
451
  The wrapper maps OpenClaw behavior to core like this:
@@ -1,4 +1,4 @@
1
- # Cogmem 3.6.4 Operations Reference for OpenClaw
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` |
@@ -83,7 +85,7 @@ openclaw gateway restart
83
85
  cogmem openclaw diagnose --workspace . --json
84
86
  ```
85
87
 
86
- 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.4 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`.
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`.
87
89
 
88
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:
89
91
 
@@ -137,7 +139,9 @@ cogmem import-openclaw --workspace . --project openclaw --json
137
139
  After import, verify semantic maintenance in this exact order:
138
140
 
139
141
  ```bash
142
+ cogmem memory plan --project openclaw --json
140
143
  cogmem memory status --project openclaw --json
144
+ cogmem memory candidates --project openclaw --json
141
145
  cogmem episode status --project openclaw --json
142
146
  cogmem dream status --project openclaw --json
143
147
  cogmem dream tick --project openclaw --mode auto --max-episodes 20 --json
@@ -148,7 +152,7 @@ cogmem memory review --project openclaw --id <candidate-id> --action approve --a
148
152
  cogmem memory recall --query "<verification question>" --project openclaw --agent openclaw --json
149
153
  ```
150
154
 
151
- `needs_confirmation` is not a Dream backlog. `memory govern` does not approve it. Use `memory review` with explicit evidence. Cogmem 3.6.4 skips import batch sealing for empty episode boundaries and marks 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.
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.
152
156
 
153
157
  Pass explicit sources when discovery is not enough:
154
158
 
@@ -169,7 +173,9 @@ Use `--start-line`, `--end-line`, or `--max-lines` to split controlled runs. Pre
169
173
  ## Read-only inspection and JSON
170
174
 
171
175
  ```bash
176
+ cogmem memory plan --project openclaw --json
172
177
  cogmem memory status --project openclaw --json
178
+ cogmem memory candidates --project openclaw --json
173
179
  cogmem memory candidates --project openclaw --status needs_confirmation --json
174
180
  cogmem episode status --project openclaw --json
175
181
  cogmem dream status --project openclaw --json
@@ -177,7 +183,7 @@ cogmem dream status --project openclaw --json
177
183
 
178
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.
179
185
 
180
- `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.
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.
181
187
 
182
188
  ## Recall and source drill-down
183
189
 
@@ -185,6 +191,7 @@ Use recall for a direct factual question:
185
191
 
186
192
  ```bash
187
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
188
195
  cogmem explain-recall --query "<question>" --project openclaw --agent openclaw --json
189
196
  ```
190
197
 
@@ -192,8 +199,12 @@ Follow returned evidence, never a summary alone:
192
199
 
193
200
  ```bash
194
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
195
204
  ```
196
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
+
197
208
  ## Memory Atlas
198
209
 
199
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.
@@ -219,7 +230,7 @@ Use `--no-refresh` during lock incidents and `--refresh` when the operator wants
219
230
 
220
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.
221
232
 
222
- Every evidence result distinguishes `evidenceTotal` from `evidenceReturned` and includes an event ID plus a `memory show` drill-down command.
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.
223
234
 
224
235
  ## Candidate governance and review
225
236
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cogmem",
3
3
 
4
- "version": "3.6.4",
4
+ "version": "3.6.5",
5
5
 
6
6
  "type": "module",
7
7
  "description": "cogmem — agent-native memory kernel for a single local-first AI agent",