@psiclawops/hypermem 0.9.3 → 0.9.5

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 (69) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/INSTALL.md +75 -68
  3. package/README.md +18 -36
  4. package/assets/default-config.json +41 -0
  5. package/bench/data-access-bench.mjs +1 -1
  6. package/bin/hypermem-doctor.mjs +76 -2
  7. package/bin/hypermem-status.mjs +255 -7
  8. package/dist/adaptive-lifecycle.d.ts +39 -0
  9. package/dist/adaptive-lifecycle.d.ts.map +1 -1
  10. package/dist/adaptive-lifecycle.js +87 -9
  11. package/dist/background-indexer.d.ts.map +1 -1
  12. package/dist/background-indexer.js +16 -14
  13. package/dist/compositor.d.ts.map +1 -1
  14. package/dist/compositor.js +239 -20
  15. package/dist/cross-agent.d.ts +1 -1
  16. package/dist/cross-agent.js +17 -17
  17. package/dist/hybrid-retrieval.d.ts +8 -0
  18. package/dist/hybrid-retrieval.d.ts.map +1 -1
  19. package/dist/hybrid-retrieval.js +112 -10
  20. package/dist/index.d.ts +16 -5
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +19 -4
  23. package/dist/message-store.d.ts +62 -1
  24. package/dist/message-store.d.ts.map +1 -1
  25. package/dist/message-store.js +355 -2
  26. package/dist/open-domain.d.ts.map +1 -1
  27. package/dist/open-domain.js +3 -2
  28. package/dist/proactive-pass.d.ts +42 -2
  29. package/dist/proactive-pass.d.ts.map +1 -1
  30. package/dist/proactive-pass.js +294 -39
  31. package/dist/seed.d.ts +1 -1
  32. package/dist/seed.js +1 -1
  33. package/dist/session-flusher.d.ts +2 -2
  34. package/dist/session-flusher.js +2 -2
  35. package/dist/spawn-context.d.ts +1 -1
  36. package/dist/spawn-context.js +1 -1
  37. package/dist/topic-store.js +5 -5
  38. package/dist/topic-synthesizer.d.ts.map +1 -1
  39. package/dist/topic-synthesizer.js +10 -4
  40. package/dist/trigger-registry.d.ts +1 -1
  41. package/dist/trigger-registry.js +4 -4
  42. package/dist/types.d.ts +101 -2
  43. package/dist/types.d.ts.map +1 -1
  44. package/dist/vector-store.d.ts +10 -1
  45. package/dist/vector-store.d.ts.map +1 -1
  46. package/dist/vector-store.js +45 -9
  47. package/docs/DIAGNOSTICS.md +88 -1
  48. package/docs/INTEGRATION_VALIDATION.md +40 -1
  49. package/docs/MIGRATION.md +1 -1
  50. package/docs/TUNING.md +47 -6
  51. package/install.sh +5 -60
  52. package/memory-plugin/dist/index.js +192 -0
  53. package/memory-plugin/openclaw.plugin.json +199 -2
  54. package/memory-plugin/package.json +2 -2
  55. package/package.json +29 -10
  56. package/plugin/dist/index.d.ts +2 -0
  57. package/plugin/dist/index.d.ts.map +1 -1
  58. package/plugin/dist/index.js +178 -11
  59. package/plugin/dist/index.js.map +1 -1
  60. package/plugin/openclaw.plugin.json +199 -2
  61. package/plugin/package.json +2 -2
  62. package/scripts/install-packed-runtime.mjs +99 -0
  63. package/scripts/install-runtime.mjs +164 -4
  64. package/ARCHITECTURE.md +0 -298
  65. package/docs/KNOWN_LIMITATIONS.md +0 -35
  66. package/docs/PHASE1-VALIDATION.md +0 -132
  67. package/docs/RELEASE_0.8.0_VALIDATION.md +0 -70
  68. package/docs/RELEASE_PROCESS.md +0 -10
  69. package/docs/ROADMAP.md +0 -266
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  All notable changes to hypermem are documented here.
4
4
 
