openclaw-cortex-memory 0.1.0-Alpha.3 → 0.1.0-Alpha.31

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.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +296 -203
  3. package/SIGNATURE.md +7 -0
  4. package/SKILL.md +92 -268
  5. package/dist/index.d.ts +100 -22
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1249 -1252
  8. package/dist/index.js.map +1 -1
  9. package/dist/openclaw.plugin.json +501 -16
  10. package/dist/src/dedup/three_stage_deduplicator.d.ts +25 -0
  11. package/dist/src/dedup/three_stage_deduplicator.d.ts.map +1 -0
  12. package/dist/src/dedup/three_stage_deduplicator.js +224 -0
  13. package/dist/src/dedup/three_stage_deduplicator.js.map +1 -0
  14. package/dist/src/engine/memory_engine.d.ts +6 -1
  15. package/dist/src/engine/memory_engine.d.ts.map +1 -1
  16. package/dist/src/engine/ts_engine.d.ts +242 -0
  17. package/dist/src/engine/ts_engine.d.ts.map +1 -1
  18. package/dist/src/engine/ts_engine.js +1468 -52
  19. package/dist/src/engine/ts_engine.js.map +1 -1
  20. package/dist/src/engine/types.d.ts +29 -0
  21. package/dist/src/engine/types.d.ts.map +1 -1
  22. package/dist/src/graph/ontology.d.ts +125 -0
  23. package/dist/src/graph/ontology.d.ts.map +1 -0
  24. package/dist/src/graph/ontology.js +1237 -0
  25. package/dist/src/graph/ontology.js.map +1 -0
  26. package/dist/src/net/http_post.d.ts +17 -0
  27. package/dist/src/net/http_post.d.ts.map +1 -0
  28. package/dist/src/net/http_post.js +56 -0
  29. package/dist/src/net/http_post.js.map +1 -0
  30. package/dist/src/quality/llm_output_validator.d.ts +66 -0
  31. package/dist/src/quality/llm_output_validator.d.ts.map +1 -0
  32. package/dist/src/quality/llm_output_validator.js +659 -0
  33. package/dist/src/quality/llm_output_validator.js.map +1 -0
  34. package/dist/src/reflect/reflector.d.ts +7 -0
  35. package/dist/src/reflect/reflector.d.ts.map +1 -1
  36. package/dist/src/reflect/reflector.js +352 -8
  37. package/dist/src/reflect/reflector.js.map +1 -1
  38. package/dist/src/rules/rule_store.d.ts.map +1 -1
  39. package/dist/src/rules/rule_store.js +75 -16
  40. package/dist/src/rules/rule_store.js.map +1 -1
  41. package/dist/src/session/session_end.d.ts +33 -0
  42. package/dist/src/session/session_end.d.ts.map +1 -1
  43. package/dist/src/session/session_end.js +67 -64
  44. package/dist/src/session/session_end.js.map +1 -1
  45. package/dist/src/store/archive_store.d.ts +136 -0
  46. package/dist/src/store/archive_store.d.ts.map +1 -0
  47. package/dist/src/store/archive_store.js +635 -0
  48. package/dist/src/store/archive_store.js.map +1 -0
  49. package/dist/src/store/embedding_utils.d.ts +32 -0
  50. package/dist/src/store/embedding_utils.d.ts.map +1 -0
  51. package/dist/src/store/embedding_utils.js +173 -0
  52. package/dist/src/store/embedding_utils.js.map +1 -0
  53. package/dist/src/store/graph_memory_store.d.ts +114 -0
  54. package/dist/src/store/graph_memory_store.d.ts.map +1 -0
  55. package/dist/src/store/graph_memory_store.js +841 -0
  56. package/dist/src/store/graph_memory_store.js.map +1 -0
  57. package/dist/src/store/read_store.d.ts +89 -0
  58. package/dist/src/store/read_store.d.ts.map +1 -1
  59. package/dist/src/store/read_store.js +2459 -28
  60. package/dist/src/store/read_store.js.map +1 -1
  61. package/dist/src/store/vector_store.d.ts +45 -0
  62. package/dist/src/store/vector_store.d.ts.map +1 -0
  63. package/dist/src/store/vector_store.js +202 -0
  64. package/dist/src/store/vector_store.js.map +1 -0
  65. package/dist/src/store/write_store.d.ts +54 -0
  66. package/dist/src/store/write_store.d.ts.map +1 -1
  67. package/dist/src/store/write_store.js +284 -6
  68. package/dist/src/store/write_store.js.map +1 -1
  69. package/dist/src/sync/session_sync.d.ts +119 -2
  70. package/dist/src/sync/session_sync.d.ts.map +1 -1
  71. package/dist/src/sync/session_sync.js +2377 -31
  72. package/dist/src/sync/session_sync.js.map +1 -1
  73. package/dist/src/utils/runtime_env.d.ts +4 -0
  74. package/dist/src/utils/runtime_env.d.ts.map +1 -0
  75. package/dist/src/utils/runtime_env.js +51 -0
  76. package/dist/src/utils/runtime_env.js.map +1 -0
  77. package/dist/src/wiki/wiki_linter.d.ts +25 -0
  78. package/dist/src/wiki/wiki_linter.d.ts.map +1 -0
  79. package/dist/src/wiki/wiki_linter.js +268 -0
  80. package/dist/src/wiki/wiki_linter.js.map +1 -0
  81. package/dist/src/wiki/wiki_logger.d.ts +10 -0
  82. package/dist/src/wiki/wiki_logger.d.ts.map +1 -0
  83. package/dist/src/wiki/wiki_logger.js +78 -0
  84. package/dist/src/wiki/wiki_logger.js.map +1 -0
  85. package/dist/src/wiki/wiki_maintainer.d.ts +36 -0
  86. package/dist/src/wiki/wiki_maintainer.d.ts.map +1 -0
  87. package/dist/src/wiki/wiki_maintainer.js +38 -0
  88. package/dist/src/wiki/wiki_maintainer.js.map +1 -0
  89. package/dist/src/wiki/wiki_projector.d.ts +33 -0
  90. package/dist/src/wiki/wiki_projector.d.ts.map +1 -0
  91. package/dist/src/wiki/wiki_projector.js +633 -0
  92. package/dist/src/wiki/wiki_projector.js.map +1 -0
  93. package/dist/src/wiki/wiki_queue.d.ts +29 -0
  94. package/dist/src/wiki/wiki_queue.d.ts.map +1 -0
  95. package/dist/src/wiki/wiki_queue.js +137 -0
  96. package/dist/src/wiki/wiki_queue.js.map +1 -0
  97. package/openclaw.plugin.json +501 -16
  98. package/package.json +58 -7
  99. package/schema/graph.schema.yaml +330 -0
  100. package/scripts/cli.js +19 -14
  101. package/scripts/repair-memory.js +321 -0
  102. package/scripts/uninstall.js +22 -5
  103. package/skills/cortex-memory/SKILL.md +49 -0
  104. package/skills/cortex-memory/references/agent-manual.md +115 -0
  105. package/skills/cortex-memory/references/configuration.md +92 -0
  106. package/skills/cortex-memory/references/publish-checklist.md +46 -0
  107. package/skills/cortex-memory/references/system-prompt-template.md +27 -0
  108. package/skills/cortex-memory/references/tools.md +181 -0
  109. package/skills/cortex-memory/scripts/smoke-check.ps1 +56 -0
  110. package/index.ts +0 -2142
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "id": "openclaw-cortex-memory",
3
3
  "name": "Cortex Memory",
