@psiclawops/hypermem 0.8.0 → 0.8.1

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/ARCHITECTURE.md CHANGED
@@ -267,7 +267,7 @@ For open and deferred items, see [docs/ROADMAP.md](docs/ROADMAP.md).
267
267
  | `rate-limiter.ts` | ~230 | L3 | Token-bucket for embedding API |
268
268
  | `schema.ts` | ~200 | L2 | Messages schema + migrations |
269
269
  | `episode-store.ts` | ~180 | L4 | Significant event tracking |
270
- | `preference-store.ts` | ~170 | L4 | operator behavioral patterns |
270
+ | `preference-store.ts` | ~170 | L4 | Operator behavioral patterns |
271
271
  | `topic-store.ts` | ~160 | L4 | Cross-session thread tracking |
272
272
  | `plugin/src/index.ts` | ~590 | - | `hypercompositor` context engine plugin + window invalidation |
273
273
  | `memory-plugin/src/index.ts` | ~290 | - | `hypermem` memory slot plugin (memory_search via hybrid retrieval) |
package/README.md CHANGED
@@ -32,6 +32,8 @@ The difference isn't intelligence. It's what was in the prompt. Two failure mode
32
32
 
33
33
  **Compaction crunch.** Long sessions fill the context window. The runtime summarizes to make room. Specifics (tool output, exact decisions, file paths) are lost in the summary. The agent keeps running, but degraded.
34
34
 
35
+ **Bloated context.** 128k tokens doesn't mean 128k of useful prompt. Without active curation, agents fill the window with stale history, redundant instructions, and memory that isn't relevant to this turn. A bigger context window just means more room to waste. The information is in the prompt somewhere, buried under content irrelevant to this turn.
36
+
35
37
  ---
36
38
 
37
39
  ## What OpenClaw provides today
@@ -104,10 +106,10 @@ What's in storage, not in this prompt:
104
106
  Change the topic, and the next turn pulls different content from the same storage.
105
107
  ```
106
108
 
107
- ### Standard context engine vs. hypercompositor
109
+ ### OpenClaw default vs. hypercompositor
108
110
 
109
111
  ```
110
- Standard hypercompositor
112
+ OpenClaw default hypercompositor
111
113
  ──────────────────────────────── ────────────────────────────────
112
114
  message → append to transcript message → detect active topic
113
115
  transcript full → trim oldest query 4 storage layers in parallel
@@ -125,7 +127,7 @@ When it fills: When budget is exceeded:
125
127
  no recovery path change topic back → retrieved again
126
128
  ```
127
129
 
128
- | | Standard | hypercompositor |
130
+ | | OpenClaw default | hypercompositor |
129
131
  |---|---|---|
130
132
  | Context source | Growing transcript only | Transcript + 3 additional storage layers |
131
133
  | When context fills | Trim + summarize (lossy) | Budget allocation (lossless storage) |
@@ -164,9 +166,9 @@ Different models have different default behaviors. GPT-5.4 tends toward 2x verbo
164
166
 
165
167
  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:
166
168
 
167
- - **Calibration** known model tendencies and specific adjustments (e.g., "2x verbosity: cut first drafts in half")
168
- - **Corrections** hard/medium/soft severity rules applied in order (e.g., "No preamble before the answer")
169
- - **Task overrides** per-task-type adjustments
169
+ - **Calibration:** known model tendencies and specific adjustments (e.g., "2x verbosity: cut first drafts in half")
170
+ - **Corrections:** hard/medium/soft severity rules applied in order (e.g., "No preamble before the answer")
171
+ - **Task overrides:** per-task-type adjustments
170
172
 
171
173
  Model adaptation is only active at the `full` tier. At `light` and `standard`, model-specific corrections are suppressed.
172
174
 
@@ -196,7 +198,7 @@ Would you like me to go deeper on any of these?
196
198
  WITH outputProfile: "light":
197
199
  For a 128k window: reserve 14k for identity/system, target 46k for history, 10k for recent
198
200
  tool context, and leave ~30k as allocator reserve. hypermem handles slot competition
199
- automatically set `reserveFraction` to your preferred floor and let the compositor fill.
201
+ automatically. Set `reserveFraction` to your preferred floor and let the compositor fill.
200
202
  ```
201
203
 
202
204
  **Confabulation resistance** checks output against stored facts before claims are recorded. No LLM call. Pattern matching against the fact corpus, with confidence scoring and contradiction detection. Unsupported claims are flagged, contradictions surface in diagnostics, and a confabulation risk score is attached to the stored episode.
@@ -241,16 +243,7 @@ SQL queries that interpolate datetime values are fully parameterized. FTS5 trigg
241
243
 
242
244
  ## Pressure management
243
245
 