5
+ ## 0.9.5 - 2026-04-29
6
+
7
+ - **Install-readiness defaults hardened.** Fresh installs now stage `embedding.provider: "none"` by default, making the first-install path FTS5-only and free of Ollama or hosted-provider dependencies.
8
+ - **Install states documented.** README, INSTALL, and TUNING now classify fresh installs as GREEN/YELLOW/RED, with FTS5/no-embedding installs explicitly YELLOW rather than failed.
9
+ - **Semantic recall is opt-in after baseline install.** Ollama and hosted embedding setup moved behind the verified baseline path so operators can bring HyperMem online before adding vector recall.
10
+ - **OpenClaw command guidance updated.** Install docs now use the current `openclaw gateway` command surface instead of stale daemon commands.
11
+ - **Public package payload tightened.** npm package files now include operator-facing docs only; internal architecture and release-process docs are excluded from the published artifact.
12
+ - **Fresh-install smoke covers the FTS5 default.** The release gate now validates the no-embedding default path directly.
13
+
14
+ ## 0.9.4 - 2026-04-28
15
+
16
+ - **Recall surface re-enriched.** Bootstrap, warmup, and steady lifecycle bands now carry larger warming fractions, `/new` and topic-shift recall surge harder, and topic-bearing warmup avoids heartbeat/small-talk decay.
17
+ - **Adjacency-aware preservation added.** Hybrid retrieval boosts recent antecedents while filtering heartbeat/system noise, and compose eviction guards the literal antecedent under non-critical pressure.
18
+ - **Install path hardened.** `hypermem-install` ships the doctor, bench, and default config artifacts, writes `~/.openclaw/hypermem/config.json` only when missing, probes the default Ollama embedder, preserves existing config, supports CI-safe flags, and rejects unknown options.
19
+ - **Fresh-install smoke gate added.** `release-gate-internal/fresh-install-smoke.sh` packs the npm artifact, installs it in the PsiClawOps Docker test image without a source mount, verifies graceful no-tools failure, verifies skip-mode staging, and proves existing config is not overwritten.
20
+ - **Installer failure artifacts captured.** Failed smoke runs now preserve logs, generated configs, package metadata, the packed tarball, and container `/tmp` inventories under `.artifacts/fresh-install-smoke/` for postmortem reuse.
21
+
22
+ ## 0.9.3 - OpenClaw 2026.4.26 compatibility hardening
23
+
24
+ - **Plugin manifests declare runtime config schema.** HyperCompositor and HyperMem memory manifests now expose the supported config surface for OpenClaw 2026.4.26 registry/config validation.
25
+ - **Install and doctor flow aligned with persisted plugin registry.** operator guidance and `hypermem-doctor` now include registry refresh, doctor repair, and plugin-list verification steps.
26
+ - **Native compaction collision guard added.** `hypermem-doctor` warns when `agents.defaults.compaction.maxActiveTranscriptBytes` is set; HyperMem deployments should leave it unset so HyperMem remains the single trim/compose pressure owner.
27
+ - **Embedding query/document asymmetry supported.** HyperMem config now supports query/document input types and prefixes, with defaults for `nomic-embed-text`, `qwen3-embedding`, and `mxbai-embed-large`.
28
+ - **Forked subagent warm-start repair.** `prepareSubagentSpawn()` falls back to durable runtime history when the hot cache is empty, so forked children inherit parent working context instead of silently starting cold.
29
+
5
30
  ## 0.9.2 - 0.9.1 republish + publish-path hardening
6
31
 
7
32
  - **0.9.1 was a broken publish.** The npm tarballs for `@psiclawops/hypermem@0.9.1`, `@psiclawops/hypercompositor@0.9.1`, and `@psiclawops/hypermem-memory@0.9.1` shipped without `dist/`, so `import` against the registry artifact fails with `ERR_MODULE_NOT_FOUND`. **Skip 0.9.1.** Operators currently on 0.9.1 should upgrade to 0.9.2.
@@ -16,7 +41,7 @@ All notable changes to hypermem are documented here.
16
41
  - **Vector store init log shows actual provider/model/dims.** Diagnostic log line at startup now reflects the resolved configuration instead of the static placeholder, so misconfiguration is visible immediately.
17
42
  - **Tool artifact API arity + hydration docs aligned.** Doc-only follow-ups; no runtime behavior change.
18
43
 
19
- **Operator action:** upgrade from 0.9.0 is recommended. 0.9.0 in production with a configured non-default embedder may have written mismatched vectors; check `hypermem-status` for vector-store init line after upgrade.
44
+ **operator action:** upgrade from 0.9.0 is recommended. 0.9.0 in production with a configured non-default embedder may have written mismatched vectors; check `hypermem-status` for vector-store init line after upgrade.
20
45
 
21
46
  ## 0.9.0 - adaptive context lifecycle
22
47
 
@@ -49,7 +74,7 @@ All notable changes to hypermem are documented here.
49
74
  - **Provider + model identity is now tracked explicitly in HyperCompositor model state.** Mid-session routing changes are detected on the full `provider/model` key, not budget alone, so `github-copilot/claude-sonnet-4-6` and `anthropic/claude-sonnet-4-6` are treated as different operational envelopes.
50
75
  - **Downshift detection now keys off provider/model-aware state.** Budget-downshift handling still stays conservative, but verbose logs now surface provider swaps, model swaps, and budget deltas clearly during `context:assemble`.
51
76
  - **Install docs now declare the full operator path.** README, INSTALL.md, and TUNING.md now separate staging from activation, document install states explicitly, add merge-safe wiring guidance, and clarify what healthy-but-empty looks like on a first run.
52
- - **0.8.5 release parity.** Package versions are aligned for the next publish while preserving the npm-first installer and merge-safe config guidance landed from Pylon's install review.
77
+ - **0.8.5 release parity.** Package versions are aligned for the next publish while preserving the npm-first installer and merge-safe config guidance landed from Hank's install review.
53
78
 
54
79
  ## 0.8.4 — compaction fence fix, install-path fixes, zod runtime packaging
55
80
 
package/INSTALL.md CHANGED
@@ -5,7 +5,7 @@ This is the canonical install procedure. Keep README shorter and point operators
5
5
  ## Prerequisites
6
6
 
7
7
  - **Node.js 22+** (uses built-in `node:sqlite`)
8
- - **OpenClaw** must already be installed, onboarded, and running. HyperMem is a plugin for an existing OpenClaw deployment -- it does not bootstrap OpenClaw itself. If you have never run `openclaw gateway start` or completed OpenClaw onboarding, do that first. The HyperMem install guide picks up after OpenClaw is operational.
8
+ - **OpenClaw** must already be installed, onboarded, and running. HyperMem is a plugin for an existing OpenClaw deployment -- it does not bootstrap OpenClaw itself. If you have not completed OpenClaw onboarding, do that first. The HyperMem install guide picks up after OpenClaw is operational.
9
9
  - **Disk space:** allow at least 2 GB free. Plugin builds pull OpenClaw as a dev dependency.
10
10
 
11
11
  **Verify before starting:**
@@ -15,7 +15,7 @@ openclaw gateway status # should show "running" or "ready"
15
15
  openclaw config get gateway # should return gateway config, not an error