4
- "version": "0.1.0-Alpha.1",
4
+ "version": "0.1.0-Alpha.31",
5
5
  "description": "Long-term memory system with semantic, episodic, and procedural memory for AI Agents",
6
6
  "main": "dist/index.js",
7
- "author": "OpenClaw Community",
7
+ "author": "deki18",
8
8
  "license": "MIT",
9
- "type": "memory",
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"
@@ -52,10 +73,48 @@
52
73
  "type": "string",
53
74
  "description": "Event summary"
54
75
  },
76
+ "cause": {
77
+ "type": "string",
78
+ "description": "What triggered the event (task/request/problem statement)"
79
+ },
80
+ "process": {
81
+ "type": "string",
82
+ "description": "How the task was handled (steps/attempts/iterations)"
83
+ },
84
+ "result": {
85
+ "type": "string",
86
+ "description": "Final result and acceptance outcome"
87
+ },
55
88
  "entities": {
56
89
  "type": "array",
57
90
  "description": "Involved entities",
58
91
  "items": {
92
+ "oneOf": [
93
+ {
94
+ "type": "string"
95
+ },
96
+ {
97
+ "type": "object",
98
+ "properties": {
99
+ "id": {
100
+ "type": "string"
101
+ },
102
+ "name": {
103
+ "type": "string"
104
+ },
105
+ "type": {
106
+ "type": "string"
107
+ }
108
+ },
109
+ "additionalProperties": false
110
+ }
111
+ ]
112
+ }
113
+ },
114
+ "entity_types": {
115
+ "type": "object",
116
+ "description": "Entity type map, key is entity name and value is type",
117
+ "additionalProperties": {
59
118
  "type": "string"
60
119
  }
61
120
  },
