@inetafrica/open-claudia 2.6.58 → 2.6.59

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/README.md CHANGED
@@ -267,7 +267,7 @@ Open Claudia layers three memory systems on top of the backend's native sessions
267
267
 
268
268
  **Recall engines** — how packs and entities get matched and surfaced is pluggable per chat via `/engine` (or the `RECALL_ENGINE` env default). **classic** (the default) is keyword FTS plus a relevance judge with headline injection — stable and unchanged. **discoverer** (opt-in) adds a typed-edge graph over the same corpus (`parent`/`governed-by`/`related` edges with weights in `recall-graph.db`) and runs: a pre-gate that skips recall on trivial turns → FTS seeding → spreading activation across the graph (1–2 hops — auto-pulls cross-cutting concerns the query never named) → a walker that reads each candidate and returns the genuinely-relevant set with one-line why-bullets (fail-open to keyword seeds, so it never recalls worse than classic). Edges form structurally from pack `parent` frontmatter and `[[links]]`, and strengthen via Hebbian co-use when the agent opens packs together (📖); weights decay over time. Inspect with `open-claudia recall-stats` and `open-claudia recall graph [--sync]`, or flip on `/recall` to watch — per turn — which packs/entities surfaced and why, right in the chat. Switch back any time with `/engine classic`.
269
269
 
270
- **Dream consolidation** — while the per-turn reviewer takes quick notes, *dream* is the slow overnight pass (default 4am, on a high-tier model — opus by default, set `DREAM_TIER` or `DREAM_MODEL`): it merges packs that drifted into the same topic, builds parent/sub pack trees with umbrella summaries, tightens descriptions and tags so the router matches with less noise, dedupes entities, cross-links notes, and tends the recall graph (structural sync, weight decay, orphan prune). Anything merged away is backed up under `~/.open-claudia/backup/dream-<stamp>/` first, and every dream that changes something reports in chat. Configure with `DREAM_CRON` / `DREAM_MODEL`, disable with `DREAM=off`.
270
+ **Dream consolidation** — while the per-turn reviewer takes quick notes, *dream* is the slow overnight pass (default 4am, on a high-tier model — opus by default, set `DREAM_TIER` or `DREAM_MODEL`): it merges packs that drifted into the same topic, builds parent/sub pack trees with umbrella summaries, tightens descriptions and tags so the router matches with less noise, dedupes entities, cross-links notes, and tends the recall graph (structural sync, weight decay, orphan prune). The pass is *evidence-grounded*: per-turn recall telemetry (what surfaced, what got kept, what the agent actually opened) feeds the prompt, so archive/merge calls rest on usage numbers rather than vibes. Most nights run as cheap *deltas* — full pack bodies only for what changed since the last dream plus graph neighbours and pre-computed merge candidates; a full-corpus sweep runs every `DREAM_FULL_SWEEP_DAYS` (30). Deterministic phases run even if the model call fails: journal backfill dedupe, weakening of graph nodes that keep arriving but never get kept, co-rescue edge reinforcement, episodic index tending, and a memory-health report (rescue rate, noise, latency, spend) in the morning chat summary. Dream may also tune one bounded recall knob per night (`recall-tuning.json`) — every change is checked against the next window's health and auto-rolled-back if rescue drops or noise rises; env pins always win. Anything merged away is backed up under `~/.open-claudia/backup/dream-<stamp>/` first, and every dream that changes something reports in chat. Configure with `DREAM_CRON` / `DREAM_MODEL`, disable with `DREAM=off`.
271
271
 
272
272
  **Personality** — your `soul.md` holds identity and hard rules; `~/.open-claudia/persona.md` holds the voice on top — tone, quirks, emoji habits. It feeds into the system prompt and the dream pass may evolve it gently (bounded, backed up, announced). Edit it directly any time.
273
273
 
@@ -279,6 +279,7 @@ open-claudia entity list|show <slug>|match "<text>"|note <name> "<text>"|remove
279
279
  open-claudia dream [--dry-run] # run the consolidation pass now
280
280
  open-claudia recall-stats # discoverer-engine metrics summary
281
281
  open-claudia recall graph [--sync] # recall-graph node/edge stats; --sync rebuilds structural edges
282
+ open-claudia kpi [--json|--html|--knobs] # harness KPIs by version+model; --html writes a chart report, --knobs shows dream-tuned knob state
282
283
  open-claudia transcript-search "<query>" # alias: ts; --all for every project
283
284
  open-claudia transcript-window "<pattern>" # alias: tw; hits with surrounding turns
