agenr 1.2.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 CHANGED
@@ -1,5 +1,40 @@
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
+
3
38
  ## [1.2.0] - 2026-03-29
4
39
 
5
40
  The surgeon retirement pass — an autonomous agent that evaluates and retires stale knowledge entries.
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 | 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>` | Bulk-ingest one file or directory of OpenClaw transcript files. |
139
- | `agenr db reset` | Delete and recreate the knowledge database. |
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
  ```