@@ -67,7 +126,33 @@
67
126
  "type": "array",
68
127
  "description": "Entity relationships",
69
128
  "items": {
70
- "type": "string"
129
+ "oneOf": [
130
+ {
131
+ "type": "string"
132
+ },
133
+ {
134
+ "type": "object",
135
+ "properties": {
136
+ "source": {
137
+ "type": "string"
138
+ },
139
+ "target": {
140
+ "type": "string"
141
+ },
142
+ "type": {
143
+ "type": "string"
144
+ },
145
+ "evidence_span": {
146
+ "type": "string"
147
+ },
148
+ "confidence": {
149
+ "type": "number"
150
+ }
151
+ },
152
+ "required": ["source", "target"],
153
+ "additionalProperties": false
154
+ }
155
+ ]
71
156
  }
72
157
  }
73
158
  },
@@ -84,12 +169,98 @@
84
169
  "entity": {
85
170
  "type": "string",
86
171
  "description": "Entity name"
172
+ },
173
+ "rel": {
174
+ "type": "string",
175
+ "description": "Optional relation type filter"
176
+ },
177
+ "dir": {
178
+ "type": "string",
179
+ "description": "Relation direction filter",
180
+ "enum": ["incoming", "outgoing", "both"]
181
+ },
182
+ "path_to": {
183
+ "type": "string",
184
+ "description": "Find path from entity to this target entity"
185
+ },
186
+ "max_depth": {
187
+ "type": "integer",
188
+ "description": "Path query max depth (2~4)"
87
189
  }
88
190
  },
89
191
  "required": ["entity"],
90
192
  "additionalProperties": false
91
193
  }
92
194
  },
