@psiclawops/hypermem 0.9.2 → 0.9.4
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/CHANGELOG.md +16 -0
- package/INSTALL.md +73 -70
- package/README.md +33 -51
- package/assets/default-config.json +47 -0
- package/bin/hypermem-doctor.mjs +76 -2
- package/bin/hypermem-status.mjs +255 -7
- package/dist/adaptive-lifecycle.d.ts +39 -0
- package/dist/adaptive-lifecycle.d.ts.map +1 -1
- package/dist/adaptive-lifecycle.js +87 -9
- package/dist/background-indexer.d.ts.map +1 -1
- package/dist/background-indexer.js +7 -5
- package/dist/compositor.d.ts.map +1 -1
- package/dist/compositor.js +239 -20
- package/dist/hybrid-retrieval.d.ts +8 -0
- package/dist/hybrid-retrieval.d.ts.map +1 -1
- package/dist/hybrid-retrieval.js +112 -10
- package/dist/index.d.ts +15 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -0
- package/dist/message-store.d.ts +62 -1
- package/dist/message-store.d.ts.map +1 -1
- package/dist/message-store.js +355 -2
- package/dist/open-domain.d.ts.map +1 -1
- package/dist/open-domain.js +3 -2
- package/dist/proactive-pass.d.ts +42 -2
- package/dist/proactive-pass.d.ts.map +1 -1
- package/dist/proactive-pass.js +294 -39
- package/dist/topic-synthesizer.d.ts.map +1 -1
- package/dist/topic-synthesizer.js +9 -3
- package/dist/types.d.ts +99 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vector-store.d.ts +10 -1
- package/dist/vector-store.d.ts.map +1 -1
- package/dist/vector-store.js +45 -9
- package/docs/DIAGNOSTICS.md +87 -0
- package/docs/INTEGRATION_VALIDATION.md +40 -1
- package/docs/ROADMAP.md +25 -12
- package/docs/TUNING.md +45 -4
- package/install.sh +5 -60
- package/memory-plugin/dist/index.d.ts +24 -0
- package/memory-plugin/dist/index.js +570 -0
- package/memory-plugin/openclaw.plugin.json +199 -2
- package/memory-plugin/package.json +3 -3
- package/package.json +24 -10
- package/plugin/dist/index.d.ts +210 -0
- package/plugin/dist/index.d.ts.map +1 -0
- package/plugin/dist/index.js +3641 -0
- package/plugin/dist/index.js.map +1 -0
- package/plugin/openclaw.plugin.json +199 -2
- package/plugin/package.json +4 -4
- package/scripts/install-packed-runtime.mjs +99 -0
- package/scripts/install-runtime.mjs +164 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to hypermem are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.9.4 - 2026-04-28
|
|
6
|
+
|
|
7
|
+
- **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.
|
|
8
|
+
- **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.
|
|
9
|
+
- **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.
|
|
10
|
+
- **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.
|
|
11
|
+
- **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.
|
|
12
|
+
|
|
13
|
+
## 0.9.3 - OpenClaw 2026.4.26 compatibility hardening
|
|
14
|
+
|
|
15
|
+
- **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.
|
|
16
|
+
- **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.
|
|
17
|
+
- **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.
|
|
18
|
+
- **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`.
|
|
19
|
+
- **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.
|
|
20
|
+
|
|
5
21
|
## 0.9.2 - 0.9.1 republish + publish-path hardening
|
|
6
22
|
|
|
7
23
|
- **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.
|
package/INSTALL.md
CHANGED
|
@@ -5,17 +5,17 @@ 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
|
|
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 daemon start` or 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:**
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
openclaw
|
|
14
|
+
openclaw daemon 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
|
|
18
|
+
If `gateway status` shows "disabled" or "not configured", complete OpenClaw onboarding first. `openclaw daemon 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 daemon start` (or the full onboarding flow) before installing plugins.
|
|
19
19
|
|
|
20
20
|
## Non-OpenClaw usage
|
|
21
21
|
|
|
@@ -51,14 +51,16 @@ No gateway, plugin load path, or OpenClaw config is required in library mode. Op
|
|
|
51
51
|
|
|
52
52
|
This guide is deliberately declarative. Follow the steps in order and verify each install state before moving on.
|
|
53
53
|
|
|
54
|
-
> **Release note:**
|
|
54
|
+
> **Release note:** current releases ship `hypermem-install`, `install:runtime`, and `hypermem-model-audit`. If your installed package does not contain them, upgrade to the latest `@psiclawops/hypermem` before following this guide.
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
npm install @psiclawops/hypermem
|
|
58
58
|
npx hypermem-install
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
`hypermem-install` stages the plugin runtime into `~/.openclaw/plugins/hypermem
|
|
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,44 +68,28 @@ 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
|
|
71
|
+
It installs the npm package into `~/.hypermem`, backs up any existing staged runtime when confirmed, stages the runtime with `hypermem-install`, writes the recall-friendly 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
|
|
|
73
|
-
> **Prerequisites:** OpenClaw must be installed and onboarded. Run `openclaw
|
|
75
|
+
> **Prerequisites:** OpenClaw must be installed and onboarded. Run `openclaw daemon status` to confirm. If the gateway is not configured, complete OpenClaw setup first.
|
|
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
|
-
|
|
79
|
+
`hypermem-install` creates the current recommended starter config automatically when `~/.openclaw/hypermem/config.json` is missing. The shipped starter config is recall-friendly standard mode:
|
|
80
|
+
|
|
81
|
+
- `embedding.provider: "ollama"` with `nomic-embed-text`
|
|
82
|
+
- `warmHistoryBudgetFraction: 0.45`
|
|
83
|
+
- standard fact, keystone, and history caps
|
|
78
84
|
|
|
79
|
-
|
|
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
|
|
85
|
+
If Ollama is not running or `nomic-embed-text` is not installed, `hypermem-install` fails with a remediation block instead of silently staging a degraded semantic-recall install. For CI, container practice, or intentional FTS-only installs, either run:
|
|
81
86
|
|
|
82
87
|
```bash
|
|
83
|
-
|
|
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
|
|
88
|
+
npx hypermem-install --skip-embedding-check
|
|
105
89
|
```
|
|
106
90
|
|
|
91
|
+
or pre-create `~/.openclaw/hypermem/config.json` with `{"embedding":{"provider":"none"}}` before running the installer. Existing config files are preserved unchanged.
|
|
92
|
+
|
|
107
93
|
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.
|
|
108
94
|
|
|
109
95
|
### Install states
|
|
@@ -141,6 +127,8 @@ openclaw config set plugins.load.paths "$HYPERMEM_PATHS" --strict-json
|
|
|
141
127
|
# Set the context engine and memory slots:
|
|
142
128
|
openclaw config set plugins.slots.contextEngine hypercompositor
|
|
143
129
|
openclaw config set plugins.slots.memory hypermem
|
|
130
|
+
openclaw plugins registry --refresh
|
|
131
|
+
openclaw doctor --fix --yes
|
|
144
132
|
|
|
145
133
|
# Only set plugins.allow if your OpenClaw config already uses an allowlist.
|
|
146
134
|
# If `openclaw config get plugins.allow` returns null, empty, or unset, skip this step.
|
|
@@ -153,7 +141,7 @@ openclaw config set plugins.allow '["existing-plugin","hypercompositor","hyperme
|
|
|
153
141
|
**Step 3: Restart.**
|
|
154
142
|
|
|
155
143
|
```bash
|
|
156
|
-
openclaw
|
|
144
|
+
openclaw daemon restart
|
|
157
145
|
```
|
|
158
146
|
|
|
159
147
|
OpenClaw loads the plugin runtime from `~/.openclaw/plugins/hypermem/`.
|
|
@@ -231,7 +219,7 @@ Upgrades preserve the HyperMem data directory and existing config. The runtime s
|
|
|
231
219
|
cp -a ~/.openclaw/plugins/hypermem ~/.openclaw/plugins/hypermem.backup.$(date +%Y%m%d-%H%M%S) 2>/dev/null || true
|
|
232
220
|
npm install @psiclawops/hypermem@latest
|
|
233
221
|
npx hypermem-install
|
|
234
|
-
openclaw
|
|
222
|
+
openclaw daemon restart
|
|
235
223
|
```
|
|
236
224
|
|
|
237
225
|
Then validate:
|
|
@@ -256,7 +244,7 @@ Rollback disables HyperMem without deleting data:
|
|
|
256
244
|
```bash
|
|
257
245
|
openclaw config set plugins.slots.contextEngine legacy
|
|
258
246
|
openclaw config set plugins.slots.memory none
|
|
259
|
-
openclaw
|
|
247
|
+
openclaw daemon restart
|
|
260
248
|
```
|
|
261
249
|
|
|
262
250
|
---
|
|
@@ -529,7 +517,7 @@ npm install
|
|
|
529
517
|
npm run build
|
|
530
518
|
```
|
|
531
519
|
|
|
532
|
-
Build both plugins, then install the runtime payload into 's durable plugin directory:
|
|
520
|
+
Build both plugins, then install the runtime payload into OpenClaw's durable plugin directory:
|
|
533
521
|
|
|
534
522
|
```bash
|
|
535
523
|
npm --prefix plugin install && npm --prefix plugin run build
|
|
@@ -561,6 +549,8 @@ openclaw config set plugins.load.paths "$HYPERMEM_PATHS" --strict-json
|
|
|
561
549
|
# Set the context engine and memory slots:
|
|
562
550
|
openclaw config set plugins.slots.contextEngine hypercompositor
|
|
563
551
|
openclaw config set plugins.slots.memory hypermem
|
|
552
|
+
openclaw plugins registry --refresh
|
|
553
|
+
openclaw doctor --fix --yes
|
|
564
554
|
|
|
565
555
|
# Only set plugins.allow if your OpenClaw config already uses an allowlist.
|
|
566
556
|
# If it returns an array, append the HyperMem plugin ids to that existing array.
|
|
@@ -574,7 +564,7 @@ openclaw config set plugins.allow '["existing-plugin","hypercompositor","hyperme
|
|
|
574
564
|
See [Embedding Providers](#embedding-providers) above.
|
|
575
565
|
|
|
576
566
|
- **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).
|
|
567
|
+
- **Local:** `ollama pull nomic-embed-text`. No config file needed (Ollama is the default). 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
568
|
- **Hosted/Gemini:** create `~/.openclaw/hypermem/config.json` with the provider config block from the relevant section above.
|
|
579
569
|
|
|
580
570
|
### Step 4 — Restart and verify
|
|
@@ -582,7 +572,7 @@ See [Embedding Providers](#embedding-providers) above.
|
|
|
582
572
|
Do not start tuning before this section passes. If HyperMem is not loaded and composing, the next problem is installation, not tuning.
|
|
583
573
|
|
|
584
574
|
```bash
|
|
585
|
-
openclaw
|
|
575
|
+
openclaw daemon restart
|
|
586
576
|
```
|
|
587
577
|
|
|
588
578
|
> **If restart reports the gateway is disabled or not configured:** you need to complete OpenClaw onboarding before this step. See [Prerequisites](#prerequisites). `gateway restart` only works on an already-running gateway.
|
|
@@ -593,7 +583,7 @@ Send a message to any agent, then check:
|
|
|
593
583
|
openclaw logs --limit 50 | grep hypermem
|
|
594
584
|
```
|
|
595
585
|
|
|
596
|
-
> **If `openclaw logs` fails with an auth or token error:** the gateway API requires authentication. Run `openclaw
|
|
586
|
+
> **If `openclaw logs` fails with an auth or token error:** the gateway API requires authentication. Run `openclaw daemon 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.
|
|
597
587
|
|
|
598
588
|
Expected:
|
|
599
589
|
```
|
|
@@ -678,7 +668,7 @@ architect: 'infrastructure',
|
|
|
678
668
|
```bash
|
|
679
669
|
npm run build
|
|
680
670
|
npm --prefix plugin run build
|
|
681
|
-
openclaw
|
|
671
|
+
openclaw daemon restart
|
|
682
672
|
```
|
|
683
673
|
|
|
684
674
|
Agents not listed in `AGENT_DOMAIN_MAP` default to domain `'general'`, which is fine for most setups. The org registry only matters if you use cross-agent memory visibility (org-scoped or council-scoped facts). If all your facts are agent-private or fleet-wide, you can skip the org structure entirely.
|
|
@@ -696,7 +686,7 @@ npm install
|
|
|
696
686
|
npm run build
|
|
697
687
|
npm --prefix plugin install && npm --prefix plugin run build
|
|
698
688
|
npm --prefix memory-plugin install && npm --prefix memory-plugin run build
|
|
699
|
-
openclaw
|
|
689
|
+
openclaw daemon restart
|
|
700
690
|
```
|
|
701
691
|
|
|
702
692
|
What changed on the path from 0.5.x to current:
|
|
@@ -775,9 +765,11 @@ openclaw config set agents.defaults.compaction.reserveTokens 16384 --strict-json
|
|
|
775
765
|
openclaw config set agents.defaults.compaction.keepRecentTokens 6000 --strict-json
|
|
776
766
|
openclaw config set agents.defaults.compaction.reserveTokensFloor 15000 --strict-json
|
|
777
767
|
openclaw config set agents.defaults.compaction.maxHistoryShare 0.65 --strict-json
|
|
768
|
+
# Recommended for HyperMem: leave OpenClaw transcript byte rotation unset.
|
|
769
|
+
openclaw config unset agents.defaults.compaction.maxActiveTranscriptBytes
|
|
778
770
|
```
|
|
779
771
|
|
|
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.
|
|
772
|
+
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
773
|
|
|
782
774
|
### LLM idle timeout
|
|
783
775
|
|
|
@@ -824,41 +816,52 @@ Resolution order is: (1) `plugins.entries.hypercompositor.config` in `openclaw.j
|
|
|
824
816
|
|
|
825
817
|
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
818
|
|
|
827
|
-
The recommended starting config for a standard single-agent deployment is
|
|
819
|
+
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.
|
|
820
|
+
|
|
821
|
+
Key 0.9.4 defaults:
|
|
828
822
|
|
|
829
823
|
```json
|
|
830
824
|
{
|
|
825
|
+
"embedding": {
|
|
826
|
+
"provider": "ollama",
|
|
827
|
+
"model": "nomic-embed-text",
|
|
828
|
+
"dims": 768,
|
|
829
|
+
"dimensions": 768
|
|
830
|
+
},
|
|
831
831
|
"compositor": {
|
|
832
|
-
"
|
|
832
|
+
"turnBudget": {
|
|
833
|
+
"budgetFraction": 0.6,
|
|
834
|
+
"minContextFraction": 0.18
|
|
835
|
+
},
|
|
836
|
+
"warming": {
|
|
837
|
+
"protectedFloorEnabled": true,
|
|
838
|
+
"shapedWarmupDecay": true
|
|
839
|
+
},
|
|
840
|
+
"adjacency": {
|
|
841
|
+
"enabled": true,
|
|
842
|
+
"boostMultiplier": 1.3,
|
|
843
|
+
"maxLookback": 5,
|
|
844
|
+
"maxClockDeltaMin": 10,
|
|
845
|
+
"evictionGuardMessages": 3,
|
|
846
|
+
"evictionGuardTokenCap": 4000
|
|
847
|
+
},
|
|
848
|
+
"budgetFraction": 0.6,
|
|
833
849
|
"contextWindowReserve": 0.25,
|
|
834
850
|
"targetBudgetFraction": 0.50,
|
|
835
|
-
"warmHistoryBudgetFraction": 0.
|
|
836
|
-
"maxFacts":
|
|
837
|
-
"maxHistoryMessages":
|
|
838
|
-
"maxCrossSessionContext":
|
|
839
|
-
"
|
|
840
|
-
"
|
|
841
|
-
"
|
|
842
|
-
"keystoneMaxMessages": 12,
|
|
843
|
-
"wikiTokenCap": 500
|
|
851
|
+
"warmHistoryBudgetFraction": 0.45,
|
|
852
|
+
"maxFacts": 28,
|
|
853
|
+
"maxHistoryMessages": 250,
|
|
854
|
+
"maxCrossSessionContext": 0,
|
|
855
|
+
"keystoneHistoryFraction": 0.20,
|
|
856
|
+
"keystoneMaxMessages": 15,
|
|
857
|
+
"hyperformProfile": "standard"
|
|
844
858
|
}
|
|
845
859
|
}
|
|
846
860
|
```
|
|
847
861
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
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 |
|
|
862
|
+
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.
|
|
863
|
+
|
|
864
|
+
`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
865
|
|
|
863
866
|
**Lean profile** (~35–45% fewer tokens per turn) — for constrained hosts, small models, or cost-sensitive deployments:
|
|
864
867
|
|
|
@@ -997,7 +1000,7 @@ Expected on fresh installs. Facts and episodes accumulate over real conversation
|
|
|
997
1000
|
|
|
998
1001
|
**Lost bundled plugins after setting `plugins.allow`**
|
|
999
1002
|
|
|
1000
|
-
If you set `plugins.allow` to only `["hypercompositor","hypermem"]` without including your pre-existing allowed plugins, OpenClaw can stop loading bundled CLI surfaces and channel plugins. Fix: restore the prior allowlist, append `hypercompositor` and `hypermem`, then `openclaw
|
|
1003
|
+
If you set `plugins.allow` to only `["hypercompositor","hypermem"]` without including your pre-existing allowed plugins, OpenClaw can stop loading bundled CLI surfaces and channel plugins. Fix: restore the prior allowlist, append `hypercompositor` and `hypermem`, then `openclaw daemon restart`. If `plugins.allow` was previously unset or empty, remove the HyperMem-only allowlist instead of keeping it.
|
|
1001
1004
|
|
|
1002
1005
|
**Plugin not found**
|
|
1003
1006
|
|
|
@@ -1045,7 +1048,7 @@ To return to OpenClaw's default context engine:
|
|
|
1045
1048
|
```bash
|
|
1046
1049
|
openclaw config set plugins.slots.contextEngine legacy
|
|
1047
1050
|
openclaw config set plugins.slots.memory none
|
|
1048
|
-
openclaw
|
|
1051
|
+
openclaw daemon restart
|
|
1049
1052
|
```
|
|
1050
1053
|
|
|
1051
1054
|
Data in `~/.openclaw/hypermem/` is untouched. Re-enable by switching back.
|
|
@@ -1063,7 +1066,7 @@ Example:
|
|
|
1063
1066
|
```bash
|
|
1064
1067
|
# Point hypermem at a different data location:
|
|
1065
1068
|
export HYPERMEM_DATA_DIR=/mnt/data/hypermem
|
|
1066
|
-
openclaw
|
|
1069
|
+
openclaw daemon restart
|
|
1067
1070
|
```
|
|
1068
1071
|
|
|
1069
1072
|
> The config file path (`~/.openclaw/hypermem/config.json`) is separate from the data directory. Moving `HYPERMEM_DATA_DIR` does not move the config file.
|
package/README.md
CHANGED
|
@@ -20,13 +20,13 @@ Or via the shell installer:
|
|
|
20
20
|
curl -fsSL https://raw.githubusercontent.com/PsiClawOps/hypermem/main/install.sh | bash
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Or install manually via `npm install @psiclawops/hypermem
|
|
23
|
+
Or install manually via `npm install @psiclawops/hypermem`: see [Installation](#installation) for the full declarative plugin path, verification checkpoints, and setup variants.
|
|
24
24
|
|
|
25
25
|
Release operators should also read:
|
|
26
26
|
|
|
27
|
-
- [INSTALL.md](./INSTALL.md)
|
|
28
|
-
- [docs/INTEGRATION_VALIDATION.md](./docs/INTEGRATION_VALIDATION.md)
|
|
29
|
-
- [docs/DIAGNOSTICS.md](./docs/DIAGNOSTICS.md)
|
|
27
|
+
- [INSTALL.md](./INSTALL.md): canonical fresh install and upgrade guide
|
|
28
|
+
- [docs/INTEGRATION_VALIDATION.md](./docs/INTEGRATION_VALIDATION.md): end-to-end integration validation contract
|
|
29
|
+
- [docs/DIAGNOSTICS.md](./docs/DIAGNOSTICS.md): status, model audit, compose, trim, and release diagnostics
|
|
30
30
|
|
|
31
31
|
A successful `hypermem-install` only stages the runtime. HyperMem is active only after OpenClaw config is wired, the gateway restarts, and logs show compose activity.
|
|
32
32
|
|
|
@@ -57,7 +57,7 @@ The difference is not intelligence. It is prompt access. Three failure modes fol
|
|
|
57
57
|
|
|
58
58
|
## What OpenClaw provides today
|
|
59
59
|
|
|
60
|
-
OpenClaw already gives agents a
|
|
60
|
+
OpenClaw already gives agents a strong baseline. It injects structured guidance into every session:
|
|
61
61
|
|
|
62
62
|
| File | What it contributes | Survives session restart? |
|
|
63
63
|
|---|---|---|
|
|
@@ -78,16 +78,16 @@ OpenClaw gives agents a strong starting shape: identity files, user guidance, ta
|
|
|
78
78
|
|
|
79
79
|
hypermem closes that gap with four SQLite-backed memory layers that stay local, run in-process, and remain queryable across sessions. No external database service. No retrieval stack to babysit.
|
|
80
80
|
|
|
81
|
-
| Layer | What it holds |
|
|
81
|
+
| Layer | What it holds | Representative local read |
|
|
82
82
|
|---|---|---|
|
|
83
|
-
| **L1 SQLite `:memory:`** | What the agent needs right now. Identity, recent history, active state. | 0.08ms |
|
|
84
|
-
| **L2 History** | Every conversation, queryable and concurrent-safe. Per-agent. | 0.13ms |
|
|
85
|
-
| **L3 Semantic** | Finds related content even when the words don't match. |
|
|
86
|
-
| **L4 Knowledge** | Facts, wiki pages, episodes, preferences. Shared across agents. | 0.09ms |
|
|
83
|
+
| **L1 SQLite `:memory:`** | What the agent needs right now. Identity, recent history, active state. | L1 slot GET: 0.08ms avg |
|
|
84
|
+
| **L2 History** | Every conversation, queryable and concurrent-safe. Per-agent. | L2 history window: 0.13ms avg |
|
|
85
|
+
| **L3 Semantic** | Finds related content even when the words don't match. | async/cached; provider-dependent. See [Speed](#speed) and [Diagnostics](./docs/DIAGNOSTICS.md#memory-access-benchmark). |
|
|
86
|
+
| **L4 Knowledge** | Facts, wiki pages, episodes, preferences. Shared across agents. | L4 knowledge query: 0.09ms avg |
|
|
87
87
|
|
|
88
88
|
Durable context stays in SQLite and remains queryable across session boundaries. The retry logic decision from last week, the deployment preferences from last month, and the architecture choices from day one can be pulled back in when they matter.
|
|
89
89
|
|
|
90
|
-
That changes OpenClaw in a few concrete ways. Starts are warm instead of blank because recent history, ranked facts, active topics, and cached semantic state are loaded before the first turn. Recall survives wording drift because FTS5, sqlite-vec, RRF fusion, and an optional reranker can recover the same idea through different phrasing. Time-aware facts can answer
|
|
90
|
+
That changes OpenClaw in a few concrete ways. Starts are warm instead of blank because recent history, ranked facts, active topics, and cached semantic state are loaded before the first turn. Recall survives wording drift because FTS5, sqlite-vec, RRF fusion, and an optional reranker can recover the same idea through different phrasing. Time-aware facts can answer "last week" and "before the release" as retrieval problems instead of vague prompt guessing. Shared knowledge stops living in one agent’s scratchpad because `library.db` holds facts, docs, episodes, preferences, fleet state, and output standards with visibility controls.
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
@@ -189,11 +189,11 @@ Behavior standards define how your agents write. Anti-sycophancy rules prevent f
|
|
|
189
189
|
|
|
190
190
|
### Model adaptation
|
|
191
191
|
|
|
192
|
-
Different
|
|
192
|
+
Different providers and model families have different default answer shapes. Model adaptation applies operator-defined output standards per model so those defaults do not leak into every response.
|
|
193
193
|
|
|
194
194
|
Adaptation entries are stored in the `model_output_directives` table and matched by model ID using exact match, then glob pattern (longest wins), then wildcard fallback. Each entry contains:
|
|
195
195
|
|
|
196
|
-
- **Calibration:** known model tendencies and specific adjustments (e.g., "
|
|
196
|
+
- **Calibration:** known model tendencies and specific adjustments (e.g., "prefer concise first drafts")
|
|
197
197
|
- **Corrections:** hard/medium/soft severity rules applied in order (e.g., "No preamble before the answer")
|
|
198
198
|
- **Task overrides:** per-task-type adjustments
|
|
199
199
|
|
|
@@ -208,7 +208,7 @@ The example below shows the intended effect of `hyperformProfile: "light"`. hype
|
|
|
208
208
|
```
|
|
209
209
|
Prompt: "How should I size my context window budget for a long-running agent session?"
|
|
210
210
|
|
|
211
|
-
WITHOUT hyperform shaping (
|
|
211
|
+
WITHOUT hyperform shaping (generic verbose default):
|
|
212
212
|
Here are the key factors to consider when sizing your context window budget:
|
|
213
213
|
|
|
214
214
|
**1. Session depth**
|
|
@@ -276,7 +276,7 @@ Reference run, production database: 5,104 facts, 28,441 episodes, 847 knowledge
|
|
|
276
276
|
| Operation | avg | p50 | p95 |
|
|
277
277
|
|---|---|---|---|
|
|
278
278
|
| L1 slot GET (SQLite in-memory) | 0.08ms | 0.07ms | 0.13ms |
|
|
279
|
-
|
|
|
279
|
+
| L2 history window (100 messages) | 0.13ms | 0.11ms | 0.19ms |
|
|
280
280
|
| L4 facts (top-28, confidence × decay) | 0.28ms | 0.26ms | 0.36ms |
|
|
281
281
|
| L4 facts + agentId filter | 0.31ms | 0.29ms | 0.40ms |
|
|
282
282
|
| L4 FTS5 keyword search | 0.06ms | 0.05ms | 0.08ms |
|
|
@@ -357,13 +357,13 @@ Facts are ranked by `confidence × recencyDecay`, where decay is exponential wit
|
|
|
357
357
|
│
|
|
358
358
|
topic detection ──► scope retrieval to active thread
|
|
359
359
|
│
|
|
360
|
-
|
|
361
|
-
│
|
|
362
|
-
│
|
|
363
|
-
│ L1 in-memory L2 History
|
|
364
|
-
│ hot state
|
|
365
|
-
│ 0.
|
|
366
|
-
|
|
360
|
+
┌────┴────────────────────────────────────────────────────────────────┐
|
|
361
|
+
│ query 4 layers (parallel) │
|
|
362
|
+
│ │
|
|
363
|
+
│ L1 in-memory L2 History L3 Vectors L4 Library │
|
|
364
|
+
│ hot state durable history semantic recall facts/wiki │
|
|
365
|
+
│ 0.08ms avg 0.13ms avg async/cached 0.09ms avg │
|
|
366
|
+
└────┬────────────────────────────────────────────────────────────────┘
|
|
367
367
|
│
|
|
368
368
|
budget allocator ──► 10 slots, fixed token cap
|
|
369
369
|
│
|
|
@@ -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.
|
|
389
|
+
**Current release: hypermem 0.9.4.** Changelog: [CHANGELOG.md](./CHANGELOG.md)
|
|
390
390
|
|
|
391
391
|
| Requirement | Version | Notes |
|
|
392
392
|
|---|---|---|
|
|
@@ -398,7 +398,7 @@ 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.
|
|
401
|
+
ENGINE_VERSION, // '0.9.4'
|
|
402
402
|
MIN_NODE_VERSION, // '22.0.0'
|
|
403
403
|
SQLITE_VEC_VERSION, // '0.1.9'
|
|
404
404
|
MAIN_SCHEMA_VERSION, // 10 (messages.db)
|
|
@@ -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
|
|
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
|
-
|
|
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 is recall-friendly standard mode with Ollama `nomic-embed-text`; if Ollama is not available, install it or run `npx hypermem-install --skip-embedding-check` for CI/container practice. To force lightweight FTS-only mode, pre-create `~/.openclaw/hypermem/config.json` with `{"embedding":{"provider":"none"}}` before running the installer.
|
|
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
|
|
|
@@ -574,9 +553,12 @@ 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
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"embedding": {
|
|
3
|
+
"provider": "ollama",
|
|
4
|
+
"model": "nomic-embed-text",
|
|
5
|
+
"dims": 768,
|
|
6
|
+
"dimensions": 768,
|
|
7
|
+
"ollamaUrl": "http://localhost:11434",
|
|
8
|
+
"timeout": 10000,
|
|
9
|
+
"batchSize": 32
|
|
10
|
+
},
|
|
11
|
+
"compositor": {
|
|
12
|
+
"turnBudget": {
|
|
13
|
+
"budgetFraction": 0.6,
|
|
14
|
+
"minContextFraction": 0.18
|
|
15
|
+
},
|
|
16
|
+
"warming": {
|
|
17
|
+
"protectedFloorEnabled": true,
|
|
18
|
+
"shapedWarmupDecay": true
|
|
19
|
+
},
|
|
20
|
+
"adjacency": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"boostMultiplier": 1.3,
|
|
23
|
+
"maxLookback": 5,
|
|
24
|
+
"maxClockDeltaMin": 10,
|
|
25
|
+
"evictionGuardMessages": 3,
|
|
26
|
+
"evictionGuardTokenCap": 4000
|
|
27
|
+
},
|
|
28
|
+
"contextWindowOverrides": {},
|
|
29
|
+
"budgetFraction": 0.6,
|
|
30
|
+
"contextWindowReserve": 0.25,
|
|
31
|
+
"targetBudgetFraction": 0.5,
|
|
32
|
+
"warmHistoryBudgetFraction": 0.45,
|
|
33
|
+
"maxFacts": 28,
|
|
34
|
+
"maxHistoryMessages": 250,
|
|
35
|
+
"maxCrossSessionContext": 0,
|
|
36
|
+
"keystoneHistoryFraction": 0.2,
|
|
37
|
+
"keystoneMaxMessages": 15,
|
|
38
|
+
"hyperformProfile": "standard"
|
|
39
|
+
},
|
|
40
|
+
"indexer": {
|
|
41
|
+
"enabled": true,
|
|
42
|
+
"factExtractionMode": "tiered",
|
|
43
|
+
"periodicInterval": 300000,
|
|
44
|
+
"batchSize": 128,
|
|
45
|
+
"maxMessagesPerTick": 500
|
|
46
|
+
}
|
|
47
|
+
}
|