cogmem 3.7.1 → 3.7.2
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 +6 -0
- package/MEMORY_ATLAS.md +2 -2
- package/README.md +4 -4
- package/RELEASE_CHECKLIST.md +4 -4
- package/dist/atlas/MemoryAtlasService.d.ts +1 -0
- package/dist/atlas/MemoryAtlasService.js +36 -4
- package/dist/atlas/MemoryAtlasTypes.d.ts +7 -0
- package/dist/factory.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/store/MemoryAtlasStore.d.ts +1 -0
- package/dist/store/MemoryAtlasStore.js +54 -0
- package/examples/hermes-backend/AGENTS.md +1 -1
- package/examples/hermes-backend/README.md +1 -1
- package/examples/hermes-backend/SKILL.md +2 -2
- package/examples/hermes-backend/references/operations.md +2 -2
- package/examples/openclaw-backend/AGENTS.md +1 -1
- package/examples/openclaw-backend/README.md +1 -1
- package/examples/openclaw-backend/SKILL.md +2 -2
- package/examples/openclaw-backend/references/operations.md +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.7.2
|
|
4
|
+
|
|
5
|
+
- Fixed Memory Atlas `graph-explore` edge projection so selected action, topic, and ordinary memory edges are merged before the final stable edge limit.
|
|
6
|
+
- Added direct internal-edge SQL for selected Atlas nodes, including chunked parameters, so bounded graph results are not silently limited to the first 30 node IDs.
|
|
7
|
+
- Added edge truncation metadata and warnings when `graph-explore` omits candidate edges after prioritizing exact matched cards/facets.
|
|
8
|
+
|
|
3
9
|
## 3.7.1
|
|
4
10
|
|
|
5
11
|
- Hardened OpenClaw volatile recall, Atlas context, turn bridge, and session-state serialization so historical text, card titles, summaries, source windows, related cards, short-term conclusions, and source anchors cannot close or create `COGMEM_*` prompt blocks.
|
package/MEMORY_ATLAS.md
CHANGED
|
@@ -10,7 +10,7 @@ Atlas projects existing project-scoped records into these node kinds:
|
|
|
10
10
|
- Facet nodes: `time`, `topic`, `issue`, `entity`, `session`, `thread`, `memoryKind`, and `actionKind`.
|
|
11
11
|
- Action frames are extracted deterministically from raw user evidence and link actor, target, action kind, time, topic, project, and evidence.
|
|
12
12
|
|
|
13
|
-
Existing memory edges remain canonical. Atlas adds derived navigation edges such as `OCCURRED_ON`, `OCCURRED_IN`, `ABOUT_TOPIC`, `PART_OF_ISSUE`, `INVOLVES_ENTITY`, `IN_SESSION`, `IN_THREAD`, and `HAS_EVIDENCE` without changing the underlying belief or binding graph. The 3.7.
|
|
13
|
+
Existing memory edges remain canonical. Atlas adds derived navigation edges such as `OCCURRED_ON`, `OCCURRED_IN`, `ABOUT_TOPIC`, `PART_OF_ISSUE`, `INVOLVES_ENTITY`, `IN_SESSION`, `IN_THREAD`, and `HAS_EVIDENCE` without changing the underlying belief or binding graph. The 3.7.2 offline curator automatically proposes only bounded `SAME_ISSUE`, `FOLLOWS_UP`, and weak `RELATED_TO` episode relations; stronger relations such as `REFINES`, `CORRECTS`, `CONTRADICTS`, and `SUPERSEDES` remain reserved for explicit evidence-bearing governance/binding flows. Entity facet node IDs are project-scoped; same-name tools or people in different projects do not share Atlas nodes.
|
|
14
14
|
|
|
15
15
|
This is not a copied tree. One episode exists once as `episode:<id>`. A day, topic, issue, entity, session, memory kind, or action kind is only a facet entrance:
|
|
16
16
|
|
|
@@ -145,4 +145,4 @@ Upgrade an existing 3.5.2 database with:
|
|
|
145
145
|
cogmem migrate --yes --backup --json
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
Migration 0025 creates and backfills the disposable projection. Migration 0026 adds exact memory-kind metadata, projection health, and candidate-review audit state. Migration 0027 corrects 3.6.0-upgraded databases by marking Atlas projections dirty until the real action/time rebuild runs. Cogmem 3.7.
|
|
148
|
+
Migration 0025 creates and backfills the disposable projection. Migration 0026 adds exact memory-kind metadata, projection health, and candidate-review audit state. Migration 0027 corrects 3.6.0-upgraded databases by marking Atlas projections dirty until the real action/time rebuild runs. Cogmem 3.7.2 keeps the projection-first schema and adds facet nodes, canonical cards, issue hints, and episode relation edges during Atlas rebuild/maintenance. Projection metadata schema `3.7.2` invalidates earlier 3.7.x Atlas v2 projections so project-scoped entity facets are rebuilt. `cogmem memory tick` refreshes only dirty projects, records rebuild errors, prunes old access telemetry, and decays navigation activation without starting a daemon.
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ It is not a knowledge-base app, a note-taking app, a vector RAG wrapper, an Obsi
|
|
|
11
11
|
|
|
12
12
|
## Status
|
|
13
13
|
|
|
14
|
-
Current version: `3.7.
|
|
14
|
+
Current version: `3.7.2`
|
|
15
15
|
|
|
16
16
|
Distribution: npm registry. GitHub remains the source mirror and hosts this installer, but package install and upgrade resolve `cogmem` from npm by default.
|
|
17
17
|
|
|
@@ -229,7 +229,7 @@ cogmem migrate --dry-run --json
|
|
|
229
229
|
|
|
230
230
|
For a manual migration, run `cogmem migrate --yes --backup`. The migration runner adopts the existing `_meta.schema_version`, applies only later idempotent migrations, preserves Raw Ledger rows, and creates a timestamped, transaction-consistent standalone database backup before changing an on-disk database. The backup includes committed SQLite WAL pages instead of copying only the main database file.
|
|
231
231
|
|
|
232
|
-
Upgrade a 3.5.2 database, a 3.6.x database, or a pre-release schema-25 test database into the current 3.7.
|
|
232
|
+
Upgrade a 3.5.2 database, a 3.6.x database, or a pre-release schema-25 test database into the current 3.7.2 schema and projection set with one command:
|
|
233
233
|
|
|
234
234
|
```bash
|
|
235
235
|
cogmem migrate --yes --backup --json
|
|
@@ -304,7 +304,7 @@ cogmem memory review --project my-agent --id <candidate-id> --action approve --a
|
|
|
304
304
|
|
|
305
305
|
`cogmem memory map` remains the system anatomy map. Memory Atlas is the content map. It does not replace recall or create a second fact store; it projects existing topics, entities, clusters, episodes, beliefs, action frames, time buckets, bindings, and evidence into a bounded navigation surface.
|
|
306
306
|
|
|
307
|
-
In 3.7.
|
|
307
|
+
In 3.7.2, Atlas is a multi-dimensional navigation graph rather than a folder tree. A remembered episode has one canonical node such as `episode:<id>`. Time, topic, issue, entity, session/thread, memory-kind, and action-kind nodes are facet entrances connected to that canonical episode with typed edges. Results dedupe by `canonicalId` and explain `matchedFacets` plus `matchedPaths`.
|
|
308
308
|
|
|
309
309
|
```bash
|
|
310
310
|
cogmem memory graph --project my-agent --json
|
|
@@ -798,7 +798,7 @@ npm pack --dry-run --json
|
|
|
798
798
|
npm publish --dry-run --access public
|
|
799
799
|
```
|
|
800
800
|
|
|
801
|
-
Create a GitHub Release from the matching version tag, for example `v3.7.
|
|
801
|
+
Create a GitHub Release from the matching version tag, for example `v3.7.2`. The `.github/workflows/publish.yml` workflow publishes to npm only when the release is published, not when a tag is pushed. The npm Trusted Publisher entry must match repository `liuqin164/cogmem`, workflow file `publish.yml`, and environment `npm publish`.
|
|
802
802
|
|
|
803
803
|
Publish manually only for emergency fallback:
|
|
804
804
|
|
package/RELEASE_CHECKLIST.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# cogmem 3.7.
|
|
1
|
+
# cogmem 3.7.2 Release Checklist
|
|
2
2
|
|
|
3
3
|
This release is distributed through the npm registry. GitHub remains the source and review mirror.
|
|
4
4
|
|
|
5
5
|
## Required Metadata
|
|
6
6
|
|
|
7
7
|
- `package.json` name is `cogmem`.
|
|
8
|
-
- `package.json` version is `3.7.
|
|
8
|
+
- `package.json` version is `3.7.2`.
|
|
9
9
|
- `package.json` has `publishConfig.access = public`.
|
|
10
10
|
- Public export `.` points to `dist/public.js` and `dist/public.d.ts`.
|
|
11
11
|
- Internal subpath `./internal` exists only as an explicit advanced subpath.
|
|
@@ -61,7 +61,7 @@ MCP `tools/list` includes strategy, episode append/import/status/seal/repair, to
|
|
|
61
61
|
- README and skills explain Raw Ledger-first episode assembly, soft/hard sealing, explicit conditional Dream ticks, raw-event evidence grounding, repair/retry, and hookless Hermes MCP/import usage.
|
|
62
62
|
- README and skills give the full post-import maintenance sequence: status, episode status, Dream status, bounded Dream tick, candidate listing, govern candidate, needs-confirmation listing, explicit review, and recall verification.
|
|
63
63
|
- README and skills explain that 3.6.4+ skips empty imported episode boundaries and legacy empty Dream jobs instead of letting them abort `dream tick`.
|
|
64
|
-
- README and skills explain the 3.7.
|
|
64
|
+
- README and skills explain the 3.7.2 agent operations protocol: `memory plan` for next actions, default grouped `memory candidates --json`, `memory list --since/--until/--order`, historical-discussion recall intent, Atlas canonical cards, `matchedFacets`, `relatedButNotSelected`, `relaxationTrace`, Atlas evidence `sourceLocator`, and cursor-based `memory bind`.
|
|
65
65
|
- README, `MEMORY_ATLAS.md`, and installed skills explain the multi-dimensional Atlas model: a canonical episode/raw event exists once, facet nodes connect through typed edges, query results intersect facets, and display/injection dedupes by `canonicalId`.
|
|
66
66
|
- `connect openclaw|hermes --json` documents structured `nextSteps`; `nextCommands` must contain only agent-safe, non-interactive commands and must not include `cogmem init`, `cogmem-init`, gateway restart, or Hermes reload.
|
|
67
67
|
- README and skills document `cogmem mcp` as the preferred MCP server command for new configs while preserving `cogmem-mcp` as a compatibility bin.
|
|
@@ -94,7 +94,7 @@ npm publish --dry-run --access public
|
|
|
94
94
|
|
|
95
95
|
The pack dry-run must include built public API files, CLI files, examples, docs, and `install.sh`. It must not include local databases or machine-specific files.
|
|
96
96
|
|
|
97
|
-
After verification, create a GitHub Release from the matching version tag, for example `v3.7.
|
|
97
|
+
After verification, create a GitHub Release from the matching version tag, for example `v3.7.2`. The release workflow publishes through npm Trusted Publishing when the release is published. It must not publish on tag push alone.
|
|
98
98
|
|
|
99
99
|
Emergency manual fallback:
|
|
100
100
|
|
|
@@ -57,8 +57,8 @@ export class MemoryAtlasService {
|
|
|
57
57
|
nodes = uniqueNodes([...actions.map((action) => this.store.getNode(action.id, projectId)).filter((node) => Boolean(node)), ...nodes]).slice(0, limit);
|
|
58
58
|
}
|
|
59
59
|
const nodesWithEvidence = this.attachEvidence(nodes, projectId, options);
|
|
60
|
-
const
|
|
61
|
-
const result = slice(projectId, nodesWithEvidence, edges, query);
|
|
60
|
+
const edgeProjection = this.edgeProjection(nodesWithEvidence, projectId, exactMatchedNodeIds(cards, facetResult.plan));
|
|
61
|
+
const result = slice(projectId, nodesWithEvidence, edgeProjection.edges, query);
|
|
62
62
|
result.facets = {
|
|
63
63
|
...facetsForPlan(facetResult.plan),
|
|
64
64
|
legacy: { time: compiled.range, target: target.labels.join(', ') || compiled.target, memoryKinds: compiled.memoryKinds, keywords: compiled.keywords },
|
|
@@ -68,6 +68,10 @@ export class MemoryAtlasService {
|
|
|
68
68
|
result.cards = this.attachCardEvidence(cards, projectId, options);
|
|
69
69
|
if (facetResult.relaxationTrace.length)
|
|
70
70
|
result.relaxationTrace = facetResult.relaxationTrace;
|
|
71
|
+
if (edgeProjection.truncation) {
|
|
72
|
+
result.edgeTruncation = edgeProjection.truncation;
|
|
73
|
+
result.warnings.push(`edges_truncated:${edgeProjection.truncation.omitted}_omitted`);
|
|
74
|
+
}
|
|
71
75
|
const hasFacet = Boolean(compiled.range || compiled.target || compiled.memoryKinds.length || compiled.tokens.length);
|
|
72
76
|
result.coldMemoryResurrected = hasFacet && nodes.some((node) => node.activation <= 0.1);
|
|
73
77
|
return result;
|
|
@@ -248,9 +252,23 @@ export class MemoryAtlasService {
|
|
|
248
252
|
});
|
|
249
253
|
}
|
|
250
254
|
edgesFor(nodes, projectId) {
|
|
255
|
+
return this.edgeProjection(nodes, projectId).edges;
|
|
256
|
+
}
|
|
257
|
+
edgeProjection(nodes, projectId, priorityIds = new Set()) {
|
|
251
258
|
const ids = new Set(nodes.map((node) => node.id));
|
|
252
|
-
|
|
253
|
-
|
|
259
|
+
const limit = 60;
|
|
260
|
+
const candidates = this.safeEdges(this.store.listEdgesWithinNodes(projectId, [...ids], 4000)
|
|
261
|
+
.filter((edge) => ids.has(edge.source) && ids.has(edge.target)), projectId);
|
|
262
|
+
const sorted = uniqueEdges(candidates).sort((left, right) => edgePriority(right, priorityIds) - edgePriority(left, priorityIds)
|
|
263
|
+
|| right.confidence - left.confidence
|
|
264
|
+
|| edgeKey(left).localeCompare(edgeKey(right)));
|
|
265
|
+
const edges = sorted.slice(0, limit);
|
|
266
|
+
return {
|
|
267
|
+
edges,
|
|
268
|
+
truncation: sorted.length > edges.length
|
|
269
|
+
? { limit, returned: edges.length, omitted: sorted.length - edges.length, candidateCount: sorted.length, prioritized: priorityIds.size > 0 }
|
|
270
|
+
: undefined,
|
|
271
|
+
};
|
|
254
272
|
}
|
|
255
273
|
safeEdges(edges, projectId) {
|
|
256
274
|
return edges.map((edge) => ({ ...edge, evidenceEventIds: edge.evidenceEventIds.filter((eventId) => {
|
|
@@ -294,6 +312,20 @@ function uniqueIds(ids) { return Array.from(new Set(ids)); }
|
|
|
294
312
|
function uniqueEdges(edges) {
|
|
295
313
|
return Array.from(new Map(edges.map((edge) => [`${edge.source}\0${edge.relation}\0${edge.target}`, edge])).values());
|
|
296
314
|
}
|
|
315
|
+
function edgeKey(edge) { return `${edge.source}\0${edge.relation}\0${edge.target}`; }
|
|
316
|
+
function edgePriority(edge, priorityIds) {
|
|
317
|
+
return (priorityIds.has(edge.source) ? 1 : 0) + (priorityIds.has(edge.target) ? 1 : 0);
|
|
318
|
+
}
|
|
319
|
+
function exactMatchedNodeIds(cards, plan) {
|
|
320
|
+
return new Set([
|
|
321
|
+
...cards.flatMap((card) => [
|
|
322
|
+
card.canonicalId,
|
|
323
|
+
...card.matchedFacets.map((facet) => facet.nodeId),
|
|
324
|
+
...card.matchedPaths.flatMap((path) => path.via),
|
|
325
|
+
]),
|
|
326
|
+
...plan.facets.map((facet) => facet.nodeId).filter((id) => Boolean(id)),
|
|
327
|
+
]);
|
|
328
|
+
}
|
|
297
329
|
function edgeTraversalCost(edge) {
|
|
298
330
|
const confidence = Math.max(0.01, Math.min(1, edge.confidence));
|
|
299
331
|
const relationPenalty = /^(EVIDENCED_BY|DERIVED_FROM|TARGETS|OCCURRED_IN|SUPPORTS|ABOUT|MENTIONS)$/u.test(edge.relation)
|
|
@@ -101,6 +101,13 @@ export interface MemoryAtlasSlice {
|
|
|
101
101
|
edges: MemoryAtlasEdge[];
|
|
102
102
|
nextActions: MemoryAtlasNextAction[];
|
|
103
103
|
warnings: string[];
|
|
104
|
+
edgeTruncation?: {
|
|
105
|
+
limit: number;
|
|
106
|
+
returned: number;
|
|
107
|
+
omitted: number;
|
|
108
|
+
candidateCount: number;
|
|
109
|
+
prioritized: boolean;
|
|
110
|
+
};
|
|
104
111
|
facets?: {
|
|
105
112
|
planner?: {
|
|
106
113
|
intent: string;
|
package/dist/factory.js
CHANGED
|
@@ -83,7 +83,7 @@ import { SqliteVecStore } from './store/SqliteVecStore.js';
|
|
|
83
83
|
import { VectorStore } from './store/VectorStore.js';
|
|
84
84
|
import { config } from './utils/Config.js';
|
|
85
85
|
import { KernelRunningError, SnapshotExporter, SnapshotImporter, } from './snapshot/index.js';
|
|
86
|
-
const CORE_VERSION = '3.7.
|
|
86
|
+
const CORE_VERSION = '3.7.2';
|
|
87
87
|
const LATEST_SCHEMA_VERSION = 27;
|
|
88
88
|
export class MemoryKernel {
|
|
89
89
|
options;
|
package/dist/mcp/server.js
CHANGED
|
@@ -33,6 +33,7 @@ export declare class MemoryAtlasStore {
|
|
|
33
33
|
evidenceTotal(nodeId: string, projectId: string): number;
|
|
34
34
|
listEdges(projectId: string): MemoryAtlasEdge[];
|
|
35
35
|
listEdgesForNodes(projectId: string, nodeIds: string[], limit?: number): MemoryAtlasEdge[];
|
|
36
|
+
listEdgesWithinNodes(projectId: string, nodeIds: string[], limit?: number): MemoryAtlasEdge[];
|
|
36
37
|
findEdgesBetween(projectId: string, leftNodeId: string, rightNodeId: string): MemoryAtlasEdge[];
|
|
37
38
|
findEdgesFromNodesToTarget(projectId: string, leftNodeIds: string[], rightNodeId: string): MemoryAtlasEdge[];
|
|
38
39
|
listActions(projectId: string, options: {
|
|
@@ -301,6 +301,54 @@ export class MemoryAtlasStore {
|
|
|
301
301
|
edges.push(...this.topicRelationEdges(projectId, topicPaths, Math.max(1, Math.min(limit, 2000))));
|
|
302
302
|
return Array.from(new Map(edges.map((edge) => [`${edge.source}\0${edge.relation}\0${edge.target}`, edge])).values()).slice(0, Math.max(1, Math.min(limit, 4000)));
|
|
303
303
|
}
|
|
304
|
+
listEdgesWithinNodes(projectId, nodeIds, limit = 4000) {
|
|
305
|
+
const selectedIds = new Set(Array.from(new Set(nodeIds)));
|
|
306
|
+
const parsed = Array.from(selectedIds).map((id) => parseNodeId(id, projectId)).filter((item) => Boolean(item));
|
|
307
|
+
if (!parsed.length)
|
|
308
|
+
return [];
|
|
309
|
+
const edges = [];
|
|
310
|
+
const cap = Math.max(1, Math.min(limit, 4000));
|
|
311
|
+
for (const sourceChunk of chunked(parsed, 120)) {
|
|
312
|
+
for (const targetChunk of chunked(parsed, 120)) {
|
|
313
|
+
const sourceClause = sourceChunk.map(() => '(source_type=? AND source_id=?)').join(' OR ');
|
|
314
|
+
const targetClause = targetChunk.map(() => '(target_type=? AND target_id=?)').join(' OR ');
|
|
315
|
+
const rows = this.db.prepare(`
|
|
316
|
+
SELECT * FROM memory_edges
|
|
317
|
+
WHERE project_id=? AND status IN ('active','weak')
|
|
318
|
+
AND (${sourceClause}) AND (${targetClause})
|
|
319
|
+
ORDER BY confidence DESC LIMIT ?
|
|
320
|
+
`).all(projectId, ...sourceChunk.flatMap((item) => [item.type, item.id]), ...targetChunk.flatMap((item) => [item.type, item.id]), cap);
|
|
321
|
+
for (const row of rows)
|
|
322
|
+
edges.push({
|
|
323
|
+
source: nodeId(String(row.source_type), String(row.source_id), projectId), relation: String(row.relation_type),
|
|
324
|
+
target: nodeId(String(row.target_type), String(row.target_id), projectId), confidence: Number(row.confidence),
|
|
325
|
+
evidenceEventIds: parseStringArray(String(row.evidence_event_ids_json || '[]')),
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const actionIds = parsed.filter((item) => item.type === 'action').map((item) => item.id);
|
|
330
|
+
if (actionIds.length) {
|
|
331
|
+
for (const chunk of chunked(actionIds, 400)) {
|
|
332
|
+
const actions = this.db.prepare(`SELECT action_id,target_entity_id,occurred_at,confidence FROM memory_action_frames
|
|
333
|
+
WHERE project_id=? AND action_id IN (${chunk.map(() => '?').join(',')})`).all(projectId, ...chunk);
|
|
334
|
+
for (const action of actions) {
|
|
335
|
+
const evidenceEventIds = this.actionEvidenceIds(action.action_id, projectId);
|
|
336
|
+
if (action.target_entity_id && selectedIds.has(`entity:${action.target_entity_id}`)) {
|
|
337
|
+
edges.push({ source: `action:${action.action_id}`, relation: 'TARGETS', target: `entity:${action.target_entity_id}`, confidence: action.confidence, evidenceEventIds });
|
|
338
|
+
}
|
|
339
|
+
const timeId = timeNodeId(projectId, action.occurred_at);
|
|
340
|
+
if (selectedIds.has(timeId))
|
|
341
|
+
edges.push({ source: `action:${action.action_id}`, relation: 'OCCURRED_IN', target: timeId, confidence: 1, evidenceEventIds });
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const topicPaths = parsed.filter((item) => item.type === 'topic').map((item) => item.id);
|
|
346
|
+
if (topicPaths.length) {
|
|
347
|
+
edges.push(...this.topicRelationEdges(projectId, topicPaths, cap)
|
|
348
|
+
.filter((edge) => selectedIds.has(edge.source) && selectedIds.has(edge.target)));
|
|
349
|
+
}
|
|
350
|
+
return Array.from(new Map(edges.map((edge) => [`${edge.source}\0${edge.relation}\0${edge.target}`, edge])).values());
|
|
351
|
+
}
|
|
304
352
|
findEdgesBetween(projectId, leftNodeId, rightNodeId) {
|
|
305
353
|
const left = parseNodeId(leftNodeId, projectId);
|
|
306
354
|
const right = parseNodeId(rightNodeId, projectId);
|
|
@@ -725,6 +773,12 @@ function stringArray(value) {
|
|
|
725
773
|
function optionalMetadataString(value) {
|
|
726
774
|
return typeof value === 'string' && value ? value : undefined;
|
|
727
775
|
}
|
|
776
|
+
function chunked(values, size) {
|
|
777
|
+
const chunks = [];
|
|
778
|
+
for (let index = 0; index < values.length; index += size)
|
|
779
|
+
chunks.push(values.slice(index, index + size));
|
|
780
|
+
return chunks;
|
|
781
|
+
}
|
|
728
782
|
function facetFromEdge(edge, projectId) {
|
|
729
783
|
return {
|
|
730
784
|
type: edge.target_type,
|
|
@@ -227,7 +227,7 @@ Hermes has no automatic observation path in this integration. Use `cogmem_episod
|
|
|
227
227
|
|
|
228
228
|
Use `cogmem_topic_operate` with actor `user_explicit` only for explicit user naming/organization instructions. Model suggestions use `model_candidate` and remain reviewable; alias collisions fail closed. Use `cogmem_episode_repair` for split/merge/move/reclassify/requeue work so receipts, stale candidates, cross-references, Dream jobs, and audit records stay synchronized. Do not hand-edit the database.
|
|
229
229
|
|
|
230
|
-
Use `cogmem memory map --project hermes --json` or MCP `cogmem_memory_map` 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 correction edges. If `cogmem memory tick --project hermes --json` suggests `bind_raw_events`, run `cogmem memory bind --project hermes --json`; it scans the historical ledger by cursor and can resume with `--since <globalSeq>`. For old-discussion questions, use `cogmem memory recall --intent historical_discussion ...` or `cogmem_graph_explore`; in 3.7.
|
|
230
|
+
Use `cogmem memory map --project hermes --json` or MCP `cogmem_memory_map` 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 correction edges. If `cogmem memory tick --project hermes --json` suggests `bind_raw_events`, run `cogmem memory bind --project hermes --json`; it scans the historical ledger by cursor and can resume with `--since <globalSeq>`. For old-discussion questions, use `cogmem memory recall --intent historical_discussion ...` or `cogmem_graph_explore`; in 3.7.2 cards carry `canonicalId`, `matchedFacets`, `matchedPaths`, `relatedButNotSelected`, and `sourceLocator`. Answer from the selected canonical card, not from a side card. Re-run `cogmem connect hermes --workspace . --auto --force --json` after upgrades to patch existing MCP allow-lists with new Cogmem tools. Follow only `nextCommands` for unattended agent work; operator/host actions are in `nextSteps` with `safeForAutomation=false`.
|
|
231
231
|
|
|
232
232
|
Dream correction records require explicit user clarification; assistant self-correction and questions containing `是不是` are not user-owned contradictions. Invalid provider output is a rejected diagnostic. Maintenance ticks supersede `needs_confirmation` entries older than the default 30-day TTL and retain their evidence rows.
|
|
233
233
|
|
|
@@ -109,7 +109,7 @@ Dream stores explicit user clarification as organizational correction evidence r
|
|
|
109
109
|
|
|
110
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`.
|
|
111
111
|
|
|
112
|
-
Cogmem 3.7.
|
|
112
|
+
Cogmem 3.7.2 exposes 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, day/month/year, topic, issue, entity/target, session/thread, memory-kind, action-kind, and keyword conditions like table filters, so cold memory can be revived without requiring an entity-time-action tuple. Unicode entity cues are supported, but alias merges still require governed evidence. Prefer returned `cards[]` for historical discussion: `canonicalId` dedupes the episode, `matchedFacets` explains why it matched, `relatedButNotSelected` is only side context, `relaxationTrace` marks day/month/year or issue/topic fallback, and `sourceLocator` opens raw evidence. Touch only nodes actually used, and follow returned event IDs or `sourceLocator` commands before quoting exact wording.
|
|
113
113
|
|
|
114
114
|
## Runtime
|
|
115
115
|
|
|
@@ -114,7 +114,7 @@ timeout_ms = 60000
|
|
|
114
114
|
|
|
115
115
|
## Migrate Existing Hermes Memory
|
|
116
116
|
|
|
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.
|
|
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.2 schema/projection set in one backed-up command:
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
cogmem migrate --yes --backup --json
|
|
@@ -216,7 +216,7 @@ Choose the graph tool from the question shape:
|
|
|
216
216
|
|
|
217
217
|
Atlas combines whatever conditions the user supplies like table filters. Do not require entity + time + action. Project, day/month/year, topic, issue, entity/target, session/thread, memory kind, action kind, and ordinary cues may revive cold nodes together. Entity cue extraction accepts Unicode letter/number names, but it is not full NER and must not be treated as proof that two aliases are the same person/tool. Activation is visibility, not truth. Atlas summaries are hints and never replace raw evidence.
|
|
218
218
|
|
|
219
|
-
In 3.7.
|
|
219
|
+
In 3.7.2, `cogmem_graph_search`, `cogmem_graph_explore`, and historical recall can return canonical `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 match, not an exact hit; supported relaxations include day → month → year and issue → parent topic.
|
|
220
220
|
|
|
221
221
|
When the prompt does not contain enough injected Cogmem context, do not search legacy memory files first. Ask Cogmem directly:
|
|
222
222
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cogmem 3.7.
|
|
1
|
+
# Cogmem 3.7.2 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
|
|
|
@@ -76,7 +76,7 @@ cogmem doctor
|
|
|
76
76
|
cogmem connect hermes --workspace . --auto --force --json
|
|
77
77
|
```
|
|
78
78
|
|
|
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.
|
|
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.2 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.
|
|
80
80
|
|
|
81
81
|
## Import Hermes memory
|
|
82
82
|
|
|
@@ -185,7 +185,7 @@ Recall behavior:
|
|
|
185
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
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
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.
|
|
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.2, cards carry `canonicalId`, `matchedFacets`, `matchedPaths`, `relatedButNotSelected`, and `sourceLocator`; answer from the selected canonical card, not from a related-but-not-selected side card.
|
|
189
189
|
|
|
190
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:
|
|
191
191
|
|
|
@@ -84,7 +84,7 @@ cogmem memory tick --project openclaw --json
|
|
|
84
84
|
cogmem memory bind --project openclaw --json
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Cogmem 3.7.
|
|
87
|
+
Cogmem 3.7.2 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. Unicode entity cues are supported, but alias merges still require governed evidence. Prefer returned `cards[]` for historical discussion: `canonicalId` dedupes the episode, `matchedFacets` explains why it matched, `relatedButNotSelected` is only side context, `relaxationTrace` marks day/month/year or issue/topic fallback, and `sourceLocator` opens the raw evidence.
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
cogmem memory plan --project openclaw --json
|
|
@@ -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.x database, or a pre-release schema-25 test database to the current 3.7.
|
|
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.2 schema/projection set in one backed-up command:
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
cogmem migrate --yes --backup --json
|
|
@@ -282,7 +282,7 @@ Graph reads default to stale-safe diagnostics. If a drainer or gateway has SQLit
|
|
|
282
282
|
|
|
283
283
|
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. Entity cue extraction accepts Unicode letter/number names, but it is not full NER and must not be treated as proof that two aliases are the same person/tool. Graph reads do not change activation; explicitly touch only nodes the agent actually uses. Activation changes visibility only.
|
|
284
284
|
|
|
285
|
-
In 3.7.
|
|
285
|
+
In 3.7.2, `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 match, not an exact hit; supported relaxations include day → month → year and issue → parent topic.
|
|
286
286
|
|
|
287
287
|
Follow returned `sourceLocator.command` or event IDs with `cogmem memory show`; never treat an Atlas summary or title as evidence.
|
|
288
288
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cogmem 3.7.
|
|
1
|
+
# Cogmem 3.7.2 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
|
|
|
@@ -86,7 +86,7 @@ openclaw gateway restart
|
|
|
86
86
|
cogmem openclaw diagnose --workspace . --json
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
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.
|
|
89
|
+
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.2 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`.
|
|
90
90
|
|
|
91
91
|
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:
|
|
92
92
|
|