openclaw-cortex-memory 0.1.0-Alpha.8 → 0.1.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/LICENSE +21 -0
- package/README.md +347 -299
- package/SIGNATURE.md +7 -0
- package/SKILL.md +96 -350
- package/dist/index.d.ts +93 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1234 -1318
- package/dist/index.js.map +1 -1
- package/dist/openclaw.plugin.json +377 -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 +6 -1
- package/dist/src/engine/memory_engine.d.ts.map +1 -1
- package/dist/src/engine/ts_engine.d.ts +208 -0
- package/dist/src/engine/ts_engine.d.ts.map +1 -1
- package/dist/src/engine/ts_engine.js +1353 -84
- package/dist/src/engine/ts_engine.js.map +1 -1
- package/dist/src/engine/types.d.ts +27 -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 +31 -214
- package/dist/src/session/session_end.js.map +1 -1
- package/dist/src/store/archive_store.d.ts +52 -7
- package/dist/src/store/archive_store.d.ts.map +1 -1
- package/dist/src/store/archive_store.js +526 -96
- package/dist/src/store/archive_store.js.map +1 -1
- package/dist/src/store/embedding_utils.d.ts +32 -0
- package/dist/src/store/embedding_utils.d.ts.map +1 -0
- package/dist/src/store/embedding_utils.js +173 -0
- package/dist/src/store/embedding_utils.js.map +1 -0
- 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 +95 -0
- package/dist/src/store/read_store.d.ts.map +1 -1
- package/dist/src/store/read_store.js +2108 -268
- package/dist/src/store/read_store.js.map +1 -1
- package/dist/src/store/vector_store.d.ts +15 -0
- package/dist/src/store/vector_store.d.ts.map +1 -1
- package/dist/src/store/vector_store.js +75 -1
- package/dist/src/store/vector_store.js.map +1 -1
- package/dist/src/store/write_store.d.ts +46 -0
- package/dist/src/store/write_store.d.ts.map +1 -1
- package/dist/src/store/write_store.js +399 -50
- package/dist/src/store/write_store.js.map +1 -1
- package/dist/src/sync/session_sync.d.ts +115 -2
- package/dist/src/sync/session_sync.d.ts.map +1 -1
- package/dist/src/sync/session_sync.js +2497 -44
- package/dist/src/sync/session_sync.js.map +1 -1
- package/dist/src/utils/runtime_env.d.ts +4 -0
- package/dist/src/utils/runtime_env.d.ts.map +1 -0
- package/dist/src/utils/runtime_env.js +51 -0
- package/dist/src/utils/runtime_env.js.map +1 -0
- 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 +377 -18
- package/package.json +52 -5
- package/schema/graph.schema.yaml +330 -0
- package/scripts/cli.js +80 -26
- package/scripts/repair-memory.js +321 -0
- package/scripts/uninstall.js +7 -1
- 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.0
|
|
4
|
+
"version": "0.1.0",
|
|
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,27 @@
|
|
|
18
18
|
"channels": false,
|
|
19
19
|
"memory": true
|
|
20
20
|
},
|
|
21
|
+
"runtimeRequirements": {
|
|
22
|
+
"requiresCredentials": true,
|
|
23
|
+
"requiresNetwork": true,
|
|
24
|
+
"credentialSources": {
|
|
25
|
+
"env": [
|
|
26
|
+
"EMBEDDING_API_KEY",
|
|
27
|
+
"LLM_API_KEY",
|
|
28
|
+
"RERANKER_API_KEY"
|
|
29
|
+
],
|
|
30
|
+
"pluginConfig": [
|
|
31
|
+
"embedding.apiKey",
|
|
32
|
+
"llm.apiKey",
|
|
33
|
+
"reranker.apiKey"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"externalEndpoints": {
|
|
37
|
+
"embedding": "OpenAI-compatible /embeddings endpoint",
|
|
38
|
+
"llm": "OpenAI-compatible /chat/completions endpoint",
|
|
39
|
+
"reranker": "Reranker /rerank endpoint"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
21
42
|
"hooks": [
|
|
22
43
|
"message_received",
|
|
23
44
|
"session_end"
|
|
@@ -36,6 +57,15 @@
|
|
|
36
57
|
"top_k": {
|
|
37
58
|
"type": "integer",
|
|
38
59
|
"description": "Number of results to return"
|
|
60
|
+
},
|
|
61
|
+
"fusion_mode": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"enum": ["auto", "authoritative", "candidates", "off"],
|
|
64
|
+
"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."
|
|
65
|
+
},
|
|
66
|
+
"track_hits": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"description": "Whether to update anti-decay hit statistics. Set false for diagnostics or benchmarks."
|
|
39
69
|
}
|
|
40
70
|
},
|
|
41
71
|
"required": ["query"],
|
|
@@ -52,6 +82,18 @@
|
|
|
52
82
|
"type": "string",
|
|
53
83
|
"description": "Event summary"
|
|
54
84
|
},
|
|
85
|
+
"cause": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"description": "What triggered the event (task/request/problem statement)"
|
|
88
|
+
},
|
|
89
|
+
"process": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "How the task was handled (steps/attempts/iterations)"
|
|
92
|
+
},
|
|
93
|
+
"result": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "Final result and acceptance outcome"
|
|
96
|
+
},
|
|
55
97
|
"entities": {
|
|
56
98
|
"type": "array",
|
|
57
99
|
"description": "Involved entities",
|
|
@@ -78,6 +120,13 @@
|
|
|
78
120
|
]
|
|
79
121
|
}
|
|
80
122
|
},
|
|
123
|
+
"entity_types": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"description": "Entity type map, key is entity name and value is type",
|
|
126
|
+
"additionalProperties": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
81
130
|
"outcome": {
|
|
82
131
|
"type": "string",
|
|
83
132
|
"description": "Event outcome"
|
|
@@ -101,6 +150,12 @@
|
|
|
101
150
|
},
|
|
102
151
|
"type": {
|
|
103
152
|
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"evidence_span": {
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
"confidence": {
|
|
158
|
+
"type": "number"
|
|
104
159
|
}
|
|
105
160
|
},
|
|
106
161
|
"required": ["source", "target"],
|
|
@@ -146,6 +201,75 @@
|
|
|
146
201
|
"additionalProperties": false
|
|
147
202
|
}
|
|
148
203
|
},
|
|
204
|
+
{
|
|
205
|
+
"name": "export_graph_view",
|
|
206
|
+
"description": "Export status-aware graph view and optionally write wiki graph snapshots",
|
|
207
|
+
"parameters": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"properties": {
|
|
210
|
+
"write_snapshot": {
|
|
211
|
+
"type": "boolean",
|
|
212
|
+
"description": "When true (default), write wiki/graph/view.json, timeline.jsonl and Mermaid network snapshots"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"required": [],
|
|
216
|
+
"additionalProperties": false
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "lint_memory_wiki",
|
|
221
|
+
"description": "Run wiki memory lint checks for graph consistency, evidence coverage, page quality, and structured repair guidance",
|
|
222
|
+
"parameters": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"properties": {},
|
|
225
|
+
"required": [],
|
|
226
|
+
"additionalProperties": false
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "list_graph_conflicts",
|
|
231
|
+
"description": "List pending/handled graph memory conflicts that require user confirmation",
|
|
232
|
+
"parameters": {
|
|
233
|
+
"type": "object",
|
|
234
|
+
"properties": {
|
|
235
|
+
"status": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"enum": ["pending", "accepted", "rejected", "all"],
|
|
238
|
+
"description": "Filter conflict status"
|
|
239
|
+
},
|
|
240
|
+
"limit": {
|
|
241
|
+
"type": "integer",
|
|
242
|
+
"description": "Maximum returned conflicts"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": [],
|
|
246
|
+
"additionalProperties": false
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "resolve_graph_conflict",
|
|
251
|
+
"description": "Resolve a graph conflict by accepting or rejecting the new candidate fact",
|
|
252
|
+
"parameters": {
|
|
253
|
+
"type": "object",
|
|
254
|
+
"properties": {
|
|
255
|
+
"conflict_id": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"description": "Conflict ID from list_graph_conflicts"
|
|
258
|
+
},
|
|
259
|
+
"action": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"enum": ["accept", "reject"],
|
|
262
|
+
"description": "Resolution action"
|
|
263
|
+
},
|
|
264
|
+
"note": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"description": "Optional note for audit trail"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"required": ["conflict_id", "action"],
|
|
270
|
+
"additionalProperties": false
|
|
271
|
+
}
|
|
272
|
+
},
|
|
149
273
|
{
|
|
150
274
|
"name": "get_hot_context",
|
|
151
275
|
"description": "Get hot memory context for current session",
|
|
@@ -196,6 +320,39 @@
|
|
|
196
320
|
"additionalProperties": false
|
|
197
321
|
}
|
|
198
322
|
},
|
|
323
|
+
{
|
|
324
|
+
"name": "backfill_embeddings",
|
|
325
|
+
"description": "Backfill missing embeddings for active/archive records",
|
|
326
|
+
"parameters": {
|
|
327
|
+
"type": "object",
|
|
328
|
+
"properties": {
|
|
329
|
+
"layer": {
|
|
330
|
+
"type": "string",
|
|
331
|
+
"enum": ["active", "archive", "all"],
|
|
332
|
+
"description": "Target layer to backfill"
|
|
333
|
+
},
|
|
334
|
+
"batch_size": {
|
|
335
|
+
"type": "integer",
|
|
336
|
+
"description": "Batch size per processing window"
|
|
337
|
+
},
|
|
338
|
+
"max_retries": {
|
|
339
|
+
"type": "integer",
|
|
340
|
+
"description": "Max retry count for failed records"
|
|
341
|
+
},
|
|
342
|
+
"retry_failed_only": {
|
|
343
|
+
"type": "boolean",
|
|
344
|
+
"description": "Only retry failed records"
|
|
345
|
+
},
|
|
346
|
+
"rebuild_mode": {
|
|
347
|
+
"type": "string",
|
|
348
|
+
"enum": ["incremental", "vector_only", "full"],
|
|
349
|
+
"description": "Rebuild mode"
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"required": [],
|
|
353
|
+
"additionalProperties": false
|
|
354
|
+
}
|
|
355
|
+
},
|
|
199
356
|
{
|
|
200
357
|
"name": "delete_memory",
|
|
201
358
|
"description": "Delete a memory by ID",
|
|
@@ -212,7 +369,7 @@
|
|
|
212
369
|
}
|
|
213
370
|
},
|
|
214
371
|
{
|
|
215
|
-
"name": "
|
|
372
|
+
"name": "cortex_diagnostics",
|
|
216
373
|
"description": "Check memory system status",
|
|
217
374
|
"parameters": {
|
|
218
375
|
"type": "object",
|
|
@@ -220,6 +377,17 @@
|
|
|
220
377
|
"required": [],
|
|
221
378
|
"additionalProperties": false
|
|
222
379
|
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "diagnostics",
|
|
383
|
+
"description": "Legacy alias for cortex_diagnostics",
|
|
384
|
+
"optional": true,
|
|
385
|
+
"parameters": {
|
|
386
|
+
"type": "object",
|
|
387
|
+
"properties": {},
|
|
388
|
+
"required": [],
|
|
389
|
+
"additionalProperties": false
|
|
390
|
+
}
|
|
223
391
|
}
|
|
224
392
|
],
|
|
225
393
|
"configSchema": {
|
|
@@ -230,20 +398,9 @@
|
|
|
230
398
|
"description": "Enable or disable Cortex Memory plugin",
|
|
231
399
|
"default": true
|
|
232
400
|
},
|
|
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
401
|
"dbPath": {
|
|
245
402
|
"type": "string",
|
|
246
|
-
"description": "Path to the memory database directory"
|
|
403
|
+
"description": "Path to the memory database directory (default: <openclaw_base>/workspace/memory/openclaw-cortex-memory)"
|
|
247
404
|
},
|
|
248
405
|
"autoSync": {
|
|
249
406
|
"type": "boolean",
|
|
@@ -260,6 +417,35 @@
|
|
|
260
417
|
"description": "Auto reflection scan interval in minutes",
|
|
261
418
|
"default": 30
|
|
262
419
|
},
|
|
420
|
+
"graphQualityMode": {
|
|
421
|
+
"type": "string",
|
|
422
|
+
"description": "Graph extraction quality gate mode",
|
|
423
|
+
"enum": ["off", "warn", "strict"],
|
|
424
|
+
"default": "warn"
|
|
425
|
+
},
|
|
426
|
+
"wikiProjection": {
|
|
427
|
+
"type": "object",
|
|
428
|
+
"description": "Feature flags for wiki projection runtime",
|
|
429
|
+
"properties": {
|
|
430
|
+
"enabled": {
|
|
431
|
+
"type": "boolean",
|
|
432
|
+
"description": "Enable wiki projection pipeline",
|
|
433
|
+
"default": false
|
|
434
|
+
},
|
|
435
|
+
"mode": {
|
|
436
|
+
"type": "string",
|
|
437
|
+
"description": "Wiki projection mode",
|
|
438
|
+
"enum": ["off", "incremental", "rebuild"],
|
|
439
|
+
"default": "off"
|
|
440
|
+
},
|
|
441
|
+
"maxBatch": {
|
|
442
|
+
"type": "integer",
|
|
443
|
+
"description": "Max events/pages processed per projection batch",
|
|
444
|
+
"default": 100
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"additionalProperties": false
|
|
448
|
+
},
|
|
263
449
|
"embedding": {
|
|
264
450
|
"type": "object",
|
|
265
451
|
"description": "Embedding model configuration",
|
|
@@ -299,7 +485,7 @@
|
|
|
299
485
|
"default": 4
|
|
300
486
|
}
|
|
301
487
|
},
|
|
302
|
-
"required": ["provider", "model"
|
|
488
|
+
"required": ["provider", "model"],
|
|
303
489
|
"additionalProperties": false
|
|
304
490
|
},
|
|
305
491
|
"llm": {
|
|
@@ -327,7 +513,7 @@
|
|
|
327
513
|
"description": "LLM API base URL (camelCase alias)"
|
|
328
514
|
}
|
|
329
515
|
},
|
|
330
|
-
"required": ["provider", "model"
|
|
516
|
+
"required": ["provider", "model"],
|
|
331
517
|
"additionalProperties": false
|
|
332
518
|
},
|
|
333
519
|
"reranker": {
|
|
@@ -355,7 +541,7 @@
|
|
|
355
541
|
"description": "Reranker API base URL (camelCase alias)"
|
|
356
542
|
}
|
|
357
543
|
},
|
|
358
|
-
"required": ["
|
|
544
|
+
"required": ["model"],
|
|
359
545
|
"additionalProperties": false
|
|
360
546
|
},
|
|
361
547
|
"fallbackToBuiltin": {
|
|
@@ -381,6 +567,124 @@
|
|
|
381
567
|
"type": "boolean",
|
|
382
568
|
"description": "Return only fused authoritative memory package to agent",
|
|
383
569
|
"default": true
|
|
570
|
+
},
|
|
571
|
+
"channelWeights": {
|
|
572
|
+
"type": "object",
|
|
573
|
+
"description": "Channel score multiplier overrides",
|
|
574
|
+
"properties": {
|
|
575
|
+
"rules": { "type": "number" },
|
|
576
|
+
"archive": { "type": "number" },
|
|
577
|
+
"vector": { "type": "number" },
|
|
578
|
+
"graph": { "type": "number" }
|
|
579
|
+
},
|
|
580
|
+
"additionalProperties": false
|
|
581
|
+
},
|
|
582
|
+
"channelTopK": {
|
|
583
|
+
"type": "object",
|
|
584
|
+
"description": "Per-channel pre-merge candidate quotas",
|
|
585
|
+
"properties": {
|
|
586
|
+
"rules": { "type": "integer" },
|
|
587
|
+
"archive": { "type": "integer" },
|
|
588
|
+
"vector": { "type": "integer" },
|
|
589
|
+
"graph": { "type": "integer" }
|
|
590
|
+
},
|
|
591
|
+
"additionalProperties": false
|
|
592
|
+
},
|
|
593
|
+
"minLexicalHits": {
|
|
594
|
+
"type": "integer",
|
|
595
|
+
"description": "Ensure lexical-hit coverage in final ranked set"
|
|
596
|
+
},
|
|
597
|
+
"minSemanticHits": {
|
|
598
|
+
"type": "integer",
|
|
599
|
+
"description": "Ensure semantic-hit coverage in final ranked set"
|
|
600
|
+
},
|
|
601
|
+
"lengthNorm": {
|
|
602
|
+
"type": "object",
|
|
603
|
+
"description": "Length normalization settings for semantic score",
|
|
604
|
+
"properties": {
|
|
605
|
+
"enabled": { "type": "boolean", "default": true },
|
|
606
|
+
"pivotChars": { "type": "integer", "default": 1200 },
|
|
607
|
+
"strength": { "type": "number", "default": 0.75 },
|
|
608
|
+
"minFactor": { "type": "number", "default": 0.45 }
|
|
609
|
+
},
|
|
610
|
+
"additionalProperties": false
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
"additionalProperties": false
|
|
614
|
+
},
|
|
615
|
+
"vectorChunking": {
|
|
616
|
+
"type": "object",
|
|
617
|
+
"description": "Vector chunking controls for active/archive full-text chunk embeddings",
|
|
618
|
+
"properties": {
|
|
619
|
+
"chunkSize": {
|
|
620
|
+
"type": "integer",
|
|
621
|
+
"description": "Chunk size in characters",
|
|
622
|
+
"default": 600
|
|
623
|
+
},
|
|
624
|
+
"chunkOverlap": {
|
|
625
|
+
"type": "integer",
|
|
626
|
+
"description": "Chunk overlap in characters",
|
|
627
|
+
"default": 100
|
|
628
|
+
},
|
|
629
|
+
"evidenceMaxChunks": {
|
|
630
|
+
"type": "integer",
|
|
631
|
+
"description": "Maximum evidence chunks per archive event",
|
|
632
|
+
"default": 2
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
"additionalProperties": false
|
|
636
|
+
},
|
|
637
|
+
"writePolicy": {
|
|
638
|
+
"type": "object",
|
|
639
|
+
"description": "Write-path quality thresholds and limits",
|
|
640
|
+
"properties": {
|
|
641
|
+
"archiveMinConfidence": {
|
|
642
|
+
"type": "number",
|
|
643
|
+
"description": "Minimum confidence for archiving events",
|
|
644
|
+
"default": 0.35
|
|
645
|
+
},
|
|
646
|
+
"archiveMinQualityScore": {
|
|
647
|
+
"type": "number",
|
|
648
|
+
"description": "Minimum quality score for archive events",
|
|
649
|
+
"default": 0.4
|
|
650
|
+
},
|
|
651
|
+
"activeMinQualityScore": {
|
|
652
|
+
"type": "number",
|
|
653
|
+
"description": "Minimum quality score for active records",
|
|
654
|
+
"default": 0.45
|
|
655
|
+
},
|
|
656
|
+
"activeDedupTailLines": {
|
|
657
|
+
"type": "integer",
|
|
658
|
+
"description": "Active-layer dedup tail line window",
|
|
659
|
+
"default": 200
|
|
660
|
+
},
|
|
661
|
+
"activeTextMaxChars": {
|
|
662
|
+
"type": "integer",
|
|
663
|
+
"description": "Maximum chars for active text payload",
|
|
664
|
+
"default": 200000
|
|
665
|
+
},
|
|
666
|
+
"archiveSourceTextMaxChars": {
|
|
667
|
+
"type": "integer",
|
|
668
|
+
"description": "Maximum chars for archive source_text payload",
|
|
669
|
+
"default": 500000
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
"additionalProperties": false
|
|
673
|
+
},
|
|
674
|
+
"syncPolicy": {
|
|
675
|
+
"type": "object",
|
|
676
|
+
"description": "Sync ingestion controls",
|
|
677
|
+
"properties": {
|
|
678
|
+
"includeLocalActiveInput": {
|
|
679
|
+
"type": "boolean",
|
|
680
|
+
"description": "Whether sync_memory reads local memory/sessions/active/sessions.jsonl as source input",
|
|
681
|
+
"default": false
|
|
682
|
+
},
|
|
683
|
+
"graphQualityMode": {
|
|
684
|
+
"type": "string",
|
|
685
|
+
"description": "Graph quality gate mode for sync_memory/history import writes",
|
|
686
|
+
"enum": ["off", "warn", "strict"],
|
|
687
|
+
"default": "strict"
|
|
384
688
|
}
|
|
385
689
|
},
|
|
386
690
|
"additionalProperties": false
|
|
@@ -440,6 +744,61 @@
|
|
|
440
744
|
}
|
|
441
745
|
},
|
|
442
746
|
"additionalProperties": false
|
|
747
|
+
},
|
|
748
|
+
"readTuning": {
|
|
749
|
+
"type": "object",
|
|
750
|
+
"description": "Read-path ranking and recency tuning",
|
|
751
|
+
"properties": {
|
|
752
|
+
"scoring": {
|
|
753
|
+
"type": "object",
|
|
754
|
+
"properties": {
|
|
755
|
+
"lexicalWeight": { "type": "number", "default": 0.2 },
|
|
756
|
+
"bm25Scale": { "type": "number", "default": 2 },
|
|
757
|
+
"semanticWeight": { "type": "number", "default": 0.3 },
|
|
758
|
+
"recencyWeight": { "type": "number", "default": 0.1 },
|
|
759
|
+
"qualityWeight": { "type": "number", "default": 0.15 },
|
|
760
|
+
"typeMatchWeight": { "type": "number", "default": 0.15 },
|
|
761
|
+
"graphMatchWeight": { "type": "number", "default": 0.1 }
|
|
762
|
+
},
|
|
763
|
+
"additionalProperties": false
|
|
764
|
+
},
|
|
765
|
+
"rrf": {
|
|
766
|
+
"type": "object",
|
|
767
|
+
"properties": {
|
|
768
|
+
"k": { "type": "integer", "default": 60 },
|
|
769
|
+
"weight": { "type": "number", "default": 1.5 }
|
|
770
|
+
},
|
|
771
|
+
"additionalProperties": false
|
|
772
|
+
},
|
|
773
|
+
"recency": {
|
|
774
|
+
"type": "object",
|
|
775
|
+
"properties": {
|
|
776
|
+
"buckets": {
|
|
777
|
+
"type": "array",
|
|
778
|
+
"items": {
|
|
779
|
+
"type": "object",
|
|
780
|
+
"properties": {
|
|
781
|
+
"maxAgeHours": { "type": "number" },
|
|
782
|
+
"score": { "type": "number" },
|
|
783
|
+
"bonus": { "type": "number" }
|
|
784
|
+
},
|
|
785
|
+
"required": ["maxAgeHours", "score", "bonus"],
|
|
786
|
+
"additionalProperties": false
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
"additionalProperties": false
|
|
791
|
+
},
|
|
792
|
+
"autoContext": {
|
|
793
|
+
"type": "object",
|
|
794
|
+
"properties": {
|
|
795
|
+
"queryMaxChars": { "type": "integer", "default": 240 },
|
|
796
|
+
"lightweightSearch": { "type": "boolean", "default": true }
|
|
797
|
+
},
|
|
798
|
+
"additionalProperties": false
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
"additionalProperties": false
|
|
443
802
|
}
|
|
444
803
|
},
|
|
445
804
|
"additionalProperties": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-cortex-memory",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
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,7 +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:
|
|
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",
|
|
28
|
+
"test:lengthnorm": "node scripts/lengthnorm-regression.js",
|
|
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",
|
|
18
30
|
"release:check": "node scripts/release-pipeline.js",
|
|
19
31
|
"dev": "tsc --watch",
|
|
20
32
|
"prepack": "npm run build",
|
|
@@ -37,10 +49,11 @@
|
|
|
37
49
|
},
|
|
38
50
|
"devDependencies": {
|
|
39
51
|
"@types/node": "^22.19.15",
|
|
52
|
+
"clawhub": "^0.9.0",
|
|
40
53
|
"typescript": "^5.7.2"
|
|
41
54
|
},
|
|
42
55
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.
|
|
56
|
+
"openclaw": ">=2026.4.5"
|
|
44
57
|
},
|
|
45
58
|
"engines": {
|
|
46
59
|
"node": ">=22.0.0"
|
|
@@ -49,15 +62,49 @@
|
|
|
49
62
|
"dist/",
|
|
50
63
|
"scripts/cli.js",
|
|
51
64
|
"scripts/uninstall.js",
|
|
65
|
+
"scripts/repair-memory.js",
|
|
66
|
+
"schema/",
|
|
52
67
|
"openclaw.plugin.json",
|
|
53
|
-
"
|
|
68
|
+
"SIGNATURE.md",
|
|
69
|
+
"SKILL.md",
|
|
70
|
+
"skills/cortex-memory/"
|
|
54
71
|
],
|
|
55
72
|
"openclaw": {
|
|
56
73
|
"plugin": true,
|
|
57
74
|
"requiresPython": false,
|
|
58
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
|
+
},
|
|
59
105
|
"compat": {
|
|
60
|
-
"pluginApi": ">=2026.
|
|
106
|
+
"pluginApi": ">=2026.4.5",
|
|
107
|
+
"minGatewayVersion": "2026.4.5"
|
|
61
108
|
},
|
|
62
109
|
"extensions": [
|
|
63
110
|
"./dist/index.js"
|