284
285
  ```
@@ -436,8 +437,11 @@ All stored in `~/.open-claudia/`:
436
437
  | `MEMORY_RECALL_MAX_CHARS` | No | Hard cap for auto-injected pack/entity memory per turn (default `9000`, `off` disables auto recall injection) |
437
438
  | `RECALL_ENGINE` | No | Default recall engine when a chat hasn't set one via `/engine` (`classic` or `discoverer`, default `classic`) |
438
439
  | `RECALL_GRAPH_DB` / `RECALL_METRICS` | No | Override the discoverer graph DB path; `off` on metrics disables per-turn recall logging |
439
- | `RECALL_WALKER_MAX_CANDIDATES` | No | Cap on candidates sent to the discoverer's walker judge per turn (default `14`) |
440
- | `RECALL_EPISODES` / `RECALL_EPISODE_LIMIT` | No | `off` disables episodic transcript candidates in recall; limit caps transcript hits per turn (default `3`) |
440
+ | `RECALL_WALKER_MAX_CANDIDATES` | No | Cap on candidates sent to the discoverer's walker judge per turn (default `14`; dream-tunable 8–20, env pins it) |
441
+ | `RECALL_EPISODES` / `RECALL_EPISODE_LIMIT` | No | `off` disables episodic transcript candidates in recall; limit caps transcript hits per turn (default `3`; dream-tunable 1–5) |
442
+ | `RECALL_SEEDS_TIER_MAX_WORDS` | No | Turns at or under this word count take the fast seeds-only recall path (default `4`; dream-tunable 2–6) |
443
+ | `RECALL_DECAY_HALF_LIFE_DAYS` | No | Half-life for recall-graph edge decay during dream tending (default `60`; dream-tunable 10–90) |
444
+ | `RECALL_CASCADE` / `RECALL_CASCADE_SHADOW_RATE` | No | `off` disables the deterministic keep/drop cascade before the walker judge; shadow rate is the fraction of cascade verdicts also judged to audit agreement (default `0.1`) |
441
445
  | `PROJECT_TRANSCRIPTS` | No | Enable redacted project transcripts (default `true`) |
442
446
  | `TRANSCRIPT_MAX_ENTRY_CHARS` | No | Max chars per transcript entry (default `12000`) |
443
447
  | `TRANSCRIPTS_DIR` / `PACKS_DIR` / `ENTITIES_DIR` | No | Override storage directories |
@@ -448,6 +452,7 @@ All stored in `~/.open-claudia/`:
448
452
  | `DREAM_CRON` | No | Schedule for the dream pass (default `0 4 * * *`) |
449
453
  | `DREAM_MODEL` | No | Explicit model override for the dream pass (otherwise picked from `DREAM_TIER`) |
450
454
  | `DREAM_TIER` | No | Model tier for the dream pass: `low` (haiku) / `medium` (sonnet) / `high` (opus, default) |
455
+ | `DREAM_FULL_SWEEP_DAYS` | No | Days between full-corpus dream sweeps; other nights are cheap deltas over recently-touched packs (default `30`) |
451
456
  | `PERSONA_FILE` | No | Override the persona file location |
452
457
  | `WEB_UI` / `WEB_PORT` / `WEB_PASSWORD` | No | Web UI toggle, port, and password |
453
458
  | `WHISPER_CLI` / `WHISPER_MODEL` | No | whisper.cpp binary and model for voice notes |
package/bin/cli.js CHANGED
@@ -318,6 +318,10 @@ switch (command) {
318
318
  require("./recall").run(["stats", ...args.slice(1)]);
319
319
  break;
320
320
  }
321
+ case "kpi": {
322
+ require("./kpi").run(args.slice(1));
323
+ break;
324
+ }
321
325
  case "recall": {
322
326
  require("./recall").run(args.slice(1));
323
327
  break;
package/bin/kpi.js ADDED
@@ -0,0 +1,55 @@
1
+ // open-claudia kpi [--json] [--html [--out <path>]] [--knobs]
2
+ //
3
+ // Compare harness performance across versions and models: rescue rate, noise,
4
+ // latency by tier, cost/turn, cascade + walker health — aggregated from the
5
+ // version-stamped recall telemetry, plus the nightly dream KPI snapshots.
6
+
7
+ const path = require("path");
8
+
9
+ const HELP = `
10
+ Harness KPIs by version.
11
+
12
+ open-claudia kpi Version-vs-version table
13
+ open-claudia kpi --json Raw aggregates
14
+ open-claudia kpi --html Write a self-contained HTML report (charts), print its path
15
+ open-claudia kpi --html --out p Write the report to a specific path
16
+ open-claudia kpi --knobs Current recall-knob values + dream tuning history
17
+
18
+ Data sources: recall-metrics.jsonl (per-turn, version+model stamped) and
19
+ recall-kpi.jsonl (one snapshot per dream night).
20
+ `;
21
+
22
+ function run(args) {
23
+ if (args.includes("--help") || args[0] === "help") { console.log(HELP); return; }
24
+ const kpi = require(path.join(__dirname, "..", "core", "recall", "kpi"));
25
+
26
+ if (args.includes("--knobs")) {
27
+ const tuning = require(path.join(__dirname, "..", "core", "recall", "tuning"));
28
+ console.log("Recall knobs (env pin > dream tuning > default)");
29
+ console.log("───────────────────────────────────────────────");
30
+ for (const k of tuning.knobTable()) {
31
+ console.log(`${k.name.padEnd(22)} ${String(k.current).padEnd(6)}${k.pinned ? " [pinned by env]" : k.current !== k.default ? " [dream-tuned]" : ""}`);
32
+ }
33
+ const hist = tuning.history();
34
+ if (hist.length) {
35
+ console.log("\nTuning history");
36
+ for (const h of hist.slice(-10)) console.log(` ${h.ts.slice(0, 10)} ${h.knob}: ${h.from} → ${h.to} — ${h.reason}`);
37
+ }
38
+ return;
39
+ }
40
+
41
+ if (args.includes("--html")) {
42
+ const i = args.indexOf("--out");
43
+ const out = i !== -1 ? args[i + 1] : undefined;
44
+ console.log(kpi.writeHtmlReport(out));
45
+ return;
46
+ }
47
+
48
+ const rows = kpi.aggregate();
49
+ if (args.includes("--json")) { console.log(JSON.stringify({ versions: rows, snapshots: kpi.trend() }, null, 2)); return; }
50
+ console.log(kpi.renderTable(rows));
51
+ const snaps = kpi.trend();
52
+ if (snaps.length) console.log(`\n${snaps.length} nightly snapshot(s) in recall-kpi.jsonl — \`open-claudia kpi --html\` for charts.`);
53
+ }
54
+
55
+ module.exports = { run, HELP };