openclaw-cortex-memory 0.1.0-Alpha.9 → 0.1.1
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/LICENSE +21 -0
- package/README.md +347 -290
- package/SIGNATURE.md +7 -0
- package/SKILL.md +96 -345
- package/dist/index.d.ts +69 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1130 -1330
- package/dist/index.js.map +1 -1
- package/dist/openclaw.plugin.json +397 -18
- package/dist/src/dedup/three_stage_deduplicator.d.ts.map +1 -1
- package/dist/src/dedup/three_stage_deduplicator.js +13 -3
- package/dist/src/dedup/three_stage_deduplicator.js.map +1 -1
- package/dist/src/engine/memory_engine.d.ts +5 -1
- package/dist/src/engine/memory_engine.d.ts.map +1 -1
- package/dist/src/engine/ts_engine.d.ts +149 -0
- package/dist/src/engine/ts_engine.d.ts.map +1 -1
- package/dist/src/engine/ts_engine.js +863 -203
- package/dist/src/engine/ts_engine.js.map +1 -1
- package/dist/src/engine/types.d.ts +20 -0
- package/dist/src/engine/types.d.ts.map +1 -1
- package/dist/src/graph/ontology.d.ts +87 -15
- package/dist/src/graph/ontology.d.ts.map +1 -1
- package/dist/src/graph/ontology.js +999 -12
- package/dist/src/graph/ontology.js.map +1 -1
- package/dist/src/net/http_post.d.ts +17 -0
- package/dist/src/net/http_post.d.ts.map +1 -0
- package/dist/src/net/http_post.js +56 -0
- package/dist/src/net/http_post.js.map +1 -0
- package/dist/src/quality/llm_output_validator.d.ts +65 -0
- package/dist/src/quality/llm_output_validator.d.ts.map +1 -0
- package/dist/src/quality/llm_output_validator.js +635 -0
- package/dist/src/quality/llm_output_validator.js.map +1 -0
- package/dist/src/reflect/reflector.d.ts.map +1 -1
- package/dist/src/reflect/reflector.js +296 -26
- package/dist/src/reflect/reflector.js.map +1 -1
- package/dist/src/rules/rule_store.d.ts.map +1 -1
- package/dist/src/rules/rule_store.js +75 -16
- package/dist/src/rules/rule_store.js.map +1 -1
- package/dist/src/session/session_end.d.ts +20 -42
- package/dist/src/session/session_end.d.ts.map +1 -1
- package/dist/src/session/session_end.js +21 -218
- package/dist/src/session/session_end.js.map +1 -1
- package/dist/src/store/archive_store.d.ts +28 -7
- package/dist/src/store/archive_store.d.ts.map +1 -1
- package/dist/src/store/archive_store.js +367 -130
- package/dist/src/store/archive_store.js.map +1 -1
- package/dist/src/store/graph_memory_store.d.ts +115 -0
- package/dist/src/store/graph_memory_store.d.ts.map +1 -0
- package/dist/src/store/graph_memory_store.js +1061 -0
- package/dist/src/store/graph_memory_store.js.map +1 -0
- package/dist/src/store/read_store.d.ts +75 -0
- package/dist/src/store/read_store.d.ts.map +1 -1
- package/dist/src/store/read_store.js +1837 -312
- package/dist/src/store/read_store.js.map +1 -1
- package/dist/src/store/vector_store.d.ts +2 -0
- package/dist/src/store/vector_store.d.ts.map +1 -1
- package/dist/src/store/vector_store.js +19 -3
- package/dist/src/store/vector_store.js.map +1 -1
- package/dist/src/store/write_store.d.ts +11 -0
- package/dist/src/store/write_store.d.ts.map +1 -1
- package/dist/src/store/write_store.js +242 -42
- package/dist/src/store/write_store.js.map +1 -1
- package/dist/src/sync/session_sync.d.ts +72 -1
- package/dist/src/sync/session_sync.d.ts.map +1 -1
- package/dist/src/sync/session_sync.js +2246 -126
- package/dist/src/sync/session_sync.js.map +1 -1
- package/dist/src/wiki/wiki_linter.d.ts +26 -0
- package/dist/src/wiki/wiki_linter.d.ts.map +1 -0
- package/dist/src/wiki/wiki_linter.js +339 -0
- package/dist/src/wiki/wiki_linter.js.map +1 -0
- package/dist/src/wiki/wiki_logger.d.ts +10 -0
- package/dist/src/wiki/wiki_logger.d.ts.map +1 -0
- package/dist/src/wiki/wiki_logger.js +78 -0
- package/dist/src/wiki/wiki_logger.js.map +1 -0
- package/dist/src/wiki/wiki_maintainer.d.ts +39 -0
- package/dist/src/wiki/wiki_maintainer.d.ts.map +1 -0
- package/dist/src/wiki/wiki_maintainer.js +38 -0
- package/dist/src/wiki/wiki_maintainer.js.map +1 -0
- package/dist/src/wiki/wiki_projector.d.ts +35 -0
- package/dist/src/wiki/wiki_projector.d.ts.map +1 -0
- package/dist/src/wiki/wiki_projector.js +1151 -0
- package/dist/src/wiki/wiki_projector.js.map +1 -0
- package/dist/src/wiki/wiki_queue.d.ts +29 -0
- package/dist/src/wiki/wiki_queue.d.ts.map +1 -0
- package/dist/src/wiki/wiki_queue.js +137 -0
- package/dist/src/wiki/wiki_queue.js.map +1 -0
- package/openclaw.plugin.json +397 -18
- package/package.json +51 -5
- package/schema/graph.schema.yaml +330 -0
- package/scripts/cli.js +67 -13
- package/scripts/repair-memory.js +321 -0
- package/skills/cortex-memory/SKILL.md +83 -0
- package/skills/cortex-memory/references/agent-manual.md +127 -0
- package/skills/cortex-memory/references/configuration.md +109 -0
- package/skills/cortex-memory/references/publish-checklist.md +45 -0
- package/skills/cortex-memory/references/system-prompt-template.md +27 -0
- package/skills/cortex-memory/references/tools.md +191 -0
package/openclaw.plugin.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-cortex-memory",
|
|
3
3
|
"name": "Cortex Memory",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"description": "Long-term memory system with semantic, episodic, and procedural memory for AI Agents",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"author": "deki18",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"
|
|
9
|
+
"kind": "memory",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/deki18/openclaw-cortex-memory"
|
|
@@ -18,6 +18,47 @@
|
|
|
18
18
|
"channels": false,
|
|
19
19
|
"memory": true
|
|
20
20
|
},
|
|
21
|
+
"contracts": {
|
|
22
|
+
"tools": [
|
|
23
|
+
"search_memory",
|
|
24
|
+
"store_event",
|
|
25
|
+
"query_graph",
|
|
26
|
+
"export_graph_view",
|
|
27
|
+
"lint_memory_wiki",
|
|
28
|
+
"list_graph_conflicts",
|
|
29
|
+
"resolve_graph_conflict",
|
|
30
|
+
"get_hot_context",
|
|
31
|
+
"get_auto_context",
|
|
32
|
+
"reflect_memory",
|
|
33
|
+
"sync_memory",
|
|
34
|
+
"backfill_embeddings",
|
|
35
|
+
"delete_memory",
|
|
36
|
+
"cortex_diagnostics",
|
|
37
|
+
"diagnostics",
|
|
38
|
+
"cortex_memory_status"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"runtimeRequirements": {
|
|
42
|
+
"requiresCredentials": true,
|
|
43
|
+
"requiresNetwork": true,
|
|
44
|
+
"credentialSources": {
|
|
45
|
+
"env": [
|
|
46
|
+
"EMBEDDING_API_KEY",
|
|
47
|
+
"LLM_API_KEY",
|
|
48
|
+
"RERANKER_API_KEY"
|
|
49
|
+
],
|
|
50
|
+
"pluginConfig": [
|
|
51
|
+
"embedding.apiKey",
|
|
52
|
+
"llm.apiKey",
|
|
53
|
+
"reranker.apiKey"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"externalEndpoints": {
|
|
57
|
+
"embedding": "OpenAI-compatible /embeddings endpoint",
|
|
58
|
+
"llm": "OpenAI-compatible /chat/completions endpoint",
|
|
59
|
+
"reranker": "Reranker /rerank endpoint"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
21
62
|
"hooks": [
|
|
22
63
|
"message_received",
|
|
23
64
|
"session_end"
|
|
@@ -36,6 +77,15 @@
|
|
|
36
77
|
"top_k": {
|
|
37
78
|
"type": "integer",
|
|
38
79
|
"description": "Number of results to return"
|
|
80
|
+
},
|
|
81
|
+
"fusion_mode": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"enum": ["auto", "authoritative", "candidates", "off"],
|
|
84
|
+
"description": "LLM fusion behavior for this search. auto honors config; authoritative returns only the fused answer; candidates returns fusion plus ranked candidates; off disables fusion."
|
|
85
|
+
},
|
|
86
|
+
"track_hits": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Whether to update anti-decay hit statistics. Set false for diagnostics or benchmarks."
|
|
39
89
|
}
|
|
40
90
|
},
|
|
41
91
|
"required": ["query"],
|
|
@@ -52,6 +102,18 @@
|
|
|
52
102
|
"type": "string",
|
|
53
103
|
"description": "Event summary"
|
|
54
104
|
},
|
|
105
|
+
"cause": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "What triggered the event (task/request/problem statement)"
|
|
108
|
+
},
|
|
109
|
+
"process": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "How the task was handled (steps/attempts/iterations)"
|
|
112
|
+
},
|
|
113
|
+
"result": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "Final result and acceptance outcome"
|
|
116
|
+
},
|
|
55
117
|
"entities": {
|
|
56
118
|
"type": "array",
|
|
57
119
|
"description": "Involved entities",
|
|
@@ -78,6 +140,13 @@
|
|
|
78
140
|
]
|
|
79
141
|
}
|
|
80
142
|
},
|
|
143
|
+
"entity_types": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"description": "Entity type map, key is entity name and value is type",
|
|
146
|
+
"additionalProperties": {
|
|
147
|
+
"type": "string"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
81
150
|
"outcome": {
|
|
82
151
|
"type": "string",
|
|
83
152
|
"description": "Event outcome"
|
|
@@ -101,6 +170,12 @@
|
|
|
101
170
|
},
|
|
102
171
|
"type": {
|
|
103
172
|
"type": "string"
|
|
173
|
+
},
|
|
174
|
+
"evidence_span": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"confidence": {
|
|
178
|
+
"type": "number"
|
|
104
179
|
}
|
|
105
180
|
},
|
|
106
181
|
"required": ["source", "target"],
|
|
@@ -146,6 +221,75 @@
|
|
|
146
221
|
"additionalProperties": false
|
|
147
222
|
}
|
|
148
223
|
},
|
|
224
|
+
{
|
|
225
|
+
"name": "export_graph_view",
|
|
226
|
+
"description": "Export status-aware graph view and optionally write wiki graph snapshots",
|
|
227
|
+
"parameters": {
|
|
228
|
+
"type": "object",
|
|
229
|
+
"properties": {
|
|
230
|
+
"write_snapshot": {
|
|
231
|
+
"type": "boolean",
|
|
232
|
+
"description": "When true (default), write wiki/graph/view.json, timeline.jsonl and Mermaid network snapshots"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"required": [],
|
|
236
|
+
"additionalProperties": false
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "lint_memory_wiki",
|
|
241
|
+
"description": "Run wiki memory lint checks for graph consistency, evidence coverage, page quality, and structured repair guidance",
|
|
242
|
+
"parameters": {
|
|
243
|
+
"type": "object",
|
|
244
|
+
"properties": {},
|
|
245
|
+
"required": [],
|
|
246
|
+
"additionalProperties": false
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "list_graph_conflicts",
|
|
251
|
+
"description": "List pending/handled graph memory conflicts that require user confirmation",
|
|
252
|
+
"parameters": {
|
|
253
|
+
"type": "object",
|
|
254
|
+
"properties": {
|
|
255
|
+
"status": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"enum": ["pending", "accepted", "rejected", "all"],
|
|
258
|
+
"description": "Filter conflict status"
|
|
259
|
+
},
|
|
260
|
+
"limit": {
|
|
261
|
+
"type": "integer",
|
|
262
|
+
"description": "Maximum returned conflicts"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"required": [],
|
|
266
|
+
"additionalProperties": false
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "resolve_graph_conflict",
|
|
271
|
+
"description": "Resolve a graph conflict by accepting or rejecting the new candidate fact",
|
|
272
|
+
"parameters": {
|
|
273
|
+
"type": "object",
|
|
274
|
+
"properties": {
|
|
275
|
+
"conflict_id": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"description": "Conflict ID from list_graph_conflicts"
|
|
278
|
+
},
|
|
279
|
+
"action": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"enum": ["accept", "reject"],
|
|
282
|
+
"description": "Resolution action"
|
|
283
|
+
},
|
|
284
|
+
"note": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"description": "Optional note for audit trail"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"required": ["conflict_id", "action"],
|
|
290
|
+
"additionalProperties": false
|
|
291
|
+
}
|
|
292
|
+
},
|
|
149
293
|
{
|
|
150
294
|
"name": "get_hot_context",
|
|
151
295
|
"description": "Get hot memory context for current session",
|
|
@@ -196,6 +340,39 @@
|
|
|
196
340
|
"additionalProperties": false
|
|
197
341
|
}
|
|
198
342
|
},
|
|
343
|
+
{
|
|
344
|
+
"name": "backfill_embeddings",
|
|
345
|
+
"description": "Backfill missing embeddings for active/archive records",
|
|
346
|
+
"parameters": {
|
|
347
|
+
"type": "object",
|
|
348
|
+
"properties": {
|
|
349
|
+
"layer": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"enum": ["active", "archive", "all"],
|
|
352
|
+
"description": "Target layer to backfill"
|
|
353
|
+
},
|
|
354
|
+
"batch_size": {
|
|
355
|
+
"type": "integer",
|
|
356
|
+
"description": "Batch size per processing window"
|
|
357
|
+
},
|
|
358
|
+
"max_retries": {
|
|
359
|
+
"type": "integer",
|
|
360
|
+
"description": "Max retry count for failed records"
|
|
361
|
+
},
|
|
362
|
+
"retry_failed_only": {
|
|
363
|
+
"type": "boolean",
|
|
364
|
+
"description": "Only retry failed records"
|
|
365
|
+
},
|
|
366
|
+
"rebuild_mode": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"enum": ["incremental", "vector_only", "full"],
|
|
369
|
+
"description": "Rebuild mode"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"required": [],
|
|
373
|
+
"additionalProperties": false
|
|
374
|
+
}
|
|
375
|
+
},
|
|
199
376
|
{
|
|
200
377
|
"name": "delete_memory",
|
|
201
378
|
"description": "Delete a memory by ID",
|
|
@@ -212,7 +389,7 @@
|
|
|
212
389
|
}
|
|
213
390
|
},
|
|
214
391
|
{
|
|
215
|
-
"name": "
|
|
392
|
+
"name": "cortex_diagnostics",
|
|
216
393
|
"description": "Check memory system status",
|
|
217
394
|
"parameters": {
|
|
218
395
|
"type": "object",
|
|
@@ -220,6 +397,17 @@
|
|
|
220
397
|
"required": [],
|
|
221
398
|
"additionalProperties": false
|
|
222
399
|
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "diagnostics",
|
|
403
|
+
"description": "Legacy alias for cortex_diagnostics",
|
|
404
|
+
"optional": true,
|
|
405
|
+
"parameters": {
|
|
406
|
+
"type": "object",
|
|
407
|
+
"properties": {},
|
|
408
|
+
"required": [],
|
|
409
|
+
"additionalProperties": false
|
|
410
|
+
}
|
|
223
411
|
}
|
|
224
412
|
],
|
|
225
413
|
"configSchema": {
|
|
@@ -230,20 +418,9 @@
|
|
|
230
418
|
"description": "Enable or disable Cortex Memory plugin",
|
|
231
419
|
"default": true
|
|
232
420
|
},
|
|
233
|
-
"apiUrl": {
|
|
234
|
-
"type": "string",
|
|
235
|
-
"description": "URL of the memory service API",
|
|
236
|
-
"default": "http://localhost:8765"
|
|
237
|
-
},
|
|
238
|
-
"engineMode": {
|
|
239
|
-
"type": "string",
|
|
240
|
-
"description": "Memory engine mode",
|
|
241
|
-
"enum": ["ts"],
|
|
242
|
-
"default": "ts"
|
|
243
|
-
},
|
|
244
421
|
"dbPath": {
|
|
245
422
|
"type": "string",
|
|
246
|
-
"description": "Path to the memory database directory"
|
|
423
|
+
"description": "Path to the memory database directory (default: <openclaw_base>/workspace/memory/openclaw-cortex-memory)"
|
|
247
424
|
},
|
|
248
425
|
"autoSync": {
|
|
249
426
|
"type": "boolean",
|
|
@@ -260,6 +437,35 @@
|
|
|
260
437
|
"description": "Auto reflection scan interval in minutes",
|
|
261
438
|
"default": 30
|
|
262
439
|
},
|
|
440
|
+
"graphQualityMode": {
|
|
441
|
+
"type": "string",
|
|
442
|
+
"description": "Graph extraction quality gate mode",
|
|
443
|
+
"enum": ["off", "warn", "strict"],
|
|
444
|
+
"default": "warn"
|
|
445
|
+
},
|
|
446
|
+
"wikiProjection": {
|
|
447
|
+
"type": "object",
|
|
448
|
+
"description": "Feature flags for wiki projection runtime",
|
|
449
|
+
"properties": {
|
|
450
|
+
"enabled": {
|
|
451
|
+
"type": "boolean",
|
|
452
|
+
"description": "Enable wiki projection pipeline",
|
|
453
|
+
"default": false
|
|
454
|
+
},
|
|
455
|
+
"mode": {
|
|
456
|
+
"type": "string",
|
|
457
|
+
"description": "Wiki projection mode",
|
|
458
|
+
"enum": ["off", "incremental", "rebuild"],
|
|
459
|
+
"default": "off"
|
|
460
|
+
},
|
|
461
|
+
"maxBatch": {
|
|
462
|
+
"type": "integer",
|
|
463
|
+
"description": "Max events/pages processed per projection batch",
|
|
464
|
+
"default": 100
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
"additionalProperties": false
|
|
468
|
+
},
|
|
263
469
|
"embedding": {
|
|
264
470
|
"type": "object",
|
|
265
471
|
"description": "Embedding model configuration",
|
|
@@ -299,7 +505,7 @@
|
|
|
299
505
|
"default": 4
|
|
300
506
|
}
|
|
301
507
|
},
|
|
302
|
-
"required": ["provider", "model"
|
|
508
|
+
"required": ["provider", "model"],
|
|
303
509
|
"additionalProperties": false
|
|
304
510
|
},
|
|
305
511
|
"llm": {
|
|
@@ -327,7 +533,7 @@
|
|
|
327
533
|
"description": "LLM API base URL (camelCase alias)"
|
|
328
534
|
}
|
|
329
535
|
},
|
|
330
|
-
"required": ["provider", "model"
|
|
536
|
+
"required": ["provider", "model"],
|
|
331
537
|
"additionalProperties": false
|
|
332
538
|
},
|
|
333
539
|
"reranker": {
|
|
@@ -355,7 +561,7 @@
|
|
|
355
561
|
"description": "Reranker API base URL (camelCase alias)"
|
|
356
562
|
}
|
|
357
563
|
},
|
|
358
|
-
"required": ["
|
|
564
|
+
"required": ["model"],
|
|
359
565
|
"additionalProperties": false
|
|
360
566
|
},
|
|
361
567
|
"fallbackToBuiltin": {
|
|
@@ -381,6 +587,124 @@
|
|
|
381
587
|
"type": "boolean",
|
|
382
588
|
"description": "Return only fused authoritative memory package to agent",
|
|
383
589
|
"default": true
|
|
590
|
+
},
|
|
591
|
+
"channelWeights": {
|
|
592
|
+
"type": "object",
|
|
593
|
+
"description": "Channel score multiplier overrides",
|
|
594
|
+
"properties": {
|
|
595
|
+
"rules": { "type": "number" },
|
|
596
|
+
"archive": { "type": "number" },
|
|
597
|
+
"vector": { "type": "number" },
|
|
598
|
+
"graph": { "type": "number" }
|
|
599
|
+
},
|
|
600
|
+
"additionalProperties": false
|
|
601
|
+
},
|
|
602
|
+
"channelTopK": {
|
|
603
|
+
"type": "object",
|
|
604
|
+
"description": "Per-channel pre-merge candidate quotas",
|
|
605
|
+
"properties": {
|
|
606
|
+
"rules": { "type": "integer" },
|
|
607
|
+
"archive": { "type": "integer" },
|
|
608
|
+
"vector": { "type": "integer" },
|
|
609
|
+
"graph": { "type": "integer" }
|
|
610
|
+
},
|
|
611
|
+
"additionalProperties": false
|
|
612
|
+
},
|
|
613
|
+
"minLexicalHits": {
|
|
614
|
+
"type": "integer",
|
|
615
|
+
"description": "Ensure lexical-hit coverage in final ranked set"
|
|
616
|
+
},
|
|
617
|
+
"minSemanticHits": {
|
|
618
|
+
"type": "integer",
|
|
619
|
+
"description": "Ensure semantic-hit coverage in final ranked set"
|
|
620
|
+
},
|
|
621
|
+
"lengthNorm": {
|
|
622
|
+
"type": "object",
|
|
623
|
+
"description": "Length normalization settings for semantic score",
|
|
624
|
+
"properties": {
|
|
625
|
+
"enabled": { "type": "boolean", "default": true },
|
|
626
|
+
"pivotChars": { "type": "integer", "default": 1200 },
|
|
627
|
+
"strength": { "type": "number", "default": 0.75 },
|
|
628
|
+
"minFactor": { "type": "number", "default": 0.45 }
|
|
629
|
+
},
|
|
630
|
+
"additionalProperties": false
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
"additionalProperties": false
|
|
634
|
+
},
|
|
635
|
+
"vectorChunking": {
|
|
636
|
+
"type": "object",
|
|
637
|
+
"description": "Vector chunking controls for active/archive full-text chunk embeddings",
|
|
638
|
+
"properties": {
|
|
639
|
+
"chunkSize": {
|
|
640
|
+
"type": "integer",
|
|
641
|
+
"description": "Chunk size in characters",
|
|
642
|
+
"default": 600
|
|
643
|
+
},
|
|
644
|
+
"chunkOverlap": {
|
|
645
|
+
"type": "integer",
|
|
646
|
+
"description": "Chunk overlap in characters",
|
|
647
|
+
"default": 100
|
|
648
|
+
},
|
|
649
|
+
"evidenceMaxChunks": {
|
|
650
|
+
"type": "integer",
|
|
651
|
+
"description": "Maximum evidence chunks per archive event",
|
|
652
|
+
"default": 2
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
"additionalProperties": false
|
|
656
|
+
},
|
|
657
|
+
"writePolicy": {
|
|
658
|
+
"type": "object",
|
|
659
|
+
"description": "Write-path quality thresholds and limits",
|
|
660
|
+
"properties": {
|
|
661
|
+
"archiveMinConfidence": {
|
|
662
|
+
"type": "number",
|
|
663
|
+
"description": "Minimum confidence for archiving events",
|
|
664
|
+
"default": 0.35
|
|
665
|
+
},
|
|
666
|
+
"archiveMinQualityScore": {
|
|
667
|
+
"type": "number",
|
|
668
|
+
"description": "Minimum quality score for archive events",
|
|
669
|
+
"default": 0.4
|
|
670
|
+
},
|
|
671
|
+
"activeMinQualityScore": {
|
|
672
|
+
"type": "number",
|
|
673
|
+
"description": "Minimum quality score for active records",
|
|
674
|
+
"default": 0.45
|
|
675
|
+
},
|
|
676
|
+
"activeDedupTailLines": {
|
|
677
|
+
"type": "integer",
|
|
678
|
+
"description": "Active-layer dedup tail line window",
|
|
679
|
+
"default": 200
|
|
680
|
+
},
|
|
681
|
+
"activeTextMaxChars": {
|
|
682
|
+
"type": "integer",
|
|
683
|
+
"description": "Maximum chars for active text payload",
|
|
684
|
+
"default": 200000
|
|
685
|
+
},
|
|
686
|
+
"archiveSourceTextMaxChars": {
|
|
687
|
+
"type": "integer",
|
|
688
|
+
"description": "Maximum chars for archive source_text payload",
|
|
689
|
+
"default": 500000
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
"additionalProperties": false
|
|
693
|
+
},
|
|
694
|
+
"syncPolicy": {
|
|
695
|
+
"type": "object",
|
|
696
|
+
"description": "Sync ingestion controls",
|
|
697
|
+
"properties": {
|
|
698
|
+
"includeLocalActiveInput": {
|
|
699
|
+
"type": "boolean",
|
|
700
|
+
"description": "Whether sync_memory reads local memory/sessions/active/sessions.jsonl as source input",
|
|
701
|
+
"default": false
|
|
702
|
+
},
|
|
703
|
+
"graphQualityMode": {
|
|
704
|
+
"type": "string",
|
|
705
|
+
"description": "Graph quality gate mode for sync_memory/history import writes",
|
|
706
|
+
"enum": ["off", "warn", "strict"],
|
|
707
|
+
"default": "strict"
|
|
384
708
|
}
|
|
385
709
|
},
|
|
386
710
|
"additionalProperties": false
|
|
@@ -440,6 +764,61 @@
|
|
|
440
764
|
}
|
|
441
765
|
},
|
|
442
766
|
"additionalProperties": false
|
|
767
|
+
},
|
|
768
|
+
"readTuning": {
|
|
769
|
+
"type": "object",
|
|
770
|
+
"description": "Read-path ranking and recency tuning",
|
|
771
|
+
"properties": {
|
|
772
|
+
"scoring": {
|
|
773
|
+
"type": "object",
|
|
774
|
+
"properties": {
|
|
775
|
+
"lexicalWeight": { "type": "number", "default": 0.2 },
|
|
776
|
+
"bm25Scale": { "type": "number", "default": 2 },
|
|
777
|
+
"semanticWeight": { "type": "number", "default": 0.3 },
|
|
778
|
+
"recencyWeight": { "type": "number", "default": 0.1 },
|
|
779
|
+
"qualityWeight": { "type": "number", "default": 0.15 },
|
|
780
|
+
"typeMatchWeight": { "type": "number", "default": 0.15 },
|
|
781
|
+
"graphMatchWeight": { "type": "number", "default": 0.1 }
|
|
782
|
+
},
|
|
783
|
+
"additionalProperties": false
|
|
784
|
+
},
|
|
785
|
+
"rrf": {
|
|
786
|
+
"type": "object",
|
|
787
|
+
"properties": {
|
|
788
|
+
"k": { "type": "integer", "default": 60 },
|
|
789
|
+
"weight": { "type": "number", "default": 1.5 }
|
|
790
|
+
},
|
|
791
|
+
"additionalProperties": false
|
|
792
|
+
},
|
|
793
|
+
"recency": {
|
|
794
|
+
"type": "object",
|
|
795
|
+
"properties": {
|
|
796
|
+
"buckets": {
|
|
797
|
+
"type": "array",
|
|
798
|
+
"items": {
|
|
799
|
+
"type": "object",
|
|
800
|
+
"properties": {
|
|
801
|
+
"maxAgeHours": { "type": "number" },
|
|
802
|
+
"score": { "type": "number" },
|
|
803
|
+
"bonus": { "type": "number" }
|
|
804
|
+
},
|
|
805
|
+
"required": ["maxAgeHours", "score", "bonus"],
|
|
806
|
+
"additionalProperties": false
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
"additionalProperties": false
|
|
811
|
+
},
|
|
812
|
+
"autoContext": {
|
|
813
|
+
"type": "object",
|
|
814
|
+
"properties": {
|
|
815
|
+
"queryMaxChars": { "type": "integer", "default": 240 },
|
|
816
|
+
"lightweightSearch": { "type": "boolean", "default": true }
|
|
817
|
+
},
|
|
818
|
+
"additionalProperties": false
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
"additionalProperties": false
|
|
443
822
|
}
|
|
444
823
|
},
|
|
445
824
|
"additionalProperties": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-cortex-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Long-term memory system for OpenClaw AI Agent",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,8 +14,19 @@
|
|
|
14
14
|
"test:compat": "node scripts/compat-regression.js",
|
|
15
15
|
"test:model": "node scripts/model-regression.js",
|
|
16
16
|
"test:graph": "node scripts/graph-eval.js",
|
|
17
|
+
"test:graph-quality": "node scripts/graph-quality-eval.js",
|
|
18
|
+
"test:graph-quality-zh": "node scripts/graph-quality-eval.js --gold eval/graph_quality_gold.zh.jsonl --pred eval/graph_quality_predictions.zh.sample.jsonl --thresholds eval/graph_quality_thresholds.json",
|
|
19
|
+
"test:m1-ingest-regression": "node scripts/m1-ingest-regression.js",
|
|
20
|
+
"test:m2-quality-dedup": "node scripts/m2-quality-dedup-regression.js",
|
|
21
|
+
"test:m3-graph-quality-conflicts": "node scripts/m3-graph-quality-conflicts-regression.js",
|
|
22
|
+
"test:m5-cross-store": "node scripts/m5-cross-store-regression.js",
|
|
23
|
+
"test:wiki-projection": "node scripts/wiki-projection-regression.js",
|
|
24
|
+
"test:wiki-lint": "node scripts/wiki-lint-regression.js",
|
|
25
|
+
"test:read-search": "node scripts/read-search-regression.js",
|
|
26
|
+
"test:extended-blocking": "npm run test:m1-ingest-regression && npm run test:m2-quality-dedup && npm run test:m3-graph-quality-conflicts && npm run test:m5-cross-store && npm run test:wiki-projection && npm run test:wiki-lint",
|
|
27
|
+
"test:ci-core": "npm run test:m1-ingest-regression && npm run test:m2-quality-dedup && npm run test:m3-graph-quality-conflicts && npm run test:m5-cross-store && npm run test:wiki-projection && npm run test:wiki-lint && npm run test:graph && npm run test:lengthnorm && npm run test:read-search",
|
|
17
28
|
"test:lengthnorm": "node scripts/lengthnorm-regression.js",
|
|
18
|
-
"test:all": "npm run test:compat && npm run test:model && npm run test:graph && npm run test:lengthnorm",
|
|
29
|
+
"test:all": "npm run test:compat && npm run test:model && npm run test:graph && npm run test:graph-quality && npm run test:graph-quality-zh && npm run test:lengthnorm && npm run test:read-search",
|
|
19
30
|
"release:check": "node scripts/release-pipeline.js",
|
|
20
31
|
"dev": "tsc --watch",
|
|
21
32
|
"prepack": "npm run build",
|
|
@@ -38,10 +49,11 @@
|
|
|
38
49
|
},
|
|
39
50
|
"devDependencies": {
|
|
40
51
|
"@types/node": "^22.19.15",
|
|
52
|
+
"clawhub": "^0.9.0",
|
|
41
53
|
"typescript": "^5.7.2"
|
|
42
54
|
},
|
|
43
55
|
"peerDependencies": {
|
|
44
|
-
"openclaw": ">=2026.
|
|
56
|
+
"openclaw": ">=2026.4.5"
|
|
45
57
|
},
|
|
46
58
|
"engines": {
|
|
47
59
|
"node": ">=22.0.0"
|
|
@@ -50,15 +62,49 @@
|
|
|
50
62
|
"dist/",
|
|
51
63
|
"scripts/cli.js",
|
|
52
64
|
"scripts/uninstall.js",
|
|
65
|
+
"scripts/repair-memory.js",
|
|
66
|
+
"schema/",
|
|
53
67
|
"openclaw.plugin.json",
|
|
54
|
-
"
|
|
68
|
+
"SIGNATURE.md",
|
|
69
|
+
"SKILL.md",
|
|
70
|
+
"skills/cortex-memory/"
|
|
55
71
|
],
|
|
56
72
|
"openclaw": {
|
|
57
73
|
"plugin": true,
|
|
58
74
|
"requiresPython": false,
|
|
59
75
|
"cli": "cortex-memory",
|
|
76
|
+
"requires": {
|
|
77
|
+
"credentials": true,
|
|
78
|
+
"network": true,
|
|
79
|
+
"env": [
|
|
80
|
+
"EMBEDDING_API_KEY",
|
|
81
|
+
"LLM_API_KEY",
|
|
82
|
+
"RERANKER_API_KEY"
|
|
83
|
+
],
|
|
84
|
+
"config": [
|
|
85
|
+
"embedding.apiKey",
|
|
86
|
+
"llm.apiKey",
|
|
87
|
+
"reranker.apiKey",
|
|
88
|
+
"embedding.baseURL",
|
|
89
|
+
"llm.baseURL",
|
|
90
|
+
"reranker.baseURL"
|
|
91
|
+
],
|
|
92
|
+
"externalEndpoints": [
|
|
93
|
+
"embedding API endpoint (OpenAI-compatible /embeddings)",
|
|
94
|
+
"LLM API endpoint (OpenAI-compatible /chat/completions)",
|
|
95
|
+
"reranker API endpoint (/rerank)"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"build": {
|
|
99
|
+
"openclawVersion": "2026.4.5",
|
|
100
|
+
"pluginSdkVersion": "2026.4.5"
|
|
101
|
+
},
|
|
102
|
+
"install": {
|
|
103
|
+
"minHostVersion": ">=2026.4.5"
|
|
104
|
+
},
|
|
60
105
|
"compat": {
|
|
61
|
-
"pluginApi": ">=2026.
|
|
106
|
+
"pluginApi": ">=2026.4.5",
|
|
107
|
+
"minGatewayVersion": "2026.4.5"
|
|
62
108
|
},
|
|
63
109
|
"extensions": [
|
|
64
110
|
"./dist/index.js"
|