244
- hypermem composes context fresh on every turn, but a long-running session still accumulates history in its JSONL transcript. When that grows large enough, incoming tool results have nowhere to land and get silently stripped. Four automatic paths handle this:
245
-
246
- | Path | Trigger | Action |
247
- |---|---|---|
248
- | **Pressure-tiered tool-loop trim** | Any tool-loop turn | Measures projected occupancy before results land; trims large results at 80%+ and truncates the messages[] array for the current turn |
249
- | **AfterTurn trim** | Every turn at >80% | Pre-emptive headroom cut after the assistant replies, before the next turn arrives |
250
- | **Deep compaction** | compact() at >85% | Cuts in-memory cache to 25% budget and truncates JSONL to ~20% depth. Bypasses the normal reshape guard |
251
- | **Reshape guard** | Structured tool history on downshift | `canPersistReshapedHistory()` blocks a lower-context snapshot from overwriting the full JSONL history |
252
-
253
- **The one thing these paths cannot fix:** a session whose JSONL transcript on disk is already at 98% when the gateway restarts. The JSONL loads into runtime context before any compaction runs. Check `session_status` on startup. If you're above 85%, start a fresh session.
246
+ hypermem manages context pressure automatically through four escalating paths. Most sessions never need manual intervention. For trigger thresholds and path details, see [Pressure management](#pressure-management-1) below.
254
247
 
255
248
  ---
256
249
 
@@ -332,7 +325,7 @@ FTS5 queries use compound indexes on `agentId + sort key` and prefix optimizatio
332
325
  | Knowledge | Domain/key/value structured data with full-text search |
333
326
  | Episodes | Significant events with impact scores and participant tracking |
334
327
  | Topics | Cross-session thread tracking and synthesized wiki pages |
335
- | Preferences | operator behavioral patterns |
328
+ | Preferences | Operator behavioral patterns |
336
329
  | Fleet Registry | Agent registry with tier, org, and capability metadata |
337
330
  | System Registry | Service state and lifecycle |
338
331
  | Work Items | Work queue with status transitions and FTS5 |
@@ -383,7 +376,7 @@ Slot-level budget allocation is shown in the [hypercompositor diagram](#what-the
383
376
 
384
377
  ## Requirements
385
378
 
386
- **Current release: hypermem 0.8.0.** Changelog: [CHANGELOG.md](./CHANGELOG.md)
379
+ **Current release: hypermem 0.8.1.** Changelog: [CHANGELOG.md](./CHANGELOG.md)
387
380
 
388
381
  | Requirement | Version | Notes |
389
382
  |---|---|---|
@@ -396,7 +389,7 @@ SQLite is a library, not a service. All four layers run in-process with no exter
396
389
  **Runtime version constants** (importable from the package):
397
390
  ```typescript
398
391
  import {
399
- ENGINE_VERSION, // '0.8.0'
392
+ ENGINE_VERSION, // '0.8.1'
400
393
  MIN_NODE_VERSION, // '22.0.0'
401
394
  SQLITE_VEC_VERSION, // '0.1.9'
402
395
  MAIN_SCHEMA_VERSION, // 10 (messages.db)
@@ -410,29 +403,63 @@ Schema versions are stamped into each database on startup and checked on open. A
410
403
 
411
404
  ## Installation
412
405
 
406
+ **Requirements:** Node.js 22+, OpenClaw with context engine plugin support. No standalone SQLite install needed (uses Node 22 built-in `node:sqlite`). Embedding provider is optional for first install.
407
+
408
+ ### From source
409
+
413
410
  ```bash
414
- git clone https://github.com/PsiClawOps/hypermem.git ~/.openclaw/workspace/repo/hypermem
415
- cd ~/.openclaw/workspace/repo/hypermem
411
+ git clone https://github.com/PsiClawOps/hypermem.git
412
+ cd hypermem
416
413
  npm install && npm run build
417
414
  npm --prefix plugin install && npm --prefix plugin run build
418
415
  npm --prefix memory-plugin install && npm --prefix memory-plugin run build
416
+ npm run install:runtime
417
+ ```
418
+
419
+ `install:runtime` stages the runtime payload into `~/.openclaw/plugins/hypermem` and prints the exact config commands to wire the plugins. Before running them, create the data directory and config:
420
+
421
+ ```bash
422
+ mkdir -p ~/.openclaw/hypermem
423
+ cat > ~/.openclaw/hypermem/config.json <<'JSON'
424
+ {
425
+ "embedding": {
426
+ "provider": "none"
427
+ }
428
+ }
429
+ JSON
430
+ ```
431
+
432
+ This sets lightweight mode (FTS5 keyword search, no embedding provider needed). Add an embedding provider later for semantic search without losing stored data. See [INSTALL.md](./INSTALL.md#embedding-providers) for options.
419
433
 
434
+ Wire the plugins into OpenClaw:
435
+
436
+ ```bash
437
+ openclaw config set plugins.load.paths "[\"$HOME/.openclaw/plugins/hypermem/plugin\",\"$HOME/.openclaw/plugins/hypermem/memory-plugin\"]" --strict-json
420
438
  openclaw config set plugins.slots.contextEngine hypercompositor
421
439
  openclaw config set plugins.slots.memory hypermem
422
- openclaw config set plugins.load.paths '["~/.openclaw/workspace/repo/hypermem/plugin","~/.openclaw/workspace/repo/hypermem/memory-plugin"]' --strict-json
423
440
  openclaw config set plugins.allow '["hypercompositor","hypermem"]' --strict-json
424
441
  openclaw gateway restart
425
442
  ```
426
443
 
427
- Or use the one-line installer:
444
+ Verify (run from the repo clone directory):
445
+
446
+ ```bash
447
+ openclaw plugins list # hypercompositor and hypermem should show as loaded
448
+ node bin/hypermem-status.mjs --health # confirms database initialization
449
+ openclaw logs --limit 50 | grep hypermem # should show "hypermem initialized"
450
+ ```
451
+
452
+ If you see `falling back to default engine "legacy"` in the logs, the install is not active. Check [INSTALL.md troubleshooting](./INSTALL.md#troubleshooting-clean-installs).
453
+
454
+ ### One-line installer
428
455
 
429
456
  ```bash
430
457
  curl -fsSL https://raw.githubusercontent.com/PsiClawOps/hypermem/main/install.sh | bash
431
458
  ```
432
459
 
433
- **Requirements:** Node.js 22+, OpenClaw with context engine plugin support, and either Ollama (local) or an OpenRouter API key (hosted) for embeddings. No standalone SQLite install is required for the documented repo install: hypermem uses the SQLite bundled with Node 22 via `node:sqlite`, and `sqlite-vec` provides the platform-specific extension through npm dependencies.
460
+ Interactive: detects hardware, selects embedding tier, writes config, registers plugins.
434
461
 
435
- Full guide with deployment-specific options: **[INSTALL.md](./INSTALL.md)**
462
+ Full guide with embedding tiers, reranker setup, fleet config, and tuning: **[INSTALL.md](./INSTALL.md)**
436
463
 
437
464
  ### Agent-assisted install
438
465
 
@@ -440,7 +467,7 @@ If you prefer, hand the install to your OpenClaw agent:
440
467
 
441
468
  > "Install hypermem following INSTALL.md. I'm running a [solo / multi-agent] setup."
442
469
 
443
- ### operator guides
470
+ ### Operator guides
444
471
 
445
472
  - **[docs/MEMORY_MD_AUTHORING.md](./docs/MEMORY_MD_AUTHORING.md)**, how to keep `MEMORY.md` compact, durable, and reviewable
446
473
  - **[docs/TUNING.md](./docs/TUNING.md)**, context assembly and output shaping profiles
@@ -448,7 +475,7 @@ If you prefer, hand the install to your OpenClaw agent:
448
475
 
449
476
  ### Tuning
450
477
 
451
- Two independent surfaces: **context assembly** (what fills the context window) and **output shaping** (how the model writes). Pick a profile first most deployments adjust one or two settings on top.
478
+ Two independent surfaces: **context assembly** (what fills the context window) and **output shaping** (how the model writes). Pick a profile first. Most deployments adjust one or two settings on top.
452
479
 
453
480
  | Profile | Target window | Best for |
454
481
  |---|---|---|
@@ -499,7 +526,7 @@ Full reference: **[docs/TUNING.md](./docs/TUNING.md)**
499
526
 
500
527
  ## API
501
528
 
502
- > **Note:** The examples below use placeholder agent names (`my-agent`, `alice`, etc.). Replace these with your actual agent IDs from your OpenClaw config. Single-agent installs typically use `main`. Multi-agent fleets use whatever IDs you've configured. See [INSTALL.md § "Configure your fleet"](./INSTALL.md#step-5--configure-your-fleet-multi-agent-only) for details.
529
+ > **Note:** The examples below use placeholder agent names (`my-agent`, `agent1`, etc.). Replace these with your actual agent IDs from your OpenClaw config. Single-agent installs typically use `main`. Multi-agent fleets use whatever IDs you've configured. See [INSTALL.md § "Configure your fleet"](./INSTALL.md#step-5--configure-your-fleet-multi-agent-only) for details.
503
530
 
504
531
  ```typescript
505
532
  import { HyperMem } from '@psiclawops/hypermem';
@@ -556,6 +583,21 @@ node bin/hypermem-status.mjs --health # health checks only (exit 1 on fai
556
583
 
557
584
  ---
558
585
 
586
+ ## Pressure management
587
+
588
+ hypermem composes context fresh on every turn, but a long-running session still accumulates history in its JSONL transcript. When that grows large enough, incoming tool results have nowhere to land and get silently stripped. Four automatic paths handle this:
589
+
590
+ | Path | Trigger | Action |
591
+ |---|---|---|
592
+ | **Pressure-tiered tool-loop trim** | Any tool-loop turn | Measures projected occupancy before results land; trims large results at 80%+ and truncates the messages[] array for the current turn |
593
+ | **AfterTurn trim** | Every turn at >80% | Pre-emptive headroom cut after the assistant replies, before the next turn arrives |
594
+ | **Deep compaction** | compact() at >85% | Cuts in-memory cache to 25% budget and truncates JSONL to ~20% depth. Bypasses the normal reshape guard |
595
+ | **Reshape guard** | Structured tool history on downshift | `canPersistReshapedHistory()` blocks a lower-context snapshot from overwriting the full JSONL history |
596
+
597
+ **The one thing these paths cannot fix:** a session whose JSONL transcript on disk is already at 98% when the gateway restarts. The JSONL loads into runtime context before any compaction runs. Check `session_status` on startup. If you're above 85%, start a fresh session.
598
+
599
+ ---
600
+
559
601
  ## Data directory
560
602
 
561
603
  ```text
@@ -578,7 +620,7 @@ The migration guide includes worked examples showing how to bring data from Open
578
620
 
579
621
  All examples default to dry-run. Nothing is written until you add `--apply`.
580
622
 
581
- operator guide: **[docs/MIGRATION_GUIDE.md](./docs/MIGRATION_GUIDE.md)**
623
+ Operator guide: **[docs/MIGRATION_GUIDE.md](./docs/MIGRATION_GUIDE.md)**
582
624
 
583
625
 
584
626
  ---
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Usage:
6
6
  * node bin/hypermem-status.mjs # full dashboard
7
- * node bin/hypermem-status.mjs --agent carol # scoped to one agent
7
+ * node bin/hypermem-status.mjs --agent forge # scoped to one agent
8
8
  * node bin/hypermem-status.mjs --json # machine-readable output
9
9
  * node bin/hypermem-status.mjs --health # health checks only (exit 1 on failure)
10
10
  *
@@ -37,27 +37,27 @@ import { isSafeForSharedVisibility } from './secret-scanner.js';
37
37
  // returns results. New agents default to 'general'.
38
38
  //
39
39
  // ── EXAMPLE DATA ──────────────────────────────────────────────────
40
- // The agent names below (alice, director1, etc.) are PLACEHOLDERS.
40
+ // The agent names below (agent1, director1, etc.) are PLACEHOLDERS.
41
41
  // Replace them with your own agent IDs and domain labels to match
42
42
  // your fleet. Single-agent installs don't need to edit this:
43
43
  // unknown agents fall through to 'general' automatically.
44
44
  // See INSTALL.md § "Configure your fleet" for details.
45
45
  // ─────────────────────────────────────────────────────────────────
46
46
  const AGENT_DOMAIN_MAP = {
47
- alice: 'infrastructure',
47
+ agent1: 'infrastructure',
48
48
  director2: 'infrastructure',
49
49
  director1: 'infrastructure',
50
50
  director3: 'infrastructure',
51
- bob: 'product',
51
+ agent2: 'product',
52
52
  director4: 'product',
53
53
  director5: 'product',
54
54
  director6: 'product',
55
- dave: 'security',
55
+ agent3: 'security',
56
56
  director7: 'security',
57
57
  director8: 'security',
58
58
  agent4: 'ux',
59
- carol: 'governance',
60
- oscar: 'strategy',
59
+ agent6: 'governance',
60
+ agent5: 'strategy',
61
61
  specialist1: 'development',
62
62
  specialist2: 'communications',
63
63
  main: 'general',
@@ -94,7 +94,7 @@ function extractFactCandidates(content) {
94
94
  // Preference patterns — medium confidence (0.60)
95
95
  const preferencePatterns = [
96
96
  /(?:prefer|always use|never use|don't use|avoid) (.{10,150})/gi,
97
- /(?:operator) (?:wants|prefers|likes|hates|dislikes) (.{10,150})/gi,
97
+ /(?:operator|operator) (?:wants|prefers|likes|hates|dislikes) (.{10,150})/gi,
98
98
  ];
99
99
  // Operational patterns: deployments, incidents, fixes — high confidence (0.70)
100
100
  const operationalPatterns = [
@@ -148,7 +148,7 @@ const OPERATIONAL_BOILERPLATE = [
148
148
  /still\s*waiting/i,
149
149
  /will\s*pick\s*(it\s*)?up\s*(on\s*(next|the))?/i,
150
150
  /message\s*is\s*in\s*(his|her|their|the)\s*queue/i,
151
- /sent\s+to\s+(carol|bob|agent4|dave|oscar|alice)/i,
151
+ /sent\s+to\s+(agent6|agent2|agent4|agent3|agent5|agent1)/i,
152
152
  /dispatched\s+(it\s+)?to/i,
153
153
  /timed\s*out\s*after/i,
154
154
  /\bNO_REPLY\b/,
@@ -393,7 +393,7 @@ function detectTopic(content) {
393
393
  if (!content || content.length < 50)
394
394
  return null;
395
395
  // Product/project name detection
396
- const productMatch = content.match(/\b(HyperMem|ClawText|dashboard|canvas|council|automation|OpenClaw|dispatch)\b/i);
396
+ const productMatch = content.match(/\b(HyperMem|ClawText|ClawDash|ClawCanvas|ClawCouncil|ClawTomation|OpenClaw|ClawDispatch)\b/i);
397
397
  if (productMatch)
398
398
  return productMatch[1];
399
399
  // Infrastructure topic detection
@@ -27,7 +27,7 @@ export interface OrgRegistry {
27
27
  * Default fleet org structure.
28
28
  *
29
29
  * ── EXAMPLE DATA ──────────────────────────────────────────────────────────
30
- * The agent names below (alice, bob, director1, etc.) are PLACEHOLDERS.
30
+ * The agent names below (agent1, agent2, director1, etc.) are PLACEHOLDERS.
31
31
  * Replace them with your own agent IDs to match your fleet configuration.
32
32
  *
33
33
  * Single-agent installs: you don't need to edit this. Your agent ID is
@@ -21,7 +21,7 @@ import { FleetStore } from './fleet-store.js';
21
21
  * Default fleet org structure.
22
22
  *
23
23
  * ── EXAMPLE DATA ──────────────────────────────────────────────────────────
24
- * The agent names below (alice, bob, director1, etc.) are PLACEHOLDERS.
24
+ * The agent names below (agent1, agent2, director1, etc.) are PLACEHOLDERS.
25
25
  * Replace them with your own agent IDs to match your fleet configuration.
26
26
  *
27
27
  * Single-agent installs: you don't need to edit this. Your agent ID is
@@ -34,27 +34,27 @@ import { FleetStore } from './fleet-store.js';
34
34
  */
35
35
  export function defaultOrgRegistry() {
36
36
  const agents = {
37
- alice: { agentId: 'alice', tier: 'council' },
38
- bob: { agentId: 'bob', tier: 'council' },
37
+ agent1: { agentId: 'agent1', tier: 'council' },
38
+ agent2: { agentId: 'agent2', tier: 'council' },
39
39
  agent4: { agentId: 'agent4', tier: 'council' },
40
- dave: { agentId: 'dave', tier: 'council' },
41
- carol: { agentId: 'carol', tier: 'council' },
42
- oscar: { agentId: 'oscar', tier: 'council' },
43
- director1: { agentId: 'director1', tier: 'director', org: 'alice-org', councilLead: 'alice' },
44
- director2: { agentId: 'director2', tier: 'director', org: 'alice-org', councilLead: 'alice' },
45
- director3: { agentId: 'director3', tier: 'director', org: 'alice-org', councilLead: 'alice' },
46
- director4: { agentId: 'director4', tier: 'director', org: 'bob-org', councilLead: 'bob' },
47
- director5: { agentId: 'director5', tier: 'director', org: 'bob-org', councilLead: 'bob' },
48
- director6: { agentId: 'director6', tier: 'director', org: 'bob-org', councilLead: 'bob' },
49
- director7: { agentId: 'director7', tier: 'director', org: 'dave-org', councilLead: 'dave' },
50
- director8: { agentId: 'director8', tier: 'director', org: 'dave-org', councilLead: 'dave' },
40
+ agent3: { agentId: 'agent3', tier: 'council' },
41
+ agent6: { agentId: 'agent6', tier: 'council' },
42
+ agent5: { agentId: 'agent5', tier: 'council' },
43
+ director1: { agentId: 'director1', tier: 'director', org: 'agent1-org', councilLead: 'agent1' },
44
+ director2: { agentId: 'director2', tier: 'director', org: 'agent1-org', councilLead: 'agent1' },
45
+ director3: { agentId: 'director3', tier: 'director', org: 'agent1-org', councilLead: 'agent1' },
46
+ director4: { agentId: 'director4', tier: 'director', org: 'agent2-org', councilLead: 'agent2' },
47
+ director5: { agentId: 'director5', tier: 'director', org: 'agent2-org', councilLead: 'agent2' },
48
+ director6: { agentId: 'director6', tier: 'director', org: 'agent2-org', councilLead: 'agent2' },
49
+ director7: { agentId: 'director7', tier: 'director', org: 'agent3-org', councilLead: 'agent3' },
50
+ director8: { agentId: 'director8', tier: 'director', org: 'agent3-org', councilLead: 'agent3' },
51
51
  specialist1: { agentId: 'specialist1', tier: 'specialist' },
52
52
  specialist2: { agentId: 'specialist2', tier: 'specialist' },
53
53
  };
54
54
  const orgs = {
55
- 'alice-org': ['alice', 'director1', 'director2', 'director3'],
56
- 'bob-org': ['bob', 'director4', 'director5', 'director6'],
57
- 'dave-org': ['dave', 'director7', 'director8'],
55
+ 'agent1-org': ['agent1', 'director1', 'director2', 'director3'],
56
+ 'agent2-org': ['agent2', 'director4', 'director5', 'director6'],
57
+ 'agent3-org': ['agent3', 'director7', 'director8'],
58
58
  };
59
59
  return { orgs, agents };
60
60
  }
@@ -67,7 +67,7 @@ export interface DreamerResult {
67
67
  }
68
68
  /**
69
69
  * Resolve the workspace directory for an agent.
70
- * Council agents live at ~/.openclaw/workspace/{agentId}/
70
+ * Council agents live at ~/.openclaw/workspace-council/{agentId}/
71
71
  * Other agents at ~/.openclaw/workspace/{agentId}/
72
72
  */
73
73
  export declare function resolveAgentWorkspacePath(agentId: string): Promise<string | null>;
@@ -31,12 +31,12 @@ export const DEFAULT_DREAMER_CONFIG = {
31
31
  // ─── Workspace path resolution ───────────────────────────────────────────────
32
32
  /**
33
33
  * Resolve the workspace directory for an agent.
34
- * Council agents live at ~/.openclaw/workspace/{agentId}/
34
+ * Council agents live at ~/.openclaw/workspace-council/{agentId}/
35
35
  * Other agents at ~/.openclaw/workspace/{agentId}/
36
36
  */
37
37
  export async function resolveAgentWorkspacePath(agentId) {
38
38
  const home = os.homedir();
39
- const councilPath = path.join(home, '.openclaw', 'workspace', agentId);
39
+ const councilPath = path.join(home, '.openclaw', 'workspace-council', agentId);
40
40
  const workspacePath = path.join(home, '.openclaw', 'workspace', agentId);
41
41
  try {
42
42
  await fs.access(councilPath);
package/dist/index.d.ts CHANGED
@@ -126,8 +126,8 @@ export interface StartupFleetSeedResult {
126
126
  *
127
127
  * Usage:
128
128
  * const hm = await hypermem.create({ dataDir: '~/.openclaw/hypermem' });
129
- * await hm.record('alice', 'agent:alice:webchat:main', userMsg);
130
- * const result = await hm.compose({ agentId: 'alice', sessionKey: '...', ... });
129
+ * await hm.record('agent1', 'agent:agent1:webchat:main', userMsg);
130
+ * const result = await hm.compose({ agentId: 'agent1', sessionKey: '...', ... });
131
131
  */
132
132
  export declare class HyperMem {
133
133
  readonly dbManager: DatabaseManager;
@@ -185,7 +185,7 @@ export declare class HyperMem {
185
185
  /**
186
186
  * List archived or forked contexts for an agent.
187
187
  *
188
- * operator-safe enumeration path. This is the approved archived-context
188
+ * Operator-safe enumeration path. This is the approved archived-context
189
189
  * listing surface. Active composition remains separate.
190
190
  */
191
191
  listArchivedContexts(agentId: string, opts?: {
package/dist/index.js CHANGED
@@ -97,7 +97,7 @@ const DEFAULT_CONFIG = {
97
97
  cache: {
98
98
  keyPrefix: 'hm:',
99
99
  sessionTTL: 14400, // 4 hours — system/identity/meta slots
100
- historyTTL: 604800, // 7 days — extended for canvas display
100
+ historyTTL: 604800, // 7 days — extended for ClawCanvas display
101
101
  },
102
102
  compositor: {
103
103
  // TUNE-010 (2026-04-02): Raised from 65000 → 90000.
@@ -217,7 +217,7 @@ function mergeStartupCandidate(target, partial) {
217
217
  function discoverStartupFleetCandidates(dbManager, opts = {}) {
218
218
  const homeDir = process.env.HOME || os.homedir();
219
219
  const workspaceRoots = opts.workspaceRoots ?? [
220
- path.join(homeDir, '.openclaw', 'workspace'),
220
+ path.join(homeDir, '.openclaw', 'workspace-council'),
221
221
  path.join(homeDir, '.openclaw', 'workspace'),
222
222
  ];
223
223
  const candidates = new Map();
@@ -331,8 +331,8 @@ function discoverStartupFleetCandidates(dbManager, opts = {}) {
331
331
  *
332
332
  * Usage:
333
333
  * const hm = await hypermem.create({ dataDir: '~/.openclaw/hypermem' });
334
- * await hm.record('alice', 'agent:alice:webchat:main', userMsg);
335
- * const result = await hm.compose({ agentId: 'alice', sessionKey: '...', ... });
334
+ * await hm.record('agent1', 'agent:agent1:webchat:main', userMsg);
335
+ * const result = await hm.compose({ agentId: 'agent1', sessionKey: '...', ... });
336
336
  */
337
337
  export class HyperMem {
338
338
  dbManager;
@@ -531,7 +531,7 @@ export class HyperMem {
531
531
  /**
532
532
  * List archived or forked contexts for an agent.
533
533
  *
534
- * operator-safe enumeration path. This is the approved archived-context
534
+ * Operator-safe enumeration path. This is the approved archived-context
535
535
  * listing surface. Active composition remains separate.
536
536
  */
537
537
  listArchivedContexts(agentId, opts) {
@@ -61,7 +61,7 @@ export function buildOpenDomainFtsQuery(query) {
61
61
  .split(/\s+/)
62
62
  .filter(w => w.length >= 3 && !STOP_WORDS.has(w))
63
63
  .slice(0, 6)
64
- .map(w => `${w}*`);
64
+ .map(w => `"${w}"*`);
65
65
  if (terms.length === 0)
66
66
  return null;
67
67
  return terms.join(' OR ');
package/dist/seed.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Usage:
8
8
  * const seeder = new WorkspaceSeeder(hypermem);
9
- * const result = await seeder.seedWorkspace('/path/to/workspace', { agentId: 'alice' });
9
+ * const result = await seeder.seedWorkspace('/path/to/workspace', { agentId: 'agent1' });
10
10
  *
11
11
  * Idempotent: skips files whose source hash hasn't changed since last index.
12
12
  * Atomic: each file's chunks are swapped in a single transaction.
package/dist/seed.js CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Usage:
8
8
  * const seeder = new WorkspaceSeeder(hypermem);
9
- * const result = await seeder.seedWorkspace('/path/to/workspace', { agentId: 'alice' });
9
+ * const result = await seeder.seedWorkspace('/path/to/workspace', { agentId: 'agent1' });
10
10
  *
11
11
  * Idempotent: skips files whose source hash hasn't changed since last index.
12
12
  * Atomic: each file's chunks are swapped in a single transaction.
@@ -33,8 +33,8 @@ export interface FlushSessionResult {
33
33
  * from those stores naturally.
34
34
  *
35
35
  * @param cache Connected CacheLayer instance
36
- * @param agentId Agent identifier (e.g. "alice")
37
- * @param sessionKey Full session key (e.g. "agent:alice:webchat:scratchpad")
36
+ * @param agentId Agent identifier (e.g. "agent1")
37
+ * @param sessionKey Full session key (e.g. "agent:agent1:webchat:scratchpad")
38
38
  * @param opts Optional flags
39
39
  */
40
40
  export declare function flushSession(cache: CacheLayer, agentId: string, sessionKey: string, opts?: FlushSessionOptions): Promise<FlushSessionResult>;
@@ -18,8 +18,8 @@
18
18
  * from those stores naturally.
19
19
  *
20
20
  * @param cache Connected CacheLayer instance
21
- * @param agentId Agent identifier (e.g. "alice")
22
- * @param sessionKey Full session key (e.g. "agent:alice:webchat:scratchpad")
21
+ * @param agentId Agent identifier (e.g. "agent1")
22
+ * @param sessionKey Full session key (e.g. "agent:agent1:webchat:scratchpad")
23
23
  * @param opts Optional flags
24
24
  */
25
25
  export async function flushSession(cache, agentId, sessionKey, opts = {}) {
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Usage:
8
8
  * const ctx = await buildSpawnContext(messageStore, docChunkStore, agentId, {
9
- * parentSessionKey: 'agent:alice:webchat:main',
9
+ * parentSessionKey: 'agent:agent1:webchat:main',
10
10
  * workingSnapshot: 10,
11
11
  * documents: ['/path/to/spec.md'],
12
12
  * });
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Usage:
8
8
  * const ctx = await buildSpawnContext(messageStore, docChunkStore, agentId, {
9
- * parentSessionKey: 'agent:alice:webchat:main',
9
+ * parentSessionKey: 'agent:agent1:webchat:main',
10
10
  * workingSnapshot: 10,
11
11
  * documents: ['/path/to/spec.md'],
12
12
  * });
@@ -59,11 +59,11 @@ export class TemporalStore {
59
59
  const limit = opts.limit ?? 20;
60
60
  const order = opts.order ?? 'DESC';
61
61
  const minConf = opts.minConfidence ?? 0;
62
- const params = [];
62
+ const params = [minConf];
63
63
  const conditions = [
64
64
  'f.superseded_by IS NULL',
65
65
  'f.decay_score < 0.8',
66
- `t.confidence >= ${minConf}`,
66
+ 't.confidence >= ?',
67
67
  ];
68
68
  if (opts.agentId) {
69
69
  conditions.push('t.agent_id = ?');
@@ -12,12 +12,12 @@
12
12
  const KNOWN_NAMES = {
13
13
  hypermem: 'HyperMem',
14
14
  hyperbuilder: 'HyperBuilder',
15
- clawcanvas: 'canvas',
16
- clawdash: 'dashboard',
17
- clawdispatch: 'dispatch',
15
+ clawcanvas: 'ClawCanvas',
16
+ clawdash: 'ClawDash',
17
+ clawdispatch: 'ClawDispatch',
18
18
  clawtext: 'ClawText',
19
- clawtomation: 'automation',
20
- clawcouncil: 'council',
19
+ clawtomation: 'ClawTomation',
20
+ clawcouncil: 'ClawCouncil',
21
21
  openclaw: 'OpenClaw',
22
22
  clawhub: 'ClawHub',
23
23
  };
@@ -35,7 +35,7 @@ function keystoneScore(msg) {
35
35
  const backtickMatches = text.match(/`[^`]+`/g) || [];
36
36
  score += backtickMatches.length * 0.2;
37
37
  // Agent mentions (known patterns)
38
- const agentMentions = text.match(/\b(alice|bob|agent4|dave|oscar|carol|director1|director2|director7|specialist2|specialist1)\b/gi) || [];
38
+ const agentMentions = text.match(/\b(agent1|agent2|agent4|agent3|agent5|agent6|director1|director2|director7|specialist2|specialist1)\b/gi) || [];
39
39
  score += agentMentions.length * 0.25;
40
40
  // Quoted content
41
41
  const quotedMatches = text.match(/"[^"]{10,}"/g) || [];
@@ -39,7 +39,7 @@ export interface CollectionTrigger {
39
39
  export declare const TRIGGER_REGISTRY_VERSION = "1.0.0";
40
40
  /**
41
41
  * Default trigger registry for standard ACA collections.
42
- * Covers the core ACA offload use case from carol's spec.
42
+ * Covers the core ACA offload use case from agent6's spec.
43
43
  */
44
44
  export declare const TRIGGER_REGISTRY: CollectionTrigger[];
45
45
  /** Backward-compat alias — same reference as TRIGGER_REGISTRY */
@@ -13,7 +13,7 @@ import { createHash } from 'node:crypto';
13
13
  export const TRIGGER_REGISTRY_VERSION = '1.0.0';
14
14
  /**
15
15
  * Default trigger registry for standard ACA collections.
16
- * Covers the core ACA offload use case from carol's spec.
16
+ * Covers the core ACA offload use case from agent6's spec.
17
17
  */
18
18
  export const TRIGGER_REGISTRY = [
19
19
  {
@@ -61,7 +61,7 @@ export const TRIGGER_REGISTRY = [
61
61
  ],
62
62
  maxTokens: 800,
63
63
  maxChunks: 2,
64
- owner: 'alice',
64
+ owner: 'agent1',
65
65
  category: 'operations',
66
66
  description: 'Agent operational procedures: boot sequence, heartbeat, work queue, session startup',
67
67
  },
@@ -98,7 +98,7 @@ export const TRIGGER_REGISTRY = [
98
98
  ],
99
99
  maxTokens: 1500,
100
100
  maxChunks: 4,
101
- owner: 'alice',
101
+ owner: 'agent1',
102
102
  category: 'memory',
103
103
  description: 'Decision history: past choices, previously agreed approaches, recalled context',
104
104
  },
@@ -124,7 +124,7 @@ export const TRIGGER_REGISTRY = [
124
124
  ],
125
125
  maxTokens: 1200,
126
126
  maxChunks: 3,
127
- owner: 'alice',
127
+ owner: 'agent1',
128
128
  category: 'operations',
129
129
  description: 'Agent tooling reference: CLI commands, config paths, deployment procedures, quick reference',
130
130
  },
package/dist/types.d.ts CHANGED
@@ -70,7 +70,7 @@ export type FactScope = 'agent' | 'session' | 'user';
70
70
  /**
71
71
  * Memory visibility levels:
72
72
  * - private: Only the owning agent can read. Identity, SOUL, personal reflections.
73
- * - org: Agents in the same org (e.g., alice's directors: Hank, Jack, Irene).
73
+ * - org: Agents in the same org (e.g., agent1's directors: Pylon, Vigil, Plane).
74
74
  * - council: All council seats can read.
75
75
  * - fleet: Any agent in the fleet can read.
76
76
  */
@@ -400,7 +400,7 @@ export interface ProviderMessage {
400
400
  * to identify high-signal unprocessed messages.
401
401
  *
402
402
  * Stored in Redis (hm:{a}:s:{s}:cursor) with dual-write to SQLite for
403
- * durability across Redis eviction (bob Gate 2).
403
+ * durability across Redis eviction (agent2 Gate 2).
404
404
  */
405
405
  export interface SessionCursor {
406
406
  /** StoredMessage.id of the newest message included in the last window */
package/dist/version.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Release version — matches package.json and is stamped into library.db on every startup. */
2
- export declare const ENGINE_VERSION = "0.8.0";
2
+ export declare const ENGINE_VERSION = "0.8.1";
3
3
  /** Minimum Node.js version required — matches package.json engines field. */
4
4
  export declare const MIN_NODE_VERSION = "22.0.0";
5
5
  /** @deprecated No longer used — Redis was replaced with SQLite :memory: CacheLayer. */
@@ -19,15 +19,15 @@ export declare const LIBRARY_SCHEMA_VERSION_EXPORT = 19;
19
19
  /**
20
20
  * Compatibility version — the single number operators and consumers check.
21
21
  * Maps to: messages.db schema v10, library schema v19.
22
- * Matches ENGINE_VERSION for the 0.8.0 release.
22
+ * Matches ENGINE_VERSION for the 0.8.1 release.
23
23
  */
24
- export declare const HYPERMEM_COMPAT_VERSION = "0.8.0";
24
+ export declare const HYPERMEM_COMPAT_VERSION = "0.8.1";
25
25
  /**
26
26
  * Schema compatibility map — machine-readable version requirements.
27
27
  * Use this to verify DB schemas match the running engine.
28
28
  */
29
29
  export declare const SCHEMA_COMPAT: {
30
- readonly compatVersion: "0.8.0";
30
+ readonly compatVersion: "0.8.1";
31
31
  readonly mainSchema: 10;
32
32
  readonly librarySchema: 19;
33
33
  };
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Release version — matches package.json and is stamped into library.db on every startup. */
2
- export const ENGINE_VERSION = '0.8.0';
2
+ export const ENGINE_VERSION = '0.8.1';
3
3
  /** Minimum Node.js version required — matches package.json engines field. */
4
4
  export const MIN_NODE_VERSION = '22.0.0';
5
5
  /** @deprecated No longer used — Redis was replaced with SQLite :memory: CacheLayer. */
@@ -19,15 +19,15 @@ export const LIBRARY_SCHEMA_VERSION_EXPORT = 19;
19
19
  /**
20
20
  * Compatibility version — the single number operators and consumers check.
21
21
  * Maps to: messages.db schema v10, library schema v19.
22
- * Matches ENGINE_VERSION for the 0.8.0 release.
22
+ * Matches ENGINE_VERSION for the 0.8.1 release.
23
23
  */
24
- export const HYPERMEM_COMPAT_VERSION = '0.8.0';
24
+ export const HYPERMEM_COMPAT_VERSION = '0.8.1';
25
25
  /**
26
26
  * Schema compatibility map — machine-readable version requirements.
27
27
  * Use this to verify DB schemas match the running engine.
28
28
  */
29
29
  export const SCHEMA_COMPAT = {
30
- compatVersion: '0.8.0',
30
+ compatVersion: '0.8.1',
31
31
  mainSchema: 10,
32
32
  librarySchema: 19,
33
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psiclawops/hypermem",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Agent-centric memory and context composition engine for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",