@joshuaswarren/openclaw-engram 9.1.5 → 9.1.7

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 (27) hide show
  1. package/README.md +49 -0
  2. package/dist/access-cli.js +4 -4
  3. package/dist/{calibration-LBE4XTN4.js → calibration-QBVYTFTQ.js} +2 -2
  4. package/dist/{causal-consolidation-5VSMA2L5.js → causal-consolidation-T7EEYKPA.js} +4 -4
  5. package/dist/{chunk-BIVUV2GJ.js → chunk-UO4TIAAW.js} +4 -4
  6. package/dist/{chunk-V2E2ORE5.js → chunk-XCAYYSI7.js} +1 -1
  7. package/dist/{chunk-QX3ELIKM.js → chunk-YKWJUR3I.js} +1 -1
  8. package/dist/chunk-YKWJUR3I.js.map +1 -0
  9. package/dist/{chunk-HPTDE747.js → chunk-Z6PKTPAF.js} +262 -10
  10. package/dist/chunk-Z6PKTPAF.js.map +1 -0
  11. package/dist/{engine-3TEQ54VW.js → engine-77ETPFGR.js} +3 -3
  12. package/dist/fallback-llm-KV6HAJ2N.js +9 -0
  13. package/dist/index.js +38 -7
  14. package/dist/index.js.map +1 -1
  15. package/dist/{storage-7BE5XQTN.js → storage-ZAI7Z232.js} +2 -2
  16. package/dist/storage-ZAI7Z232.js.map +1 -0
  17. package/openclaw.plugin.json +71 -0
  18. package/package.json +4 -2
  19. package/scripts/rebuild-native.mjs +72 -0
  20. package/dist/chunk-HPTDE747.js.map +0 -1
  21. package/dist/chunk-QX3ELIKM.js.map +0 -1
  22. /package/dist/{calibration-LBE4XTN4.js.map → calibration-QBVYTFTQ.js.map} +0 -0
  23. /package/dist/{causal-consolidation-5VSMA2L5.js.map → causal-consolidation-T7EEYKPA.js.map} +0 -0
  24. /package/dist/{chunk-BIVUV2GJ.js.map → chunk-UO4TIAAW.js.map} +0 -0
  25. /package/dist/{chunk-V2E2ORE5.js.map → chunk-XCAYYSI7.js.map} +0 -0
  26. /package/dist/{engine-3TEQ54VW.js.map → engine-77ETPFGR.js.map} +0 -0
  27. /package/dist/{storage-7BE5XQTN.js.map → fallback-llm-KV6HAJ2N.js.map} +0 -0
package/README.md CHANGED
@@ -266,6 +266,8 @@ These capabilities can be enabled progressively:
266
266
  - **Shared Context** — Cross-agent memory sharing for multi-agent setups
267
267
  - **Identity Continuity** — Consistent agent personality across sessions
268
268
  - **Hot/Cold Tiering** — Automatic migration of aging memories to cold storage
269
+ - **Memory Cache** — Process-level singleton cache for `readAllMemories()` — turns 15s disk scans into <100ms cache hits, shared across all sessions
270
+ - **Semantic Consolidation** — Finds clusters of semantically similar memories, synthesizes canonical versions via LLM, archives originals to reduce bloat
269
271
  - **Native Knowledge** — Search curated markdown (workspace docs, Obsidian vaults) without extracting into memory
270
272
  - **Behavior Loop Tuning** — Runtime self-tuning of extraction and recall parameters
271
273
 
@@ -334,6 +336,45 @@ Enable it in your `openclaw.json`:
334
336
 
335
337
  Set `parallelMaxResultsPerAgent: 0` to disable an individual agent's results without disabling the feature entirely.
336
338
 