16
16
  ```
17
17
 
18
- If `gateway status` shows "disabled" or "not configured", complete OpenClaw onboarding first. `openclaw gateway restart` only works when the gateway service is already set up. On a brand-new OpenClaw install that has never been started, you need `openclaw gateway start` (or the full onboarding flow) before installing plugins.
18
+ If `openclaw gateway status` shows "disabled" or "not configured", complete OpenClaw onboarding first. `openclaw gateway restart` only works when the gateway service is already set up. On a brand-new OpenClaw install that has never been onboarded, complete the OpenClaw onboarding flow before installing plugins.
19
19
 
20
20
  ## Non-OpenClaw usage
21
21
 
@@ -58,7 +58,9 @@ npm install @psiclawops/hypermem
58
58
  npx hypermem-install
59
59
  ```
60
60
 
61
- `hypermem-install` stages the plugin runtime into `~/.openclaw/plugins/hypermem`. It does **not** modify your OpenClaw config and does **not** restart the gateway. That means a successful `npx hypermem-install` is **not** a completed install. It is only a completed staging step.
61
+ `hypermem-install` stages the plugin runtime into `~/.openclaw/plugins/hypermem` and writes `~/.openclaw/hypermem/config.json` only if that file does not already exist. It does **not** modify your OpenClaw config and does **not** restart the gateway. That means a successful `npx hypermem-install` is **not** a completed install. It is only a completed staging step.
62
+
63
+ For local release validation, use `npm run install:runtime:packed` from the repo. That command builds an npm tarball, installs that tarball into a temporary app, and stages the runtime from the installed package. Do not validate production behavior from a repo symlink or copied working-tree files.
62
64
 
63
65
  The shell installer is now a thin npm-first wrapper around this same path:
64
66
 
@@ -66,7 +68,7 @@ The shell installer is now a thin npm-first wrapper around this same path:
66
68
  curl -fsSL https://raw.githubusercontent.com/PsiClawOps/hypermem/main/install.sh | bash
67
69
  ```
68
70
 
69
- It installs the npm package into `~/.hypermem`, backs up any existing staged runtime when confirmed, stages the runtime with `hypermem-install`, writes a lightweight starter config only if no config exists, and prints merge-safe OpenClaw activation commands. It does not edit OpenClaw config and does not restart the gateway.
71
+ It installs the npm package into `~/.hypermem`, backs up any existing staged runtime when confirmed, stages the runtime with `hypermem-install`, writes the FTS5 starter config only if no config exists, and prints merge-safe OpenClaw activation commands. It does not edit OpenClaw config and does not restart the gateway.
70
72
 
71
73
  Release validation details live in [docs/INTEGRATION_VALIDATION.md](./docs/INTEGRATION_VALIDATION.md). Diagnostic surfaces live in [docs/DIAGNOSTICS.md](./docs/DIAGNOSTICS.md).
72
74
 
@@ -74,37 +76,15 @@ Release validation details live in [docs/INTEGRATION_VALIDATION.md](./docs/INTEG
74
76
  >
75
77
  > **Config merge warning:** if you already have values in `plugins.load.paths` or `plugins.allow`, merge them instead of overwriting blindly.
76
78
 
77
- Create the config directory and write the current recommended fresh-install starter config. This does 2 things:
79
+ `hypermem-install` creates the current recommended starter config automatically when `~/.openclaw/hypermem/config.json` is missing. The shipped starter config is installation-safe FTS5 mode:
78
80
 
79
- 1. sets `embedding.provider` to `none` so a clean install does not try to use Ollama by default
80
- 2. applies the current recommended lean compositor settings so fresh installs start from the same OpenClaw and HyperMem guidance we want operators to use
81
+ - `embedding.provider: "none"`
82
+ - `warmHistoryBudgetFraction: 0.45`
83
+ - standard fact, keystone, and history caps
81
84
 
82
- ```bash
83
- mkdir -p ~/.openclaw/hypermem
84
- cat > ~/.openclaw/hypermem/config.json <<'JSON'
85
- {
86
- "embedding": {
87
- "provider": "none"
88
- },
89
- "compositor": {
90
- "budgetFraction": 0.55,
91
- "contextWindowReserve": 0.25,
92
- "targetBudgetFraction": 0.50,
93
- "warmHistoryBudgetFraction": 0.27,
94
- "maxFacts": 25,
95
- "maxHistoryMessages": 500,
96
- "maxCrossSessionContext": 4000,
97
- "maxRecentToolPairs": 3,
98
- "maxProseToolPairs": 10,
99
- "keystoneHistoryFraction": 0.15,
100
- "keystoneMaxMessages": 12,
101
- "wikiTokenCap": 500
102
- }
103
- }
104
- JSON
105
- ```
85
+ This is intentional. A clean first install should load, compose, and verify without requiring Ollama or an external API key. The result is **YELLOW** install readiness: HyperMem is active with keyword recall, but semantic vector recall is disabled. Upgrade to Ollama, OpenRouter, or Gemini after the baseline install is active.
106
86
 
107
- If you want a lighter or richer memory profile later, adjust from this baseline using the tuning guidance below instead of starting from the older code defaults.
87
+ Existing config files are preserved unchanged. If an existing config selects `embedding.provider: "ollama"`, `hypermem-install` checks that Ollama and `nomic-embed-text` are available unless you pass `--skip-embedding-check`.
108
88
 
109
89
  ### Install states
110
90
 
@@ -120,6 +100,16 @@ Treat the install as 5 explicit states:
120
100
 
121
101
  Do not stop at state 2 and call the install done.
122
102
 
103
+ Install readiness states:
104
+
105
+ | State | Meaning | Action |
106
+ |---|---|---|
107
+ | **GREEN** | Runtime active and semantic embeddings/reranker are configured as intended | Ready for normal use |
108
+ | **YELLOW** | Runtime active with FTS5 fallback or model-audit warnings | Usable, but finish provider/model tuning before production claims |
109
+ | **RED** | Runtime not staged, not loaded, not wired, or falling back to `legacy` | Not installed |
110
+
111
+ A no-embedding FTS5 install is **YELLOW**, not failed. A `legacy` context-engine fallback is **RED**.
112
+
123
113
  Wire both plugins into OpenClaw:
124
114
 
125
115
  **Step 1: Check your existing config (mandatory — do this before wiring).**
@@ -141,6 +131,8 @@ openclaw config set plugins.load.paths "$HYPERMEM_PATHS" --strict-json
141
131
  # Set the context engine and memory slots:
142
132
  openclaw config set plugins.slots.contextEngine hypercompositor
143
133
  openclaw config set plugins.slots.memory hypermem
134
+ openclaw plugins registry --refresh
135
+ openclaw doctor --fix --yes
144
136
 
145
137
  # Only set plugins.allow if your OpenClaw config already uses an allowlist.
146
138
  # If `openclaw config get plugins.allow` returns null, empty, or unset, skip this step.
@@ -290,7 +282,7 @@ Everything runs in-process on SQLite memory databases. No external database serv
290
282
 
291
283
  > **Package versions:** the root package (`hypermem`) and the two plugins (`hypercompositor`, `hypermem-memory`) are versioned independently. Plugin versions trail the core by one minor version when no plugin-facing API changes ship in a release — this is expected.
292
284
 
293
- The **embedding layer** (L3 semantic search) requires a configured provider. Without one, hypermem falls back to FTS5 keyword matching. This is functional but degrades recall quality. Fresh installs should start with `provider: "none"` explicitly so the runtime behavior is intentional and easy to verify, then upgrade later. See [Setup Styles](#setup-styles) below.
285
+ The **embedding layer** (L3 semantic search) is optional at install time. The packaged starter config uses `provider: "none"`, so HyperMem starts in FTS5 keyword mode with no external service dependency. This is functional and easy to verify, but recall quality improves when you later enable Ollama, OpenRouter, or Gemini. See [Setup Styles](#setup-styles) below.
294
286
 
295
287
  ---
296
288
 
@@ -321,7 +313,7 @@ Pick a tier based on your hardware:
321
313
 
322
314
  ### Minimal (no embedder)
323
315
 
324
- No Ollama, no API key. This config must exist **before gateway restart and runtime verification** so the clean install validates the intended lightweight behavior. Set `provider: 'none'` explicitly in `~/.openclaw/hypermem/config.json` to disable embedding entirely:
316
+ No Ollama, no API key. This is the default clean-install posture. `hypermem-install` writes this config when `~/.openclaw/hypermem/config.json` is missing:
325
317
 
326
318
  ```json
