agenr 0.4.1 → 0.5.2

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
@@ -2,19 +2,79 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### Added
6
+ - `entries.project` column (with index) to tag knowledge by source project/repo (NULL for legacy entries)
7
+ - Project auto-detection from transcript CWD in watch mode (tags entries at write time)
8
+ - `--project` and `--exclude-project` filters/tags across commands:
9
+ - `agenr recall --project/--exclude-project [--strict]`
10
+ - `agenr context --project/--exclude-project [--strict]`
11
+ - `agenr store --project`
12
+ - `agenr ingest --project`
13
+ - `agenr consolidate --project/--exclude-project` (never merges across projects)
14
+ - `agenr db stats --project/--exclude-project`
15
+ - `agenr db export --project/--exclude-project`
16
+ - MCP tool support for project:
17
+ - `agenr_recall` accepts optional `project` filter (comma-separated for multiple)
18
+ - `agenr_store` accepts optional `project` tag
19
+ - `agenr eval recall` command for scoring regression checks (baseline save and compare)
20
+
21
+ ### Fixed
22
+ - Recall scoring and session-start recall:
23
+ - Freshness boost for importance >= 6 (clamped to avoid amplifying noisy entries)
24
+ - Smooth exponential todo staleness decay (half-life 7 days; floors at 0.10 or 0.40 for importance >= 8)
25
+ - Session-start permanent window widened to 30 days (temporary remains shorter)
26
+ - Dynamic budget allocation based on available categories
27
+ - Recency tiebreaking within a 0.05 score dead-band applied to the recent category only
28
+ - Watch ingestion now advances `byteOffset` by bytes actually read in each cycle, preventing duplicate processing when files grow during read.
29
+ - Watch state saves are now atomic (temp file + rename), preventing partial-write corruption on process crashes.
30
+
31
+ ## 0.5.0 (2026-02-17)
32
+
5
33
  ### Added
6
34
  - `_meta` table with schema version stamp for future migrations
7
35
  - `agenr db version` command to print schema version metadata
36
+ - `agenr daemon start|stop|restart` commands
37
+ - `agenr daemon install --dir/--platform/--node-path` options for explicit daemon configuration
38
+ - `entries.platform` column (with index) to tag knowledge by platform (`openclaw|claude-code|codex`, NULL for legacy entries)
39
+ - `--platform` filters/tags across commands:
40
+ - `agenr recall --platform`
41
+ - `agenr context --platform`
42
+ - `agenr store --platform`
43
+ - `agenr ingest --platform`
44
+ - `agenr consolidate --platform`
45
+ - `agenr db export --platform`
46
+ - MCP tool support for platform:
47
+ - `agenr_recall` accepts optional `platform` filter
48
+ - `agenr_store` accepts optional `platform` tag
8
49
 
9
50
  ### Changed
10
51
  - `agenr db stats` output now includes schema version
52
+ - `agenr db stats` now includes per-platform breakdown
53
+ - `agenr daemon install` now uses smart platform defaults and writes `watch --dir <path> --platform <name>` instead of `watch --auto`
54
+ - `agenr daemon install` now prefers stable node symlinks (Homebrew) when `process.execPath` is version-specific; use `--node-path` to override
55
+ - `agenr watch --auto` is deprecated; `agenr watch --platform <name>` is now the standard invocation and auto-resolves the default platform directory when `--dir` is omitted
56
+
57
+ ## 0.4.1 (2026-02-17)
11
58
 
12
- ## 0.4.0
59
+ ### Fixed
60
+ - npx symlink handling: isDirectRun check now uses realpathSync to resolve npx symlinks correctly
61
+
62
+ ## 0.4.0 (2026-02-15)
13
63
 
14
64
  ### Added
15
65
  - `agenr context` command - generate context files for AI tool integration
16
66
  - `agenr watch --context` - auto-refresh context file after each extraction cycle
17
67
  - `agenr daemon` - launchd daemon management for background watching
68
+ - `agenr consolidate` - knowledge base cleanup with rule-based and LLM-assisted merging
69
+ - Online dedup at write time (mem0-style dedup with 3 cosine bands)
70
+ - Post-extraction LLM dedup pass
71
+ - Concurrent chunk extraction
72
+ - Smart filtering before chunking
73
+ - Rate limit protection for chunk extraction
74
+ - Graceful shutdown for long-running commands (SIGINT/SIGTERM)
75
+ - Ingest auto-retry for failed files
76
+ - Source adapter refactor with timestamp preservation
77
+ - Watch WAL checkpointing
18
78
 
19
79
  ### Changed
20
80
  - Embedding dimensions upgraded from 512 to 1024 (text-embedding-3-small)
@@ -24,26 +84,21 @@
24
84
  - Session-start recall no longer dominated by stale todos (todo staleness penalty)
25
85
  - Consolidate releases DB lock after WAL checkpoint, not before
26
86
 
27
- ## 0.3.1
28
-
29
- ### Added
30
- - `agenr consolidate` - knowledge base cleanup with rule-based and LLM-assisted merging
31
-
32
- ## 0.3.0
87
+ ## 0.3.0 (2026-02-15)
33
88
 