195
+ {
196
+ "name": "export_graph_view",
197
+ "description": "Export status-aware graph view and optionally write wiki graph snapshots",
198
+ "parameters": {
199
+ "type": "object",
200
+ "properties": {
201
+ "write_snapshot": {
202
+ "type": "boolean",
203
+ "description": "When true (default), write data/memory/wiki/graph/view.json and timeline.jsonl"
204
+ }
205
+ },
206
+ "required": [],
207
+ "additionalProperties": false
208
+ }
209
+ },
210
+ {
211
+ "name": "lint_memory_wiki",
212
+ "description": "Run wiki memory lint checks and return structured repair guidance",
213
+ "parameters": {
214
+ "type": "object",
215
+ "properties": {},
216
+ "required": [],
217
+ "additionalProperties": false
218
+ }
219
+ },
220
+ {
221
+ "name": "list_graph_conflicts",
222
+ "description": "List pending/handled graph memory conflicts that require user confirmation",
223
+ "parameters": {
224
+ "type": "object",
225
+ "properties": {
226
+ "status": {
227
+ "type": "string",
228
+ "enum": ["pending", "accepted", "rejected", "all"],
229
+ "description": "Filter conflict status"
230
+ },
231
+ "limit": {
232
+ "type": "integer",
233
+ "description": "Maximum returned conflicts"
234
+ }
235
+ },
236
+ "required": [],
237
+ "additionalProperties": false
238
+ }
239
+ },
240
+ {
241
+ "name": "resolve_graph_conflict",
242
+ "description": "Resolve a graph conflict by accepting or rejecting the new candidate fact",
243
+ "parameters": {
244
+ "type": "object",
245
+ "properties": {
246
+ "conflict_id": {
247
+ "type": "string",
248
+ "description": "Conflict ID from list_graph_conflicts"
249
+ },
250
+ "action": {
251
+ "type": "string",
252
+ "enum": ["accept", "reject"],
253
+ "description": "Resolution action"
254
+ },
255
+ "note": {
256
+ "type": "string",
257
+ "description": "Optional note for audit trail"
258
+ }
259
+ },
260
+ "required": ["conflict_id", "action"],
261
+ "additionalProperties": false
262
+ }
263
+ },
93
264
  {
94
265
  "name": "get_hot_context",
95
266
  "description": "Get hot memory context for current session",
@@ -140,6 +311,39 @@
140
311
  "additionalProperties": false
141
312
  }
142
313
  },
314
+ {
315
+ "name": "backfill_embeddings",
316
+ "description": "Backfill missing embeddings for active/archive records",
317
+ "parameters": {
318
+ "type": "object",
319
+ "properties": {
320
+ "layer": {
321
+ "type": "string",
322
+ "enum": ["active", "archive", "all"],
323
+ "description": "Target layer to backfill"
324
+ },
325
+ "batch_size": {
326
+ "type": "integer",
327
+ "description": "Batch size per processing window"
328
+ },
329
+ "max_retries": {
330
+ "type": "integer",
331
+ "description": "Max retry count for failed records"
332
+ },
333
+ "retry_failed_only": {
334
+ "type": "boolean",
335
+ "description": "Only retry failed records"
336
+ },
337
+ "rebuild_mode": {
338
+ "type": "string",
339
+ "enum": ["incremental", "vector_only", "full"],
340
+ "description": "Rebuild mode"
341
+ }
342
+ },
343
+ "required": [],
344
+ "additionalProperties": false
345
+ }
346
+ },
143
347
  {
144
348
  "name": "delete_memory",
145
349
  "description": "Delete a memory by ID",
@@ -174,20 +378,9 @@
174
378
  "description": "Enable or disable Cortex Memory plugin",
175
379
  "default": true
176
380
  },
177
- "apiUrl": {
178
- "type": "string",
179
- "description": "URL of the memory service API",
180
- "default": "http://127.0.0.1:8765"
181
- },
182
- "engineMode": {
183
- "type": "string",
184
- "description": "Memory engine mode",
185
- "enum": ["ts"],
186
- "default": "ts"
187
- },
188
381
  "dbPath": {
189
382
  "type": "string",
190
- "description": "Path to the memory database directory"
383
+ "description": "Path to the memory database directory (default: <openclaw_base>/workspace/memory/openclaw-cortex-memory)"
191
384
  },
192
385
  "autoSync": {
193
386
  "type": "boolean",
@@ -199,6 +392,40 @@
199
392
  "description": "Automatically trigger reflection periodically",
200
393
  "default": false
201
394
  },