327
319
  {
@@ -331,7 +323,7 @@ No Ollama, no API key. This config must exist **before gateway restart and runti
331
323
  }
332
324
  ```
333
325
 
334
- Without a config file, the default provider is `ollama` if Ollama isn't running, the vector store initialization fails non-fatally and hypermem falls back to FTS5. Using `provider: 'none'` makes the intent explicit and avoids the init attempt.
326
+ With `provider: 'none'`, HyperMem does not attempt vector initialization. The install should verify cleanly as FTS5 mode, then you can opt into semantic recall later.
335
327
 
336
328
  You'll see in the logs:
337
329
  ```
@@ -561,6 +553,8 @@ openclaw config set plugins.load.paths "$HYPERMEM_PATHS" --strict-json
561
553
  # Set the context engine and memory slots:
562
554
  openclaw config set plugins.slots.contextEngine hypercompositor
563
555
  openclaw config set plugins.slots.memory hypermem
556
+ openclaw plugins registry --refresh
557
+ openclaw doctor --fix --yes
564
558
 
565
559
  # Only set plugins.allow if your OpenClaw config already uses an allowlist.
566
560
  # If it returns an array, append the HyperMem plugin ids to that existing array.
@@ -573,8 +567,8 @@ openclaw config set plugins.allow '["existing-plugin","hypercompositor","hyperme
573
567
 