34
89
  ### Added
35
90
  - `agenr watch` - live file watcher with auto-extraction
36
91
  - `agenr ingest` - bulk ingestion of markdown, plaintext, and JSONL
37
92
  - `agenr mcp` - MCP server for cross-tool AI memory (recall, store, extract)
38
93
 
39
- ## 0.2.0
94
+ ## 0.2.0 (2026-02-14)
40
95
 
41
96
  ### Added
42
97
  - `agenr store` - smart dedup with cosine similarity bands
43
98
  - `agenr recall` - recall with scoring and budget-constrained retrieval
44
99
  - `agenr db` subcommands (stats, export, reset, path)
45
100
 
46
- ## 0.1.0
101
+ ## 0.1.0 (2026-02-14)
47
102
 
48
103
  ### Added
49
104
  - `agenr extract` - structured knowledge extraction from conversation transcripts
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # agenr
1
+ # AGENR
2
2
 
3
- **/eɪ.dʒɛn.ɚ/** (AY-GEN-ER) - local-first memory for AI agents.
3
+ **AY-JEN-ER** - Human memory for AI agents.
4
4
 
5
- Your AI forgets everything between sessions. agenr fixes that.
5
+ Your AI forgets everything between sessions. AGENR fixes that.
6
6
 
7
7
  It extracts structured knowledge from your OpenClaw conversation transcripts - facts, decisions, preferences, todos, relationships, events, lessons - and stores them in a local database with semantic search. Entries strengthen when reinforced, decay when stale, and resolve contradictions. It's not a search engine. It's memory that gets healthier with use.
8
8
 
@@ -10,9 +10,9 @@ One local database. Your memory stays on your machine.
10
10
 
11
11
  ## What you need
12
12
 
13
- agenr uses embeddings to make your memory searchable. The best setup we've found: an **OpenAI API key** with `text-embedding-3-small`. Embeddings cost fractions of a penny per operation - a full ingestion of 100+ session transcripts runs about $0.10 total.
13
+ AGENR uses embeddings to make your memory searchable. The best setup we've found: an **OpenAI API key** with `text-embedding-3-small`. Embeddings cost fractions of a penny per operation - a full ingestion of 100+ session transcripts runs about $0.10 total.
14
14
 
15
- agenr also supports **OpenAI Pro subscriptions** and **Anthropic Claude subscriptions** (no API key needed) for the LLM extraction step. But for the best balance of speed, accuracy, and cost, we recommend `gpt-4o-mini` with an API key. `agenr setup` walks you through all of this.
15
+ AGENR also supports **OpenAI Pro subscriptions** and **Anthropic Claude subscriptions** (no API key needed) for the LLM extraction step. But for the best balance of speed, accuracy, and cost, we recommend `gpt-4o-mini` with an API key. `agenr setup` walks you through all of this.
16
16
 
17
17
  ```bash
18
18
  export OPENAI_API_KEY=sk-... # for embeddings + extraction
@@ -85,7 +85,7 @@ Done. Your agent now has persistent memory that survives compaction, session res
85
85
 
86
86
  ## What happens when you ingest
87
87
 
88
- agenr reads your OpenClaw session transcripts, filters out noise (tool calls, file dumps, boilerplate - about 80% of a typical session), and extracts structured knowledge entries:
88
+ AGENR reads your OpenClaw session transcripts, filters out noise (tool calls, file dumps, boilerplate - about 80% of a typical session), and extracts structured knowledge entries:
89
89
 
90
90
  ```
91
91
  agenr ingest ~/.openclaw/agents/main/sessions/ --glob '**/*.jsonl'
@@ -113,10 +113,10 @@ agenr recall "package manager"
113
113
  The watcher keeps your memory current as you work. It tails your session files, extracts new knowledge every few minutes, and stores it. If you ingested history first, watch resumes right where ingest left off - no re-processing.
114
114
 
115
115
  ```bash
116
- # Watch your OpenClaw sessions directory
117
- agenr watch --dir ~/.openclaw/agents/main/sessions/
116
+ # Watch your OpenClaw sessions directory (auto-resolves the default path)
117
+ agenr watch --platform openclaw
118
118
 
119
- # Auto-detect your session directory
119
+ # Deprecated: --auto still works (defaults to OpenClaw) but will be removed in a future version
120
120
  agenr watch --auto
121
121
 
122
122
  # Install as a background daemon (macOS launchd)
@@ -128,7 +128,7 @@ agenr daemon logs
128
128
  You can also auto-refresh a context file that AI tools read on startup:
129
129
 
130
130
  ```bash