395
+ "autoReflectIntervalMinutes": {
396
+ "type": "integer",
397
+ "description": "Auto reflection scan interval in minutes",
398
+ "default": 30
399
+ },
400
+ "graphQualityMode": {
401
+ "type": "string",
402
+ "description": "Graph extraction quality gate mode",
403
+ "enum": ["off", "warn", "strict"],
404
+ "default": "warn"
405
+ },
406
+ "wikiProjection": {
407
+ "type": "object",
408
+ "description": "Feature flags for wiki projection runtime",
409
+ "properties": {
410
+ "enabled": {
411
+ "type": "boolean",
412
+ "description": "Enable wiki projection pipeline",
413
+ "default": false
414
+ },
415
+ "mode": {
416
+ "type": "string",
417
+ "description": "Wiki projection mode",
418
+ "enum": ["off", "incremental", "rebuild"],
419
+ "default": "off"
420
+ },
421
+ "maxBatch": {
422
+ "type": "integer",
423
+ "description": "Max events/pages processed per projection batch",
424
+ "default": 100
425
+ }
426
+ },
427
+ "additionalProperties": false
428
+ },
202
429
  "embedding": {
203
430
  "type": "object",
204
431
  "description": "Embedding model configuration",
@@ -226,8 +453,19 @@
226
453
  "dimensions": {
227
454
  "type": "integer",
228
455
  "description": "Embedding dimensions"
456
+ },
457
+ "timeoutMs": {
458
+ "type": "integer",
459
+ "description": "Embedding request timeout in milliseconds",
460
+ "default": 20000
461
+ },
462
+ "maxRetries": {
463
+ "type": "integer",
464
+ "description": "Maximum retry attempts for embedding requests",
465
+ "default": 4
229
466
  }
230
467
  },
468
+ "required": ["provider", "model"],
231
469
  "additionalProperties": false
232
470
  },
233
471
  "llm": {
@@ -255,6 +493,7 @@
255
493
  "description": "LLM API base URL (camelCase alias)"
256
494
  }
257
495
  },
496
+ "required": ["provider", "model"],
258
497
  "additionalProperties": false
259
498
  },
260
499
  "reranker": {
@@ -282,12 +521,258 @@
282
521
  "description": "Reranker API base URL (camelCase alias)"
283
522
  }
284
523
  },
524
+ "required": ["model"],
285
525
  "additionalProperties": false
286
526
  },