339
+ ### Semantic Consolidation (opt-in)
340
+
341
+ Over time, memory stores accumulate redundant facts — the same information extracted multiple times across sessions, expressed slightly differently. Semantic consolidation finds clusters of similar memories using token overlap, synthesizes a single canonical version via LLM, and archives the originals. This reduces storage bloat, speeds up recall, and improves memory quality.
342
+
343
+ - **Conservative by default** — Only merges when 80%+ token overlap is detected across 3+ memories
344
+ - **LLM synthesis** — Uses your configured model to combine unique information from all cluster members
345
+ - **Safe archival** — Originals are archived (not deleted) with full provenance tracking
346
+ - **Configurable** — Adjust threshold, cluster size, excluded categories, model, and schedule
347
+ - **Excluded categories** — Corrections and commitments are never consolidated (configurable)
348
+
349
+ Enable it in your `openclaw.json`:
350
+
351
+ ```jsonc
352
+ {
353
+ "plugins": {
354
+ "entries": {
355
+ "openclaw-engram": {
356
+ "config": {
357
+ "semanticConsolidationEnabled": true
358
+ // Optional tuning:
359
+ // "semanticConsolidationThreshold": 0.8, // 0.8=conservative, 0.6=aggressive
360
+ // "semanticConsolidationModel": "fast", // "auto", "fast", or specific model
361
+ // "semanticConsolidationIntervalHours": 168, // weekly (default)
362
+ // "semanticConsolidationMaxPerRun": 100
363
+ }
364
+ }
365
+ }
366
+ }
367
+ }
368
+ ```
369
+
370
+ Run manually from the CLI:
371
+
372
+ ```bash
373
+ openclaw engram semantic-consolidate --dry-run # Preview what would be merged
374
+ openclaw engram semantic-consolidate --verbose # Run with detailed output
375
+ openclaw engram semantic-consolidate --threshold 0.6 # Override threshold
376
+ ```
377
+
337
378
  ### Advanced (opt-in)
338
379
 
339
380
  - **Objective-State Recall** — Surfaces file/process/tool state snapshots alongside semantic memory
@@ -417,6 +458,11 @@ openclaw engram review-disposition <id> --status rejected # Operator review
417
458
  openclaw engram benchmark recall # Benchmark status and validation
418
459
  openclaw engram benchmark-ci-gate # CI gate for regressions
419
460
 
461
+ # Memory maintenance
462
+ openclaw engram consolidate # Run standard consolidation
463
+ openclaw engram semantic-consolidate # Run semantic dedup consolidation
464
+ openclaw engram semantic-consolidate --dry-run # Preview without changes
465
+
420
466
  # Access layer
421
467
  openclaw engram access http-serve --token "$TOKEN" # Start HTTP API
422
468
  openclaw engram access mcp-serve # Start stdio MCP server