574
568
  See [Embedding Providers](#embedding-providers) above.
575
569
 
576
- - **Lightweight (no embedder):** create `~/.openclaw/hypermem/config.json` with `{"embedding":{"provider":"none"}}`. The Quick Start block above already does this. Without this file, the default provider is `ollama` and you'll see a non-fatal init warning if Ollama isn't running.
577
- - **Local:** `ollama pull nomic-embed-text`. No config file needed (Ollama is the default).
570
+ - **Lightweight (no embedder):** keep the starter `{"embedding":{"provider":"none"}}` config. This is the default first-install path and verifies as YELLOW until you intentionally enable semantic recall.
571
+ - **Local:** install Ollama, run `ollama pull nomic-embed-text`, then set `embedding.provider` to `"ollama"` with `model: "nomic-embed-text"`. HyperMem applies retrieval query/document prefixes for supported Ollama embedders (`nomic-embed-text`, `qwen3-embedding`, `mxbai-embed-large`) unless `queryPrefix` / `documentPrefix` are set explicitly.
578
572
  - **Hosted/Gemini:** create `~/.openclaw/hypermem/config.json` with the provider config block from the relevant section above.
579
573
 
580
574
  ### Step 4 — Restart and verify
@@ -593,7 +587,7 @@ Send a message to any agent, then check:
593
587
  openclaw logs --limit 50 | grep hypermem
594
588
  ```
595
589
 
596
- > **If `openclaw logs` fails with an auth or token error:** the gateway API requires authentication. Run `openclaw gateway status` to confirm the gateway is running and accessible. If the gateway is running but logs fail, check `openclaw config get gateway.token` and ensure your shell session has the correct auth context.
590
+ > **If `openclaw logs` fails with an auth or token error:** the gateway API requires authentication. Run `openclaw gateway status` to confirm the gateway is running and accessible. If the gateway is running but logs fail, check your OpenClaw CLI auth context.
597
591
 
598
592
  Expected:
599
593
  ```
@@ -622,7 +616,7 @@ openclaw status # look for hypermem in plugi
622
616
 
623
617
  ### Step 5 — Configure your fleet
624
618
 
625
- hypermem works out of the box for both single-agent and multi-agent installs. The source ships with generic placeholder agent names (`agent1`, `agent2`, `director1`, etc.) in two files that define fleet topology:
619
+ hypermem works out of the box for both single-agent and multi-agent installs. The source ships with generic placeholder agent names (`alice`, `bob`, `director1`, etc.) in two files that define fleet topology:
626
620
 
627
621
  | File | What it defines |
628
622
  |---|---|
@@ -649,7 +643,7 @@ Facts, episodes, and topics are all scoped to your agent ID automatically. Cross
649
643
 
650
644
  #### Multi-agent installs
651
645
 
652
- hypermem ships with generic placeholder agent names (`agent1`, `agent2`, `director1`, etc.) in the two fleet topology files listed above.
646
+ hypermem ships with generic placeholder agent names (`alice`, `bob`, `director1`, etc.) in the two fleet topology files listed above.
653
647
 
654
648
  Replace the placeholder names with your fleet:
655
649
 
@@ -657,7 +651,7 @@ Replace the placeholder names with your fleet:
657
651
 
658
652
  ```typescript
659
653
  // Before (placeholder):
660
- agent1: { agentId: 'agent1', tier: 'council' },
654
+ alice: { agentId: 'alice', tier: 'council' },
661
655
 
662
656
  // After (your fleet):
663
657
  architect: { agentId: 'architect', tier: 'council' },
@@ -667,7 +661,7 @@ architect: { agentId: 'architect', tier: 'council' },
667
661
 
668
662
  ```typescript
669
663
  // Before (placeholder):
670
- agent1: 'infrastructure',
664
+ alice: 'infrastructure',
671
665
 
672
666
  // After (your fleet):
673
667
  architect: 'infrastructure',
@@ -775,9 +769,11 @@ openclaw config set agents.defaults.compaction.reserveTokens 16384 --strict-json
775
769
  openclaw config set agents.defaults.compaction.keepRecentTokens 6000 --strict-json
776
770
  openclaw config set agents.defaults.compaction.reserveTokensFloor 15000 --strict-json
777
771
  openclaw config set agents.defaults.compaction.maxHistoryShare 0.65 --strict-json
772
+ # Recommended for HyperMem: leave OpenClaw transcript byte rotation unset.
773
+ openclaw config unset agents.defaults.compaction.maxActiveTranscriptBytes
778
774
  ```
779
775
 
780
- This reserves 16k tokens for reply generation. HyperMem's own pressure system (afterTurn at 80%, nuclear at 85%) fires first in normal operation. OpenClaw's safeguard catches edge cases.
776
+ This reserves 16k tokens for reply generation. HyperMem's own pressure system (afterTurn at 80%, nuclear at 85%) fires first in normal operation. OpenClaw's safeguard catches edge cases. Leave `agents.defaults.compaction.maxActiveTranscriptBytes` unset while HyperMem owns context pressure; native transcript byte rotation can evict transcript spans before HyperMem's fences and repair gates see them.
781
777
 
782
778
  ### LLM idle timeout
783
779
 
@@ -824,41 +820,52 @@ Resolution order is: (1) `plugins.entries.hypercompositor.config` in `openclaw.j
824
820
 
825
821
  These settings live in `~/.openclaw/hypermem/config.json` under the `compositor` key. All fields are optional — omit any knob to get the code-level default. Gateway restart required after changes.
826
822
 
827
- The recommended starting config for a standard single-agent deployment is intentionally lean on turn-1 warming. Semantic recall and fact triggers fire against each incoming message, so topic-relevant context surfaces as the conversation takes shape. This produces a steadier pressure profile than aggressive pre-loading and avoids the warm→trim→compact cycling you see when every session starts near the top of the budget.
823
+ The recommended starting config for a standard single-agent deployment is the same recall-friendly profile shipped in `assets/default-config.json` and written by `hypermem-install` when no config exists. It keeps semantic recall active, protects topic-bearing warm context, boosts recent antecedents, and guards the literal antecedent of the current user turn under non-critical pressure.
824
+
825
+ Key 0.9.4 defaults:
828
826
 
829
827
  ```json
830
828
  {
829
+ "embedding": {
830
+ "provider": "ollama",
831
+ "model": "nomic-embed-text",
832
+ "dims": 768,
833
+ "dimensions": 768
834
+ },
831
835
  "compositor": {
832
- "budgetFraction": 0.55,
836
+ "turnBudget": {
837
+ "budgetFraction": 0.6,
838
+ "minContextFraction": 0.18
839
+ },
840
+ "warming": {
841
+ "protectedFloorEnabled": true,
842
+ "shapedWarmupDecay": true
843
+ },
844
+ "adjacency": {
845
+ "enabled": true,
846
+ "boostMultiplier": 1.3,
847
+ "maxLookback": 5,
848
+ "maxClockDeltaMin": 10,
849
+ "evictionGuardMessages": 3,
850
+ "evictionGuardTokenCap": 4000
851
+ },
852
+ "budgetFraction": 0.6,
833
853
  "contextWindowReserve": 0.25,
834
854
  "targetBudgetFraction": 0.50,
835
- "warmHistoryBudgetFraction": 0.27,
836
- "maxFacts": 25,
837
- "maxHistoryMessages": 500,
838
- "maxCrossSessionContext": 4000,
839
- "maxRecentToolPairs": 3,
840
- "maxProseToolPairs": 10,
841
- "keystoneHistoryFraction": 0.15,
842
- "keystoneMaxMessages": 12,
843
- "wikiTokenCap": 500
855
+ "warmHistoryBudgetFraction": 0.45,
856
+ "maxFacts": 28,
857
+ "maxHistoryMessages": 250,
858
+ "maxCrossSessionContext": 0,
859
+ "keystoneHistoryFraction": 0.20,
860
+ "keystoneMaxMessages": 15,
861
+ "hyperformProfile": "standard"
844
862
  }
845
863
  }
846
864
  ```
847
865
 
848
- | Knob | Recommended | What it controls | Notes |
849
- |---|---|---|---|
850
- | `budgetFraction` | 0.55 | Fraction of the detected context window used as input budget | Raise to 0.65 for agents that aggressively tool-use. Autodetect only handles known model families see *Context window overrides* below for custom/local/finetuned models |
851
- | `contextWindowReserve` | 0.25 | Reserve left for output and tool results | Below 0.20 on large-context models invites late-turn overflow |
852
- | `targetBudgetFraction` | 0.50 | Split between context assembly and history | Higher = richer facts/wiki; lower = more conversation headroom |
853
- | `warmHistoryBudgetFraction` | 0.27 | History's share of first-turn warming | The key lever against tight trim cycles; don't push below 0.20 |
854
- | `maxFacts` | 25 | Structured facts injected per turn | Recall surfaces more as topics emerge; 35 is fine for long-memory seats |
855
- | `maxHistoryMessages` | 500 | Candidate pool for history ranking | Pool size, not load size. 300 is fine for short-session agents |
856
- | `maxCrossSessionContext` | 4000 | Cross-session context tokens | Solo agents with one session: set to 0 |
857
- | `maxRecentToolPairs` | 3 | Verbatim tool pairs kept | Raise to 5 for code agents with heavy tool output |
858
- | `maxProseToolPairs` | 10 | Compressed tool pairs before stubbing | |
859
- | `keystoneHistoryFraction` | 0.15 | Older significant turns reserved within history slot | |
860
- | `keystoneMaxMessages` | 12 | Max keystone candidates per turn | Raise to 18 if the agent loses track of older decisions |
861
- | `wikiTokenCap` | 500 | Cap on wiki/knowledge injection | Raise if your agent uses heavy doc content |
866
+ Run `hypermem-doctor --fix-plan` after upgrades. It flags older preserved configs that are missing the 0.9.4 recall-surface knobs, legacy `agents.defaults.memorySearch`, native compaction collisions, plugin wiring defects, and risky model-window autodetect paths.
867
+
868
+ `hypermem-status --master` also reports the active recall-surface config as `0.9.4 surface N/10 recommended knobs`, plus history-query health, vector coverage, and bounded maintenance debt. Fleet maintenance scans are bounded by default; use `--fleet-agent-limit`, `--max-candidates-per-conversation`, and `--top-agents` only when you intentionally widen the health check. Referenced-noise repair remains capped by `--repair-limit` with a hard max of 500.
862
869
 
863
870
  **Lean profile** (~35–45% fewer tokens per turn) — for constrained hosts, small models, or cost-sensitive deployments:
864
871
 
package/README.md CHANGED
@@ -332,7 +332,7 @@ Diagnostics expose reranker status, candidate count, and provider, so operators
332
332
  | Knowledge / wiki | Domain knowledge and synthesized topic pages with full-text search |
333
333
  | Episodes | Significant events, decisions, discoveries, participants, and source links |
334
334
  | Topics | Cross-session thread tracking and topic lifecycle state |
335
- | Preferences | Operator and agent behavior patterns |
335
+ | Preferences | operator and agent behavior patterns |
336
336
  | Documents | Chunked workspace/governance docs, doc sources, and trigger retrieval metadata |
337
337
  | Knowledge graph | Links between facts, knowledge, topics, episodes, agents, and preferences |
338
338
  | Fleet registry | Agents, orgs, tiers, capabilities, and fleet topology |
@@ -386,7 +386,7 @@ Slot-level budget allocation is shown in the [hypercompositor diagram](#what-the
386
386
 
387
387
  ## Requirements
388
388
 
389
- **Current release: hypermem 0.9.2.** Changelog: [CHANGELOG.md](./CHANGELOG.md)
389
+ **Current release: hypermem 0.9.5.** Changelog: [CHANGELOG.md](./CHANGELOG.md)
390
390
 
391
391
  | Requirement | Version | Notes |
392
392
  |---|---|---|
@@ -398,10 +398,10 @@ SQLite is a library, not a service. All four layers run in-process with no exter
398
398
  **Runtime version constants** (importable from the package):
399
399
  ```typescript
400
400
  import {
401
- ENGINE_VERSION, // '0.9.2'
401
+ ENGINE_VERSION, // '0.9.5'
402
402
  MIN_NODE_VERSION, // '22.0.0'
403
403
  SQLITE_VEC_VERSION, // '0.1.9'
404
- MAIN_SCHEMA_VERSION, // 10 (messages.db)
404
+ MAIN_SCHEMA_VERSION, // 11 (messages.db)
405
405
  LIBRARY_SCHEMA_VERSION_EXPORT, // 19 (library.db)
406
406
  } from '@psiclawops/hypermem';
407
407
  ```
@@ -423,7 +423,9 @@ npm install @psiclawops/hypermem
423
423
  npx hypermem-install
424
424
  ```
425
425
 
426
- `hypermem-install` stages the runtime payload into `~/.openclaw/plugins/hypermem`. It does **not** modify OpenClaw config and does **not** restart the gateway. HyperMem is active only after OpenClaw is wired, restarted, and compose activity appears in logs.
426
+ `hypermem-install` stages the runtime payload into `~/.openclaw/plugins/hypermem` and creates `~/.openclaw/hypermem/config.json` only when it is missing. It does **not** modify OpenClaw config and does **not** restart the gateway. HyperMem is active only after OpenClaw is wired, restarted, and compose activity appears in logs.
427
+
428
+ For production-shaped local validation, run `npm run install:runtime:packed` from the repo. It packs HyperMem, installs the tarball into a temporary app, and stages OpenClaw from that installed package. Avoid validating live gateway behavior from repo symlinks or copied working-tree files.
427
429
 
428
430
  Install states:
429
431
 
@@ -435,30 +437,7 @@ Install states:
435
437
  | Runtime loaded | gateway restarted and both plugins loaded |
436
438
  | Runtime active | logs show `hypermem initialized` and compose activity |
437
439
 
438
- Minimal starter config for lightweight FTS-only mode:
439
-
440
- ```bash
441
- mkdir -p ~/.openclaw/hypermem
442
- cat > ~/.openclaw/hypermem/config.json <<'JSON'
443
- {
444
- "embedding": { "provider": "none" },
445
- "compositor": {
446
- "budgetFraction": 0.55,
447
- "contextWindowReserve": 0.25,
448
- "targetBudgetFraction": 0.50,
449
- "warmHistoryBudgetFraction": 0.27,
450
- "maxFacts": 25,
451
- "maxHistoryMessages": 500,
452
- "maxCrossSessionContext": 4000,
453
- "maxRecentToolPairs": 3,
454
- "maxProseToolPairs": 10,
455
- "keystoneHistoryFraction": 0.15,
456
- "keystoneMaxMessages": 12,
457
- "wikiTokenCap": 500
458
- }
459
- }
460
- JSON
461
- ```
440
+ The installer writes the starter config for you when `~/.openclaw/hypermem/config.json` is missing. The default first-install posture is FTS5/no-embedding mode with `{"embedding":{"provider":"none"}}`, so HyperMem can load and compose without Ollama or an API key. That verifies as **YELLOW** install readiness: runtime active, semantic vector recall disabled. Enable Ollama, OpenRouter, or Gemini after the baseline install is active.
462
441
 
463
442
  Then merge the staged plugin paths into OpenClaw config and set the slots:
464
443
 
@@ -480,7 +459,7 @@ hypermem-status --health
480
459
  hypermem-model-audit --strict
481
460
  ```
482
461
 
483
- `hypermem-doctor` is the confidence check: it validates plugin wiring, runtime load state, recommended OpenClaw settings such as `contextPruning.mode=off`, GPT-5 personality overlay off, startup/bootstrap injection sizing, compaction safety settings, HyperMem data files, and model context-window overrides for GPT/OpenAI-compatible/local gateways. It is read-only and prints a reviewable fix plan.
462
+ `hypermem-doctor` is the confidence check: it validates plugin wiring, plugin registry refresh readiness, runtime load state, recommended OpenClaw settings such as `contextPruning.mode=off`, GPT-5 personality overlay off, startup/bootstrap injection sizing, compaction safety settings including `maxActiveTranscriptBytes` remaining unset for HyperMem-managed compaction, HyperMem data files, and model context-window overrides for GPT/OpenAI-compatible/local gateways. It is read-only and prints a reviewable fix plan.
484
463
 
485
464
  Full install, upgrade, source-clone, embedding provider, reranker, fleet config, and rollback guidance lives in **[INSTALL.md](./INSTALL.md)**.
486
465
 
@@ -498,7 +477,7 @@ If you prefer, hand the install to your OpenClaw agent:
498
477
 
499
478
  > "Install hypermem following INSTALL.md. I'm running a [solo / multi-agent] setup."
500
479
 
501
- ### Operator guides
480
+ ### operator guides
502
481
 
503
482
  - **[docs/MEMORY_MD_AUTHORING.md](./docs/MEMORY_MD_AUTHORING.md)**, how to keep `MEMORY.md` compact, durable, and reviewable
504
483
  - **[docs/TUNING.md](./docs/TUNING.md)**, context assembly and output shaping profiles
@@ -516,7 +495,7 @@ Two independent surfaces: **context assembly** (what fills the context window) a
516
495
  | `standard` | 128k | Normal deployments, small fleets |
517
496
  | `full` | 200k+ | Multi-agent fleets, large-context models |
518
497
 
519
- Start with `light`. Use `mergeProfile()` to adjust individual settings:
498
+ Start from the installed baseline. Use `light` for constrained/no-embedding installs, `standard` once semantic recall is enabled, and `full` for large-context fleets. Use `mergeProfile()` to adjust individual settings:
520
499
 
521
500
  ```typescript
522
501
  import { mergeProfile } from '@psiclawops/hypermem';
@@ -567,16 +546,19 @@ README keeps the interface surface short. Use the detailed docs for exact exampl
567
546
 
568
547
  **Runtime API:** import `HyperMem` from `@psiclawops/hypermem` for direct Node.js use, custom tests, and non-OpenClaw integrations. See **[INSTALL.md § Non-OpenClaw usage](./INSTALL.md#non-openclaw-usage)** and package TypeScript declarations for the current interface.
569
548
 
570
- **Operator CLIs:**
549
+ **operator CLIs:**
571
550
 
572
551
  ```bash
573
552
  hypermem-status --health
574
553
  hypermem-status --master
575
554
  hypermem-model-audit --strict
576
555
  hypermem-bench --iterations 1000 --warmup 50 --agent main
556
+ # repo release validation:
557
+ npm run release:install-smoke
558
+ npm run validate:history-query
577
559
  ```
578
560
 
579
- Diagnostics and validation details: **[docs/DIAGNOSTICS.md](./docs/DIAGNOSTICS.md)** and **[docs/INTEGRATION_VALIDATION.md](./docs/INTEGRATION_VALIDATION.md)**.
561
+ Diagnostics and validation details: **[docs/DIAGNOSTICS.md](./docs/DIAGNOSTICS.md)** and **[docs/INTEGRATION_VALIDATION.md](./docs/INTEGRATION_VALIDATION.md)**. The master health surface reports 0.9.4 recall-surface config completeness, history-query readiness, vector coverage, bounded maintenance debt, and referenced-noise repair status.
580
562
 
581
563
  ## Pressure management
582
564
 
@@ -612,7 +594,7 @@ hypermem composes context fresh on every turn, but a long-running session still
612
594
  | Symptom | Cause | Fix |
613
595
  |---|---|---|
614
596
  | `falling back to default engine "legacy"` in logs | Plugin not loaded or slot misconfigured | Check `openclaw config get plugins.slots.contextEngine` is `hypercompositor`, paths are correct, and both plugins are in `plugins.allow` |
615
- | `openclaw gateway restart` says disabled/not configured | OpenClaw not fully onboarded | Complete OpenClaw setup first. `gateway restart` requires a running gateway. |
597
+ | `openclaw gateway restart` says disabled/not configured | OpenClaw not fully onboarded | Complete OpenClaw setup first. `openclaw gateway restart` requires an onboarded gateway. |
616
598
  | `openclaw logs` fails with auth/token error | Gateway auth not set up for CLI | Run `openclaw gateway status` to confirm the gateway is accessible |
617
599
  | `facts=0 semantic=0` every turn | Fresh install, no data yet | Expected. Facts accumulate over real conversations. |
618
600
  | Health check says "no sessions ingested" | No agent has run a session yet | Send a test message, then re-run |
@@ -631,7 +613,7 @@ The migration guide includes worked examples showing how to bring data from Open
631
613
 
632
614
  All examples default to dry-run. Nothing is written until you add `--apply`.
633
615
 
634
- Operator guide: **[docs/MIGRATION_GUIDE.md](./docs/MIGRATION_GUIDE.md)**
616
+ operator guide: **[docs/MIGRATION_GUIDE.md](./docs/MIGRATION_GUIDE.md)**
635
617
 
636
618
 
637
619
  ---
@@ -0,0 +1,41 @@
1
+ {
2
+ "embedding": {
3
+ "provider": "none"
4
+ },
5
+ "compositor": {
6
+ "turnBudget": {
7
+ "budgetFraction": 0.6,
8
+ "minContextFraction": 0.18
9
+ },
10
+ "warming": {
11
+ "protectedFloorEnabled": true,
12
+ "shapedWarmupDecay": true
13
+ },
14
+ "adjacency": {
15
+ "enabled": true,
16
+ "boostMultiplier": 1.3,
17
+ "maxLookback": 5,
18
+ "maxClockDeltaMin": 10,
19
+ "evictionGuardMessages": 3,
20
+ "evictionGuardTokenCap": 4000
21
+ },
22
+ "contextWindowOverrides": {},
23
+ "budgetFraction": 0.6,
24
+ "contextWindowReserve": 0.25,
25
+ "targetBudgetFraction": 0.5,
26
+ "warmHistoryBudgetFraction": 0.45,
27
+ "maxFacts": 28,
28
+ "maxHistoryMessages": 250,
29
+ "maxCrossSessionContext": 0,
30
+ "keystoneHistoryFraction": 0.2,
31
+ "keystoneMaxMessages": 15,
32
+ "hyperformProfile": "standard"
33
+ },
34
+ "indexer": {
35
+ "enabled": true,
36
+ "factExtractionMode": "tiered",
37
+ "periodicInterval": 300000,
38
+ "batchSize": 128,
39
+ "maxMessagesPerTick": 500
40
+ }
41
+ }
@@ -16,7 +16,7 @@ function argValue(name, fallback = null) {
16
16
  return process.argv.find((a, i) => process.argv[i - 1] === name) ?? fallback;
17
17
  }
18
18
 
19
- const DATA_DIR = argValue('--data-dir', process.env.HYPERMEM_DATA_DIR ?? path.join(process.env.HOME || '/home/user', '.openclaw', 'hypermem'));
19
+ const DATA_DIR = argValue('--data-dir', process.env.HYPERMEM_DATA_DIR ?? path.join(process.env.HOME || os.homedir(), '.openclaw', 'hypermem'));
20
20
  const ITERATIONS = parseInt(argValue('--iterations', '100'), 10);
21
21
  const WARMUP = parseInt(argValue('--warmup', '3'), 10);
22
22
  const TARGET_AGENT = argValue('--agent', null);