287
527
  "fallbackToBuiltin": {
288
528
  "type": "boolean",
289
529
  "description": "Fallback to OpenClaw builtin memory when Cortex Memory fails",
290
530
  "default": true
531
+ },
532
+ "readFusion": {
533
+ "type": "object",
534
+ "description": "Post-rerank LLM fusion for multi-route retrieval results",
535
+ "properties": {
536
+ "enabled": {
537
+ "type": "boolean",
538
+ "description": "Enable LLM fusion after rerank",
539
+ "default": true
540
+ },
541
+ "maxCandidates": {
542
+ "type": "integer",
543
+ "description": "Maximum reranked candidates used for fusion",
544
+ "default": 10
545
+ },
546
+ "authoritative": {
547
+ "type": "boolean",
548
+ "description": "Return only fused authoritative memory package to agent",
549
+ "default": true
550
+ },
551
+ "channelWeights": {
552
+ "type": "object",
553
+ "description": "Channel score multiplier overrides",
554
+ "properties": {
555
+ "rules": { "type": "number" },
556
+ "archive": { "type": "number" },
557
+ "vector": { "type": "number" },
558
+ "graph": { "type": "number" }
559
+ },
560
+ "additionalProperties": false
561
+ },
562
+ "channelTopK": {
563
+ "type": "object",
564
+ "description": "Per-channel pre-merge candidate quotas",
565
+ "properties": {
566
+ "rules": { "type": "integer" },
567
+ "archive": { "type": "integer" },
568
+ "vector": { "type": "integer" },
569
+ "graph": { "type": "integer" }
570
+ },
571
+ "additionalProperties": false
572
+ },
573
+ "minLexicalHits": {
574
+ "type": "integer",
575
+ "description": "Ensure lexical-hit coverage in final ranked set"
576
+ },
577
+ "minSemanticHits": {
578
+ "type": "integer",
579
+ "description": "Ensure semantic-hit coverage in final ranked set"
580
+ },
581
+ "lengthNorm": {
582
+ "type": "object",
583
+ "description": "Length normalization settings for semantic score",
584
+ "properties": {
585
+ "enabled": { "type": "boolean", "default": true },
586
+ "pivotChars": { "type": "integer", "default": 1200 },
587
+ "strength": { "type": "number", "default": 0.75 },
588
+ "minFactor": { "type": "number", "default": 0.45 }
589
+ },
590
+ "additionalProperties": false
591
+ }
592
+ },
593
+ "additionalProperties": false
594
+ },
595
+ "vectorChunking": {
596
+ "type": "object",
597
+ "description": "Vector chunking controls for active/archive full-text chunk embeddings",
598
+ "properties": {
599
+ "chunkSize": {
600
+ "type": "integer",
601
+ "description": "Chunk size in characters",
602
+ "default": 600
603
+ },
604
+ "chunkOverlap": {
605
+ "type": "integer",
606
+ "description": "Chunk overlap in characters",
607
+ "default": 100
608
+ },
609
+ "evidenceMaxChunks": {
610
+ "type": "integer",
611
+ "description": "Maximum evidence chunks per archive event",
612
+ "default": 2
613
+ }
614
+ },
615
+ "additionalProperties": false
616
+ },
617
+ "writePolicy": {
618
+ "type": "object",
619
+ "description": "Write-path quality thresholds and limits",
620
+ "properties": {
621
+ "archiveMinConfidence": {
622
+ "type": "number",
623
+ "description": "Minimum confidence for archiving events",
624
+ "default": 0.35
625
+ },
626
+ "archiveMinQualityScore": {
627
+ "type": "number",
628
+ "description": "Minimum quality score for archive events",
629
+ "default": 0.4
630
+ },
631
+ "activeMinQualityScore": {
632
+ "type": "number",
633
+ "description": "Minimum quality score for active records",
634
+ "default": 0.45
635
+ },
636
+ "activeDedupTailLines": {
637
+ "type": "integer",
638
+ "description": "Active-layer dedup tail line window",
639
+ "default": 200
640
+ },
641
+ "activeTextMaxChars": {
642
+ "type": "integer",
643
+ "description": "Maximum chars for active text payload",
644
+ "default": 200000
645
+ },
646
+ "archiveSourceTextMaxChars": {
647
+ "type": "integer",
648
+ "description": "Maximum chars for archive source_text payload",
649
+ "default": 500000
650
+ }
651
+ },
652
+ "additionalProperties": false
653
+ },
654
+ "syncPolicy": {
655
+ "type": "object",
656
+ "description": "Sync ingestion controls",
657
+ "properties": {
658
+ "includeLocalActiveInput": {
659
+ "type": "boolean",
660
+ "description": "Whether sync_memory reads local memory/sessions/active/sessions.jsonl as source input",
661
+ "default": false
662
+ }
663
+ },
664
+ "additionalProperties": false
665
+ },
666
+ "memoryDecay": {
667
+ "type": "object",
668
+ "description": "Time-decay controls for retrieval ranking by event_type",
669
+ "properties": {
670
+ "enabled": {
671
+ "type": "boolean",
672
+ "description": "Enable event-type half-life decay in retrieval ranking",
673
+ "default": true
674
+ },
675
+ "minFloor": {
676
+ "type": "number",
677
+ "description": "Minimum decay factor floor in [0,1]",
678
+ "default": 0.15
679
+ },
680
+ "defaultHalfLifeDays": {
681
+ "type": "number",
682
+ "description": "Default half-life in days for unconfigured event types",
683
+ "default": 90
684
+ },
685
+ "halfLifeByEventType": {
686
+ "type": "object",
687
+ "description": "Half-life days overrides by event_type",
688
+ "additionalProperties": {
689
+ "type": "number"
690
+ }
691
+ },
692
+ "antiDecay": {
693
+ "type": "object",
694
+ "description": "Hit-frequency anti-decay controls",
695
+ "properties": {
696
+ "enabled": {
697
+ "type": "boolean",
698
+ "description": "Enable anti-decay boost for frequently hit memories",
699
+ "default": true
700
+ },
701
+ "maxBoost": {
702
+ "type": "number",
703
+ "description": "Maximum multiplicative anti-decay boost (>=1)",
704
+ "default": 1.6
705
+ },
706
+ "hitWeight": {
707
+ "type": "number",
708
+ "description": "Hit count to boost conversion weight",
709
+ "default": 0.08
710
+ },
711
+ "recentWindowDays": {
712
+ "type": "number",
713
+ "description": "Recent hit window in days for freshness contribution",
714
+ "default": 30
715
+ }
716
+ },
717
+ "additionalProperties": false
718
+ }
719
+ },
720
+ "additionalProperties": false
721
+ },
722
+ "readTuning": {
723
+ "type": "object",
724
+ "description": "Read-path ranking and recency tuning",
725
+ "properties": {
726
+ "scoring": {
727
+ "type": "object",
728
+ "properties": {
729
+ "lexicalWeight": { "type": "number", "default": 0.2 },
730
+ "bm25Scale": { "type": "number", "default": 2 },
731
+ "semanticWeight": { "type": "number", "default": 0.3 },
732
+ "recencyWeight": { "type": "number", "default": 0.1 },
733
+ "qualityWeight": { "type": "number", "default": 0.15 },
734
+ "typeMatchWeight": { "type": "number", "default": 0.15 },
735
+ "graphMatchWeight": { "type": "number", "default": 0.1 }
736
+ },
737
+ "additionalProperties": false
738
+ },
739
+ "rrf": {
740
+ "type": "object",
741
+ "properties": {
742
+ "k": { "type": "integer", "default": 60 },
743
+ "weight": { "type": "number", "default": 1.5 }
744
+ },
745
+ "additionalProperties": false
746
+ },
747
+ "recency": {
748
+ "type": "object",
749
+ "properties": {
750
+ "buckets": {
751
+ "type": "array",
752
+ "items": {
753
+ "type": "object",
754
+ "properties": {
755
+ "maxAgeHours": { "type": "number" },
756
+ "score": { "type": "number" },
757
+ "bonus": { "type": "number" }
758
+ },
759
+ "required": ["maxAgeHours", "score", "bonus"],
760
+ "additionalProperties": false
761
+ }
762
+ }
763
+ },
764
+ "additionalProperties": false
765
+ },
766
+ "autoContext": {
767
+ "type": "object",
768
+ "properties": {
769
+ "queryMaxChars": { "type": "integer", "default": 80 },
770
+ "lightweightSearch": { "type": "boolean", "default": true }
771
+ },
772
+ "additionalProperties": false
773
+ }
774
+ },
775
+ "additionalProperties": false
291
776
  }
