cogmem 3.6.4 → 3.7.0
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 +24 -0
- package/MEMORY_ATLAS.md +47 -10
- package/README.md +36 -13
- package/RELEASE_CHECKLIST.md +7 -4
- package/dist/agent/AgentMemoryBackend.d.ts +19 -2
- package/dist/agent/AgentMemoryBackend.js +134 -3
- package/dist/agent/AgentRecallQueryCompiler.d.ts +1 -1
- package/dist/agent/AgentRecallQueryCompiler.js +12 -0
- package/dist/atlas/EpisodeTitleGenerator.d.ts +31 -0
- package/dist/atlas/EpisodeTitleGenerator.js +152 -0
- package/dist/atlas/FacetQueryPlanner.d.ts +31 -0
- package/dist/atlas/FacetQueryPlanner.js +188 -0
- package/dist/atlas/GraphCurator.d.ts +27 -0
- package/dist/atlas/GraphCurator.js +397 -0
- package/dist/atlas/MemoryAtlasIndexer.d.ts +3 -0
- package/dist/atlas/MemoryAtlasIndexer.js +19 -6
- package/dist/atlas/MemoryAtlasService.d.ts +5 -1
- package/dist/atlas/MemoryAtlasService.js +165 -12
- package/dist/atlas/MemoryAtlasTypes.d.ts +89 -11
- package/dist/bin/connect.js +85 -13
- package/dist/bin/memory.js +221 -18
- package/dist/factory.d.ts +2 -0
- package/dist/factory.js +36 -18
- package/dist/host/openclaw/AutoMemoryPluginInstaller.js +83 -10
- package/dist/mcp/server.js +1 -1
- package/dist/store/EventStore.d.ts +6 -0
- package/dist/store/EventStore.js +28 -2
- package/dist/store/MemoryAtlasStore.d.ts +10 -1
- package/dist/store/MemoryAtlasStore.js +228 -14
- package/dist/types/index.d.ts +3 -0
- package/examples/hermes-backend/AGENTS.md +11 -5
- package/examples/hermes-backend/README.md +5 -3
- package/examples/hermes-backend/SKILL.md +28 -5
- package/examples/hermes-backend/references/operations.md +16 -6
- package/examples/openclaw-backend/AGENTS.md +9 -3
- package/examples/openclaw-backend/README.md +9 -3
- package/examples/openclaw-backend/SKILL.md +23 -10
- package/examples/openclaw-backend/references/operations.md +21 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cogmem 3.
|
|
1
|
+
# Cogmem 3.7.0 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.
|
|
79
|
+
The backed-up command upgrades 3.5.2 schema 24, an existing 3.6.x database, or a pre-release schema-25 test database to the current 3.7.0 schema/projection 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,32 +129,38 @@ 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
|
|
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 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.
|
|
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
|
|
|
148
|
-
Atlas uses any available project,
|
|
156
|
+
Atlas uses any available project, day/month/year, topic, issue, entity/target, session/thread, memory-kind, action-kind, and text facets together. It does not require an entity + time + operation tuple. A canonical episode appears once even if it is reached through several facets.
|
|
149
157
|
|
|
150
158
|
```bash
|
|
151
159
|
cogmem memory graph --project hermes --json
|
|
152
160
|
cogmem memory graph-search --project hermes --query "Hermes" --json
|
|
153
161
|
cogmem memory graph-explore --project hermes --query "2025 年 Hermes 的决策" --now 1782057600000 --evidence-limit 2 --json
|
|
162
|
+
cogmem memory graph-explore --project hermes --query "6月6号关于记忆黑盒聊过什么" --json
|
|
163
|
+
cogmem memory graph-explore --project hermes --query "记忆黑盒后来有没有继续讨论" --json
|
|
154
164
|
cogmem memory graph-node --project hermes --id <node-id> --include-evidence --evidence-limit 4 --json
|
|
155
165
|
cogmem memory graph-neighbors --project hermes --id <node-id> --hops 2 --json
|
|
156
166
|
cogmem memory graph-path --project hermes --from <node-id> --to <node-id> --json
|
|
@@ -166,7 +176,7 @@ Use MCP by question shape:
|
|
|
166
176
|
- Direct fact: `cogmem_recall`.
|
|
167
177
|
- Exact source: follow `evidenceEventIds` with `memory show`.
|
|
168
178
|
|
|
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.
|
|
179
|
+
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. Search/explore may return `cards[]` for canonical episodes. Use `cards[].displayTitle` for UI/readability, `oneLineSummary` as a hint, `matchedFacets` and `matchedPaths` to explain why it matched, and `canonicalId` to dedupe. `relatedButNotSelected` is context only; do not substitute it as the answer. If `relaxationTrace` exists, say the match was relaxed. `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
180
|
|
|
171
181
|
## Candidate governance and review
|
|
172
182
|
|
|
@@ -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
|
|
100
|
+
Cogmem skips import batch sealing for empty episode boundaries and skips 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,9 @@ 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.
|
|
188
|
+
- For old-discussion or "do you remember" questions, prefer `cogmem memory recall --intent historical_discussion ...` or `cogmem memory graph-explore ... --json`. In 3.7.0, cards carry `canonicalId`, `matchedFacets`, `matchedPaths`, `relatedButNotSelected`, and `sourceLocator`; answer from the selected canonical card, not from a related-but-not-selected side card.
|
|
183
189
|
|
|
184
190
|
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
191
|
|
|
@@ -187,7 +193,7 @@ Installing the workspace skill makes the kernel procedure discoverable to OpenCl
|
|
|
187
193
|
cogmem connect openclaw --workspace . --auto --force
|
|
188
194
|
```
|
|
189
195
|
|
|
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.
|
|
196
|
+
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
197
|
|
|
192
198
|
The auto wrapper keeps OpenClaw native prompt/tool/skill context untouched. It prepends only Cogmem-owned context blocks:
|
|
193
199
|
|
|
@@ -78,20 +78,24 @@ 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.
|
|
87
|
+
Cogmem 3.7.0 keeps npm as the default install/update channel and upgrades Memory Atlas into a multi-dimensional navigation graph. 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, day/month/year, topic, issue, entity/target, session/thread, memory-kind, action-kind, and keyword conditions like table filters; no fixed entity-time-action tuple is required. Prefer returned `cards[]` for historical discussion: `canonicalId` dedupes the episode, `matchedFacets` explains why it matched, `relatedButNotSelected` is only side context, and `sourceLocator` opens the raw evidence.
|
|
87
88
|
|
|
88
89
|
```bash
|
|
90
|
+
cogmem memory plan --project openclaw --json
|
|
89
91
|
cogmem memory graph-explore --project openclaw --query "去年与 Hermes 有关的决定" --json
|
|
92
|
+
cogmem memory graph-explore --project openclaw --query "6月6号关于记忆黑盒聊过什么" --json
|
|
90
93
|
cogmem memory graph-node --project openclaw --id <node-id> --include-evidence --json
|
|
91
94
|
cogmem memory graph-path --project openclaw --from <node-id> --to <node-id> --json
|
|
95
|
+
cogmem memory recall --query "几个月前我们是不是讨论过 Cogmem 的记忆黑盒" --intent historical_discussion --project openclaw --agent openclaw --json
|
|
92
96
|
```
|
|
93
97
|
|
|
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.
|
|
98
|
+
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
99
|
|
|
96
100
|
`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
101
|
|
|
@@ -126,7 +130,9 @@ cogmem import-openclaw --workspace . --project openclaw
|
|
|
126
130
|
After import:
|
|
127
131
|
|
|
128
132
|
```bash
|
|
133
|
+
cogmem memory plan --project openclaw --json
|
|
129
134
|
cogmem memory status --project openclaw --json
|
|
135
|
+
cogmem memory candidates --project openclaw --json
|
|
130
136
|
cogmem episode status --project openclaw --json
|
|
131
137
|
cogmem dream status --project openclaw --json
|
|
132
138
|
cogmem dream tick --project openclaw --mode auto --max-episodes 20 --json
|
|
@@ -224,7 +230,7 @@ To make future OpenClaw turns automatically recall and record memory, run:
|
|
|
224
230
|
cogmem connect openclaw --workspace . --auto --force
|
|
225
231
|
```
|
|
226
232
|
|
|
227
|
-
`--auto` installs `<workspace>/extensions/cogmem-auto-memory/`, patches OpenClaw `plugins.load.paths`, and enables a local plugin wrapper with `before_prompt_build` and `agent_end` hooks. The wrapper calls `KernelAgentMemoryBackend` through the public `cogmem` API via a Bun bridge; core still does not import OpenClaw. Plugin 0.
|
|
233
|
+
`--auto` installs `<workspace>/extensions/cogmem-auto-memory/`, patches OpenClaw `plugins.load.paths`, and enables a local plugin wrapper with `before_prompt_build` and `agent_end` hooks. The wrapper calls `KernelAgentMemoryBackend` through the public `cogmem` API via a Bun bridge; core still does not import OpenClaw. Plugin 0.7.0 uses singleton queue/spawn locks, stale-lock and stale-processing recovery, and bounded remember batches so queued `agent_end` recording does not hold SQLite open longer than necessary.
|
|
228
234
|
|
|
229
235
|
The wrapper does not rewrite OpenClaw's native prompt, tool instructions, skills, or conversation order. It only prepends Cogmem-owned blocks:
|
|
230
236
|
|
|
@@ -114,7 +114,7 @@ timeout_ms = 60000
|
|
|
114
114
|
|
|
115
115
|
## Migrate Existing OpenClaw Memory
|
|
116
116
|
|
|
117
|
-
Upgrade a 3.5.2 database, an existing 3.6.
|
|
117
|
+
Upgrade a 3.5.2 database, an existing 3.6.x database, or a pre-release schema-25 test database to the current 3.7.0 schema/projection set in one backed-up command:
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
cogmem migrate --yes --backup --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
|
|
179
|
+
Cogmem 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.
|
|
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.
|
|
@@ -266,6 +270,7 @@ For broad inventory, project history, or relationship questions, navigate Memory
|
|
|
266
270
|
|
|
267
271
|
```bash
|
|
268
272
|
cogmem memory graph-explore --project openclaw --query "我们关于 Hermes 做过哪些工作" --json
|
|
273
|
+
cogmem memory graph-explore --project openclaw --query "6月6号关于记忆黑盒聊过什么" --json
|
|
269
274
|
cogmem memory graph-node --project openclaw --id <node-id> --include-evidence --json
|
|
270
275
|
cogmem memory graph-path --project openclaw --from <node-id> --to <node-id> --json
|
|
271
276
|
cogmem memory graph-timeline --project openclaw --query "去年与 Hermes 有关的决定和操作" --json
|
|
@@ -273,9 +278,13 @@ cogmem memory graph-timeline --project openclaw --query "去年与 Hermes 有关
|
|
|
273
278
|
|
|
274
279
|
Graph reads default to stale-safe diagnostics. If a drainer or gateway has SQLite busy, JSON may include `atlasFresh=false` and `refreshError` while returning the existing projection. Use `--refresh` when the operator explicitly wants rebuild-or-fail, and `--no-refresh` when investigating locks.
|
|
275
280
|
|
|
276
|
-
Atlas combines the conditions present in the user's message like table filters. Do not force every question into entity + time + action. Project,
|
|
281
|
+
Atlas combines the conditions present in the user's message like table filters. Do not force every question into entity + time + action. Project, day/month/year, topic, issue, entity/target, session/thread, memory kind, action kind, and ordinary cues may independently or jointly revive cold nodes. Graph reads do not change activation; explicitly touch only nodes the agent actually uses. Activation changes visibility only.
|
|
282
|
+
|
|
283
|
+
In 3.7.0, `graph-search`, `graph-explore`, and historical recall can return `cards[]`. Prefer cards over raw node labels for past-discussion questions. A card's `canonicalId` is the single episode identity; `matchedFacets` explains time/topic/issue/entity matches; `matchedPaths` explains how the card was reached; `relatedButNotSelected` is context only and must not replace the selected answer; `sourceLocator.command` is the command to inspect exact original text. If `relaxationTrace` exists, say the answer is a relaxed nearby match, not an exact hit.
|
|
284
|
+
|
|
285
|
+
Follow returned `sourceLocator.command` or event IDs with `cogmem memory show`; never treat an Atlas summary or title as evidence.
|
|
277
286
|
|
|
278
|
-
The OpenClaw auto plugin calls the Atlas core directly and injects
|
|
287
|
+
The OpenClaw auto plugin calls the Atlas core directly and injects bounded volatile `<COGMEM_RECALL_CONTEXT>` / `<COGMEM_MEMORY_ATLAS>` blocks. For `historical_discussion`, the recall context includes selected episode cards, `matchedFacets`, `selectedLane`, `strictFacetsMatched`-style decision metadata when available, `relatedButNotSelected`, and `relaxationTrace`. It does not require MCP. Use normal `memory recall` for a direct factual question and `memory show` for exact wording.
|
|
279
288
|
|
|
280
289
|
If `<COGMEM_RECALL_CONTEXT>` is absent, thin, or does not answer the user's question, do not answer "I do not remember" until you actively query CogMem. Use the kernel first, not the old `memory/` Markdown files:
|
|
281
290
|
|
|
@@ -288,15 +297,17 @@ Useful intents:
|
|
|
288
297
|
```bash
|
|
289
298
|
cogmem memory recall --query "上个会话我们聊了什么" --intent previous_session_summary --project openclaw --agent openclaw --session "$OPENCLAW_SESSION_ID" --exclude-session "$OPENCLAW_SESSION_ID" --json
|
|
290
299
|
cogmem memory recall --query "我关于记忆黑盒问题的原话是什么" --intent forensic_quote --project openclaw --agent openclaw --json
|
|
300
|
+
cogmem memory recall --query "几个月前我们是不是讨论过 Cogmem 的记忆黑盒" --intent historical_discussion --project openclaw --agent openclaw --json
|
|
291
301
|
```
|
|
292
302
|
|
|
293
303
|
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
304
|
|
|
295
305
|
```bash
|
|
296
306
|
cogmem memory show --event <eventId> --before 2 --after 2 --json
|
|
307
|
+
cogmem memory list --project openclaw --since <globalSeq> --order asc --json
|
|
297
308
|
```
|
|
298
309
|
|
|
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.
|
|
310
|
+
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. 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
311
|
|
|
301
312
|
Use collection routing for creative artifacts or drafts:
|
|
302
313
|
|
|
@@ -309,12 +320,13 @@ Default recall includes untagged and `collection:anchor` memory only. `collectio
|
|
|
309
320
|
Use the self-map and explicit tick when the agent needs to understand or maintain the memory system:
|
|
310
321
|
|
|
311
322
|
```bash
|
|
323
|
+
cogmem memory plan --project openclaw --json
|
|
312
324
|
cogmem memory map --project openclaw --json
|
|
313
325
|
cogmem memory tick --project openclaw --json
|
|
314
326
|
cogmem memory bind --project openclaw --json
|
|
315
327
|
```
|
|
316
328
|
|
|
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.
|
|
329
|
+
`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. `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
330
|
|
|
319
331
|
`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
332
|
|
|
@@ -340,9 +352,9 @@ To make every future OpenClaw turn automatically use the memory kernel, install
|
|
|
340
352
|
cogmem connect openclaw --workspace . --auto --force
|
|
341
353
|
```
|
|
342
354
|
|
|
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.
|
|
355
|
+
`--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
356
|
|
|
345
|
-
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.
|
|
357
|
+
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.7.0 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
358
|
|
|
347
359
|
When automatic memory recording looks stuck, do not delete queue files first. Diagnose the plugin and locks:
|
|
348
360
|
|
|
@@ -409,7 +421,7 @@ For periodic curation, let the host timer wake one bounded tick:
|
|
|
409
421
|
cogmem dream tick --project openclaw --mode auto --max-episodes 10 --json
|
|
410
422
|
```
|
|
411
423
|
|
|
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.
|
|
424
|
+
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
425
|
|
|
414
426
|
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
427
|
|
|
@@ -437,7 +449,8 @@ After package updates or config drift, repair the host wiring:
|
|
|
437
449
|
|
|
438
450
|
```bash
|
|
439
451
|
cogmem connect openclaw --workspace . --auto --force
|
|
440
|
-
cogmem doctor --fix --agent openclaw --workspace .
|
|
452
|
+
cogmem doctor --fix --agent openclaw --workspace . --plugin-only --json
|
|
453
|
+
openclaw gateway restart
|
|
441
454
|
```
|
|
442
455
|
|
|
443
456
|
The wrapper maps OpenClaw behavior to core like this:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cogmem 3.
|
|
1
|
+
# Cogmem 3.7.0 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.
|
|
88
|
+
The second command upgrades 3.5.2 schema 24, an existing 3.6.x database, or a pre-release schema-25 test database to the current 3.7.0 schema/projection 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
|
|
|
@@ -96,9 +98,9 @@ Use `cogmem openclaw diagnose --workspace . --json` when automatic memory blocks
|
|
|
96
98
|
- `plugin.current=false`: generated files are stale; run plugin-only fix and restart gateway.
|
|
97
99
|
- no `audit.lastBeforePromptBuild`: plugin is not loaded or the hook did not fire.
|
|
98
100
|
- `audit.lastBeforePromptBuild.action=error`: bridge or DB failure; inspect `reason`, `bridgeCommand`, and `dbLocked`.
|
|
99
|
-
- `action=inject` but no visible block: inspect `returnedInjectionShape`. Plugin 0.
|
|
101
|
+
- `action=inject` but no visible block: inspect `returnedInjectionShape`. Plugin 0.7.0 returns `prependContext`, `context`, and `promptPrefix`; if OpenClaw still ignores all three, the host hook contract changed and the OpenClaw plugin API must be checked before blaming recall.
|
|
100
102
|
|
|
101
|
-
Plugin 0.
|
|
103
|
+
Plugin 0.7.0 queue behavior:
|
|
102
104
|
|
|
103
105
|
- `agent_end` only appends durable JSONL jobs, then starts at most one drainer through queue/spawn locks.
|
|
104
106
|
- `drain-remember-queue` acquires the queue lock before opening Cogmem or SQLite. A second drainer exits without opening the DB.
|
|
@@ -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
|
|
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 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.
|
|
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
|
|
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,16 +199,22 @@ 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
|
-
Atlas combines whichever facets the question supplies, like table filters. Supported constraints include project,
|
|
210
|
+
Atlas combines whichever facets the question supplies, like table filters. Supported constraints include project, day/month/year, topic, issue, entity/target, session/thread, memory kind, action kind, and ordinary text cues. Do not require a fixed entity + time + action tuple. A canonical episode appears once even if it is reached through several facets.
|
|
200
211
|
|
|
201
212
|
```bash
|
|
202
213
|
cogmem memory graph --project openclaw --json
|
|
203
214
|
cogmem memory graph-search --project openclaw --query "Hermes" --json
|
|
204
215
|
cogmem memory graph-explore --project openclaw --query "2025 年 Hermes 的决策" --now 1782057600000 --evidence-limit 2 --json
|
|
216
|
+
cogmem memory graph-explore --project openclaw --query "6月6号关于记忆黑盒聊过什么" --json
|
|
217
|
+
cogmem memory graph-explore --project openclaw --query "记忆黑盒后来有没有继续讨论" --json
|
|
205
218
|
cogmem memory graph-node --project openclaw --id <node-id> --include-evidence --evidence-limit 4 --json
|
|
206
219
|
cogmem memory graph-neighbors --project openclaw --id <node-id> --hops 2 --json
|
|
207
220
|
cogmem memory graph-path --project openclaw --from <node-id> --to <node-id> --json
|
|
@@ -219,7 +232,7 @@ Use `--no-refresh` during lock incidents and `--refresh` when the operator wants
|
|
|
219
232
|
|
|
220
233
|
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
234
|
|
|
222
|
-
Every evidence result distinguishes `evidenceTotal` from `evidenceReturned` and includes an event ID plus
|
|
235
|
+
Search/explore may return `cards[]` for canonical episodes. Use `cards[].displayTitle` for UI/readability, `oneLineSummary` as a hint, `matchedFacets` and `matchedPaths` to explain why it matched, and `canonicalId` to dedupe. `relatedButNotSelected` is context only; do not substitute it as the answer. If `relaxationTrace` exists, say the match was relaxed. 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
236
|
|
|
224
237
|
## Candidate governance and review
|
|
225
238
|
|