131
- agenr watch --auto --context ~/.agenr/CONTEXT.md
131
+ agenr watch --platform openclaw --context ~/.agenr/CONTEXT.md
132
132
  ```
133
133
 
134
134
  ## How it works
@@ -150,7 +150,7 @@ Transcript -> Filter -> Extract -> Store -> Recall
150
150
 
151
151
  ## MCP integration
152
152
 
153
- agenr exposes three MCP tools: `agenr_recall`, `agenr_store`, `agenr_extract`. Any tool that speaks MCP can use your memory.
153
+ AGENR exposes three MCP tools: `agenr_recall`, `agenr_store`, `agenr_extract`. Any tool that speaks MCP can use your memory.
154
154
 
155
155
  **OpenClaw** (via [mcporter](https://mcporter.dev)):
156
156
  ```bash
@@ -164,6 +164,8 @@ Verify with `mcporter list agenr`. See [docs/OPENCLAW.md](./docs/OPENCLAW.md) fo
164
164
  | Command | What it does |
165
165
  | --- | --- |
166
166
  | `agenr setup` | Interactive configuration |
167
+ | `agenr config` | Show and update agenr configuration |
168
+ | `agenr auth` | Authentication status and diagnostics |
167
169
  | `agenr ingest <paths...>` | Bulk-ingest files and directories |
168
170
  | `agenr extract <files...>` | Extract knowledge from text |
169
171
  | `agenr store [files...]` | Store entries with semantic dedup |
@@ -173,8 +175,7 @@ Verify with `mcporter list agenr`. See [docs/OPENCLAW.md](./docs/OPENCLAW.md) fo
173
175
  | `agenr consolidate` | Clean up and merge near-duplicates |
174
176
  | `agenr context` | Generate context file for AI tool integration |
175
177
  | `agenr mcp` | Start MCP server (stdio) |
176
- | `agenr db stats` | Database statistics |
177
- | `agenr db version` | Database schema version |
178
+ | `agenr db <cmd>` | Database management (stats, version, export, reset, path, check, rebuild-index). Run `agenr db --help` for all subcommands. |
178
179
 
179
180
  Full reference: [docs/CLI.md](./docs/CLI.md) | [docs/CONFIGURATION.md](./docs/CONFIGURATION.md)
180
181
 
@@ -189,7 +190,7 @@ Deep dive: [docs/ARCHITECTURE.md](./docs/ARCHITECTURE.md)
189
190
 
190
191
  ## Status
191
192
 
192
- Alpha. The core pipeline is stable and tested (369 tests). We use it daily managing thousands of knowledge entries across OpenClaw sessions.
193
+ Alpha. The core pipeline is stable and tested (445 tests). We use it daily managing thousands of knowledge entries across OpenClaw sessions.
193
194
 
194
195
  What works: extraction, storage, recall, MCP integration, online dedup, consolidation, smart filtering, live watching, daemon mode.
195
196
 
@@ -201,7 +202,7 @@ The big labs are building bigger brains. We're building better memory. Those are
201
202
 
202
203
  Current AI's bottleneck isn't intelligence - it's continuity. A slightly less brilliant model with accumulated context might be more useful than a brilliant amnesiac. What makes a senior engineer senior isn't raw IQ - it's patterns seen, mistakes remembered, approaches that worked. That's memory.
203
204
 
204
- agenr is local-first because your memory is yours. It's structured (not just vectors) because "what did we decide about X?" needs a real answer, not a similarity score. It's open source because memory infrastructure should be shared.
205
+ AGENR keeps your memory on your machine because it is yours. It's structured (not just vectors) because "what did we decide about X?" needs a real answer, not a similarity score. It's open source because memory infrastructure should be shared.
205
206
 
206
207
  ## Troubleshooting
207
208
 
@@ -4,9 +4,11 @@ import { Model, Api, Context, SimpleStreamOptions, AssistantMessageEvent, Assist
4
4
  declare const KNOWLEDGE_TYPES: readonly ["fact", "decision", "preference", "todo", "relationship", "event", "lesson"];
5
5
  declare const EXPIRY_LEVELS: readonly ["core", "permanent", "temporary"];
6
6
  declare const SCOPE_LEVELS: readonly ["private", "personal", "public"];
7
+ declare const KNOWLEDGE_PLATFORMS: readonly ["openclaw", "claude-code", "codex"];
7
8
  type KnowledgeType = (typeof KNOWLEDGE_TYPES)[number];
8
9
  type Expiry = (typeof EXPIRY_LEVELS)[number];
9
10
  type Scope = (typeof SCOPE_LEVELS)[number];
11
+ type KnowledgePlatform = (typeof KNOWLEDGE_PLATFORMS)[number];
10
12
  type AgenrProvider = "anthropic" | "openai" | "openai-codex";
11
13
  type AgenrAuthMethod = "anthropic-oauth" | "anthropic-token" | "anthropic-api-key" | "openai-subscription" | "openai-api-key";
12
14
  interface AgenrStoredCredentials {
@@ -34,6 +36,8 @@ interface KnowledgeEntry {
34
36
  content: string;
35
37
  subject: string;
36
38
  canonical_key?: string;
39
+ platform?: KnowledgePlatform;
40
+ project?: string;
37
41
  importance: number;
38
42
  expiry: Expiry;
39
43
  scope?: Scope;