292
777
  },
293
778
  "additionalProperties": false
@@ -0,0 +1,25 @@
1
+ interface LoggerLike {
2
+ debug: (message: string, ...args: unknown[]) => void;
3
+ info: (message: string, ...args: unknown[]) => void;
4
+ warn: (message: string, ...args: unknown[]) => void;
5
+ }
6
+ interface DedupInput {
7
+ id: string;
8
+ summary: string;
9
+ embedding?: number[];
10
+ }
11
+ interface DedupResult {
12
+ duplicate: boolean;
13
+ stage?: "simhash" | "minhash" | "vector";
14
+ matchedId?: string;
15
+ }
16
+ interface DeduplicatorOptions {
17
+ memoryRoot: string;
18
+ logger: LoggerLike;
19
+ }
20
+ export declare function createThreeStageDeduplicator(options: DeduplicatorOptions): {
21
+ check(input: DedupInput): DedupResult;
22
+ append(input: DedupInput): void;
23
+ };
24
+ export {};
25
+ //# sourceMappingURL=three_stage_deduplicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"three_stage_deduplicator.d.ts","sourceRoot":"","sources":["../../../src/dedup/three_stage_deduplicator.ts"],"names":[],"mappings":"AAIA,UAAU,UAAU;IAClB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACrD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACrD;AAeD,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,UAAU,WAAW;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;CACpB;AAgJD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,mBAAmB,GAAG;IAC1E,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC;IACtC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CACjC,CAsDA"}