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.
@@ -1,4 +1,4 @@
1
- # Cogmem 3.6.3 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` |
@@ -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
- COGMEM_SKIP_INIT=1 curl -fsSL https://raw.githubusercontent.com/liuqin164/cogmem/main/install.sh | bash
31
- cogmem init --yes --agent openclaw --scope project
32
- cogmem doctor
33
- cogmem connect openclaw --workspace . --auto --force --json
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
- If Bun is already installed and the operator prefers npm global installation:
40
+ Use this resolver in agent-run scripts:
37
41
 
38
42
  ```bash
39
- npm install -g cogmem@latest
40
- cogmem init --yes --agent openclaw --scope project
41
- cogmem connect openclaw --workspace . --auto --force --json
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.3 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`.
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 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.
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 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.
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`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cogmem",
3
3
 
4
- "version": "3.6.3",
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",