agenr 1.1.0 → 1.3.0
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 +62 -0
- package/README.md +12 -7
- package/dist/{chunk-B5C3FEPR.js → chunk-2FKQCRGD.js} +833 -29
- package/dist/cli.js +6040 -1932
- package/dist/core/recall/index.d.ts +3 -1
- package/dist/core/recall/index.js +1 -1
- package/dist/internal-recall-eval-server.js +2 -2
- package/package.json +10 -2
- package/.prettierrc +0 -5
- package/.vscode/launch.json +0 -77
- package/.vscode/tasks.json +0 -12
- package/AGENTS.md +0 -269
- package/docs/EVALS.md +0 -516
- package/docs/INGEST.md +0 -340
- package/docs/OPENCLAW-PLUGIN.md +0 -447
- package/docs/PLAN.md +0 -488
- package/docs/RECALL.md +0 -416
- package/docs/STORE.md +0 -246
- package/eslint.config.js +0 -172
- package/packages/openclaw-plugin/README.md +0 -12
- package/packages/openclaw-plugin/openclaw.plugin.json +0 -34
- package/packages/openclaw-plugin/package.json +0 -31
- package/packages/openclaw-plugin/src/index.ts +0 -1
- package/packages/openclaw-plugin/tsup.config.ts +0 -10
- package/pnpm-workspace.yaml +0 -2
- package/scripts/check-sim.ts +0 -89
- package/src/adapters/api/internal-recall-eval-server.ts +0 -204
- package/src/adapters/api/routes/internal-recall-eval.ts +0 -120
- package/src/adapters/api/validation/recall-eval-request.ts +0 -441
- package/src/adapters/db/client.ts +0 -206
- package/src/adapters/db/openclaw-plugin-queries.ts +0 -285
- package/src/adapters/db/queries.ts +0 -455
- package/src/adapters/db/recall-adapter.ts +0 -344
- package/src/adapters/db/row-mapping.ts +0 -216
- package/src/adapters/db/schema.ts +0 -399
- package/src/adapters/embeddings.ts +0 -286
- package/src/adapters/files/transcript-files.ts +0 -52
- package/src/adapters/llm.ts +0 -646
- package/src/adapters/openclaw/config.ts +0 -104
- package/src/adapters/openclaw/format/prompt-section.ts +0 -58
- package/src/adapters/openclaw/format/recall-format.ts +0 -86
- package/src/adapters/openclaw/hooks/before-prompt-build.ts +0 -338
- package/src/adapters/openclaw/hooks/before-reset.ts +0 -112
- package/src/adapters/openclaw/index.ts +0 -65
- package/src/adapters/openclaw/memory/flush-plan.ts +0 -21
- package/src/adapters/openclaw/memory/runtime.ts +0 -83
- package/src/adapters/openclaw/openclaw.plugin.json +0 -34
- package/src/adapters/openclaw/runtime.ts +0 -182
- package/src/adapters/openclaw/session/predecessor.ts +0 -319
- package/src/adapters/openclaw/session/sessions-store-reader.ts +0 -136
- package/src/adapters/openclaw/session/state.ts +0 -157
- package/src/adapters/openclaw/session/summary-reader.ts +0 -112
- package/src/adapters/openclaw/session/summary.ts +0 -373
- package/src/adapters/openclaw/session/tui-lane.ts +0 -59
- package/src/adapters/openclaw/tools.ts +0 -944
- package/src/adapters/openclaw/transcript/jsonl.ts +0 -53
- package/src/adapters/openclaw/transcript/message-content.ts +0 -300
- package/src/adapters/openclaw/transcript/parser.ts +0 -406
- package/src/adapters/openclaw/transcript/timestamps.ts +0 -99
- package/src/adapters/openclaw/transcript/tool-summarization.ts +0 -347
- package/src/adapters/openclaw/types.ts +0 -248
- package/src/app/evals/recall/collect-diagnostics.ts +0 -292
- package/src/app/evals/recall/contracts.ts +0 -345
- package/src/app/evals/recall/index.ts +0 -21
- package/src/app/evals/recall/instrumented-recall-ports.ts +0 -115
- package/src/app/evals/recall/normalize-response.ts +0 -78
- package/src/app/evals/recall/provision-fixtures.ts +0 -268
- package/src/app/evals/recall/run-recall-eval-case.ts +0 -134
- package/src/app/evals/recall/sandbox.ts +0 -92
- package/src/app/ingestion/index.ts +0 -9
- package/src/app/ingestion/ports.ts +0 -81
- package/src/app/ingestion/service.ts +0 -313
- package/src/cli/commands/db.ts +0 -117
- package/src/cli/commands/ingest.ts +0 -652
- package/src/cli/commands/init/cost-estimator.ts +0 -91
- package/src/cli/commands/init/external-commands.ts +0 -243
- package/src/cli/commands/init/index.ts +0 -17
- package/src/cli/commands/init/openclaw-detect.ts +0 -58
- package/src/cli/commands/init/session-scanner.ts +0 -83
- package/src/cli/commands/init/wizard.ts +0 -498
- package/src/cli/commands/recall.ts +0 -249
- package/src/cli/commands/setup.ts +0 -1411
- package/src/cli/main.ts +0 -41
- package/src/cli/ui.ts +0 -180
- package/src/cli.ts +0 -6
- package/src/config.ts +0 -357
- package/src/core/ingestion/dedup.ts +0 -561
- package/src/core/ingestion/extract.ts +0 -329
- package/src/core/ingestion/index.ts +0 -15
- package/src/core/ingestion/parser.ts +0 -271
- package/src/core/ingestion/pipeline.ts +0 -390
- package/src/core/ingestion/prompts.ts +0 -436
- package/src/core/ports.ts +0 -108
- package/src/core/recall/index.ts +0 -6
- package/src/core/recall/lexical.ts +0 -247
- package/src/core/recall/scoring.ts +0 -177
- package/src/core/recall/search.ts +0 -463
- package/src/core/recall/temporal.ts +0 -111
- package/src/core/recall/trace.ts +0 -124
- package/src/core/recall/types.ts +0 -67
- package/src/core/store/embedding-text.ts +0 -11
- package/src/core/store/hashing.ts +0 -28
- package/src/core/store/index.ts +0 -3
- package/src/core/store/pipeline.ts +0 -324
- package/src/core/store/validation.ts +0 -153
- package/src/core/types.ts +0 -112
- package/src/internal-recall-eval-server.ts +0 -95
- package/src/logger.ts +0 -83
- package/src/ui.ts +0 -74
- package/src/version.ts +0 -24
- package/tests/adapters/api/internal-recall-eval-server.test.ts +0 -88
- package/tests/adapters/api/routes/internal-recall-eval.test.ts +0 -461
- package/tests/adapters/api/validation/recall-eval-request.test.ts +0 -285
- package/tests/adapters/db/client.test.ts +0 -286
- package/tests/adapters/db/schema.test.ts +0 -275
- package/tests/adapters/embeddings.test.ts +0 -193
- package/tests/adapters/files/transcript-files.test.ts +0 -107
- package/tests/adapters/llm.test.ts +0 -453
- package/tests/adapters/openclaw/before-prompt-build.test.ts +0 -1160
- package/tests/adapters/openclaw/before-reset.test.ts +0 -287
- package/tests/adapters/openclaw/config.test.ts +0 -60
- package/tests/adapters/openclaw/flush-plan.test.ts +0 -18
- package/tests/adapters/openclaw/package-metadata.test.ts +0 -169
- package/tests/adapters/openclaw/prompt-section.test.ts +0 -25
- package/tests/adapters/openclaw/runtime.test.ts +0 -247
- package/tests/adapters/openclaw/session/predecessor.test.ts +0 -393
- package/tests/adapters/openclaw/session/summary.test.ts +0 -256
- package/tests/adapters/openclaw/session/tui-lane.test.ts +0 -32
- package/tests/adapters/openclaw/session-state.test.ts +0 -44
- package/tests/adapters/openclaw/tools.test.ts +0 -476
- package/tests/adapters/openclaw/transcript/parser.test.ts +0 -501
- package/tests/app/evals/recall/instrumented-recall-ports.test.ts +0 -120
- package/tests/app/evals/recall/run-recall-eval-case.test.ts +0 -508
- package/tests/app/ingestion/service.test.ts +0 -251
- package/tests/cli/commands/db.test.ts +0 -34
- package/tests/cli/commands/ingest.test.ts +0 -142
- package/tests/cli/commands/init/cost-estimator.test.ts +0 -50
- package/tests/cli/commands/init/external-commands.test.ts +0 -86
- package/tests/cli/commands/init/index.test.ts +0 -20
- package/tests/cli/commands/init/openclaw-detect.test.ts +0 -35
- package/tests/cli/commands/init/session-scanner.test.ts +0 -58
- package/tests/cli/commands/init/wizard.test.ts +0 -247
- package/tests/cli/commands/recall.test.ts +0 -82
- package/tests/cli/commands/setup.test.ts +0 -347
- package/tests/cli/fake-prompts.ts +0 -150
- package/tests/config.test.ts +0 -77
- package/tests/core/ingestion/dedup.test.ts +0 -351
- package/tests/core/ingestion/extract.test.ts +0 -294
- package/tests/core/ingestion/parser.test.ts +0 -251
- package/tests/core/ingestion/pipeline.test.ts +0 -592
- package/tests/core/ingestion/prompts.test.ts +0 -100
- package/tests/core/recall/lexical.test.ts +0 -91
- package/tests/core/recall/scoring.test.ts +0 -155
- package/tests/core/recall/search.integration.test.ts +0 -753
- package/tests/core/recall/search.test.ts +0 -262
- package/tests/core/recall/temporal.test.ts +0 -71
- package/tests/core/store/hashing.test.ts +0 -28
- package/tests/core/store/pipeline.test.ts +0 -295
- package/tests/core/store/validation.test.ts +0 -154
- package/tests/logger.test.ts +0 -77
- package/tests/ui.test.ts +0 -30
- package/tests/version.test.ts +0 -14
- package/tsconfig.json +0 -21
- package/tsup.config.ts +0 -12
- package/dist/{chunk-FLRJOP3J.js → chunk-EUPZHNOY.js} +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.0] - 2026-03-30
|
|
4
|
+
|
|
5
|
+
Episodic memory — session-level temporal recall for the brain.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Episodic memory system (Phases 0–6).** A new `episodes` table stores narrative summaries of what happened during each session, queryable by time range and semantic similarity. Gives the brain temporal awareness — "what happened yesterday", "what were we working on last week", "sessions about schema changes" all work.
|
|
10
|
+
- **Episode ingest CLI.** `agenr ingest episodes <path>` scans OpenClaw session transcripts (including rotated `.reset.*` and `.deleted.*` files), generates episodic summaries, and writes episodes to the database. Supports `--recent`, `--regenerate`, `--dry-run`, `--concurrency`, `--embed-only`, and `--no-embed` flags.
|
|
11
|
+
- **Session discovery via `sessions.json`.** Uses OpenClaw's session registry for authoritative metadata (surface, agentId, chatType) on active sessions. Falls back to transcript-based surface reconstruction for rotated files.
|
|
12
|
+
- **Surface reconstruction from transcripts.** Detects session surface (webchat, telegram, signal, tui, subagent, heartbeat, cron) from Sender metadata blocks, Conversation info blocks, inbound_meta, and content heuristics. Integrated into the transcript parser to avoid double file reads.
|
|
13
|
+
- **Agent ID derivation from directory path.** Falls back to parsing the OpenClaw directory structure (`agents/{agentId}/sessions/`) when registry metadata is unavailable.
|
|
14
|
+
- **Unified recall with mode routing.** `agenr_recall` gains a `mode` parameter (`auto`, `entries`, `episodes`). Auto-routing uses three-band rules: temporal narrative → episodes, factual → entries, mixed → both. Results returned in separate sections with routing metadata.
|
|
15
|
+
- **Calendar-aware temporal window parser.** Parses "today", "yesterday", "this/last week", "this/last month", "N days/weeks/months ago", "in March", "March 15th", "last Friday", and ISO dates into precise calendar intervals for episode search.
|
|
16
|
+
- **Episode recall pipeline.** Pure temporal search via interval overlap scoring. No embedding dependency for basic temporal queries.
|
|
17
|
+
- **Hybrid semantic episode search (Phase 6).** Episode embeddings stored at write time, vector index (`idx_episodes_embedding`) for cosine similarity search. Three modes: pure temporal, pure semantic, and hybrid (hard temporal filter + semantic rerank).
|
|
18
|
+
- **Episode embedding backfill.** `agenr ingest episodes --embed-only` backfills embeddings for episodes missing them — no LLM calls, just embedding API.
|
|
19
|
+
- **Episode model configuration.** New `episodeModel` config field in `agenr setup` / `agenr init` for episode summary generation model override, following the existing extraction/dedup/surgeon pattern.
|
|
20
|
+
- **Episode writing at session start.** Predecessor episodes generated via `before_prompt_build` hook, best-effort with timeout. Backfill CLI is the canonical repair path.
|
|
21
|
+
- **Parallel preflight parsing.** Episode ingest Stage 1 parses transcript files concurrently to handle large session directories (600+ files) without hanging.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Continuity domain extraction.** Session handoff logic reorganized under `src/adapters/openclaw/session/continuity/` as a proper subdomain with clean public API. Continuity summaries (for session handoff) are now explicitly separate from episodic summaries (for temporal recall).
|
|
26
|
+
- **Renamed session summaries to continuity summaries.** Clarifies the distinction between handoff artifacts and episodic memory artifacts throughout the codebase.
|
|
27
|
+
- **Removed `before_reset` hook.** Does not fire for OpenClaw plugins — all episode and continuity logic uses `before_prompt_build` only.
|
|
28
|
+
- **Semantic memory cleanup (Ref #7).** Removed `reflection` entry type, migrated `todo` to `tasks` table, renamed `event` to `milestone`, broadened type descriptions.
|
|
29
|
+
- **Transcript file discovery.** Fixed regex to match rotated files with ISO timestamp dots (`.628Z`). Discovery now finds all 600+ files instead of only active `.jsonl` files.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- **Episode vector search ambiguous column.** Prefixed select columns with table alias in `episodeVectorSearch()` to resolve `id` ambiguity with `vector_top_k` join.
|
|
34
|
+
- **Temporal parser ordinal dates.** "March 15th", "January 1st", "February 2nd" now parse correctly.
|
|
35
|
+
- **Subagent/cron surface classification.** Session registry detects `:subagent:` and `:cron:` in session keys for correct surface tagging.
|
|
36
|
+
- **Internal session skipping.** Agenr prompt pipeline sessions are filtered from episode generation.
|
|
37
|
+
|
|
38
|
+
## [1.2.0] - 2026-03-29
|
|
39
|
+
|
|
40
|
+
The surgeon retirement pass — an autonomous agent that evaluates and retires stale knowledge entries.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- **Surgeon retirement pass.** A standalone agent loop powered by `@mariozechner/pi-agent-core` that evaluates knowledge entries and retires semantically stale ones. Runs as `agenr surgeon run` with full dry-run and apply modes, budget governance, and completion guards.
|
|
45
|
+
- **7 surgeon tools.** `get_health_stats`, `query_candidates`, `inspect_entry`, `simulate_recall`, `retire_entry`, `update_entry`, and `complete_pass` — each adapted from the v0 surgeon for v1's simpler schema.
|
|
46
|
+
- **Recall simulation without telemetry.** The `simulate_recall` tool wraps the v1 recall pipeline with a no-op telemetry adapter and optional target-entry exclusion, so the surgeon can test retrieval impact without polluting recall metrics.
|
|
47
|
+
- **Surgeon CLI commands.** `agenr surgeon run`, `agenr surgeon status`, `agenr surgeon history`, and `agenr surgeon actions <run-id>` for running, inspecting, and auditing surgeon passes.
|
|
48
|
+
- **Surgeon status shows evaluation coverage.** `agenr surgeon status` now displays recently evaluated vs new candidates, so you can see how much work remains before running.
|
|
49
|
+
- **Surgeon model configuration in setup.** `agenr setup` and `agenr init` now include surgeon model overrides in the advanced task-specific model configuration flow.
|
|
50
|
+
- **Budget and completion governance.** Cost-based budget tracking, context-limit detection, completion guards that reject premature pass completion, and continuation prompts that keep the surgeon working when budget remains.
|
|
51
|
+
- **Run and action persistence.** Surgeon runs and individual actions (retirements, skips, updates) are logged to the database for auditability and recently-evaluated filtering on future runs.
|
|
52
|
+
- **Database backup before apply.** Surgeon creates a timestamped backup of the knowledge database (including WAL/SHM sidecars) before executing mutations in apply mode.
|
|
53
|
+
- **Surgeon configuration.** New `surgeon` section in `config.json` supporting model override, cost caps, daily cost limits, context limits, custom instructions, and per-pass protection thresholds.
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- **Schema version bumped to 2.** The `surgeon_runs` table is expanded with pass type, status, token/cost tracking, model, dry-run flag, and structured summary fields. A new `surgeon_run_actions` table logs individual surgeon actions with indexed `entry_id` for efficient recently-evaluated queries. Existing databases are migrated automatically via `ALTER TABLE ADD COLUMN`.
|
|
58
|
+
- **Protection threshold raised to importance ≥ 9.** Entries with importance 8 are now eligible for surgeon evaluation since many entries default to importance 8 during ingestion.
|
|
59
|
+
- **Setup prompt updated.** The advanced model override prompt now reads "Customize task-specific models?" to reflect the addition of surgeon alongside extraction and dedup overrides.
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- **Tightened npm publish surface.** Root package now uses a strict `"files"` allowlist so only intended artifacts are published.
|
|
64
|
+
|
|
3
65
|
## [1.1.0] - 2026-03-28
|
|
4
66
|
|
|
5
67
|
This release splits the OpenClaw plugin into its own publishable npm package and tightens session-start handoff reliability.
|
package/README.md
CHANGED
|
@@ -130,13 +130,15 @@ Important: when agenr is running as an OpenClaw plugin, session summaries use Op
|
|
|
130
130
|
|
|
131
131
|
The current CLI surface is intentionally small. Today the `db` group only exposes `reset`.
|
|
132
132
|
|
|
133
|
-
| Command
|
|
134
|
-
|
|
|
135
|
-
| `agenr init`
|
|
136
|
-
| `agenr setup`
|
|
137
|
-
| `agenr recall <query>`
|
|
138
|
-
| `agenr ingest <path>`
|
|
139
|
-
| `agenr
|
|
133
|
+
| Command | What it does |
|
|
134
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
|
|
135
|
+
| `agenr init` | Interactive first-run wizard: auth, model selection, OpenClaw detection, plugin install, and optional initial ingestion. |
|
|
136
|
+
| `agenr setup` | Configure auth, model defaults, embeddings, and the agenr database path. |
|
|
137
|
+
| `agenr recall <query>` | Run the hybrid recall pipeline with optional temporal and type/tag filters. |
|
|
138
|
+
| `agenr ingest <path>` | Default durable-entry ingest shorthand. Equivalent to `agenr ingest entries <path>`. |
|
|
139
|
+
| `agenr ingest entries <path>` | Bulk-ingest one file or directory of OpenClaw transcript files into durable knowledge entries. |
|
|
140
|
+
| `agenr ingest episodes <path>` | Backfill episodic summaries from OpenClaw session transcripts, including rotated `.reset.*` and `.deleted.*` files. |
|
|
141
|
+
| `agenr db reset` | Delete and recreate the knowledge database. |
|
|
140
142
|
|
|
141
143
|
The OpenClaw plugin also gives the agent five tools directly inside the runtime: `agenr_store`, `agenr_recall`, `agenr_retire`, `agenr_update`, and `agenr_trace`.
|
|
142
144
|
|
|
@@ -149,6 +151,9 @@ agenr recall "what decisions did we make about the API?"
|
|
|
149
151
|
# Ingest transcripts
|
|
150
152
|
agenr ingest ~/.openclaw/agents/main/sessions/
|
|
151
153
|
|
|
154
|
+
# Backfill episode summaries
|
|
155
|
+
agenr ingest episodes ~/.openclaw/agents/main/sessions/ --recent 30d
|
|
156
|
+
|
|
152
157
|
# Reset the database
|
|
153
158
|
agenr db reset
|
|
154
159
|
```
|