@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/dist/vector-store.d.ts
CHANGED
|
@@ -37,6 +37,14 @@ export interface EmbeddingConfig {
|
|
|
37
37
|
geminiIndexTaskType?: string;
|
|
38
38
|
/** Gemini task type for queries. Default: RETRIEVAL_QUERY */
|
|
39
39
|
geminiQueryTaskType?: string;
|
|
40
|
+
/** Generic query input type for providers that support asymmetric retrieval embeddings. */
|
|
41
|
+
queryInputType?: string;
|
|
42
|
+
/** Generic document input type for providers that support asymmetric retrieval embeddings. */
|
|
43
|
+
documentInputType?: string;
|
|
44
|
+
/** Optional explicit query prefix, applied before embedding query text. */
|
|
45
|
+
queryPrefix?: string;
|
|
46
|
+
/** Optional explicit document prefix, applied before embedding stored document text. */
|
|
47
|
+
documentPrefix?: string;
|
|
40
48
|
/** Embedding model name. Default: nomic-embed-text (ollama) or text-embedding-3-small (openai) */
|
|
41
49
|
model: string;
|
|
42
50
|
/** Embedding dimensions. Default: 768 (ollama/nomic) or 1536 (openai/3-small) */
|
|
@@ -48,6 +56,7 @@ export interface EmbeddingConfig {
|
|
|
48
56
|
/** LRU cache max entries. Default: 128 */
|
|
49
57
|
cacheSize?: number;
|
|
50
58
|
}
|
|
59
|
+
export type EmbeddingInputKind = 'query' | 'document';
|
|
51
60
|
export interface VectorSearchResult {
|
|
52
61
|
rowid: number;
|
|
53
62
|
distance: number;
|
|
@@ -72,7 +81,7 @@ export declare function clearEmbeddingCache(): void;
|
|
|
72
81
|
* Supports single and batch embedding.
|
|
73
82
|
* Results are cached per text hash — cache hits skip the Ollama call entirely.
|
|
74
83
|
*/
|
|
75
|
-
export declare function generateEmbeddings(texts: string[], config?: EmbeddingConfig): Promise<Float32Array[]>;
|
|
84
|
+
export declare function generateEmbeddings(texts: string[], config?: EmbeddingConfig, inputKind?: EmbeddingInputKind): Promise<Float32Array[]>;
|
|
76
85
|
/**
|
|
77
86
|
* VectorStore — manages vector indexes in an agent's vector database.
|
|
78
87
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-store.d.ts","sourceRoot":"","sources":["../src/vector-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,aAAa,CAAC;AAK/D,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnD,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IACh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EG;IACH,QAAQ,IAAI,gBAAgB;CA+B7B;AAUD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,UAAU,GAAE,MAAY,GAAG,IAAI,CActF"}
|
package/dist/vector-store.js
CHANGED
|
@@ -39,6 +39,35 @@ const GEMINI_DEFAULTS = {
|
|
|
39
39
|
batchSize: 100, // Gemini batch limit
|
|
40
40
|
timeout: 15000,
|
|
41
41
|
};
|
|
42
|
+
const OLLAMA_RETRIEVAL_PREFIX_DEFAULTS = {
|
|
43
|
+
'nomic-embed-text': { query: 'search_query: ', document: 'search_document: ' },
|
|
44
|
+
'qwen3-embedding': { query: 'query: ', document: 'passage: ' },
|
|
45
|
+
'mxbai-embed-large': { query: 'Represent this sentence for searching relevant passages: ', document: '' },
|
|
46
|
+
};
|
|
47
|
+
function baseModelName(model) {
|
|
48
|
+
return String(model ?? '').split(':')[0].toLowerCase();
|
|
49
|
+
}
|
|
50
|
+
function defaultInputType(config, kind) {
|
|
51
|
+
if (kind === 'query')
|
|
52
|
+
return config.queryInputType ?? config.geminiQueryTaskType;
|
|
53
|
+
return config.documentInputType ?? config.geminiIndexTaskType;
|
|
54
|
+
}
|
|
55
|
+
function resolveTextPrefix(config, kind) {
|
|
56
|
+
const explicit = kind === 'query' ? config.queryPrefix : config.documentPrefix;
|
|
57
|
+
if (explicit != null)
|
|
58
|
+
return explicit;
|
|
59
|
+
if (config.provider === 'ollama' || !config.provider) {
|
|
60
|
+
const defaults = OLLAMA_RETRIEVAL_PREFIX_DEFAULTS[baseModelName(config.model)];
|
|
61
|
+
return defaults?.[kind] ?? '';
|
|
62
|
+
}
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
function prepareEmbeddingTexts(texts, config, kind) {
|
|
66
|
+
const prefix = resolveTextPrefix(config, kind);
|
|
67
|
+
if (!prefix)
|
|
68
|
+
return texts;
|
|
69
|
+
return texts.map((text) => text.startsWith(prefix) ? text : `${prefix}${text}`);
|
|
70
|
+
}
|
|
42
71
|
const _embeddingCache = new Map();
|
|
43
72
|
/**
|
|
44
73
|
* Insert an entry into the LRU cache, evicting the oldest if over capacity.
|
|
@@ -74,7 +103,7 @@ export function clearEmbeddingCache() {
|
|
|
74
103
|
* Generate embeddings via OpenAI Embeddings API.
|
|
75
104
|
* Batches up to batchSize inputs per request.
|
|
76
105
|
*/
|
|
77
|
-
async function generateOpenAIEmbeddings(texts, config) {
|
|
106
|
+
async function generateOpenAIEmbeddings(texts, config, kind = 'document') {
|
|
78
107
|
// Resolve API key: config > environment
|
|
79
108
|
const apiKey = config.openaiApiKey
|
|
80
109
|
?? process.env.OPENROUTER_API_KEY
|
|
@@ -92,13 +121,17 @@ async function generateOpenAIEmbeddings(texts, config) {
|
|
|
92
121
|
const controller = new AbortController();
|
|
93
122
|
const timer = setTimeout(() => controller.abort(), config.timeout);
|
|
94
123
|
try {
|
|
124
|
+
const body = { model, input: batch };
|
|
125
|
+
const inputType = defaultInputType(config, kind);
|
|
126
|
+
if (inputType)
|
|
127
|
+
body.input_type = inputType;
|
|
95
128
|
const response = await fetch(`${baseUrl}/embeddings`, {
|
|
96
129
|
method: 'POST',
|
|
97
130
|
headers: {
|
|
98
131
|
'Content-Type': 'application/json',
|
|
99
132
|
'Authorization': `Bearer ${apiKey}`,
|
|
100
133
|
},
|
|
101
|
-
body: JSON.stringify(
|
|
134
|
+
body: JSON.stringify(body),
|
|
102
135
|
signal: controller.signal,
|
|
103
136
|
});
|
|
104
137
|
if (!response.ok) {
|
|
@@ -378,7 +411,7 @@ function l2Normalize(vec) {
|
|
|
378
411
|
async function generateGeminiEmbeddings(texts, config, taskType) {
|
|
379
412
|
const baseUrl = config.geminiBaseUrl ?? 'https://generativelanguage.googleapis.com';
|
|
380
413
|
const model = config.model;
|
|
381
|
-
const effectiveTaskType = taskType ?? config
|
|
414
|
+
const effectiveTaskType = taskType ?? defaultInputType(config, 'document') ?? 'RETRIEVAL_DOCUMENT';
|
|
382
415
|
const results = [];
|
|
383
416
|
// Resolve auth: API key takes precedence (simpler), then OAuth
|
|
384
417
|
const apiKey = config.geminiApiKey ?? process.env.GEMINI_EMBEDDING_API_KEY ?? process.env.GEMINI_API_KEY ?? process.env.GOOGLE_API_KEY ?? null;
|
|
@@ -459,10 +492,11 @@ async function generateGeminiEmbeddings(texts, config, taskType) {
|
|
|
459
492
|
* Supports single and batch embedding.
|
|
460
493
|
* Results are cached per text hash — cache hits skip the Ollama call entirely.
|
|
461
494
|
*/
|
|
462
|
-
export async function generateEmbeddings(texts, config = DEFAULT_EMBEDDING_CONFIG) {
|
|
495
|
+
export async function generateEmbeddings(texts, config = DEFAULT_EMBEDDING_CONFIG, inputKind = 'document') {
|
|
463
496
|
// 'none' provider: explicit no-op — semantic search disabled, FTS5 fallback only
|
|
464
497
|
if (config.provider === 'none')
|
|
465
498
|
return [];
|
|
499
|
+
texts = prepareEmbeddingTexts(texts, config, inputKind);
|
|
466
500
|
// Apply provider-specific defaults when provider is 'openai' and fields are at Ollama defaults
|
|
467
501
|
if (config.provider === 'openai') {
|
|
468
502
|
// Merge: OpenAI defaults fill in any unset fields, user-supplied values always win
|
|
@@ -475,7 +509,7 @@ export async function generateEmbeddings(texts, config = DEFAULT_EMBEDDING_CONFI
|
|
|
475
509
|
};
|
|
476
510
|
// OpenAI path — no LRU cache (responses are billed; caching at this layer
|
|
477
511
|
// adds complexity without proportional benefit given async background use).
|
|
478
|
-
return generateOpenAIEmbeddings(texts, config);
|
|
512
|
+
return generateOpenAIEmbeddings(texts, config, inputKind);
|
|
479
513
|
}
|
|
480
514
|
if (config.provider === 'gemini') {
|
|
481
515
|
config = {
|
|
@@ -487,7 +521,9 @@ export async function generateEmbeddings(texts, config = DEFAULT_EMBEDDING_CONFI
|
|
|
487
521
|
};
|
|
488
522
|
// Gemini path — no LRU cache (same rationale as OpenAI: billed API calls,
|
|
489
523
|
// background indexing context, minimal benefit from this-layer caching).
|
|
490
|
-
return generateGeminiEmbeddings(texts, config
|
|
524
|
+
return generateGeminiEmbeddings(texts, config, inputKind === 'query'
|
|
525
|
+
? (config.geminiQueryTaskType ?? config.queryInputType ?? 'RETRIEVAL_QUERY')
|
|
526
|
+
: (config.geminiIndexTaskType ?? config.documentInputType ?? 'RETRIEVAL_DOCUMENT'));
|
|
491
527
|
}
|
|
492
528
|
if (texts.length === 0)
|
|
493
529
|
return [];
|
|
@@ -635,7 +671,7 @@ export class VectorStore {
|
|
|
635
671
|
return false; // Already indexed, content unchanged
|
|
636
672
|
}
|
|
637
673
|
// Generate embedding
|
|
638
|
-
const [embedding] = await generateEmbeddings([content], this.config);
|
|
674
|
+
const [embedding] = await generateEmbeddings([content], this.config, 'document');
|
|
639
675
|
const bytes = vecToBytes(embedding);
|
|
640
676
|
if (existing) {
|
|
641
677
|
// Update: delete old vector, insert new
|
|
@@ -684,7 +720,7 @@ export class VectorStore {
|
|
|
684
720
|
return { indexed, skipped };
|
|
685
721
|
// Batch generate embeddings
|
|
686
722
|
const texts = toIndex.map(item => item.content);
|
|
687
|
-
const embeddings = await generateEmbeddings(texts, this.config);
|
|
723
|
+
const embeddings = await generateEmbeddings(texts, this.config, 'document');
|
|
688
724
|
// Insert in a transaction
|
|
689
725
|
this.db.exec('BEGIN');
|
|
690
726
|
try {
|
|
@@ -745,7 +781,7 @@ export class VectorStore {
|
|
|
745
781
|
cachePut(simpleHash(query), queryEmbedding, maxSize);
|
|
746
782
|
}
|
|
747
783
|
else {
|
|
748
|
-
[queryEmbedding] = await generateEmbeddings([query], this.config);
|
|
784
|
+
[queryEmbedding] = await generateEmbeddings([query], this.config, 'query');
|
|
749
785
|
}
|
|
750
786
|
const queryBytes = vecToBytes(queryEmbedding);
|
|
751
787
|
const results = [];
|
package/docs/DIAGNOSTICS.md
CHANGED
|
@@ -16,6 +16,8 @@ HyperMem diagnostics are split into operator CLIs, validation scripts, and runti
|
|
|
16
16
|
| Version parity | `npm run validate:version-parity` | package versions and plugin dependencies are release-aligned |
|
|
17
17
|
| Release path | `npm run validate:release-path` | build plus plugin pipeline gateway path |
|
|
18
18
|
| Docs/config validation | `npm run validate:docs && npm run validate:config` | documented commands and config surfaces match code |
|
|
19
|
+
| History query validation | `npm run validate:history-query` | `MessageStore.queryHistory()`, `history_query` plugin tool, metadata-only telemetry, and health JSON surface are wired |
|
|
20
|
+
| Fresh-install smoke gate | `npm run release:install-smoke` | packed npm artifact installs without source fallback, no-Ollama failure is clear, skip-mode stages, existing config is preserved, and failure artifacts are captured |
|
|
19
21
|
|
|
20
22
|
## `hypermem-status`
|
|
21
23
|
|
|
@@ -35,6 +37,8 @@ hypermem-status --agent forge --master
|
|
|
35
37
|
hypermem-status --json
|
|
36
38
|
```
|
|
37
39
|
|
|
40
|
+
`hypermem-status --master --json` includes `querySurfaces.historyQuery`, which proves the built core API, memory-plugin tool registration, telemetry hook, and message-store schema are present. A missing item degrades master health with `history.query surface incomplete`. It also includes `config.recallSurface`, which reports whether the active install has the 0.9.4 recall-surface config: turn budget, protected warming, shaped warmup decay, adjacency boost, and literal antecedent guard. A partial match surfaces as `0.9.4 recall-surface config incomplete`, which usually means an older preserved config needs review after upgrade.
|
|
41
|
+
|
|
38
42
|
Healthy fresh install behavior may include empty counts or `no sessions ingested`. That is not a failure. A fresh install becomes active only after the gateway loads the plugins and an agent turn runs.
|
|
39
43
|
|
|
40
44
|
Failure signals:
|
|
@@ -71,6 +75,58 @@ It reports min, average, p50, p95, p99, and max latency for the data paths prese
|
|
|
71
75
|
|
|
72
76
|
Use this for local validation of README speed claims. Results depend on hardware, database size, selected agent, and which optional surfaces are enabled. Vector embedding generation and hosted reranker latency are not part of these SQLite access timings; they are configured separately and should be measured against the chosen provider.
|
|
73
77
|
|
|
78
|
+
## Fresh-install smoke artifacts
|
|
79
|
+
|
|
80
|
+
Release validation uses the packed artifact path, not a repo symlink:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm run release:install-smoke
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The smoke gate verifies these installer failure classes before public release:
|
|
87
|
+
|
|
88
|
+
- install from packed npm artifact with no source checkout mounted
|
|
89
|
+
- no-Ollama/no-tools class fails with actionable remediation instead of silently staging a degraded semantic-recall install
|
|
90
|
+
- `--skip-embedding-check` stages successfully for CI/container practice
|
|
91
|
+
- existing `~/.openclaw/hypermem/config.json` is preserved unchanged
|
|
92
|
+
- executable bins are present in the staged runtime
|
|
93
|
+
|
|
94
|
+
On failure, artifacts are preserved under `.artifacts/fresh-install-smoke/<run-id>/`. Inspect `metadata.txt`, `fresh-install-smoke.stdout.log`, `fresh-install-smoke.stderr.log`, `npm-pack.log`, `container-tmp-files.txt`, `container-tmp-tree.txt`, installer stdout/stderr captures, generated configs, and package metadata before rerunning. Do not debug installer failures from terminal scrollback alone. That is how the same rake gets stepped on twice.
|
|
95
|
+
|
|
96
|
+
## Recall-surface diagnostics
|
|
97
|
+
|
|
98
|
+
0.9.4 added health checks for the recall-preservation surface. Use both tools:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
hypermem-doctor --fix-plan
|
|
102
|
+
hypermem-status --master --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Expected active config:
|
|
106
|
+
|
|
107
|
+
- `compositor.turnBudget.budgetFraction = 0.6`
|
|
108
|
+
- `compositor.turnBudget.minContextFraction = 0.18`
|
|
109
|
+
- `compositor.warming.protectedFloorEnabled = true`
|
|
110
|
+
- `compositor.warming.shapedWarmupDecay = true`
|
|
111
|
+
- `compositor.adjacency.enabled = true`
|
|
112
|
+
- `compositor.adjacency.boostMultiplier = 1.3`
|
|
113
|
+
- `compositor.adjacency.maxLookback = 5`
|
|
114
|
+
- `compositor.adjacency.maxClockDeltaMin = 10`
|
|
115
|
+
- `compositor.adjacency.evictionGuardMessages = 3`
|
|
116
|
+
- `compositor.adjacency.evictionGuardTokenCap = 4000`
|
|
117
|
+
|
|
118
|
+
The deterministic release tests are:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
node test/adaptive-recall-breadth.mjs
|
|
122
|
+
node test/afterturn-protected-floor.mjs
|
|
123
|
+
node test/afterturn-stability.mjs
|
|
124
|
+
node test/hybrid-retrieval.mjs
|
|
125
|
+
node test/compositor.mjs
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
These prove the warmed context floor, shaped warmup, adjacency boost, heartbeat/system suppression, and literal antecedent guard.
|
|
129
|
+
|
|
74
130
|
## Runtime logs
|
|
75
131
|
|
|
76
132
|
After wiring and restart:
|
|
@@ -198,8 +254,39 @@ npm run validate:version-parity
|
|
|
198
254
|
npm run validate:docs
|
|
199
255
|
npm run validate:config
|
|
200
256
|
npm run validate:release-path
|
|
257
|
+
npm run validate:history-query
|
|
258
|
+
npm run release:install-smoke
|
|
201
259
|
npm test
|
|
202
260
|
hypermem-model-audit --strict || true
|
|
203
261
|
```
|
|
204
262
|
|
|
205
263
|
The local repo may not be the active OpenClaw runtime, so `hypermem-status` and `hypermem-model-audit` should be interpreted against the configured deployment. For package release proof, the required gates are version parity, docs/config validation, release path, tests, and pack dry runs.
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
### Production-shaped runtime validation
|
|
267
|
+
|
|
268
|
+
HyperMem development validation must install the packed package into OpenClaw's managed plugin directory before claiming a runtime fix is live. Do not rely on a repo symlink, global npm link, or copied `dist/` files as production evidence.
|
|
269
|
+
|
|
270
|
+
Required loop:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
npm run build:all
|
|
274
|
+
npm pack
|
|
275
|
+
node scripts/install-packed-runtime.mjs ./psiclawops-hypermem-<version>.tgz
|
|
276
|
+
systemctl --user restart openclaw-gateway
|
|
277
|
+
node bin/hypermem-status.mjs --master
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The health check must verify the managed install at `~/.openclaw/plugins/hypermem`, not the working tree.
|
|
281
|
+
|
|
282
|
+
### Referenced-noise maintenance debt
|
|
283
|
+
|
|
284
|
+
`hypermem-status --master` reports referenced-noise debt under `## Maintenance`. This is low-signal message content that cannot be deleted by ordinary noise sweep because it is still a foreign-key target, usually through `messages.parent_id`.
|
|
285
|
+
|
|
286
|
+
Operators can run the conservative repair path:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
node bin/hypermem-status.mjs --master --repair-referenced-noise --repair-limit 100
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
The repair only collapses noise nodes blocked solely by `messages.parent_id`. It reparents children to the deleted node's parent, decrements subtree depth, and rolls back the whole batch if `PRAGMA foreign_key_check` reports any violation. Context and composition snapshot heads are detected but not repaired by this pass.
|
|
@@ -154,10 +154,20 @@ npm pack ./plugin --dry-run
|
|
|
154
154
|
npm pack ./memory-plugin --dry-run
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
Runtime validation must install the packed artifact, not the repo working tree. The production-shaped local install path is:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm run install:runtime:packed
|
|
161
|
+
openclaw gateway restart
|
|
162
|
+
openclaw plugins list
|
|
163
|
+
node ~/.openclaw/plugins/hypermem/bin/hypermem-status.mjs --master
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
For isolated validation, test the packed artifact from a temp directory:
|
|
158
167
|
|
|
159
168
|
```bash
|
|
160
169
|
TMP=$(mktemp -d)
|
|
170
|
+
npm pack
|
|
161
171
|
npm --prefix "$TMP" init -y
|
|
162
172
|
npm --prefix "$TMP" install ./psiclawops-hypermem-*.tgz
|
|
163
173
|
node "$TMP/node_modules/@psiclawops/hypermem/scripts/install-runtime.mjs" "$TMP/runtime"
|
|
@@ -184,3 +194,32 @@ The staged runtime must contain:
|
|
|
184
194
|
| `memory_search` bypasses HyperMem | memory slot not set or memory plugin not loaded | set `plugins.slots.memory hypermem`, restart, verify plugins list |
|
|
185
195
|
| status tool reports missing data dir | gateway has not initialized HyperMem yet | restart after wiring and send one agent message |
|
|
186
196
|
| model audit flags unknown context window | active model needs explicit override | add `contextWindowOverrides` in HyperMem config |
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### Production-shaped runtime validation
|
|
200
|
+
|
|
201
|
+
HyperMem development validation must install the packed package into OpenClaw's managed plugin directory before claiming a runtime fix is live. Do not rely on a repo symlink, global npm link, or copied `dist/` files as production evidence.
|
|
202
|
+
|
|
203
|
+
Required loop:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npm run build:all
|
|
207
|
+
npm pack
|
|
208
|
+
node scripts/install-packed-runtime.mjs ./psiclawops-hypermem-<version>.tgz
|
|
209
|
+
systemctl --user restart openclaw-gateway
|
|
210
|
+
node bin/hypermem-status.mjs --master
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
The health check must verify the managed install at `~/.openclaw/plugins/hypermem`, not the working tree.
|
|
214
|
+
|
|
215
|
+
### Referenced-noise maintenance debt
|
|
216
|
+
|
|
217
|
+
`hypermem-status --master` reports referenced-noise debt under `## Maintenance`. This is low-signal message content that cannot be deleted by ordinary noise sweep because it is still a foreign-key target, usually through `messages.parent_id`.
|
|
218
|
+
|
|
219
|
+
Operators can run the conservative repair path:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
node bin/hypermem-status.mjs --master --repair-referenced-noise --repair-limit 100
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The repair only collapses noise nodes blocked solely by `messages.parent_id`. It reparents children to the deleted node's parent, decrements subtree depth, and rolls back the whole batch if `PRAGMA foreign_key_check` reports any violation. Context and composition snapshot heads are detected but not repaired by this pass.
|
package/docs/ROADMAP.md
CHANGED
|
@@ -12,15 +12,15 @@ For shipped capabilities, see [CHANGELOG.md](../CHANGELOG.md) and [ARCHITECTURE.
|
|
|
12
12
|
## Current state
|
|
13
13
|
|
|
14
14
|
### Released
|
|
15
|
-
- Current release: **0.9.
|
|
16
|
-
- Internal `main`: `
|
|
17
|
-
- Public `main`:
|
|
18
|
-
- Public tag `v0.9.
|
|
19
|
-
- Public CI:
|
|
20
|
-
- GitHub Release:
|
|
21
|
-
- npm at 0.9.
|
|
22
|
-
-
|
|
23
|
-
- Previous release: **0.
|
|
15
|
+
- Current release candidate: **0.9.4** — recall surface and install hardening. Prepared 2026-04-28.
|
|
16
|
+
- Internal `main`: `09c639d5` plus release-document updates
|
|
17
|
+
- Public `main`: pending publication sync
|
|
18
|
+
- Public tag `v0.9.4`: pending publication
|
|
19
|
+
- Public CI: pending publication
|
|
20
|
+
- GitHub Release: pending publication
|
|
21
|
+
- npm at 0.9.4: pending publication for `@psiclawops/hypermem`, `@psiclawops/hypercompositor`, and `@psiclawops/hypermem-memory`
|
|
22
|
+
- Install validator: `hypermem-doctor` plus packed-artifact fresh-install smoke gate
|
|
23
|
+
- Previous release: **0.9.3**
|
|
24
24
|
|
|
25
25
|
### Landed on `main` after 0.8.6
|
|
26
26
|
In the order work actually landed:
|
|
@@ -149,7 +149,17 @@ Closed fix summary:
|
|
|
149
149
|
- repairs long-lived `knowledge.visibility` schema drift;
|
|
150
150
|
- covers UUID topic ids, duplicate same-name session topic fragments, content-detector fallback, no-match skips, legacy direct-id fallback, schema-drift repair, unchanged-content watermark refresh, and idempotent upsert.
|
|
151
151
|
|
|
152
|
-
## 3.
|
|
152
|
+
## 3. HyperMem 0.9.4 recall surface hardening
|
|
153
|
+
Status: **READY FOR PUBLICATION GATES.** Internal implementation is complete and release validation is green. Public sync, npm publish, GitHub release, and public CI remain as publication steps.
|
|
154
|
+
|
|
155
|
+
0.9.4 corrects the 0.8.x → 0.9.0 over-rotation toward budget headroom and hardens the install path that external testers use. One release, four streams:
|
|
156
|
+
|
|
157
|
+
- **Warming gradient enrichment.** Bootstrap, warmup, and steady lifecycle bands now carry larger warming fractions. Smart recall widens for bootstrap/warmup, `/new`, and topic shift. AfterTurn trim protects warming floors until pressure reaches `elevated`, and warmup uses shaped decay driven by topic-bearing turn count.
|
|
158
|
+
- **Adjacency-aware preservation.** Fused retrieval now boosts recent antecedents while filtering system and heartbeat traffic. Compose eviction protects the literal antecedent of the current user turn under non-critical pressure.
|
|
159
|
+
- **Default install settings refresh.** The runtime installer ships recall-friendly defaults, stages `hypermem-doctor` and `hypermem-bench`, preserves existing config, supports CI-safe flags, surfaces legacy `agents.defaults.memorySearch`, and keeps plugin dependencies compatible with the 0.9.4 line.
|
|
160
|
+
- **Install gap-class prevention.** The fresh-install smoke gate packs the npm artifact, installs without a source checkout, verifies no-Ollama messaging, skip-mode staging, config preservation, and captures durable failure artifacts for postmortem reuse.
|
|
161
|
+
|
|
162
|
+
## 4. Contradiction-aware decay
|
|
153
163
|
After 0.9.0 lifecycle work:
|
|
154
164
|
- accelerate decay for superseded facts
|
|
155
165
|
- reduce stale architectural facts surviving long after pivots
|
|
@@ -157,7 +167,7 @@ After 0.9.0 lifecycle work:
|
|
|
157
167
|
|
|
158
168
|
This is a quality and correctness improvement, not a release blocker.
|
|
159
169
|
|
|
160
|
-
##
|
|
170
|
+
## 5. Turn DAG Phase 5 storage and performance
|
|
161
171
|
After the above correctness and continuity work:
|
|
162
172
|
- content-addressed blob store for repeated large payloads
|
|
163
173
|
- zstd compression for large message bodies
|
|
@@ -178,7 +188,8 @@ Phase 5 stays important, but it is not the next sprint until the higher-priority
|
|
|
178
188
|
| Topic synthesis bridge defect | ✅ CLOSED | Fixed in `8b9f928`; CI `24917765384` passed. |
|
|
179
189
|
| Adaptive context lifecycle (0.9.0) | ✅ SHIPPED | Released 2026-04-25 as 0.9.0. Threshold tuning remains deferred until future live evidence warrants it. |
|
|
180
190
|
| Vector coverage repair gate | ✅ CLOSED | `embed-existing` now supports knowledge and eligibility-aware coverage reporting; production vectors reached facts 113/113, knowledge 85/85, episodes 30,121/30,121 eligible coverage on 2026-04-24. |
|
|
181
|
-
|
|
|
191
|
+
| Recall surface hardening (0.9.4) | ✅ READY | Internal implementation and validation gates are green; public sync, npm publish, release page, and public CI remain. |
|
|
192
|
+
| Contradiction-aware decay | 🟡 OPEN | Prevents stale-fact poisoning after architectural pivots. Sequenced after the 0.9.4 publication closeout. |
|
|
182
193
|
| Turn DAG Phase 5 storage/perf | 🟡 OPEN | Important, but later than the items above. |
|
|
183
194
|
| Warm-restore gate closeout | ✅ DONE | Tracked gate-closeout scope is complete; reopen only for a new concrete defect or measurement gap. |
|
|
184
195
|
|
|
@@ -224,6 +235,8 @@ Their useful content is now represented here.
|
|
|
224
235
|
|
|
225
236
|
---
|
|
226
237
|
|
|
238
|
+
| OpenClaw 2026.4.26 plugin build metadata refresh | 🔲 TRIAGE | After the 4.26 compatibility patch lands and is tested against the installed runtime, update HyperCompositor and HyperMem package build metadata from OpenClaw 2026.4.9 / SDK 2026.4.12 to the verified 2026.4.26 values. Keep this short-term so persisted plugin registry diagnostics do not report stale package provenance. |
|
|
239
|
+
|
|
227
240
|
## Historical triage appendix
|
|
228
241
|
|
|
229
242
|
This appendix is the cleanup pass for older improvement lists that were still floating around in the repo and workspace.
|
package/docs/TUNING.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# hypermem Tuning Guide
|
|
2
2
|
|
|
3
|
-
Configuration reference for operators and agents. All settings are optional. The recommended install path writes a starter `config.json` with
|
|
3
|
+
Configuration reference for operators and agents. All settings are optional. The recommended install path writes a starter `config.json` with the 0.9.4 recall-friendly standard profile: local Ollama embeddings by default, protected warming, adjacency preservation, and conservative turn budgeting. Tune from that verified baseline, not from guesswork.
|
|
4
4
|
|
|
5
5
|
Config lives in `~/.openclaw/hypermem/config.json` (takes effect on gateway restart) or is passed programmatically via `HyperMem.create()`:
|
|
6
6
|
|
|
@@ -114,13 +114,38 @@ Estimated context per turn: **12–35k tokens** on a 200k model (lower on smalle
|
|
|
114
114
|
|
|
115
115
|
### Standard setup
|
|
116
116
|
|
|
117
|
-
The default out-of-the-box configuration. All memory layers active with
|
|
117
|
+
The default out-of-the-box configuration. All memory layers are active with 0.9.4 recall preservation turned on. Good for most single-agent deployments and the right baseline for external install testing.
|
|
118
118
|
|
|
119
119
|
```json
|
|
120
120
|
{
|
|
121
|
+
"embedding": {
|
|
122
|
+
"provider": "ollama",
|
|
123
|
+
"model": "nomic-embed-text",
|
|
124
|
+
"dims": 768,
|
|
125
|
+
"dimensions": 768,
|
|
126
|
+
"ollamaUrl": "http://localhost:11434"
|
|
127
|
+
},
|
|
121
128
|
"compositor": {
|
|
122
|
-
"
|
|
129
|
+
"turnBudget": {
|
|
130
|
+
"budgetFraction": 0.6,
|
|
131
|
+
"minContextFraction": 0.18
|
|
132
|
+
},
|
|
133
|
+
"warming": {
|
|
134
|
+
"protectedFloorEnabled": true,
|
|
135
|
+
"shapedWarmupDecay": true
|
|
136
|
+
},
|
|
137
|
+
"adjacency": {
|
|
138
|
+
"enabled": true,
|
|
139
|
+
"boostMultiplier": 1.3,
|
|
140
|
+
"maxLookback": 5,
|
|
141
|
+
"maxClockDeltaMin": 10,
|
|
142
|
+
"evictionGuardMessages": 3,
|
|
143
|
+
"evictionGuardTokenCap": 4000
|
|
144
|
+
},
|
|
145
|
+
"budgetFraction": 0.6,
|
|
123
146
|
"contextWindowReserve": 0.25,
|
|
147
|
+
"targetBudgetFraction": 0.5,
|
|
148
|
+
"warmHistoryBudgetFraction": 0.45,
|
|
124
149
|
"maxFacts": 28,
|
|
125
150
|
"maxHistoryMessages": 250,
|
|
126
151
|
"maxCrossSessionContext": 0,
|
|
@@ -129,13 +154,29 @@ The default out-of-the-box configuration. All memory layers active with balanced
|
|
|
129
154
|
"hyperformProfile": "standard"
|
|
130
155
|
},
|
|
131
156
|
"indexer": {
|
|
157
|
+
"enabled": true,
|
|
132
158
|
"factExtractionMode": "tiered",
|
|
133
159
|
"periodicInterval": 300000
|
|
134
160
|
}
|
|
135
161
|
}
|
|
136
162
|
```
|
|
137
163
|
|
|
138
|
-
Estimated context per turn: **35–80k tokens** on a 200k model. This is what
|
|
164
|
+
Estimated context per turn: **35–80k tokens** on a 200k model. This is what `hypermem-install` writes when no existing config is present. Existing config files are preserved, so run `hypermem-doctor --fix-plan` after upgrades to see whether older installs are missing the 0.9.4 recall-surface knobs.
|
|
165
|
+
|
|
166
|
+
### 0.9.4 recall preservation knobs
|
|
167
|
+
|
|
168
|
+
These settings prevent the regression class that motivated 0.9.4: the direct antecedent or topic-bearing warm context being trimmed away while the system still had enough usable budget.
|
|
169
|
+
|
|
170
|
+
| Knob | Default | What it protects | Health signal |
|
|
171
|
+
|---|---:|---|---|
|
|
172
|
+
| `compositor.turnBudget.budgetFraction` | `0.6` | Keeps the active turn budget below the old over-warming posture | `hypermem-status --master` recall surface line |
|
|
173
|
+
| `compositor.turnBudget.minContextFraction` | `0.18` | Guarantees a minimum context allocation on constrained windows | `hypermem-doctor --fix-plan` |
|
|
174
|
+
| `compositor.warming.protectedFloorEnabled` | `true` | Prevents afterTurn trim from evicting bootstrap/warmup floor content before elevated pressure | `node test/afterturn-protected-floor.mjs` |
|
|
175
|
+
| `compositor.warming.shapedWarmupDecay` | `true` | Uses topic-bearing turn count instead of blind fixed-turn decay | `node test/adaptive-lifecycle.mjs` |
|
|
176
|
+
| `compositor.adjacency.enabled` | `true` | Boosts recent antecedents during fused retrieval | `node test/hybrid-retrieval.mjs` |
|
|
177
|
+
| `compositor.adjacency.evictionGuardTokenCap` | `4000` | Caps the literal antecedent guard so it cannot consume the whole budget | `node test/compositor.mjs` |
|
|
178
|
+
|
|
179
|
+
Do not tune these off to save tokens until you have evidence. Lower `maxFacts`, `maxCrossSessionContext`, or wiki caps first. Disabling adjacency or protected warming is a correctness trade, not a cost preset.
|
|
139
180
|
|
|
140
181
|
### Full performance setup
|
|
141
182
|
|
package/install.sh
CHANGED
|
@@ -166,7 +166,7 @@ stage_runtime() {
|
|
|
166
166
|
write_minimal_config_if_missing() {
|
|
167
167
|
echo -e "\n${BOLD} Config check${NC}"
|
|
168
168
|
if $DRY_RUN; then
|
|
169
|
-
dryrun "would preserve existing config or write
|
|
169
|
+
dryrun "would preserve existing config or write recall-friendly starter config: $CONFIG_FILE"
|
|
170
170
|
return
|
|
171
171
|
fi
|
|
172
172
|
|
|
@@ -175,66 +175,11 @@ write_minimal_config_if_missing() {
|
|
|
175
175
|
return
|
|
176
176
|
fi
|
|
177
177
|
|
|
178
|
+
local default_config="$INSTALL_DIR/node_modules/@psiclawops/hypermem/assets/default-config.json"
|
|
179
|
+
[[ -f "$default_config" ]] || die "missing packaged default config: $default_config"
|
|
178
180
|
mkdir -p "$(dirname "$CONFIG_FILE")"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"contextWindowSize": 128000,
|
|
182
|
-
"contextWindowReserve": 0.25,
|
|
183
|
-
"deferToolPruning": false,
|
|
184
|
-
"verboseLogging": false,
|
|
185
|
-
"contextWindowOverrides": {},
|
|
186
|
-
"warmCacheReplayThresholdMs": 120000,
|
|
187
|
-
"subagentWarming": "light",
|
|
188
|
-
"embedding": {
|
|
189
|
-
"provider": "none"
|
|
190
|
-
},
|
|
191
|
-
"compositor": {
|
|
192
|
-
"budgetFraction": 0.55,
|
|
193
|
-
"reserveFraction": 0.25,
|
|
194
|
-
"historyFraction": 0.4,
|
|
195
|
-
"memoryFraction": 0.4,
|
|
196
|
-
"defaultTokenBudget": 90000,
|
|
197
|
-
"maxHistoryMessages": 500,
|
|
198
|
-
"maxFacts": 25,
|
|
199
|
-
"maxExpertisePatterns": 6,
|
|
200
|
-
"maxCrossSessionContext": 4000,
|
|
201
|
-
"maxTotalTriggerTokens": 4000,
|
|
202
|
-
"maxRecentToolPairs": 3,
|
|
203
|
-
"maxProseToolPairs": 10,
|
|
204
|
-
"warmHistoryBudgetFraction": 0.27,
|
|
205
|
-
"contextWindowReserve": 0.25,
|
|
206
|
-
"dynamicReserveTurnHorizon": 5,
|
|
207
|
-
"dynamicReserveMax": 0.5,
|
|
208
|
-
"dynamicReserveEnabled": true,
|
|
209
|
-
"keystoneHistoryFraction": 0.15,
|
|
210
|
-
"keystoneMaxMessages": 12,
|
|
211
|
-
"keystoneMinSignificance": 0.5,
|
|
212
|
-
"targetBudgetFraction": 0.50,
|
|
213
|
-
"enableFOS": true,
|
|
214
|
-
"enableMOD": true,
|
|
215
|
-
"hyperformProfile": "standard",
|
|
216
|
-
"wikiTokenCap": 500,
|
|
217
|
-
"zigzagOrdering": true
|
|
218
|
-
},
|
|
219
|
-
"eviction": {
|
|
220
|
-
"enabled": true,
|
|
221
|
-
"imageAgeTurns": 2,
|
|
222
|
-
"toolResultAgeTurns": 4,
|
|
223
|
-
"minTokensToEvict": 200,
|
|
224
|
-
"keepPreviewChars": 120
|
|
225
|
-
},
|
|
226
|
-
"maintenance": {
|
|
227
|
-
"periodicInterval": 300000,
|
|
228
|
-
"maxActiveConversations": 5,
|
|
229
|
-
"recentConversationCooldownMs": 30000,
|
|
230
|
-
"maxCandidatesPerPass": 200
|
|
231
|
-
},
|
|
232
|
-
"vectorStore": {
|
|
233
|
-
"enabled": false
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
JSON
|
|
237
|
-
success "lightweight starter config written: $CONFIG_FILE"
|
|
181
|
+
cp "$default_config" "$CONFIG_FILE"
|
|
182
|
+
success "recall-friendly starter config written: $CONFIG_FILE"
|
|
238
183
|
}
|
|
239
184
|
|
|
240
185
|
verify_stage() {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HyperMem Memory Plugin
|
|
3
|
+
*
|
|
4
|
+
* Thin adapter that bridges HyperMem's retrieval capabilities into
|
|
5
|
+
* OpenClaw's memory slot contract (`kind: "memory"`).
|
|
6
|
+
*
|
|
7
|
+
* The context engine plugin (hypercompositor) owns the full lifecycle:
|
|
8
|
+
* ingest, assemble, compact, afterTurn, bootstrap, dispose.
|
|
9
|
+
*
|
|
10
|
+
* This plugin owns the memory slot contract:
|
|
11
|
+
* - registerMemoryCapability() with runtime + publicArtifacts
|
|
12
|
+
* - memory_search tool backing via MemorySearchManager
|
|
13
|
+
* - Public artifacts for memory-wiki bridge
|
|
14
|
+
*
|
|
15
|
+
* Both plugins share the same HyperMem singleton (loaded from repo dist).
|
|
16
|
+
*/
|
|
17
|
+
declare const _default: {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
configSchema: import("openclaw/plugin-sdk").OpenClawPluginConfigSchema;
|
|
22
|
+
register: NonNullable<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition["register"]>;
|
|
23
|
+
} & Pick<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition, "kind" | "reload" | "nodeHostCommands" | "securityAuditCollectors">;
|
|
24
|
+
export default _default;
|