@@ -441,6 +487,9 @@ All settings live in `openclaw.json` under `plugins.entries.openclaw-engram.conf
441
487
  | `memoryDir` | `~/.openclaw/workspace/memory/local` | Memory storage root |
442
488
  | `memoryOsPreset` | unset | Quick config: `conservative`, `balanced`, `research-max`, `local-llm-heavy` |
443
489
  | `lcmEnabled` | `false` | Enable Lossless Context Management (proactive session archive + summary DAG) |
490
+ | `semanticConsolidationEnabled` | `false` | Enable periodic semantic dedup of similar memories |
491
+ | `semanticConsolidationThreshold` | `0.8` | Token overlap threshold (0.8=conservative, 0.6=aggressive) |
492
+ | `semanticConsolidationModel` | `"auto"` | LLM for synthesis: `"auto"`, `"fast"`, or specific model |
444
493
 
445
494
  **[See the full config reference for all 60+ settings](docs/config-reference.md)** including search backend configuration, namespace policies, Memory OS features, governance, evaluation harness, trust zones, causal trajectories, and more.
446
495
 
@@ -3,13 +3,13 @@ import {
3
3
  EngramAccessService,
4
4
  Orchestrator,
5
5
  parseConfig
6
- } from "./chunk-HPTDE747.js";
7
- import "./chunk-BIVUV2GJ.js";
6
+ } from "./chunk-Z6PKTPAF.js";
7
+ import "./chunk-UO4TIAAW.js";
8
8
  import "./chunk-IMMYYNXG.js";
9
- import "./chunk-QX3ELIKM.js";
9
+ import "./chunk-YKWJUR3I.js";
10
10
  import "./chunk-6KX4XLQJ.js";
11
+ import "./chunk-XCAYYSI7.js";
11
12
  import "./chunk-MKM2BCQH.js";
12
- import "./chunk-V2E2ORE5.js";
13
13
  import "./chunk-DEIBZP3O.js";
14
14
  import "./chunk-SSIIJJKA.js";
15
15
 
@@ -1,7 +1,7 @@
1
1
  // openclaw-engram: Local-first memory plugin
2
2
  import {
3
3
  FallbackLlmClient
4
- } from "./chunk-V2E2ORE5.js";
4
+ } from "./chunk-XCAYYSI7.js";
5
5
  import {
6
6
  listJsonFiles
7
7
  } from "./chunk-DEIBZP3O.js";
@@ -233,4 +233,4 @@ export {
233
233
  runCalibrationIfEnabled,
234
234
  synthesizeCalibrationRules
235
235
  };
236
- //# sourceMappingURL=calibration-LBE4XTN4.js.map
236
+ //# sourceMappingURL=calibration-QBVYTFTQ.js.map
@@ -1,4 +1,7 @@
1
1
  // openclaw-engram: Local-first memory plugin
2
+ import {
3
+ FallbackLlmClient
4
+ } from "./chunk-XCAYYSI7.js";
2
5
  import {
3
6
  readChainIndex,
4
7
  resolveChainsDir
@@ -6,9 +9,6 @@ import {
6
9
  import {
7
10
  isRecord
8
11
  } from "./chunk-MKM2BCQH.js";
9
- import {
10
- FallbackLlmClient
11
- } from "./chunk-V2E2ORE5.js";
12
12
  import {
13
13
  listJsonFiles,
14
14
  readJsonFile
@@ -203,4 +203,4 @@ export {
203
203
  deriveCausalPromotionCandidates,
204
204
  synthesizeCausalPreferencesViaLlm
205
205
  };
206
- //# sourceMappingURL=causal-consolidation-5VSMA2L5.js.map
206
+ //# sourceMappingURL=causal-consolidation-T7EEYKPA.js.map
@@ -4,7 +4,7 @@ import {
4
4
  parseContinuityImprovementLoops,
5
5
  parseContinuityIncident,
6
6
  sanitizeMemoryContent
7
- } from "./chunk-QX3ELIKM.js";
7
+ } from "./chunk-YKWJUR3I.js";
8
8
  import {
9
9
  log
10
10
  } from "./chunk-SSIIJJKA.js";
@@ -830,7 +830,7 @@ var CompoundingEngine = class {
830
830
  let promotionCandidates = this.config.compoundingSemanticEnabled ? this.derivePromotionCandidates(outcomeSummary, mistakes.registry, rubrics) : [];
831
831
  if (this.config.cmcConsolidationEnabled) {
832
832
  try {
833
- const { deriveCausalPromotionCandidates } = await import("./causal-consolidation-5VSMA2L5.js");
833
+ const { deriveCausalPromotionCandidates } = await import("./causal-consolidation-T7EEYKPA.js");
834
834
  const causalCandidates = await deriveCausalPromotionCandidates({
835
835
  memoryDir: this.config.memoryDir,
836
836
  causalTrajectoryStoreDir: this.config.causalTrajectoryStoreDir,
@@ -850,7 +850,7 @@ var CompoundingEngine = class {
850
850
  }
851
851
  if (this.config.calibrationEnabled) {
852
852
  try {
853
- const { runCalibrationConsolidation } = await import("./calibration-LBE4XTN4.js");
853
+ const { runCalibrationConsolidation } = await import("./calibration-QBVYTFTQ.js");
854
854
  const calRules = await runCalibrationConsolidation({
855
855
  memoryDir: this.config.memoryDir,
856
856
  gatewayConfig: this.config.gatewayConfig
@@ -1837,4 +1837,4 @@ export {
1837
1837
  defaultTierMigrationCycleBudget,
1838
1838
  CompoundingEngine
1839
1839
  };
1840
- //# sourceMappingURL=chunk-BIVUV2GJ.js.map
1840
+ //# sourceMappingURL=chunk-UO4TIAAW.js.map
@@ -362,4 +362,4 @@ export {
362
362
  buildChatCompletionTokenLimit,
363
363
  FallbackLlmClient
364
364
  };
365
- //# sourceMappingURL=chunk-V2E2ORE5.js.map
365
+ //# sourceMappingURL=chunk-XCAYYSI7.js.map
@@ -4007,4 +4007,4 @@ export {
4007
4007
  serializeEntityFile,
4008
4008
  StorageManager
4009
4009
  };
4010
- //# sourceMappingURL=chunk-QX3ELIKM.js.map
4010
+ //# sourceMappingURL=chunk-YKWJUR3I.js.map