diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json
index 7fe3ea1feb..f1c6698cc1 100644
--- a/.cursor-plugin/plugin.json
+++ b/.cursor-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "agentmemory",
- "version": "0.9.29",
+ "version": "0.9.30",
"description": "Persistent memory for Cursor: auto-captures sessions, prompts, and tool use via hooks, recalls with hybrid BM25 + vector + graph search, and exposes 54 memory tools over MCP. Keyless by default, runs entirely on your machine.",
"author": {
"name": "Rohit Ghumare",
diff --git a/.env.example b/.env.example
index 7afb54b8ae..6f112252d5 100644
--- a/.env.example
+++ b/.env.example
@@ -150,6 +150,7 @@
# AGENTMEMORY_IMAGE_EMBEDDINGS=true # Enable image embeddings when an image provider is present (experimental).
# AGENTMEMORY_AUDIT_RETENTION_MONTHS=6 # Drop whole audit-log month scopes older than N months on a daily sweep. Default 0 = keep audit history forever.
# AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES=33554432 # Largest legacy mem:audit scope file the one-time migration will read locally. Default 32 MiB; bigger or unreadable stores are left frozen.
+# AGENTMEMORY_AUDIT_INDEX_PERSIST=false # Set to 1 or true to audit index migration and cleanup writes (debugging only)
# AGENTMEMORY_INDEX_SAVE_INTERVAL_MS=600000 # Minimum time between search index saves; shutdown and deletes still save immediately.
# AGENTMEMORY_VECTOR_BUCKET_SIZE=500 # Vectors held per storage bucket before a new bucket opens; a save only rewrites buckets it changed.
# AGENTMEMORY_VECTOR_BACKFILL_MAX=500 # Batch size for re-embedding vectors missing since the last save (continues across restarts); also caps the whole-store opt-in per boot.
diff --git a/AGENTS.md b/AGENTS.md
index 02de31a366..b7b5bb4d1b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -11,29 +11,19 @@ agentmemory is a persistent memory system for AI coding agents, built on iii-eng
## Consistency Rules
-**When adding or removing MCP tools, you MUST update ALL of the following:**
+**Before every commit, run `npm run docs:sync` and commit what it changes.** It computes MCP tool counts (all, core, local fallback), REST endpoints, skills, hooks, tests, iii functions, source files, lines of code and KV scopes from the source, and rewrites them in README.md, the translated READMEs, AGENTS.md, INSTALL_FOR_AGENTS.md, plugin manifests, integration READMEs, the stat badges and the `src/index.ts` banner. The last synced values live in `scripts/docs-sync.state.json`; commit that file with the rest. `npm run docs:check` exits non-zero when anything is out of date. When the sync prints `check left in `, open that line: either fix it by hand or add its noun to the fact in `scripts/docs-sync.ts` so the next sync catches it. Never hand-edit these numbers or versions in the docs; change the source and sync.
+
+**When adding or removing MCP tools, update:**
1. `src/mcp/tools-registry.ts` — tool definition + `getAllTools()` array
2. `src/mcp/server.ts` — handler case in the `mcp::tools::call` switch
3. `src/triggers/api.ts` — REST endpoint registration
-4. `src/index.ts` — function registration + endpoint count in the log line
+4. `src/index.ts` — function registration
5. `test/mcp-standalone.test.ts` — tool count assertion
-6. `README.md` — tool counts (search for "MCP tools")
-7. `plugin/.claude-plugin/plugin.json` — tool count in description
-8. `plugin/plugin.json` and `plugin/.mcp.copilot.json` (when present) — tool count or MCP exposure
-**When adding REST endpoints, you MUST update:**
+**When adding REST endpoints, update:**
1. `src/triggers/api.ts` — endpoint registration
-2. `src/index.ts` — endpoint count in the log line
-3. `README.md` — endpoint count (search for "REST endpoints" and "endpoints on port")
-
-**When bumping version, you MUST update ALL of the following:**
-1. `package.json` — version field
-2. `src/version.ts` — VERSION constant and type union
-3. `src/types.ts` — ExportData version union
-4. `src/functions/export-import.ts` — supportedVersions set
-5. `test/export-import.test.ts` — version assertion
-6. `plugin/.claude-plugin/plugin.json` — version field
-7. `plugin/plugin.json` (when present) — version field
+
+**When bumping version, change only `package.json`.** `npm run docs:sync` carries the new version into `src/version.ts`, the `src/types.ts` ExportData union, the `supportedVersions` set in `src/functions/export-import.ts`, every plugin and package manifest that shared the old version, the deploy templates, the AGENTS.md stats heading, and CHANGELOG.md (the Unreleased section becomes the new version with today's date, plus its compare link).
**When adding new KV scopes:**
1. `src/state/schema.ts` — add to the KV object
@@ -111,17 +101,17 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
## Testing
-- All tests must pass before PR: `npm test` (1,596+ tests)
+- Before every commit run, in order: `npm run build`, `npm run skills:gen`, `npm run docs:sync`, `npm run skills:check`, `npm test` (2,500+ tests). Commit anything the generators changed. CI runs the same build, skills check and tests.
- Before any npm publish: `npm run release:gate` must pass. It installs the packed tarballs into a clean home and runs capture, recovery, restart, export/import, MCP and status checks against the installed CLI (see CONTRIBUTING.md, Release process)
- Mock pattern: `vi.mock("iii-sdk")` with mock `sdk.trigger`, `kv.get/set/list`
- Test files go in `test/` with `.test.ts` extension
- Follow existing patterns in `test/crystallize.test.ts` for function tests
-## Current Stats (v0.9.29)
+## Current Stats (v0.9.30)
- 54 MCP tools (8 visible by default, `AGENTMEMORY_TOOLS=all` for all)
- 138 REST endpoints
- 6 MCP resources, 3 MCP prompts
- 12 hooks, 17 skills
-- 260+ iii functions
-- 1,596+ tests
+- 311+ iii functions
+- 2,500+ tests
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5d5c598570..77bc391555 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,35 +6,128 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
-### Changed
+## [0.9.30] - 2026-10-06
+
+Scale, durability and safety release. The iii engine moves from 0.11.2 to 0.22.1. The stores that grew without bound on shared daemons (graph provenance, the audit log, the vector index, the viewer stream backlog) are bounded and heal themselves at boot. Capture is durable end to end: the server accepts each observation into a persistent inbox with a restart-safe event id, and hooks keep an offline spool while the server is down. Vectors survive a force-kill through a pending log. The REST API requires auth by default. Redis becomes an opt-in state backend, and the viewer is rebuilt around one snapshot plus live stream events with a Health page backed by `GET /agentmemory/status`. Every publish now goes through a release gate that installs the packed tarballs and runs capture and recovery against them. Contributions from david-waltermire, a652, cbsincool, dmazhukov and Tyxiel, with earlier work by DaveCole, Srinath279, joyjit and cristianbdev carried into merged PRs.
+
+### Breaking changes
+
+- **Auth is on by default** (#1462). When `AGENTMEMORY_SECRET` is not set, the server generates a secret into `~/.agentmemory/secret` (mode 0600) on first start. The CLI, viewer, hooks, MCP server and shim, `agentmemory connect` configs and the bundled integrations read it for loopback URLs, so they keep working with no change. Hand-written requests to `:3111` now need `Authorization: Bearer $(cat ~/.agentmemory/secret)`. An explicit `AGENTMEMORY_SECRET` still wins, and mesh sync still requires an explicit one.
+- **File import and export paths are confined** (#1462). `/compress-file`, `/replay/import-jsonl`, `/graph/import-graphify`, the Obsidian export and `/migrate` resolve symlinks and only accept paths inside the data dir, `~/.agentmemory` or a directory listed in `AGENTMEMORY_IMPORT_ROOT`. `/replay/import-jsonl` also keeps its default `~/.claude/projects`.
+- **Browser writes need JSON and an allowed origin** (#1462). `POST`, `PUT`, `PATCH` and `DELETE` requests with a body must send `Content-Type: application/json`, and a present `Origin` header must be a loopback origin for the configured ports, the viewer's own origin, or listed in `VIEWER_ALLOWED_ORIGINS`. Clients that send no `Origin` (CLI, hooks, MCP, curl) are unaffected.
+- **`AGENTMEMORY_VECTOR_BACKFILL_MAX` is now a batch size** (#1467). Recovery re-embeds missing vectors in batches of this size until the backlog is empty, across restarts, instead of stopping at the cap once per boot.
+- **iii engine 0.22.1** (#1396, #1397). Keep the `iii-` prefixed builtin worker names (`iii-http`, `iii-state`, `iii-queue`, `iii-pubsub`, `iii-cron`) in any custom config: on 0.22.1 the bare names resolve to standalone registry workers.
+- **Hooks skip agentmemory's own tools** (#1452). PostToolUse no longer captures `memory_*` MCP calls or `toolsearch`, `listmcpresources` and `fetchmcpresource`.
+- **Changed response shapes.**
+ - `mem::forget`, `mem::governance-delete` and `mem::governance-bulk` count only records that were really deleted. Absent ids come back in `notFound` and failed deletes in `failed` and `failures`, with `success: false` when anything failed. `governance-bulk` refuses an empty filter and unsupported keys on both the dry run and the live call (#1449).
+ - `GET /agentmemory/audit` and the `memory_audit` MCP tool return `{ entries, legacyFrozen, legacyFrozenBytes }`; the MCP tool used to return a bare list (#1419).
+ - `GET /agentmemory/memories` returns newest first and adds `nextCursor` (plus `search` and `facets` when requested) (#1433).
+ - `GET /agentmemory/export` returns 413 with the refusal body (`oversized`, `bytes`, `limitBytes`, `stoppedAt`) instead of 200 when the export is too large (#1422, #1449).
+ - `POST /agentmemory/session/end` for an unknown, malformed or already completed session returns 200 with `ended: false` and writes nothing (#1252).
+ - `memory_patterns` / `mem::patterns` reads the 50 most recent sessions by default (`limit`, max 500) and stops after 5,000 observations (#1424).
+ - Consolidation decay applies at most once per decay period, and `results.decay` reports `{ scanned, written }` per tier (#1417).
+
+### Upgrade notes
+
+- Scripts or tools that call the REST API by hand on `:3111`: add `Authorization: Bearer $(cat ~/.agentmemory/secret)`, or set your own `AGENTMEMORY_SECRET` and send that.
+- Imports or exports from folders outside `~/.agentmemory` and the data dir: list those folders in `AGENTMEMORY_IMPORT_ROOT` (separate several with `:`, or `;` on Windows).
+- A web page on another origin that writes through the viewer: add its origin to `VIEWER_ALLOWED_ORIGINS`.
+- Nothing else is required. Stores load unchanged, and the one-time migrations below run by themselves.
-- **iii engine and `iii-sdk` move from 0.11.2 to 0.22.1, with `@iii-dev/helpers` 0.22.1 alongside.** Same release on both sides, as before; the CLI downloads the pinned engine into `~/.agentmemory/bin`, the bundled `docker-compose.yml` pulls `iiidev/iii:0.22.1`, and `agentmemory upgrade` pins both packages to the version this package was built against. The deploy templates under `deploy/` install the published npm package, so their engine pair moves together with `AGENTMEMORY_VERSION` at release time. 0.22.x is the last engine line before 0.23 removes the `config.yaml` worker lifecycle the CLI relies on; it carries the upstream fix that keeps HTTP routes owned by the reconnecting worker, so `/agentmemory/*` no longer answers 404 after the engine reconnects (#1013), and its Node SDK bounds WebSocket connect attempts and detects half-open sockets. The bundled configs keep the `iii-` prefixed builtin workers (`iii-http`, `iii-state`, `iii-queue`, `iii-pubsub`, `iii-cron`): on 0.22.1 the unprefixed names resolve to the standalone registry workers, which is the 0.23 migration. Existing state stores load unchanged.
-- **Runtime config is re-seeded on every start.** Engines from 0.19.4 on persist each builtin worker's `config:` block on first boot (0.22 writes `config/.yaml` next to the config file; earlier engines wrote `data/configuration/` under the working directory) and treat that copy as the source of truth afterwards, which would have made `--port`, `--instance` and data-dir changes silently ineffective after the first run. The CLI now clears those persisted entries in both locations right before it spawns the engine, so the runtime config it renders from your environment is the seed every time. If one of them cannot be removed, `agentmemory start` stops with the path instead of launching an engine that would ignore the requested ports. The bundled `docker-compose.yml` keeps the same directory on a tmpfs so container starts behave the same way.
-- Dependabot no longer proposes `iii-sdk` bumps; the engine pin and the SDK version are updated together by hand.
-- The deploy Dockerfiles (`deploy/fly`, `railway`, `render`, `coolify`) refuse to build when `III_VERSION` and `III_SDK_VERSION` differ, so overriding the engine tag alone can no longer produce a worker that speaks the wrong wire protocol.
-- **The pinned engine starts quiet.** The CLI spawns it with `--no-update-check` (no update or security-advisory lookups against GitHub at boot) and with iii's anonymous usage telemetry off (`III_TELEMETRY_ENABLED=false` unless you export the variable yourself); the bundled compose file passes the same flag and variable.
-- The deploy entrypoints (`deploy/*/entrypoint.sh`) generate the same observability settings as the bundled `iii-config.yaml` (`sampling_ratio: 0.1`, console log output off) instead of full sampling with console logs, the combination behind the log feedback loop fixed in 0.9.22.
-- The README section on extending agentmemory with registry workers no longer lists builtins that already ship in `iii-config.yaml`, uses the current registry names (`database` replaced `iii-database`), and says where a custom config lives (`~/.agentmemory/iii-config.yaml`).
+### What happens on the first start
+
+- **Graph provenance is compacted once in the background.** Every node, edge, superseded edge and the cached snapshot is trimmed to 32 observation ids in slices, without blocking boot, search or the viewer. Progress is saved and resumes after a restart. `AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=false` skips it; `POST /agentmemory/graph/compact` runs it by hand (#1455).
+- **The audit log moves to monthly scopes** (`mem:audit:YYYY-MM`) with a one-time background migration. A legacy scope larger than `AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES` (default 32 MiB) or unreadable is left frozen and reported as `legacyFrozen` (#1419).
+- **The vector index migrates to buckets** (`AGENTMEMORY_VECTOR_BUCKET_SIZE`, default 500) by copying vectors, with no embedding calls. BM25 is no longer persisted and is rebuilt at every boot (#1416).
+- **State is saved every 2 s** instead of 5 s, and `agentmemory stop` waits for the engine flush, so it takes a few seconds longer (#1457, #1449).
+- **Stale sessions are marked abandoned** after `AGENTMEMORY_SESSION_SWEEP_STALE_HOURS` (default 24) by an hourly sweep that deletes nothing (#1453).
+- **Viewer stream groups.** Observations stop writing to per-session `mem-live` groups and the shared `viewer` group is capped at `AGENTMEMORY_VIEWER_STREAM_MAX` (default 500). Existing per-session groups are left in place (#1420).
### Added
-- **`GET /agentmemory/status` and a Health tab in the viewer.** One report of what is wrong and how to fix it: the health monitor state and alerts, the LLM and embedding providers and the circuit breaker, functions failing on at least 20% of their calls (with a provider-specific fix for summarize, compress and graph extraction), observations missing from the search index (the same exact check the boot reconcile runs), graph snapshot age, ports, uptime, the pinned engine version and every feature flag with how to enable it. Browsers get an HTML page with no scripts and a strict CSP; everything else gets JSON (`?format=json` or `?format=html` force either). Every probe is time-boxed at 5 s so a slow store cannot hang the page. Uses the same bearer auth as the rest of the API.
-- **`agentmemory console`** launches the iii web console (workers, functions, triggers, queues, traces) through the pinned engine, against the ports agentmemory resolved, one port above the viewer by default (`--console-port` overrides). Engine 0.22 ships the console as part of `iii` and downloads it on first use, so the "install iii console?" prompt on start and the `skipConsoleInstall` preference are gone; the ready panel now points at the command instead.
+- **Durable capture** (#1460). Hooks send a stable event id with every observation (the host tool use id when present, otherwise a hash of the event). The server writes each event to a capture inbox before storing it, keeps completed ids for `AGENTMEMORY_CAPTURE_DEDUP_HOURS`, and answers a replay with the existing observation. Failed writes retry with backoff, also after a restart, and end as dead letters shown on `/status`, the viewer Health page and `GET /agentmemory/capture`, with `POST /agentmemory/capture/retry` to retry them.
+- **Offline hook spool** (#1460, #1468). When the server is down, times out or returns a 5xx, hooks keep a copy of the observation in a bounded private spool under the data dir until the engine has saved it. The spool drains at boot and from the next hook that reaches the server. New: `agentmemory capture [--drain]` and `POST /agentmemory/capture/drain`.
+- **Vector pending log** (#1467). Every vector added to or removed from the live index is also written to a small pending log. Boot replays it after the snapshot with 0 embedding calls, and whatever is still missing is re-embedded as a durable backlog that resumes after a restart instead of stopping at a 500 cap. `/status` and the viewer show the log size and a paused backfill.
+- **Release gate** (#1463). `npm run release:gate` packs `@agentmemory/agentmemory` and `@agentmemory/mcp`, installs both tarballs into a clean home and runs named scenarios against the installed CLI: capture through the bundled hooks, offline capture recovered from the spool, replay dedup after a force kill, dead letters that survive a restart, vectors surviving a crash, stop and start, export and import, the MCP shim, the viewer and `/status`. A Release gate workflow runs it on Ubuntu and macOS.
+- **Capture cost bench** (#1464). `npm run bench:capture-costs` measures disk bytes per state scope, engine and worker memory and CPU, hook latency, provider requests, agent-visible context bytes and force-kill recovery, with separate capture and recovery budgets in `benchmark/capture-costs-budgets.json` and a figure in `docs/benchmarks/capture-costs.svg`. Optional Ollama, Redis and crash-offline variants.
+- **Codex plugin package** (#1459). The Codex plugin bundles a small stdio bridge that forwards tools, resources and prompts to the configured agentmemory daemon and reports connection errors instead of falling back to a separate store. Authenticated non-loopback connections require HTTPS. `npm run plugin:pack:codex` builds a local package with the six Codex hooks and a review package without lifecycle hooks, and `npm run plugin:verify:published` refuses a release whose runtime, MCP shim and iii versions do not match.
+- **Rebuilt viewer that streams every page** (#1433, #1407). One snapshot on connect (`GET /agentmemory/viewer/snapshot`, `GET /agentmemory/counts`), then live `.created/updated/deleted` events with no polling. 12 tabs in four groups with live counts, deep links, keyboard shortcuts and a mobile menu, a memories detail panel with version chain, diff and provenance, sessions with an inline timeline, and a searchable graph. Cursor pagination and facets on memories, sessions and observations, `GET /graph/node` and `GET /observations/locate` back it.
+- **`GET /agentmemory/status` and a Health tab in the viewer** (#1408). One report of what is wrong and how to fix it: providers and circuit breaker, failing functions, observations missing from the search index, index save state per leg (#1415), the state backend, graph compaction progress, capture inbox and spool, ports, the pinned engine version and every feature flag. HTML for browsers, JSON otherwise.
+- **`GET /agentmemory/consolidation/status`** and a "Memory layers" panel (#1407).
+- **Opt-in Redis backend for state and streams**: `AGENTMEMORY_STATE_BACKEND=file|redis` and `AGENTMEMORY_REDIS_URL` (#1425). Use one Redis server per instance, and move data with `agentmemory export` and `import` when switching.
+- **`POST /agentmemory/graph/compact`** trims oversized node, edge, edge history and snapshot provenance in slices (#1454, carries #1445 by david-waltermire), and **`AGENTMEMORY_GRAPH_COMPACT_ON_BOOT`** runs it once after upgrade (#1455).
+- **Stale session sweep**: `AGENTMEMORY_SESSION_SWEEP_ENABLED` and `AGENTMEMORY_SESSION_SWEEP_STALE_HOURS` (#1453, carries #1411 by cristianbdev).
+- **Capture filters for hooks**: `AGENTMEMORY_CAPTURE_ALLOW`, `AGENTMEMORY_CAPTURE_DENY`, `AGENTMEMORY_CAPTURE_OUTPUT_MAX` (default 8000) and `AGENTMEMORY_PRE_COMPACT_BUDGET` (default 1500, 0 disables) (#1452, carries #994 by joyjit).
+- **`AGENTMEMORY_AUDIT_INDEX_PERSIST`** (off by default) re-enables index persistence audit rows for debugging (#1182 by dmazhukov).
+- **`AGENTMEMORY_AUDIT_RETENTION_MONTHS`** and **`AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES`** for the monthly audit log (#1419).
+- **`AGENTMEMORY_STATE_SAVE_INTERVAL_MS`**, **`AGENTMEMORY_INDEX_SAVE_INTERVAL_MS`**, **`AGENTMEMORY_VECTOR_BUCKET_SIZE`**, **`AGENTMEMORY_VECTOR_BACKFILL`** and **`AGENTMEMORY_VIEWER_STREAM_MAX`** (#1457, #1415, #1416, #1420).
+- **`agentmemory console`** launches the iii web console through the pinned engine; the "install iii console?" prompt and the `skipConsoleInstall` preference are gone (#1397).
+- **Multi-instance installs**: `--instance N` gets its own port quartet, data directory and lifecycle state, and `--port` derives the other ports (#892).
+- Procedures are extracted from finished sessions when consolidation is on and an LLM provider is configured (#1407).
+- `memory_patterns` takes an optional `limit` (#1424). `POST /lessons` accepts `sourceIds`, and `mem::evolve` returns 409, 400 and 404 errors (#1433).
+- **OpenCode 2 support in the OpenCode plugin** (#1476, building on #1451 by Tyxiel). One `agentmemory-capture.ts` serves both plugin APIs: OpenCode 2 loads its `setup()` entry and OpenCode 1.x keeps the existing hooks. On OpenCode 2 it captures prompts, tool calls with their output, the assistant's answer, step and compaction events, injects memory on every model call, and requests a summary when a run finishes. Checked in live sessions on OpenCode 2.0.24, 1.18.34 and 1.17.10.
### Fixed
-- **The "Memory elevated" alert no longer fires on a healthy process (#1406).** The health check divided the heap in use by the heap Node had allocated so far, which Node keeps just above what is in use, so a normal process read 90% or more and raised the alert once its memory passed 512 MB. The check now divides by the V8 heap limit, which is about 4 GB on 64-bit Node by default, and the viewer's Heap gauge shows used against that limit. The reported 589 of 629 MB is 14% of the limit and no longer alerts.
-- **The viewer updates from the live stream instead of re-fetching, and stops blinking.** The dashboard used to wipe itself to "Loading dashboard..." and re-fetch everything on a 30 s timer and on every stream event; on an idle store that was 73 rebuilds and 20 requests a minute, and 21 live events cost 200 requests. The worker now pushes `session.updated`, `session.deleted`, `memory.updated` and `memory.deleted` on the `mem-live` viewer group next to the existing observation and `session.activity` events (which the viewer used to drop because it read the wrong field), and the viewer applies them to what is on screen: sessions, observation counts, session status and the memory total update with zero requests, redraws are batched to at most one every 250 ms and skipped when nothing changed. The 30 s timer is gone, no refresh path blanks a loaded view, and polling remains only as the fallback when the stream cannot connect (#921, #1340). The viewer now connects with the stream mode engine 0.22 serves first instead of failing twice on the other one. Live buffers on the Timeline and Activity tabs are capped at a few hundred entries so a large stream backlog cannot freeze the tab (#609). When the stream reconnects, the loaded views re-fetch once so changes made while it was down show up, and a list that was loading when live events arrived replays them, so a deleted session does not come back. Session counts no longer reload or blank the open session detail, bursts of memory events coalesce into one list reload, and with an isolated agent scope (`AGENT_ID` plus `AGENTMEMORY_AGENT_SCOPE=isolated`) the worker only pushes that agent's sessions and memories.
-- **A failed dashboard refresh keeps the last data.** Panels that fail to refresh keep their previous values behind a "could not refresh" note instead of flipping to the new-install screen; a first load that cannot reach the API shows a retry button (#1340).
-- **Dashboard numbers match the API.** The Memories card uses the server total instead of counting a capped list (#1279, #951), token savings only counts sessions that produced observations (#944), and the Graph Nodes card shows when its snapshot was taken.
-- **Session summaries stored as objects render as text instead of `[object Object]`** (#1229), and tags stored as a comma-separated string no longer break the Actions, Lessons or Sessions views (#906).
-- **`GET /agentmemory/memories` returns newest first**, so a `limit` page shows the latest memories rather than the oldest (#990).
-- **Rebuild Graph asks before replaying the corpus**, ignores repeat clicks while it runs, and reports how many sessions, nodes and edges it produced (#1383).
-- **The dashboard explains consolidation instead of showing three bare counters.** Semantic Memory, Procedural Memory and Consolidation Status are one "Memory layers" panel: each layer says what it is built from, how many items it holds, and whether it is off (with the exact setting to change), waiting (for example "3 of 5 session summaries needed"), ready, active with the last run's output, or failed with the error. The consolidation pipeline now stores each run's per-tier results, served at `GET /agentmemory/consolidation/status`.
-- **Procedures are extracted from finished sessions.** Procedural memory only came from a cross-session pass that needs two pattern memories each seen in two or more sessions, so it stayed empty on almost every install, and `mem::skill-extract` (which turns one session with a summary and three or more observations into a procedure) had no caller. It now runs for the stopping session inside the existing consolidation cooldown, only when consolidation is on and an LLM provider is configured, so it adds at most one LLM call per cooldown window and none on keyless installs.
-- **The viewer reconnects its live stream when the tab becomes visible again** after a sleep or network drop, instead of staying disconnected until a manual reload (#1370).
-- **The search index snapshot is written continuously, not only on clean shutdown.** Every observation, compression result and memory save now schedules the debounced snapshot write, and bulk indexing (import, replay, rebuild) does the same. Before, the BM25/vector snapshot was written only by a graceful shutdown; after a crash, `kill -9` or power loss the worker booted the stale snapshot, skipped the rebuild because the snapshot was not empty, and every observation captured since the last clean stop stayed invisible to search for good. On boot the worker now also compares the loaded snapshot against each session's observation count and re-indexes whatever is missing. Re-adding an observation under an id that is already indexed (compression replacing the synthetic entry) now replaces the index document instead of stacking postings on top of the old ones.
-- **Worker shutdown no longer hangs when the engine is already gone.** The SIGTERM handler waited on a state write that can never land while the SDK is reconnecting, so `agentmemory stop` had to SIGKILL an orphaned worker after its grace period. The final index flush and the SDK shutdown are now time-boxed at 4 s each, with a hard exit at 8 s, and open viewer connections are closed instead of awaited. `agentmemory stop` gives an orphaned worker that full budget before escalating to SIGKILL.
+- **Repeated identical prompts are kept** (#1468). Hooks whose host sends no event id or time now include the hook timestamp in the id, so typing the same prompt twice stores it twice; retries still reuse the stored id.
+- **Cursor prompts are stored once** (#1470). A per-session prompt ledger matches the session-end transcript back-fill against live captures, so a back-filled prompt is answered as a duplicate instead of stored a second time. Live prompts are never deduped by content.
+- **Concurrent spool writers cannot overwrite each other** (#1468), and printed recovery commands (dead letter retry, spool drain, graph compact, the status page example) send the bearer token.
+- **Graph provenance is bounded.** Each node and edge records only its own observation ids, capped at 32, which stops huge graph rows from crash-looping the worker during search (#1454, carries #1445 by david-waltermire).
+- **Search skips graph retrieval when `AGENTMEMORY_GRAPH_WEIGHT=0`** (#1446 by david-waltermire).
+- **A failed graph snapshot read no longer zeroes the snapshot**; the delta is aborted instead (#1384 by cbsincool).
+- **The graph snapshot total can no longer be lower than the nodes it returns** (#1385 by cbsincool).
+- **Ending an unknown session no longer creates a partial row** that hung the sessions listing (#1252 by a652).
+- **Memories and vectors written just before `agentmemory stop` survive the restart** (#1449).
+- **Forget and governance deletes count and audit only real deletions** (#1449).
+- **Export refuses an oversized payload before assembling it** and the REST endpoint returns 413; the MCP shim surfaces the refusal (#1449, #1422).
+- **Session and graph read-modify-write paths take locks**, closing lost updates when several agents share one daemon (#1421).
+- **Hooks no longer exit before their observe request is sent** on a slow start (#1456).
+- **A fresh vector index is checkpointed within 5 s** and observations keep a bounded, sanitized copy of their source for replay and export (#1448).
+- **Runtime config is re-seeded on every start**, so `--port`, `--instance` and data-dir changes take effect after the first run (#1396, #1397).
+- **The "Memory elevated" alert no longer fires on a healthy process** (#1409).
+- **The viewer stops blinking and keeps data on a failed refresh**, and dashboard numbers match the API (#1407).
+- Consolidation and provider detection use the same check, and functions that need an LLM show as off instead of failed (#1433).
+- Worker shutdown no longer hangs when the engine is already gone (#1396).
+- Fresh installs are portable and persistent, and native and Docker removal stops the worker before the engine (#892).
+- **`OPENAI_EMBEDDING_API_KEY` is honored** when the embedding provider is auto-detected or chosen, and wins over `OPENAI_API_KEY`; blank keys count as unset (#1472).
+- **SessionStart context reaches hosts that expect structured hook output.** When the hook input names the `SessionStart` event, context is returned as `hookSpecificOutput.additionalContext`; hosts that send no event name still get plain text (#1472).
+
+### Security
+
+- **Request hardening** (#1462, supersedes #878 by DaveCole and #922 by Srinath279). Auth on by default, origin and content type checks on writes, and confined file paths, as described under Breaking changes. Confined files are replaced only after the new content is fully written, and a destination that is a symlink is refused.
+- **Scrubbing on every write** (#1462). Write functions run the secret scrubber on their input, and compression, summary, crystal, graph, replay, team share, session title, commit message and image description text is scrubbed before storage. New patterns cover PEM private key blocks and credentials in URLs. Stored text is escaped before it goes into the injected context block.
+- **Clients resolve the API secret the same way as the server** (#1462): environment first, then `~/.agentmemory/.env`, then the generated secret file, and the stored secret is only sent to loopback URLs.
+- **Supply chain** (#1461). The automatic engine installer verifies the downloaded archive against a SHA-256 pinned in the CLI for each platform before extracting it, and refuses an unpinned version or platform. `npm run engine:hashes` refreshes the pins. Installer paths reach the shell as arguments, so a home directory containing shell syntax is never evaluated. The CI workflow runs with read-only permissions, and the deploy Dockerfiles check that the copied iii binary matches `III_VERSION`.
+- `GET /agentmemory/status` serves HTML with no scripts under a strict CSP and the same bearer auth as the rest of the API (#1408).
+- The Redis URL stays out of files and output (#1425).
+- `mem::governance-bulk` cannot widen a dry run to the whole store (#1449).
+- The pinned engine starts with `--no-update-check` and iii's anonymous usage telemetry off (#1396).
+- A profile read no longer writes a `share` audit entry (#1433).
+
+### Performance
+
+- **Vectors are stored per key in fill-and-roll buckets**, so a save rewrites a few buckets instead of the whole index and the store no longer hits V8's string limit at about 49,000 vectors (#1416).
+- **Index saves are throttled and each leg reports its own state**, so one failing leg no longer skips the others (#1415).
+- **The audit log lives in monthly scopes** read newest first (#1419).
+- **Session start context and observation lookups use small secondary indexes** instead of listing every session (#1418).
+- **`mem::remember` calls the embedding provider outside the global save lock** (#1423).
+- **`mem::patterns` is bounded** to recent sessions and an observation budget (#1424).
+- **Consolidation decay writes only rows that changed** (#1417).
+- **The viewer stream backlog is bounded** (#1420).
+- **Faster state saves**, `MALLOC_ARENA_MAX=2` for the engine on Linux, and a higher open-file limit in Docker and deploy entrypoints (#1457).
+
+### Docs and internal
+
+- **agent-memory.dev is rebuilt** around use cases and sourced proof: agent sessions showing what memory changes, a view of the 1,571 tokens the next session gets out of a month of history, live GitHub and all-time npm numbers, and new /benchmarks, /security, /privacy, /changelog and /vs comparison pages. It ships robots.txt, a sitemap, llms.txt and llms-full.txt, and link previews now point at agent-memory.dev instead of a parked domain.
+- `npm run docs:sync` and `npm run docs:check` keep the documented counts and versions in README, the translated READMEs and AGENTS.md in step with the code.
+- The README documents auth by default, request rules, file path roots, the capture inbox and spool, and the pending vector log (#1460, #1462, #1467).
+- The README, the config skill reference and `agentmemory --help` document `AGENTMEMORY_III_CONFIG` and the engine bind address, including the Docker engine config (#1472).
+- Code and tests no longer cite issue or PR numbers (#1469).
+- The `index_persist` audit gating suite is restored against bucketed persistence and monthly audit scopes (#1477), originally written by dmazhukov in #1182.
+- Unit tests grew from about 1,700 to more than 2,400.
+- Dependabot no longer proposes `iii-sdk` bumps; the engine pin and the SDK move together by hand (#1396). `dotenv` 18.0.3 (#1430) and `@types/node` 26.6.2 (#1401, #1400).
+- The deploy Dockerfiles refuse to build when `III_VERSION` and `III_SDK_VERSION` differ (#1396).
+- Thanks to MarvinFS (discussion #1358), inix-x, sbynode-ux, ErikBPF and cmondragon023, whose measurements and earlier PRs shaped the scaling work.
## [0.9.29] — 2026-08-16
@@ -168,6 +261,7 @@ Wave release closing several breaking regressions reported against v0.9.26, plus
- `/agentmemory:forget` skill still calls `memory_governance_delete` which only touches `KV.memories` and never observations ([#833](https://github.com/rohitg00/agentmemory/issues/833)). Skill rewrite + new `memory_forget` MCP tool tracked separately.
- `crypto.randomUUID()` global-only on Node <19 ([#715](https://github.com/rohitg00/agentmemory/issues/715)). Drop-in import fix tracked.
+[0.9.30]: https://github.com/rohitg00/agentmemory/compare/v0.9.29...v0.9.30
[0.9.29]: https://github.com/rohitg00/agentmemory/compare/v0.9.28...v0.9.29
[0.9.28]: https://github.com/rohitg00/agentmemory/compare/v0.9.27...v0.9.28
[0.9.27]: https://github.com/rohitg00/agentmemory/compare/v0.9.26...v0.9.27
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7a9a8e45d0..6e58c49d0c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -93,16 +93,7 @@ PRs with commits lacking sign-off will not merge.
## Release process
-Maintainers cut releases. Every bump touches these files in lockstep (the consistency tests fail if the trio of doc counts or any version drifts):
-
-1. `package.json`
-2. `src/version.ts`
-3. `plugin/.claude-plugin/plugin.json`
-4. `plugin/plugin.json`
-5. `plugin/.codex-plugin/plugin.json`
-6. `packages/mcp/package.json`
-7. `src/types.ts` (`ExportData.version` union)
-8. `src/functions/export-import.ts` (`supportedVersions` Set)
+Maintainers cut releases. To bump the version, change only `package.json`, then run `npm run docs:sync`. It carries the new version into `src/version.ts`, the `ExportData.version` union in `src/types.ts`, the `supportedVersions` set in `src/functions/export-import.ts`, every plugin and package manifest that shared the old version, the deploy templates, the AGENTS.md stats heading, and CHANGELOG.md (the Unreleased section becomes the new version with today's date and its compare link). Commit everything it changes, and check with `npm run docs:check`.
No lockfiles are committed. `test/export-import.test.ts` asserts against the `VERSION` constant, so it needs no per-release edit. Run `npm run skills:gen` if the endpoint or env surface changed.
diff --git a/README.md b/README.md
index 71235b98f5..324636bcc4 100644
--- a/README.md
+++ b/README.md
@@ -50,7 +50,7 @@
-
+
@@ -611,31 +611,33 @@ codex plugin add agentmemory@agentmemory
The Codex plugin ships from the same `plugin/` directory as the Claude Code plugin. It registers:
-- `@agentmemory/mcp` as an MCP server (proxies all 54 tools when `AGENTMEMORY_URL` points at a running agentmemory server; falls back to 7 tools locally when no server is reachable)
+- A bundled stdio MCP bridge to the running daemon, with no npm download or fallback store. See the [local Codex guide](docs/plugins/codex-local.md) to test an unreleased build.
- 6 lifecycle hooks: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PreCompact`, `Stop`
- 9 invocable skills: `/recall`, `/remember`, `/session-history`, `/forget`, `/recap`, `/handoff`, `/lesson`, `/commit-context`, `/commit-history`, plus 8 reference skills the agent loads on demand (memory discipline, MCP tools, REST API, config, agents, hooks, architecture, and the skill-authoring guide)
Codex's hook engine injects `CLAUDE_PLUGIN_ROOT` into hook subprocesses (per [`codex-rs/hooks/src/engine/discovery.rs`](https://github.com/openai/codex/blob/main/codex-rs/hooks/src/engine/discovery.rs)), so the same hook scripts work across both hosts without duplication. Subagent / SessionEnd / Notification / TaskCompleted / PostToolUseFailure events are Claude-Code-only and are not registered for Codex.
-#### Codex Desktop: plugin hooks currently silent (workaround available)
+#### Codex hook trust and compatibility
-`CodexHooks` and `PluginHooks` are both stable + default-enabled in [`codex-rs/features/src/lib.rs`](https://github.com/openai/codex/blob/main/codex-rs/features/src/lib.rs), but Codex Desktop builds currently do not dispatch plugin-local `hooks.json` ([openai/codex#16430](https://github.com/openai/codex/issues/16430)). MCP tools still work; only the lifecycle observations are missing.
+Native plugin hook dispatch is verified with Codex CLI 0.150.1. Trust the plugin hooks before expecting capture. Desktop behavior depends on its bundled runtime; check `/hooks` and confirm a captured event before enabling a workaround.
-Until upstream lands the fix, mirror the same hook commands into the global `~/.codex/hooks.json`:
+If your host requires global hooks, mirror the commands into `~/.codex/hooks.json`. When MCP is already wired, the current connector needs `--force` to reach hook installation:
```bash
-agentmemory connect codex --with-hooks
+agentmemory connect codex --with-hooks --force
```
-This adds an idempotent block to `~/.codex/hooks.json` referencing absolute paths to the bundled scripts (no `${CLAUDE_PLUGIN_ROOT}` expansion needed at user-scope). Re-run the same command after upgrading agentmemory to refresh paths. User entries in the same file are preserved; only previous agentmemory entries are replaced.
+This merges global hooks and rewrites the agentmemory MCP entry, preserving unrelated entries. Review any custom agentmemory endpoint settings before using `--force`. Re-run after upgrading to refresh script paths. Enable either native plugin hooks or global copies to avoid duplicate capture.
### GitHub Copilot CLI
+For VS Code agent mode, use the [Copilot MCP and automatic-capture guide](docs/plugins/copilot.md#vs-code-copilot-local-agent-sessions). The CLI connector does not configure VS Code.
+
```bash
# MCP-only wiring
agentmemory connect copilot-cli
-# Full hooks/skills plugin from the GitHub subdir
+# Alternatively, full hooks/skills plugin from the GitHub subdir
copilot plugin install rohitg00/agentmemory:plugin
```
@@ -739,14 +741,14 @@ The agentmemory entry is the **same MCP server block** across every host that us
| **GitHub Copilot CLI (full plugin)** | Copilot plugin install | `copilot plugin install rohitg00/agentmemory:plugin` for the plugin from the GitHub subdir. |
| **OpenClaw** | OpenClaw MCP config | Same `mcpServers` block. Deeper: `openclaw plugins install ./integrations/openclaw` claims OpenClaw's memory slot (auto-switches from `memory-core`); set `plugins.entries.agentmemory.hooks.allowConversationAccess=true` or turn capture is silently blocked. See [`integrations/openclaw`](integrations/openclaw/). |
| **Codex CLI (MCP only)** | `.codex/config.toml` | TOML shape: `codex mcp add agentmemory -- npx -y @agentmemory/mcp`, or add `[mcp_servers.agentmemory]` manually. |
-| **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, Stop) + 17 skills. On Codex Desktop, also run `agentmemory connect codex --with-hooks` until [openai/codex#16430](https://github.com/openai/codex/issues/16430) lands; plugin hooks are currently silent there. |
+| **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks + 17 skills. Trust hooks and verify capture in your host; see [Codex setup and validation](docs/plugins/codex-local.md). |
| **OpenCode (MCP only)** | `opencode.json` | Different shape: top-level `mcp` key, command as array: `{"mcp": {"agentmemory": {"type": "local", "command": ["npx", "-y", "@agentmemory/mcp"], "enabled": true}}}`. |
| **OpenCode (full plugin)** | `plugin/opencode/` | 22 auto-capture hooks covering session lifecycle, messages, tools, errors. Project attribution is per-session, so one OpenCode process spanning several repositories files each session under its own project. Two slash commands (`/recall`, `/remember`). Copy `plugin/opencode/` into your OpenCode workspace and add the plugin entry to `opencode.json`. See [`plugin/opencode/README.md`](plugin/opencode/README.md) for the full hook table + gap analysis. |
| **pi** | `~/.pi/agent/extensions/agentmemory` | `agentmemory connect pi` installs the bundled extension into pi's auto-discovery directory (recall on agent start, capture on agent end, `memory_search` / `memory_save` / `memory_health` tools, `/agentmemory-status`). `/reload` in a running pi picks it up. [`integrations/pi`](integrations/pi/) is also a pi package (`pi install ./integrations/pi` from a checkout). |
| **Hermes Agent** | `~/.hermes/config.yaml` | `cp -r integrations/hermes ~/.hermes/plugins/agentmemory` + `memory.provider: agentmemory` gives the 6-hook memory provider (prefetch, turn capture, session end, pre-compress, MEMORY.md mirroring, system prompt block). Validate with `hermes plugins doctor` and `hermes memory status`. See [`integrations/hermes`](integrations/hermes/). |
| **Qwen Code** | `~/.qwen/settings.json` | `agentmemory connect qwen` writes the standard `mcpServers` block. Hook payload is field-compatible with Claude Code, so the existing 12-hook scripts work without modification; wire them via the `hooks` section in the same `settings.json`. |
-| **Antigravity** (replaces Gemini CLI) | `mcp_config.json` (in Antigravity's User dir) | `agentmemory connect antigravity` writes the standard `mcpServers` block. macOS: `~/Library/Application Support/Antigravity/User/`. Linux: `~/.config/Antigravity/User/`. Use after the 2026-06-18 Gemini CLI sunset. |
-| **Antigravity CLI** (`agy`) | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity-cli`. The `agy` CLI keeps its own config under `~/.gemini/`, separate from the Antigravity IDE above. Pass `--with-hooks` for native auto-capture via `~/.gemini/config/hooks.json`. |
+| **Antigravity IDE / 2.0** | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity --with-hooks` installs MCP and capture hooks in the shared customization directory. See [Antigravity setup and limits](docs/plugins/antigravity.md). |
+| **Antigravity CLI** (`agy`) | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity-cli --with-hooks` uses the same MCP and hook configuration as current IDE versions. Existing installations should refresh with `--force`; see the [upgrade notes](docs/plugins/antigravity.md). |
| **Kiro** | `~/.kiro/settings/mcp.json` | `agentmemory connect kiro` writes the user-level config. Workspace overrides go in `.kiro/settings/mcp.json` next to your code. |
| **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills/`; once the Claude Code plugin is installed the 8 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. |
| **Cline (CLI)** | `~/.cline/mcp.json` | `agentmemory connect cline` writes the standard `mcpServers` block. VS Code extension users: paste the same block via Cline Settings → MCP Servers → Edit JSON. |
@@ -1190,7 +1192,14 @@ cp plugin/opencode/commands/*.md ~/.config/opencode/commands/
-Auto-starts on port `3113`. Live observation stream with a stream status indicator, a two-pane session explorer (list beside a sticky detail panel on wide screens), memory and lesson rows that expand to the full stored record including raw JSON and origin provenance, a knowledge graph that clusters nodes by type while relations are sparse, session replay, and a health dashboard.
+Auto-starts on port `3113`. The viewer loads one snapshot when it connects (`GET /agentmemory/viewer/snapshot`) and then applies live stream events: new memories, lessons, observations, audit entries, graph changes and health updates appear without polling or page reloads. The only other requests are the actions you click, "load more" pages and searches. When the stream drops, the viewer shows how old its numbers are, reconnects with backoff and resyncs from one snapshot.
+
+- **12 tabs in four groups** with live counts, deep links (`#memories/`, `#sessions/?obs=`, `#graph/`, `#health/consolidation`), keyboard shortcuts and a mobile menu.
+- **Memories:** server-side search, filters by project, agent and type, a detail panel with the version chain and a word diff, provenance links, copy buttons for the id, the MCP call and a curl command, edit (a new version), forget with confirmation, bulk forget and JSON export.
+- **Sessions:** an inline observation timeline with readable tool input and output, filters and paging, and the memories and lessons each session produced.
+- **Graph:** search, node detail with relations and sources, a legend that does not rely on colour alone, and zoom controls.
+- **Health:** the live version of `GET /agentmemory/status`. Every problem comes with its fix, plus the state backend, index save state, graph provenance compaction progress and a consolidation explainer with the real thresholds.
+- **Audit, Activity, Profile, Replay, Lessons, Actions and Crystals** pages, each with an empty state that says what the section is, why it is empty and the command that fills it, and a `?` glossary tooltip on every term and number.
```bash
open http://localhost:3113
@@ -1377,7 +1386,7 @@ fi
| Prometheus / Grafana | iii OTEL + health monitor |
| Custom plugin systems | `iii worker add ` |
-**184 source files · ~42,200 LOC · 1,674 tests · 264 functions · 50 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
+**219 source files · ~52,000 LOC · 2,500+ tests · 311 functions · 60 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
---
@@ -1677,6 +1686,36 @@ Create `~/.agentmemory/.env`:
# CLAUDE_MEMORY_BRIDGE=false
# SNAPSHOT_ENABLED=false
+# Storage and durability
+# AGENTMEMORY_STATE_BACKEND=file # file (default) or redis; see "Storage backend" below
+# AGENTMEMORY_REDIS_URL=redis://localhost:6379 # Required with redis, plain redis:// only
+# AGENTMEMORY_STATE_SAVE_INTERVAL_MS=2000 # How often the engine writes file state to disk.
+ # A hard kill loses at most this window.
+# AGENTMEMORY_INDEX_SAVE_INTERVAL_MS=600000 # Minimum time between search index saves;
+ # shutdown and deletes still save at once.
+# AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=true # One-time background trim of oversized graph
+ # provenance; false skips it
+
+# Sessions
+# AGENTMEMORY_SESSION_SWEEP_ENABLED=true # Hourly sweep marks sessions left active past
+ # the threshold as abandoned. Deletes nothing;
+ # new activity makes the session active again.
+# AGENTMEMORY_SESSION_SWEEP_STALE_HOURS=24
+
+# Capture filters (hooks)
+# AGENTMEMORY_CAPTURE_ALLOW= # Comma or space list of tool names or globs;
+ # when set, only these tools are captured
+# AGENTMEMORY_CAPTURE_DENY= # Extra names or globs to skip, added to the
+ # defaults: memory_*, toolsearch,
+ # listmcpresources, fetchmcpresource
+# AGENTMEMORY_CAPTURE_OUTPUT_MAX=8000 # Max characters of tool output per observation
+# AGENTMEMORY_PRE_COMPACT_BUDGET=1500 # Token budget for PreCompact context; 0 disables
+
+# Audit log
+# AGENTMEMORY_AUDIT_RETENTION_MONTHS=0 # Drop month scopes older than N months; 0 keeps all
+# AGENTMEMORY_AUDIT_INDEX_PERSIST=false # 1 or true records index migration and cleanup
+ # rows (debugging only)
+
# Team
# TEAM_ID=
# USER_ID=
@@ -1710,6 +1749,8 @@ curl -H "Authorization: Bearer $(cat ~/.agentmemory/secret)" http://localhost:31
| Method | Path | Description |
|--------|------|-------------|
| `GET` | `/agentmemory/health` | Health check (always public) |
+| `GET` | `/agentmemory/status` | What is wrong and how to fix it (HTML for browsers, JSON otherwise) |
+| `GET` | `/agentmemory/viewer/snapshot` | Everything the viewer shows, in one response |
| `POST` | `/agentmemory/session/start` | Start session + get context |
| `POST` | `/agentmemory/session/end` | End session |
| `POST` | `/agentmemory/observe` | Capture observation (see capture delivery below) |
@@ -1769,7 +1810,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.de-DE.md b/READMEs/README.de-DE.md
index 02631d18af..4b03c7390e 100644
--- a/READMEs/README.de-DE.md
+++ b/READMEs/README.de-DE.md
@@ -50,7 +50,7 @@
-
+
@@ -1227,7 +1227,7 @@ Volle Registry: [workers.iii.dev](https://workers.iii.dev). Jeder Worker dort ko
| Prometheus / Grafana | iii OTEL + Health-Monitor |
| Eigene Plugin-Systeme | `iii worker add ` |
-**182 Quelldateien · ~41.600 LOC · 1.674 Tests · 264 Funktionen · 50 KV-Scopes**, alles auf drei Primitiven. Kein `agentmemory plugin install`. Das Plugin-System ist iii selbst.
+**219 Quelldateien · ~52.000 LOC · 2.500+ Tests · 311 Funktionen · 60 KV-Scopes**, alles auf drei Primitiven. Kein `agentmemory plugin install`. Das Plugin-System ist iii selbst.
---
@@ -1526,7 +1526,7 @@ CONSOLIDATION_ENABLED=true
-124 Endpunkte auf Port `3111`. Die REST API bindet sich standardmäßig an `127.0.0.1`. Geschützte Endpunkte verlangen `Authorization: Bearer `, wenn `AGENTMEMORY_SECRET` gesetzt ist, und Mesh-Sync-Endpunkte erfordern `AGENTMEMORY_SECRET` auf beiden Peers.
+138 Endpunkte auf Port `3111`. Die REST API bindet sich standardmäßig an `127.0.0.1`. Geschützte Endpunkte verlangen `Authorization: Bearer `, und Mesh-Sync-Endpunkte erfordern ein explizit gesetztes `AGENTMEMORY_SECRET` auf beiden Peers.
Wichtige Endpunkte
@@ -1560,7 +1560,7 @@ Volle Endpunktliste: [`src/triggers/api.ts`](../src/triggers/api.ts)
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.es-ES.md b/READMEs/README.es-ES.md
index a01a1618c1..f2ab50822b 100644
--- a/READMEs/README.es-ES.md
+++ b/READMEs/README.es-ES.md
@@ -50,7 +50,7 @@
-
+
@@ -1220,7 +1220,7 @@ Registro completo: [workers.iii.dev](https://workers.iii.dev). Cada worker allí
| Prometheus / Grafana | iii OTEL + monitor de salud |
| Sistemas de plugins propios | `iii worker add ` |
-**182 ficheros de código · ~41.600 LOC · 1.674 tests · 264 funciones · 50 scopes KV**, todo sobre tres primitivos. No hay `agentmemory plugin install`. El sistema de plugins es iii mismo.
+**219 ficheros de código · ~52.000 LOC · 2.500+ tests · 311 funciones · 60 scopes KV**, todo sobre tres primitivos. No hay `agentmemory plugin install`. El sistema de plugins es iii mismo.
---
@@ -1519,7 +1519,7 @@ Crea `~/.agentmemory/.env`:
-124 endpoints en el puerto `3111`. La REST API se enlaza a `127.0.0.1` por defecto. Los endpoints protegidos requieren `Authorization: Bearer ` cuando `AGENTMEMORY_SECRET` está definido, y los endpoints de mesh sync requieren `AGENTMEMORY_SECRET` en ambos peers.
+138 endpoints en el puerto `3111`. La REST API se enlaza a `127.0.0.1` por defecto. Los endpoints protegidos requieren `Authorization: Bearer `, y los endpoints de mesh sync requieren un `AGENTMEMORY_SECRET` definido explícitamente en ambos peers.
Endpoints principales
@@ -1553,7 +1553,7 @@ Lista completa de endpoints: [`src/triggers/api.ts`](../src/triggers/api.ts)
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.fr-FR.md b/READMEs/README.fr-FR.md
index 7261aea409..d12fc29a44 100644
--- a/READMEs/README.fr-FR.md
+++ b/READMEs/README.fr-FR.md
@@ -50,7 +50,7 @@
-
+
@@ -1227,7 +1227,7 @@ Registre complet : [workers.iii.dev](https://workers.iii.dev). Chaque worker là
| Prometheus / Grafana | iii OTEL + moniteur de santé |
| Systèmes de plugins personnalisés | `iii worker add ` |
-**182 fichiers sources · ~41 600 LOC · 1 619 tests · 264 fonctions · 50 scopes KV**, tout sur trois primitives. Pas de `agentmemory plugin install`. Le système de plugins, c'est iii lui-même.
+**219 fichiers sources · ~52 000 LOC · 2 500+ tests · 311 fonctions · 60 scopes KV**, tout sur trois primitives. Pas de `agentmemory plugin install`. Le système de plugins, c'est iii lui-même.
---
@@ -1526,7 +1526,7 @@ Créez `~/.agentmemory/.env` :
-124 endpoints sur le port `3111`. L'API REST se lie à `127.0.0.1` par défaut. Les endpoints protégés exigent `Authorization: Bearer ` lorsque `AGENTMEMORY_SECRET` est défini, et les endpoints de mesh sync exigent `AGENTMEMORY_SECRET` sur les deux pairs.
+138 endpoints sur le port `3111`. L'API REST se lie à `127.0.0.1` par défaut. Les endpoints protégés exigent `Authorization: Bearer `, et les endpoints de mesh sync exigent un `AGENTMEMORY_SECRET` défini explicitement sur les deux pairs.
Endpoints clés
@@ -1560,7 +1560,7 @@ Liste complète des endpoints : [`src/triggers/api.ts`](../src/triggers/api.ts)
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.hi-IN.md b/READMEs/README.hi-IN.md
index aa959dd3f4..08013d8d5d 100644
--- a/READMEs/README.hi-IN.md
+++ b/READMEs/README.hi-IN.md
@@ -50,7 +50,7 @@
-
+
@@ -1209,7 +1209,7 @@ Full registry: [workers.iii.dev](https://workers.iii.dev)। वहाँ हर
| Prometheus / Grafana | iii OTEL + health monitor |
| Custom plugin systems | `iii worker add ` |
-**184 source files · ~42,200 LOC · 1,674 tests · 264 functions · 50 KV scopes**, सब कुछ तीन primitives पर। कोई `agentmemory plugin install` नहीं। Plugin system iii स्वयं है।
+**219 source files · ~52,000 LOC · 2,500+ tests · 311 functions · 60 KV scopes**, सब कुछ तीन primitives पर। कोई `agentmemory plugin install` नहीं। Plugin system iii स्वयं है।
---
@@ -1508,7 +1508,7 @@ CONSOLIDATION_ENABLED=true
-Port `3111` पर 124 endpoints। REST API default रूप से `127.0.0.1` से bind होता है। `AGENTMEMORY_SECRET` set होने पर protected endpoints `Authorization: Bearer ` की आवश्यकता रखते हैं, और mesh sync endpoints दोनों peers पर `AGENTMEMORY_SECRET` की आवश्यकता रखते हैं।
+Port `3111` पर 138 endpoints। REST API default रूप से `127.0.0.1` से bind होता है। Protected endpoints `Authorization: Bearer ` की आवश्यकता रखते हैं, और mesh sync endpoints दोनों peers पर स्पष्ट रूप से set किए गए `AGENTMEMORY_SECRET` की आवश्यकता रखते हैं।
मुख्य endpoints
@@ -1542,7 +1542,7 @@ Full endpoint list: [`src/triggers/api.ts`](../src/triggers/api.ts)
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (running services की आवश्यकता है)
```
diff --git a/READMEs/README.ja-JP.md b/READMEs/README.ja-JP.md
index 0badfa5c99..4efde4f5de 100644
--- a/READMEs/README.ja-JP.md
+++ b/READMEs/README.ja-JP.md
@@ -50,7 +50,7 @@
-
+
-ポート `3111` 上の 124 エンドポイント。REST API はデフォルトで `127.0.0.1` にバインドします。`AGENTMEMORY_SECRET` が設定されている場合、保護されたエンドポイントは `Authorization: Bearer ` を要求し、mesh sync エンドポイントは両ピアで `AGENTMEMORY_SECRET` を要求します。
+ポート `3111` 上の 138 エンドポイント。REST API はデフォルトで `127.0.0.1` にバインドします。保護されたエンドポイントは `Authorization: Bearer ` を要求し、mesh sync エンドポイントは両ピアで明示的に設定された `AGENTMEMORY_SECRET` を要求します。
主要エンドポイント
@@ -1563,7 +1563,7 @@ CONSOLIDATION_ENABLED=true
```bash
npm run dev # ホットリロード
npm run build # 本番ビルド
-npm test # 1,619 テスト
+npm test # 2,500+ テスト
npm run test:integration # API テスト(サービス起動が必要)
```
diff --git a/READMEs/README.ko-KR.md b/READMEs/README.ko-KR.md
index 1c3ae696ae..d6c0cad14b 100644
--- a/READMEs/README.ko-KR.md
+++ b/READMEs/README.ko-KR.md
@@ -50,7 +50,7 @@
-
+
@@ -1209,7 +1209,7 @@ iii worker add mcp # generic MCP host alongside the agentmemory
| Prometheus / Grafana | iii OTEL + 헬스 모니터 |
| 사용자 정의 플러그인 시스템 | `iii worker add ` |
-**182개 소스 파일 · ~41,600 LOC · 1,674 tests · 264개 함수 · 50개 KV 스코프**, 모두 세 가지 프리미티브 위에. `agentmemory plugin install`이 없습니다. 플러그인 시스템은 iii 자체입니다.
+**219개 소스 파일 · ~52,000 LOC · 2,500+ tests · 311개 함수 · 60개 KV 스코프**, 모두 세 가지 프리미티브 위에. `agentmemory plugin install`이 없습니다. 플러그인 시스템은 iii 자체입니다.
---
@@ -1508,7 +1508,7 @@ CONSOLIDATION_ENABLED=true
-`3111` 포트의 124개 엔드포인트. REST API는 기본적으로 `127.0.0.1`에 바인딩됩니다. 보호된 엔드포인트는 `AGENTMEMORY_SECRET`이 설정되었을 때 `Authorization: Bearer `를 요구하며, mesh sync 엔드포인트는 양쪽 피어 모두에서 `AGENTMEMORY_SECRET`을 요구합니다.
+`3111` 포트의 138개 엔드포인트. REST API는 기본적으로 `127.0.0.1`에 바인딩됩니다. 보호된 엔드포인트는 `Authorization: Bearer `를 요구하며, mesh sync 엔드포인트는 양쪽 피어 모두에서 명시적으로 설정된 `AGENTMEMORY_SECRET`을 요구합니다.
주요 엔드포인트
@@ -1542,7 +1542,7 @@ CONSOLIDATION_ENABLED=true
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.pt-BR.md b/READMEs/README.pt-BR.md
index 0dc6643d57..49182ae6bb 100644
--- a/READMEs/README.pt-BR.md
+++ b/READMEs/README.pt-BR.md
@@ -50,7 +50,7 @@
-
+
@@ -1220,7 +1220,7 @@ Registry completo: [workers.iii.dev](https://workers.iii.dev). Todo worker lá s
| Prometheus / Grafana | iii OTEL + monitor de saúde |
| Sistemas de plugin customizados | `iii worker add ` |
-**182 arquivos de código · ~41.600 LOC · 1.674 tests · 264 funções · 50 escopos KV**, tudo em cima de três primitivos. Sem `agentmemory plugin install`. O sistema de plugins é o próprio iii.
+**219 arquivos de código · ~52.000 LOC · 2.500+ tests · 311 funções · 60 escopos KV**, tudo em cima de três primitivos. Sem `agentmemory plugin install`. O sistema de plugins é o próprio iii.
---
@@ -1519,7 +1519,7 @@ Crie `~/.agentmemory/.env`:
-124 endpoints na porta `3111`. A REST API faz bind em `127.0.0.1` por padrão. Endpoints protegidos exigem `Authorization: Bearer ` quando `AGENTMEMORY_SECRET` está definido, e endpoints de mesh sync exigem `AGENTMEMORY_SECRET` em ambos os peers.
+138 endpoints na porta `3111`. A REST API faz bind em `127.0.0.1` por padrão. Endpoints protegidos exigem `Authorization: Bearer `, e endpoints de mesh sync exigem um `AGENTMEMORY_SECRET` definido explicitamente em ambos os peers.
Endpoints principais
@@ -1553,7 +1553,7 @@ Lista completa de endpoints: [`src/triggers/api.ts`](../src/triggers/api.ts)
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.ru-RU.md b/READMEs/README.ru-RU.md
index f41b0207b7..604277a6eb 100644
--- a/READMEs/README.ru-RU.md
+++ b/READMEs/README.ru-RU.md
@@ -50,7 +50,7 @@
-
+
@@ -1227,7 +1227,7 @@ iii worker add mcp # generic MCP host alongside the agentmemory
| Prometheus / Grafana | iii OTEL + монитор состояния |
| Самописные плагинные системы | `iii worker add ` |
-**182 исходных файла · ~41 600 LOC · 1 619 тестов · 264 функции · 50 KV-scope'ов** — всё на трёх примитивах. Никакого `agentmemory plugin install`. Плагинная система — это сам iii.
+**219 исходных файла · ~52 000 LOC · 2 500+ тестов · 311 функции · 60 KV-scope'ов** — всё на трёх примитивах. Никакого `agentmemory plugin install`. Плагинная система — это сам iii.
---
@@ -1526,7 +1526,7 @@ CONSOLIDATION_ENABLED=true
-124 эндпоинта на порту `3111`. REST API по умолчанию слушает на `127.0.0.1`. Защищённые эндпоинты требуют `Authorization: Bearer `, когда установлен `AGENTMEMORY_SECRET`, а эндпоинты mesh-синхронизации требуют `AGENTMEMORY_SECRET` на обоих узлах.
+138 эндпоинта на порту `3111`. REST API по умолчанию слушает на `127.0.0.1`. Защищённые эндпоинты требуют `Authorization: Bearer `, а эндпоинты mesh-синхронизации требуют явно заданного `AGENTMEMORY_SECRET` на обоих узлах.
Ключевые эндпоинты
@@ -1560,7 +1560,7 @@ CONSOLIDATION_ENABLED=true
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API tests (requires running services)
```
diff --git a/READMEs/README.tr-TR.md b/READMEs/README.tr-TR.md
index ae7923d597..ca1df27b76 100644
--- a/READMEs/README.tr-TR.md
+++ b/READMEs/README.tr-TR.md
@@ -50,7 +50,7 @@
-
+
@@ -1229,7 +1229,7 @@ Tam kayıt defteri: [workers.iii.dev](https://workers.iii.dev). Oradaki her work
| Prometheus / Grafana | iii OTEL + sağlık monitörü |
| Özel eklenti sistemleri | `iii worker add ` |
-**182 kaynak dosya · ~41,600 LOC · 1,619 test · 264 fonksiyon · 50 KV scope**, hepsi üç primitif üzerinde. `agentmemory plugin install` yok. Eklenti sistemi iii'nin kendisi.
+**219 kaynak dosya · ~52,000 LOC · 2,500+ test · 311 fonksiyon · 60 KV scope**, hepsi üç primitif üzerinde. `agentmemory plugin install` yok. Eklenti sistemi iii'nin kendisi.
---
@@ -1528,7 +1528,7 @@ CONSOLIDATION_ENABLED=true
-`3111` portunda 124 endpoint. REST API varsayılan olarak `127.0.0.1`'e bağlanır. `AGENTMEMORY_SECRET` ayarlandığında korumalı endpoint'ler `Authorization: Bearer ` gerektirir ve mesh sync endpoint'leri her iki eşte de `AGENTMEMORY_SECRET` gerektirir.
+`3111` portunda 138 endpoint. REST API varsayılan olarak `127.0.0.1`'e bağlanır. Korumalı endpoint'ler `Authorization: Bearer ` gerektirir ve mesh sync endpoint'leri her iki eşte de açıkça ayarlanmış bir `AGENTMEMORY_SECRET` gerektirir.
Önemli endpoint'ler
@@ -1562,7 +1562,7 @@ Tam endpoint listesi: [`src/triggers/api.ts`](../src/triggers/api.ts)
```bash
npm run dev # Hot reload
npm run build # Production build
-npm test # 1,674 tests
+npm test # 2,500+ tests
npm run test:integration # API testleri (çalışan servisler gerektirir)
```
diff --git a/READMEs/README.zh-CN.md b/READMEs/README.zh-CN.md
index 7f7c8a03f2..2a0c590d51 100644
--- a/READMEs/README.zh-CN.md
+++ b/READMEs/README.zh-CN.md
@@ -50,7 +50,7 @@
-
+
+ Dataset. LongMemEval-S: {LONGMEMEVAL.questions} questions, about 48 sessions and 115K tokens
+ per question. datasetpaper
+
+
+ Metric. recall_any@K: does any gold session appear in the top K results. Each question builds
+ a fresh index from its own sessions and searches with the question text.
+
+
+ Embeddings. {LONGMEMEVAL.embedding}. No API key and no LLM in the loop.
+
+
+ What it is not. This is retrieval recall, not end-to-end answer accuracy. The official
+ LongMemEval score adds answer generation and an LLM judge, and we do not claim one.
+
+ Adding local vectors to BM25 lifts R@5 from {pct(LONGMEMEVAL.bm25.r5)} to {pct(LONGMEMEVAL.hybrid.r5)}.{" "}
+ benchmark/LONGMEMEVAL.md
+
+
+
By question type, BM25 + vectors
+
+
+
+
+
Type
+
Questions
+
R@5
+
R@10
+
Found at top 5
+
+
+
+ {LONGMEMEVAL.byType.map((t) => (
+
+
{t.type}
+
{t.count}
+
{pct(t.r5)}
+
{pct(t.r10)}
+
+ {TYPE_HITS.find((h) => h.type === t.type)?.hits[5]} of {t.count}
+
+
+ ))}
+
+
+
+
+ Preferences are the hardest type: they depend on implicit statements, and R@5 is {pct(LONGMEMEVAL.byType[5].r5)}.
+ Knowledge updates and multi-session questions are the strongest.
+
+
+
Token cost per query
+
+ A smaller labeled set of coding-session observations: {TOKEN_SETUP.observations} observations across{" "}
+ {TOKEN_SETUP.sessions} sessions and {TOKEN_SETUP.queries} queries, with {TOKEN_SETUP.model}. The baseline loads
+ every observation into the prompt.
+
+
+
+
+
+
Mode
+
R@5
+
R@10
+
P@5
+
NDCG@10
+
MRR
+
Tokens
+
+
+
+ {TOKEN_ROWS.map((r) => (
+
+
{r.name}
+
{pct(r.r5)}
+
{pct(r.r10)}
+
{pct(r.p5)}
+
{pct(r.ndcg)}
+
{pct(r.mrr)}
+
{r.tokens.toLocaleString("en-US")}
+
+ ))}
+
+
+
+
+ {TOKENS.agentmemory.toLocaleString("en-US")} tokens instead of {TOKENS.fullContext.toLocaleString("en-US")} is{" "}
+ {TOKENS.savedPct}% fewer, with higher precision, measured on v0.6.0.{" "}
+ benchmark/REAL-EMBEDDINGS.md
+
+
+
Crash recovery
+
+ The cost bench runs the built package in an isolated home, captures N observations, kills the whole process
+ tree with SIGKILL, boots it again and checks that nothing was lost.
+
+ The cost bench checks each run against these ceilings. They were derived from repeated runs, taking the worst run plus
+ headroom, so they are upper limits rather than typical values, and they depend on the machine that runs them.
+ The embed profile uses 768-dimension vectors.
+
+
+
+
+
+
Profile
+
Observations
+
Hook p95
+
Index ready after kill
+
Disk per observation
+
Idle memory
+
Search tokens p50
+
+
+
+ {BUDGETS.map((b) => (
+
+
{b.profile}
+
{b.n.toLocaleString("en-US")}
+
{b.hookP95Ms} ms
+
{sec(b.recoveryIndexReadyMs)}
+
{kib(b.diskPerObsBytes)}
+
{mib(b.idleRssKiB)}
+
{b.searchTokensP50}
+
+ ))}
+
+
+
+
+ benchmark/capture-costs-budgets.json
+
+
+
Reproduce
+
Retrieval, from the repository root, after downloading the dataset:
),
- { ...size },
+ size,
);
}
diff --git a/website/app/page.tsx b/website/app/page.tsx
index 962ab7d542..dbbf575643 100644
--- a/website/app/page.tsx
+++ b/website/app/page.tsx
@@ -1,43 +1,37 @@
-import { ScrollProgress } from "@/components/ScrollProgress";
-import { Nav } from "@/components/Nav";
-import { Hero } from "@/components/Hero";
-import { Stats } from "@/components/Stats";
-import { Primitives } from "@/components/Primitives";
-import { Features } from "@/components/Features";
-import { CommandCenter } from "@/components/CommandCenter";
-import { LiveTerminal } from "@/components/LiveTerminal";
-import { Testimonials } from "@/components/Testimonials";
-import { Compare } from "@/components/Compare";
-import { Agents } from "@/components/Agents";
-import { Install } from "@/components/Install";
-import { Footer } from "@/components/Footer";
-import { getProjectMeta } from "@/lib/meta";
+import { Nav } from "@/components/site/Nav";
+import { Hero } from "@/components/site/Hero";
+import { Proof } from "@/components/site/Proof";
+import { Featured, InTheWild } from "@/components/site/InTheWild";
+import { UseCases } from "@/components/site/UseCases";
+import { ContextFunnel } from "@/components/site/ContextFunnel";
+import { InfraTiles } from "@/components/site/InfraTiles";
+import { MemoryScroll } from "@/components/site/MemoryScroll";
+import { Benchmarks } from "@/components/site/Benchmarks";
+import { Agents } from "@/components/site/Agents";
+import { LocalFirst } from "@/components/site/LocalFirst";
+import { Interfaces } from "@/components/site/Interfaces";
+import { Faq } from "@/components/site/Faq";
+import { Install } from "@/components/site/Install";
+import { Footer } from "@/components/site/Footer";
export default function Page() {
- const meta = getProjectMeta();
return (
<>
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/website/app/privacy/page.tsx b/website/app/privacy/page.tsx
new file mode 100644
index 0000000000..78b0d076fb
--- /dev/null
+++ b/website/app/privacy/page.tsx
@@ -0,0 +1,42 @@
+import type { Metadata } from "next";
+import { DocPage, Prose } from "@/components/site/Doc";
+
+export const metadata: Metadata = {
+ title: "Privacy",
+ description: "agentmemory runs on your computer. No account, no hosted service, no analytics, no telemetry.",
+ alternates: { canonical: "/privacy" },
+};
+
+export default function PrivacyPage() {
+ return (
+
+
+
+ What it stores. Memories, and the agent activity you choose to capture, are saved in a data folder on your machine, for example{" "}
+ ~/Library/Application Support/agentmemory on macOS. You can export or delete them at any time.
+
+
+ What leaves your machine. Nothing, unless you configure it. If you add an LLM or embedding
+ provider, agentmemory sends that provider the text it needs, under the provider's own privacy policy. Local
+ embeddings send nothing.
+
+
+ Telemetry. None.
+
+
+ Third parties. agentmemory itself never collects or receives your data. The tools you use with
+ it, such as your coding agent, LLM and embedding providers, and the iii engine if you turn on its usage
+ telemetry, may store data under their own policies.
+
Everything runs on your machine. A default install starts these listeners, all bound to 127.0.0.1:
+
+
+
+
Port
+
Process
+
Purpose
+
+
+
+
+
+ 3111
+
+
agentmemory
+
REST API and MCP over HTTP
+
+
+
+ 3112
+
+
iii engine
+
Internal streams for the server and the viewer
+
+
+
+ 3113
+
+
agentmemory
+
Real-time viewer
+
+
+
+ 49134
+
+
iii engine
+
Worker WebSocket
+
+
+
+
+ Configuration and the secret live in ~/.agentmemory. Stored state lives in the platform data
+ directory: ~/Library/Application Support/agentmemory on macOS,{" "}
+ $XDG_DATA_HOME/agentmemory or ~/.local/share/agentmemory on Linux, and{" "}
+ %APPDATA%\agentmemory on Windows. AGENTMEMORY_DATA_DIR moves it.
+
+
+
Authentication is on by default
+
+ When AGENTMEMORY_SECRET is not set, the server generates a random secret on first start and writes
+ it to ~/.agentmemory/secret with mode 0600. Every bundled client reads it from there:
+ the CLI, the viewer, the hooks, the MCP server and the configs written by agentmemory connect. The
+ stored secret is only sent to loopback addresses. Secrets are compared in constant time.
+
+ An explicit AGENTMEMORY_SECRET always wins. Remote clients need it set, and mesh sync between
+ machines requires it on both peers.
+
+
+
Requests from browsers
+
+ Writes to the REST API and the viewer must send Content-Type: application/json. When a request
+ carries an Origin header, it must be a loopback origin for the configured ports or be listed in{" "}
+ VIEWER_ALLOWED_ORIGINS. A web page you happen to visit cannot write to your memory.
+
+
+
File access is confined
+
+ Endpoints that read or write files only accept paths under ~/.agentmemory, the data directory, or a
+ directory you list in AGENTMEMORY_IMPORT_ROOT. Symlinks are resolved before every check.
+
+
+
What gets captured, and how to limit it
+
+ Hooks capture your prompts, the tools your agent calls and a bounded copy of their output. Tools named{" "}
+ memory_* and a few discovery tools are skipped by default.
+
+
+
+ AGENTMEMORY_CAPTURE_DENY adds tool names or globs to skip.
+
+
+ AGENTMEMORY_CAPTURE_ALLOW captures only the tools you list.
+
+
+ AGENTMEMORY_CAPTURE_OUTPUT_MAX caps how much tool output is stored per observation.
+
+
+ Text inside <private> tags is replaced with [REDACTED] before it is stored.
+
+
+
+
Secrets are redacted before storage
+
+ Captured text is scanned before it is written. API keys, bearer tokens, private key blocks, credentials in URLs,
+ and common token formats from model providers, GitHub, GitLab, Slack, AWS, Google and npm are replaced with{" "}
+ [REDACTED_SECRET]. The offline capture spool applies the same redaction and is private to your
+ user. Pattern matching catches common formats, not every secret, so keep secrets out of prompts when you can.
+
+
+
Export and deletion
+
+ memory_export and GET /agentmemory/export return everything stored.{" "}
+ memory_governance_delete deletes records and keeps an audit entry of the deletion. Deleted
+ observations stay deleted after a restart or a replayed event.
+
+
+
Supply chain
+
+
+ The iii engine is pinned to one version (0.22.1). The installer checks the downloaded archive
+ against a SHA-256 recorded in the package before it extracts it.
+
+
+ The engine starts with update checks off and its anonymous usage telemetry off (
+ III_TELEMETRY_ENABLED=false), unless you set that variable yourself.
+
+
+ Every pull request and push to main runs the{" "}
+ release gate on Ubuntu and macOS (workflow): CI packs the
+ npm tarball, installs it into an empty directory and checks capture, MCP, crash recovery and export round
+ trips against the installed artifact.
+
+
+
+
What is not done
+
+
Stored memory is not encrypted at rest. File permissions on your account are what protect it.
+
+ The iii console does not enforce auth. Keep it on 127.0.0.1, which is the default, and never expose it.
+
+
+ Binding to anything other than 127.0.0.1 makes the API reachable from your network. Auth stays on, but only do
+ it on networks you trust.
+
-
- );
-}
-
-export function Agents() {
- const loop = [...MARQUEE, ...MARQUEE];
- return (
-
-
- Works with
-
- Seven native plugins. Rest MCP-native.
-
-
- Native plugins for Claude Code, Copilot CLI, Codex CLI, OpenClaw,
- Hermes, pi, and Cursor. OpenCode gets a plugin that attributes
- each session to its own project. Every other MCP client gets it for
- free. `agentmemory connect <agent>` auto-wires them all.
-
- agentmemory ships a real-time viewer for your memories and an
- engine-level console for every function, trigger, and OTel span.
- Both are first-class, installed inline by the CLI on first run.
-
- Only the agentmemory number is ours, measured on LongMemEval-S and
- reproducible from the repo. Competitor figures are their own published
- claims on their own benchmarks — different datasets, shown for
- ballpark. Ship what you want; we just picked the one with receipts.
-
- Give your coding agent a memory that survives the session. 95.2%
- retrieval recall on LongMemEval-S with about 92% fewer input tokens
- than full-context replay, all on your own machine.
-
- );
-}
-
-export function Install() {
- return (
-
-
- Ship it
-
- One install. Any agent.
-
-
- Runs on your machine. Data stays local. Capture and recall need no
- LLM key; add one for Anthropic, OpenAI, Gemini, MiniMax, or
- OpenRouter to activate consolidation, graph extraction, and LLM
- compression.
-
- Built on the iii engine: every memory operation is a worker, a
- function, or a trigger. No external databases, queues, or vector
- stores. The entire runtime is one process.
-
+ Retrieval measured on LongMemEval-S, an academic benchmark for long-term memory, with a local embedding
+ model and no API key. Every number below links to the file it came from.
+
+
+
+
+
+
+
+
+ benchmark/LONGMEMEVAL.md
+
+
+ {LONGMEMEVAL.questions} questions, about 48 sessions each. Retrieval recall, not end-to-end answer accuracy.
+
+
+
+
+
+ Reproduce it
+
+ Download the dataset from{" "}
+
+ Hugging Face
+
+ , then run the same script we did. Embeddings use {LONGMEMEVAL.embedding}. The benchmark is described in
+ the{" "}
+
+ LongMemEval paper
+
+ .
+
The {100 - saved}% of your history that matters, every session.
+
+ A month of work across agents is {TOKENS.fullContext.toLocaleString("en-US")} tokens. Pasting all of it buries
+ the task. agentmemory hands the next session the {TOKENS.agentmemory.toLocaleString("en-US")} tokens that
+ answer it, and leaves the rest of the window for the work.
+
+
+
+
+
+
+ your history
+ {TOKENS.fullContext.toLocaleString("en-US")} tokens
+
+ Before code reaches main, CI packs the npm tarball, installs it into an empty directory and runs ten
+ scenarios against it on Ubuntu and macOS. Three of them kill the server with SIGKILL mid-flight.
+
+
+
+
+
+ npm run release:gate
+ {`${Math.max(0, done)}/${total}`}
+
+ Your coding agent starts every session from zero. agentmemory captures what it did, keeps it on your machine,
+ and hands the right context back next time. No account, no API key, no cloud.
+
+ agentmemory · 127.0.0.1:3111
+ Session tokens expire after 15 minutes. Refresh runs in src/auth/refresh.ts.
+ captured from claude-code
+
+
+
+
+
+
+
+
+
+ {other === "cursor" ? (
+
+
+
+ src
+ auth
+ refresh.ts
+ session.ts
+
+
+
+ why does login fail after 15 minutes?
+
+
+ memory_recall · 1 result
+
+
+ Fixed Monday in refresh.ts, from a Claude Code session. This route skips that middleware.
+
+
+
+
+ ) : (
+
+
+ › why does login fail after 15 minutes?
+
+
+ • Called agentmemory.memory_recall
+
+
+ Fixed Monday in refresh.ts, from a Claude Code session. This route skips that middleware.
+
+
+ )}
+
+
+ );
+}
+
+function ContextScene() {
+ return (
+
+
+
+ ✻ Welcome to Claude Code
+ cwd: ~/acme-api
+
+
+ pnpm workspace. Tests run with pnpm vitest run. Never edit src/generated/, it is built from the schema.
+
+
+ > run the tests
+
+
+ ⏺ Bash(pnpm vitest run)
+
+
+ ⎿ 212 passed
+
+
+
+ );
+}
+
+function HandoffScene() {
+ return (
+
+
+
+ ⏺ Edit(routes/orders.ts)
+
+
+ ⎿ 3 of 5 routes moved to refresh tokens
+
+
+ laptop closed. session ended.
+
+
+
+ overnight
+
+
+
+ > /handoff
+
+
+ Moving auth to refresh tokens. 3 of 5 routes done. Open question: cookie or header for the refresh token?
+
+
+ Next up is routes/billing.ts. Before I start: cookie or header?
+
+
+
+ );
+}
+
+function LessonScene() {
+ return (
+
+
+
+ week 1
+ "Never mock the database in integration tests."
+ you correct the agent once
+
+
+ saved
+ /lesson
+
+ confidence
+
+
+
+
+
+
+ week 3
+ "write an integration test for checkout"
+ similar work starts
+
+
+
+
+ Never mock the database in integration tests. Use the test container.
+
+
+ ⏺ Write(test/checkout.test.ts)
+
+
+ ⎿ uses the test container, no database mock
+
+
+
+ );
+}
+
+interface UseCase {
+ id: string;
+ title: string;
+ why: string;
+ without: string;
+ scene: () => ReactNode;
+}
+
+const CASES: UseCase[] = [
+ {
+ id: "agents",
+ title: "One memory for every agent",
+ why: "Claude Code, Cursor, Codex and the rest share one local memory server.",
+ without: "Each tool starts blind. You retell Cursor what Claude Code already found.",
+ scene: () => ,
+ },
+ {
+ id: "context",
+ title: "Stop re-explaining your project",
+ why: "Your stack, commands and rules load before your first message.",
+ without: "npm test, missing script, and you explain pnpm and vitest again.",
+ scene: () => ,
+ },
+ {
+ id: "handoff",
+ title: "Pick up where you left off",
+ why: "Close the laptop mid-task. Tomorrow's session knows what was half done.",
+ without: "\"I don't have context from previous sessions.\"",
+ scene: () => ,
+ },
+ {
+ id: "lesson",
+ title: "Correct it once",
+ why: "When you correct your agent, the rule is kept and comes back before similar work.",
+ without: "Week 3, the same database mock, the same correction.",
+ scene: () => ,
+ },
+ {
+ id: "why",
+ title: "Ask why the code looks like this",
+ why: "Every commit links back to the session that produced it.",
+ without: "git blame says \"fix\". Fix what?",
+ scene: () => ,
+ },
+ {
+ id: "import",
+ title: "Start with months of history",
+ why: "Import the transcripts you already have. Day one is not empty.",
+ without: "Memory starts empty, and every past session is lost.",
+ scene: () => ,
+ },
+];
+
+function PanelBody({ c }: { c: (typeof CASES)[number] }) {
+ return (
+ <>
+
{c.why}
+
{c.scene()}
+
+ without memory
+ {c.without}
+
+ >
+ );
+}
+
+export function UseCases() {
+ const [active, setActive] = useState(0);
+ const tabs = useRef<(HTMLButtonElement | null)[]>([]);
+
+ const onKey = (e: KeyboardEvent, i: number) => {
+ const last = CASES.length - 1;
+ let next = -1;
+ if (e.key === "ArrowDown" || e.key === "ArrowRight") next = i === last ? 0 : i + 1;
+ if (e.key === "ArrowUp" || e.key === "ArrowLeft") next = i === 0 ? last : i - 1;
+ if (e.key === "Home") next = 0;
+ if (e.key === "End") next = last;
+ if (next < 0) return;
+ e.preventDefault();
+ setActive(next);
+ tabs.current[next]?.focus();
+ };
+
+ return (
+
+
+
+ Use cases
+
What changes when your agent remembers.
+
Six things that happen every week with a coding agent, and what they look like with agentmemory running.
+
+
+
+ {CASES.map((u, i) => (
+
+ ))}
+
+
+
+ {CASES.map((u, i) =>
+ i === active ? (
+
+
+
+ ) : (
+
+
+
+ ),
+ )}
+
+
Example sessions. The commands, skills and hooks shown are real.
+
+
+ );
+}
diff --git a/website/components/site/client.tsx b/website/components/site/client.tsx
new file mode 100644
index 0000000000..f08d8f598c
--- /dev/null
+++ b/website/components/site/client.tsx
@@ -0,0 +1,194 @@
+"use client";
+
+import { useEffect, useRef, useState, type CSSProperties, type ReactNode } from "react";
+
+export function CopyButton({
+ text,
+ label,
+ className,
+ children,
+ labels,
+}: {
+ text: string;
+ label: string;
+ className?: string;
+ children?: ReactNode;
+ labels?: { idle: string; done: string };
+}) {
+ const [copied, setCopied] = useState(false);
+ const timer = useRef | null>(null);
+ useEffect(() => () => {
+ if (timer.current) clearTimeout(timer.current);
+ }, []);
+ return (
+
+ );
+}
+
+export function Reveal({
+ children,
+ delay = 0,
+ as: Tag = "div",
+ className,
+}: {
+ children: ReactNode;
+ delay?: number;
+ as?: "div" | "li" | "section" | "article";
+ className?: string;
+}) {
+ const ref = useRef(null);
+ useEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const io = new IntersectionObserver(
+ (entries) => {
+ for (const e of entries) {
+ if (e.isIntersecting) {
+ el.classList.add("is-in");
+ io.disconnect();
+ }
+ }
+ },
+ { rootMargin: "0px 0px -12% 0px" },
+ );
+ io.observe(el);
+ return () => io.disconnect();
+ }, []);
+ const style = { "--d": `${delay}ms` } as CSSProperties;
+ return (
+
+ {children}
+
+ );
+}
+
+export function ThemeToggle({ className }: { className?: string }) {
+ const [theme, setTheme] = useState<"light" | "dark" | null>(null);
+ useEffect(() => {
+ const explicit = document.documentElement.dataset.theme as "light" | "dark" | undefined;
+ const system = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
+ setTheme(explicit ?? system);
+ }, []);
+ const next = theme === "dark" ? "light" : "dark";
+ return (
+
+ );
+}
+
+export function useScrollProgress(steps = 0) {
+ const ref = useRef(null);
+ useEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const clamp = (v: number) => Math.min(1, Math.max(0, v));
+ const items = Array.from(el.querySelectorAll("[data-a]")).map((node) => {
+ const ds = node.dataset;
+ return {
+ node,
+ a: Number(ds.a),
+ b: Number(ds.b),
+ a2: ds.a2 === undefined ? null : Number(ds.a2),
+ b2: ds.b2 === undefined ? null : Number(ds.b2),
+ dim: ds.dim === undefined ? 1 : Number(ds.dim),
+ lift: ds.lift !== undefined,
+ last: "",
+ };
+ });
+ const rail = el.querySelector("[data-rail]");
+ const paint = (p: number) => {
+ for (const it of items) {
+ const t = clamp((p - it.a) / (it.b - it.a));
+ const u = it.a2 === null || it.b2 === null ? 0 : clamp((p - it.a2) / (it.b2 - it.a2));
+ const opacity = t * (1 - it.dim * u);
+ const transform = it.lift
+ ? `translateY(${((1 - t) * 14).toFixed(2)}px) scale(${(0.97 + 0.03 * t).toFixed(4)})`
+ : `translateY(${((1 - t) * 8).toFixed(2)}px)`;
+ const key = `${opacity.toFixed(3)}|${transform}`;
+ if (key === it.last) continue;
+ it.last = key;
+ it.node.style.opacity = opacity.toFixed(3);
+ it.node.style.transform = transform;
+ }
+ if (rail) rail.style.transform = `scaleY(${p.toFixed(4)})`;
+ };
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
+ el.dataset.step = "all";
+ paint(1);
+ return;
+ }
+ let frame = 0;
+ let visible = false;
+ const update = () => {
+ frame = 0;
+ const rect = el.getBoundingClientRect();
+ const span = rect.height - window.innerHeight;
+ const p = span > 0 ? clamp(-rect.top / span) : 1;
+ paint(p);
+ if (steps > 0) {
+ const step = String(Math.min(steps - 1, Math.floor(p * steps)));
+ if (el.dataset.step !== step) el.dataset.step = step;
+ }
+ };
+ const onScroll = () => {
+ if (visible && !frame) frame = requestAnimationFrame(update);
+ };
+ const io = new IntersectionObserver(([e]) => {
+ visible = e.isIntersecting;
+ if (visible) onScroll();
+ });
+ io.observe(el);
+ window.addEventListener("scroll", onScroll, { passive: true });
+ window.addEventListener("resize", onScroll);
+ update();
+ return () => {
+ io.disconnect();
+ window.removeEventListener("scroll", onScroll);
+ window.removeEventListener("resize", onScroll);
+ if (frame) cancelAnimationFrame(frame);
+ };
+ }, [steps]);
+ return ref;
+}
diff --git a/website/lib/bench.ts b/website/lib/bench.ts
new file mode 100644
index 0000000000..1438179abb
--- /dev/null
+++ b/website/lib/bench.ts
@@ -0,0 +1,67 @@
+import { LONGMEMEVAL, REPO_URL } from "./site";
+
+export type K = 5 | 10;
+
+export interface TypeHits {
+ type: string;
+ count: number;
+ hits: Record;
+}
+
+export const TYPE_HITS: TypeHits[] = LONGMEMEVAL.byType.map((t) => ({
+ type: t.type,
+ count: t.count,
+ hits: { 5: t.h5, 10: t.h10 },
+}));
+
+export function totalHits(k: K): number {
+ return TYPE_HITS.reduce((sum, t) => sum + t.hits[k], 0);
+}
+
+export const benchSrc = {
+ readme: `${REPO_URL}/blob/main/benchmark/README.md`,
+ budgets: `${REPO_URL}/blob/main/benchmark/capture-costs-budgets.json`,
+ costsFigure: `${REPO_URL}/blob/main/docs/benchmarks/capture-costs.svg`,
+ longmemevalScript: `${REPO_URL}/blob/main/benchmark/longmemeval-bench.ts`,
+ realEmbeddingsScript: `${REPO_URL}/blob/main/benchmark/real-embeddings-eval.ts`,
+};
+
+export const REPRODUCE = {
+ download: `pip install huggingface_hub
+python3 -c "
+from huggingface_hub import hf_hub_download
+hf_hub_download(repo_id='xiaowu0162/longmemeval-cleaned', filename='longmemeval_s_cleaned.json', repo_type='dataset', local_dir='benchmark/data')
+"`,
+ bm25: "npx tsx benchmark/longmemeval-bench.ts bm25",
+ hybrid: "npx tsx benchmark/longmemeval-bench.ts hybrid",
+ costs: "npm run build && npm run bench:capture-costs",
+};
+
+export const TOKEN_SETUP = {
+ observations: 240,
+ sessions: 30,
+ queries: 20,
+ model: "Xenova/all-MiniLM-L6-v2 (384d, local)",
+};
+
+export interface BudgetRow {
+ profile: string;
+ n: number;
+ hookP95Ms: number;
+ recoveryIndexReadyMs: number;
+ diskPerObsBytes: number;
+ idleRssKiB: number;
+ searchTokensP50: number;
+}
+
+export const BUDGETS: BudgetRow[] = [
+ { profile: "keyless", n: 1000, hookP95Ms: 268, recoveryIndexReadyMs: 3126, diskPerObsBytes: 4510, idleRssKiB: 340760, searchTokensP50: 681 },
+ { profile: "keyless", n: 10000, hookP95Ms: 257, recoveryIndexReadyMs: 5742, diskPerObsBytes: 4036, idleRssKiB: 644300, searchTokensP50: 690 },
+ { profile: "embed", n: 1000, hookP95Ms: 466, recoveryIndexReadyMs: 5914, diskPerObsBytes: 9552, idleRssKiB: 381080, searchTokensP50: 663 },
+ { profile: "embed", n: 10000, hookP95Ms: 406, recoveryIndexReadyMs: 6346, diskPerObsBytes: 9062, idleRssKiB: 863880, searchTokensP50: 678 },
+];
+
+export const RECOVERY_FACTS = [
+ { value: "10,000 of 10,000", label: "memories and vectors back after SIGKILL, with 0 embedding calls" },
+ { value: "1,000 of 1,000", label: "tool calls kept while the service was down" },
+];
diff --git a/website/lib/compare.ts b/website/lib/compare.ts
new file mode 100644
index 0000000000..74a7182b36
--- /dev/null
+++ b/website/lib/compare.ts
@@ -0,0 +1,348 @@
+import { LONGMEMEVAL, REPO_URL } from "@/lib/site";
+
+export const CHECKED_ON = "2026-10-05";
+
+export type RowKey =
+ | "what"
+ | "license"
+ | "deployment"
+ | "storage"
+ | "capture"
+ | "integrations"
+ | "retrieval"
+ | "benchmarks"
+ | "pricing";
+
+export const ROWS: { key: RowKey; label: string }[] = [
+ { key: "what", label: "What it is" },
+ { key: "license", label: "License" },
+ { key: "deployment", label: "Where it runs" },
+ { key: "storage", label: "What it needs" },
+ { key: "capture", label: "How memory is captured" },
+ { key: "integrations", label: "Agent integrations" },
+ { key: "retrieval", label: "Retrieval" },
+ { key: "benchmarks", label: "Published benchmarks" },
+ { key: "pricing", label: "Pricing" },
+];
+
+export interface Fact {
+ value: string;
+ src?: string;
+}
+
+export interface Competitor {
+ slug: string;
+ name: string;
+ tagline: string;
+ links: { home: string; docs: string; github?: string };
+ rows: Record;
+ summary: string;
+ differ: string[];
+ chooseThem: string[];
+ chooseUs: string[];
+ moving?: string[];
+}
+
+const README = `${REPO_URL}#readme`;
+
+export const AGENTMEMORY: Record = {
+ what: {
+ value: "Local memory server for coding agents. Hooks capture each session, and memory comes back through hooks and MCP in the next one.",
+ src: README,
+ },
+ license: { value: "Apache-2.0", src: `${REPO_URL}/blob/main/LICENSE` },
+ deployment: {
+ value: "On your machine, as one process bound to 127.0.0.1. There is no hosted tier.",
+ src: README,
+ },
+ storage: {
+ value: "Nothing to install. State lives in a local data folder. Redis is optional.",
+ src: README,
+ },
+ capture: {
+ value: "Automatic. Lifecycle hooks record prompts, tool calls and session ends, so there are no add() calls to write.",
+ src: README,
+ },
+ integrations: {
+ value: "25 agents, with native plugins for Claude Code, Codex CLI, Copilot CLI, Cursor and others, 54 MCP tools and a REST API.",
+ src: `${REPO_URL}#works-with-every-agent`,
+ },
+ retrieval: {
+ value: "BM25, local vectors and a knowledge graph, fused into one ranking. Works keyless on BM25 alone.",
+ src: README,
+ },
+ benchmarks: {
+ value: `LongMemEval-S retrieval recall at 5: ${LONGMEMEVAL.hybrid.r5}%. This measures retrieval only, not answer accuracy.`,
+ src: `${REPO_URL}/blob/main/benchmark/LONGMEMEVAL.md`,
+ },
+ pricing: {
+ value: "Free. If you add an LLM or embedding provider, that usage is billed by the provider.",
+ src: README,
+ },
+};
+
+const MEM0_GH = "https://github.com/mem0ai/mem0";
+const SM_GH = "https://github.com/supermemoryai/supermemory";
+const SM_SELF = "https://supermemory.ai/docs/self-hosting/overview";
+const GRAPHITI_GH = "https://github.com/getzep/graphiti";
+const CM_GH = "https://github.com/thedotmack/claude-mem";
+const LETTA_DOCS = "https://docs.letta.com/";
+const COGNEE_GH = "https://github.com/topoteretes/cognee";
+
+export const COMPETITORS: Competitor[] = [
+ {
+ slug: "mem0",
+ name: "Mem0",
+ tagline: "A memory layer you call from your own agent or app, as a library or a managed platform.",
+ links: { home: "https://mem0.ai", docs: "https://docs.mem0.ai", github: MEM0_GH },
+ rows: {
+ what: { value: "Memory layer for AI agents and apps, offered as an open source library and a managed platform.", src: MEM0_GH },
+ license: { value: "Apache-2.0", src: MEM0_GH },
+ deployment: { value: "Managed cloud platform, a self-hosted server, or a library inside your app.", src: MEM0_GH },
+ storage: { value: "An LLM (OpenAI gpt-5-mini by default) and a vector store. The platform hosts both for you.", src: MEM0_GH },
+ capture: { value: "Explicit. Your code calls memory.add() with messages, and an LLM extracts memories from them.", src: MEM0_GH },
+ integrations: { value: "Python and TypeScript SDKs, an MCP integration, OpenMemory, and an agent skill for Claude Code.", src: "https://mem0.ai" },
+ retrieval: { value: "Multi-signal retrieval over extracted memories. Graph memory is on the Pro and Enterprise plans.", src: "https://mem0.ai/pricing" },
+ benchmarks: {
+ value: "Their published scores: LoCoMo 92.5, LongMemEval 94.4, BEAM (1M) 64.1. Measured with their own harness and metric, so not comparable to retrieval recall.",
+ src: MEM0_GH,
+ },
+ pricing: { value: "Hobby free (10,000 adds and 1,000 retrievals a month), Starter $19, Pro $249, Enterprise custom.", src: "https://mem0.ai/pricing" },
+ },
+ summary:
+ "Mem0 is a memory API you build into your own application. agentmemory is a memory server for coding agents that captures sessions on its own and runs entirely on your machine.",
+ differ: [
+ "Mem0 is called by your code: you decide what to send with memory.add(), and an LLM turns it into memories. That suits products where you own the agent loop. agentmemory sits beside agents you already use, like Claude Code or Cursor, and captures their sessions through hooks without code changes.",
+ "Mem0 needs an LLM to extract memories and a vector store to hold them, or its managed platform. agentmemory runs as one local process with no external database, and works without any API key on BM25 search.",
+ "Some Mem0 capabilities, such as graph memory, on-prem deployment and audit logs, sit on paid plans. agentmemory has no paid tier, so every feature ships in the open source build.",
+ ],
+ chooseThem: [
+ "You are building your own agent or app and want a memory API with Python and TypeScript SDKs.",
+ "You want a managed platform with a dashboard and compliance paperwork.",
+ "You are happy to choose what gets remembered with explicit add() calls.",
+ ],
+ chooseUs: [
+ "You use existing coding agents and want memory captured without writing code.",
+ "You want everything on your machine, with no account and no external database.",
+ "You switch between agents and want one memory shared by all of them.",
+ ],
+ },
+ {
+ slug: "supermemory",
+ name: "supermemory",
+ tagline: "A hosted memory and context API with plugins, MCP and framework wrappers.",
+ links: { home: "https://supermemory.ai", docs: "https://supermemory.ai/docs", github: SM_GH },
+ rows: {
+ what: { value: "Memory and context engine for AI, served through a hosted API, plugins and MCP.", src: SM_GH },
+ license: {
+ value: "MIT for the public repository. Their docs state the self-hosted server binary is built from a separate, non-public codebase.",
+ src: SM_SELF,
+ },
+ deployment: { value: "Hosted API by default. A self-hosted server binary is also available.", src: SM_SELF },
+ storage: { value: "Managed by the hosted service. Self-hosting requirements are listed in their docs.", src: SM_SELF },
+ capture: { value: "Server-side. Content sent through the API, plugins or MCP is extracted into memories.", src: SM_GH },
+ integrations: {
+ value: "MCP, a Claude Code plugin, TypeScript and Python SDKs, and wrappers for Vercel AI SDK, LangChain, LangGraph, OpenAI Agents SDK, Mastra and more.",
+ src: SM_GH,
+ },
+ retrieval: { value: "Search over extracted memories and documents through the hosted API.", src: SM_GH },
+ benchmarks: {
+ value: "They report #1 on LongMemEval (95% recall at 15), LoCoMo and ConvoMem. Recall at 15 is a looser cutoff than recall at 5.",
+ src: SM_GH,
+ },
+ pricing: { value: "Free with $5 of monthly credits, Pro $19, Max $100, Scale $399, Enterprise custom.", src: "https://supermemory.ai/pricing" },
+ },
+ summary:
+ "supermemory is a hosted memory API with broad framework support. agentmemory is an open source server that runs on your machine and captures coding agent sessions directly.",
+ differ: [
+ "supermemory runs as a hosted service you send content to, and it extracts memories on its side. agentmemory runs locally, and hooks in your coding agent write to it on your machine.",
+ "According to their self-hosting docs, the downloadable server is built from a non-public codebase, collects telemetry unless SUPERMEMORY_DISABLE_TELEMETRY=1 is set, and still calls a hosted reader for URL ingestion. agentmemory is open source end to end and sends nothing anywhere unless you add a provider.",
+ "supermemory has wrappers for many app frameworks, which suits product teams. agentmemory focuses on coding agents, with native plugins and hooks for the tools developers already run.",
+ ],
+ chooseThem: [
+ "You want a managed API and do not want to run anything yourself.",
+ "You build on Vercel AI SDK, LangChain, Mastra or similar and want a drop-in wrapper.",
+ "You need memory and document retrieval for an end-user product.",
+ ],
+ chooseUs: [
+ "You want the whole engine open source and auditable.",
+ "You want zero network calls by default, with no telemetry to switch off.",
+ "Your main use is coding agents like Claude Code, Codex or Cursor.",
+ ],
+ },
+ {
+ slug: "zep",
+ name: "Zep",
+ tagline: "An enterprise context layer built on Graphiti, an open source temporal knowledge graph.",
+ links: { home: "https://www.getzep.com", docs: "https://help.getzep.com", github: GRAPHITI_GH },
+ rows: {
+ what: {
+ value: "Context layer for enterprise agents that unifies business data, documents and conversations. Built on Graphiti, its open source temporal knowledge graph.",
+ src: "https://www.getzep.com",
+ },
+ license: { value: "Zep is a commercial service. Graphiti is Apache-2.0.", src: GRAPHITI_GH },
+ deployment: { value: "Zep Cloud, with bring-your-own-keys and bring-your-own-cloud options. Graphiti runs wherever you host it.", src: "https://www.getzep.com" },
+ storage: { value: "Graphiti needs a graph database (Neo4j, FalkorDB or Amazon Neptune) and an LLM that supports structured output.", src: GRAPHITI_GH },
+ capture: { value: "Explicit. Your application sends conversations and data to Zep, or adds them to Graphiti through its API.", src: GRAPHITI_GH },
+ integrations: { value: "A memory MCP server for Zep. Graphiti ships its own MCP server.", src: "https://www.getzep.com" },
+ retrieval: { value: "Hybrid semantic, BM25 keyword and graph traversal over a temporal knowledge graph.", src: GRAPHITI_GH },
+ benchmarks: {
+ value: "Their published scores: LoCoMo 94.7% and LongMemEval 90.2% accuracy, with 155 to 162 ms retrieval latency. Answer accuracy, not retrieval recall.",
+ src: "https://www.getzep.com",
+ },
+ pricing: { value: "10,000 free credits a month, Flex $125 a month, Flex Plus $375 a month, Enterprise custom.", src: "https://www.getzep.com/pricing/" },
+ },
+ summary:
+ "Zep is a managed context platform for enterprise agents, built on the Graphiti graph engine. agentmemory is a local memory server for individual developers and their coding agents.",
+ differ: [
+ "Zep centers on a temporal knowledge graph that combines business data, documents and conversations for many users. agentmemory centers on one developer's coding sessions, captured automatically on their machine.",
+ "Running Graphiti yourself means operating a graph database and an LLM for ingestion. agentmemory needs neither: it runs as one process, and its own graph is built locally and optionally.",
+ "Zep's platform adds enterprise controls such as SOC 2 Type II and bring-your-own-cloud. agentmemory avoids that surface by not hosting anything, since data never leaves the machine.",
+ ],
+ chooseThem: [
+ "You need governed, shared context across many users and business systems.",
+ "You want a managed graph platform with enterprise compliance.",
+ "You are already invested in Neo4j or Neptune and want Graphiti on top.",
+ ],
+ chooseUs: [
+ "You want memory for your own coding agents without running a graph database.",
+ "You want capture to happen through hooks, with no integration code.",
+ "You want it free and local, with nothing to provision.",
+ ],
+ },
+ {
+ slug: "claude-mem",
+ name: "claude-mem",
+ tagline: "A memory plugin that compresses coding agent sessions with Claude and injects them back.",
+ links: { home: CM_GH, docs: "https://docs.claude-mem.ai/", github: CM_GH },
+ rows: {
+ what: {
+ value: "Memory plugin that captures coding agent sessions, compresses them with AI and injects relevant context into future sessions.",
+ src: CM_GH,
+ },
+ license: { value: "Apache-2.0", src: CM_GH },
+ deployment: { value: "Runs locally next to your agent, with a background worker and a web viewer.", src: CM_GH },
+ storage: { value: "SQLite with FTS5 and a Chroma vector database. Compression goes through the Claude Agent SDK, so it needs Claude access.", src: CM_GH },
+ capture: { value: "Automatic, through 5 lifecycle hooks: SessionStart, UserPromptSubmit, PostToolUse, Stop and SessionEnd.", src: CM_GH },
+ integrations: {
+ value: "Built for Claude Code. The README also lists OpenClaw, Codex, Gemini, Hermes, Copilot and OpenCode, and it exposes MCP search tools.",
+ src: CM_GH,
+ },
+ retrieval: { value: "Hybrid semantic and keyword search (Chroma plus SQLite FTS5) through a search, timeline and get_observations flow.", src: CM_GH },
+ benchmarks: { value: "not documented", src: CM_GH },
+ pricing: { value: "Free and open source. Compression uses your Claude usage.", src: CM_GH },
+ },
+ summary:
+ "claude-mem and agentmemory solve the same problem the same way: hooks capture coding sessions and context comes back next time. They differ in what runs the compression, what storage they need, and how much of memory they model.",
+ differ: [
+ "claude-mem compresses observations with Claude through the Claude Agent SDK, so every compression is a model call. agentmemory stores observations as captured and works with no model at all; an LLM is optional and only used for consolidation if you add one.",
+ "claude-mem uses SQLite plus a Chroma vector database. agentmemory runs as one process with its own storage and local embeddings, and adds a knowledge graph and four memory tiers with decay.",
+ "Both capture through hooks. agentmemory also ships native plugins for Codex CLI, Cursor, Copilot CLI and others, 54 MCP tools, a REST API, and a release gate that checks crash recovery on every publish.",
+ ],
+ chooseThem: [
+ "You live in Claude Code and want AI-written summaries of every session.",
+ "You are fine spending Claude usage on compression.",
+ "You prefer its search, timeline and observation flow.",
+ ],
+ chooseUs: [
+ "You want memory that works with no model calls and no API key.",
+ "You use several agents and want one shared memory across them.",
+ "You want tiered memory with decay, a knowledge graph and crash-safe capture.",
+ ],
+ moving: [
+ "Install agentmemory with npx -y @agentmemory/agentmemory@latest and connect Claude Code during setup.",
+ "Bring in past sessions from your Claude Code transcripts with npx -y @agentmemory/agentmemory@latest import-jsonl. Claude Code keeps transcripts for 30 days by default.",
+ "Disable the claude-mem plugin so only one tool captures each session.",
+ ],
+ },
+ {
+ slug: "letta",
+ name: "Letta",
+ tagline: "A platform for stateful agents, where the agent edits its own memory.",
+ links: { home: "https://www.letta.com", docs: LETTA_DOCS, github: "https://github.com/letta-ai/letta" },
+ rows: {
+ what: {
+ value: "Platform for building stateful agents. An agent runtime with memory, rather than memory for an agent you already use.",
+ src: LETTA_DOCS,
+ },
+ license: { value: "Apache-2.0", src: "https://github.com/letta-ai/letta" },
+ deployment: { value: "Letta Cloud, or the Letta server run yourself.", src: LETTA_DOCS },
+ storage: { value: "Handled by Letta Cloud or the self-hosted Letta server.", src: LETTA_DOCS },
+ capture: {
+ value: "Agent-managed. The agent reads and updates its own memory blocks with built-in memory tools.",
+ src: "https://docs.letta.com/v1-sdk/memory/memory-blocks",
+ },
+ integrations: {
+ value: "Python and TypeScript SDKs. Letta Code is its open source coding agent harness.",
+ src: "https://docs.letta.com/v1-sdk/memory/memory-blocks",
+ },
+ retrieval: {
+ value: "Core memory blocks are injected into the context window, and the agent changes them through tools.",
+ src: "https://docs.letta.com/v1-sdk/concepts/stateful-agents",
+ },
+ benchmarks: { value: "not documented", src: LETTA_DOCS },
+ pricing: { value: "not documented", src: LETTA_DOCS },
+ },
+ summary:
+ "Letta is a runtime you build agents in, and its agents manage their own memory. agentmemory adds memory to agents you already use, without changing how they run.",
+ differ: [
+ "With Letta you create agents on its platform, and each agent edits its memory blocks through tools. With agentmemory you keep your current coding agent, and memory is captured around it by hooks.",
+ "Letta memory belongs to Letta agents. agentmemory memory is shared by every connected agent, so Claude Code, Cursor and Codex all read from one store.",
+ "Letta runs as Letta Cloud or a Letta server. agentmemory runs as one local process with nothing else to deploy.",
+ ],
+ chooseThem: [
+ "You are building your own long-running agents and want a full runtime.",
+ "You want agents that decide for themselves what to remember.",
+ "You want shared memory blocks across agents you design.",
+ ],
+ chooseUs: [
+ "You want memory for the coding agents you already use.",
+ "You want capture to be automatic instead of agent-decided.",
+ "You want a single local process with no platform to run.",
+ ],
+ },
+ {
+ slug: "cognee",
+ name: "Cognee",
+ tagline: "An open source memory platform that turns your data into a knowledge graph.",
+ links: { home: "https://www.cognee.ai", docs: "https://docs.cognee.ai/", github: COGNEE_GH },
+ rows: {
+ what: { value: "Open source AI memory platform for agents that builds a knowledge graph from the data you give it.", src: COGNEE_GH },
+ license: { value: "Apache-2.0", src: COGNEE_GH },
+ deployment: { value: "Python library, Docker image, or Cognee Cloud.", src: COGNEE_GH },
+ storage: { value: "Graph, vector and relational stores. It can run the whole memory layer on a single Postgres instance.", src: COGNEE_GH },
+ capture: {
+ value: "Explicit. Your code calls cognee.remember (or add), and a pipeline turns the data into a graph. An LLM is optional with a local extraction model.",
+ src: COGNEE_GH,
+ },
+ integrations: { value: "MCP server, a Claude Code memory plugin, Cursor and Cline, plus Python, TypeScript and Rust clients and REST.", src: COGNEE_GH },
+ retrieval: { value: "cognee.recall routes between graph, vector and code retrieval, or combines them.", src: COGNEE_GH },
+ benchmarks: {
+ value: "Their published scores: 0.79 at 100K tokens and 0.67 at 10M tokens of context on their own evaluation.",
+ src: COGNEE_GH,
+ },
+ pricing: { value: "The library is free. Cognee Cloud pricing: not documented.", src: COGNEE_GH },
+ },
+ summary:
+ "Cognee builds knowledge graphs from data you feed it, for agents and apps. agentmemory captures coding agent sessions automatically and keeps them on your machine.",
+ differ: [
+ "Cognee is a pipeline you run over documents and data: add them, then turn them into a graph. agentmemory captures what your coding agent does as it works, through hooks.",
+ "Cognee relies on graph, vector and relational stores, which can share one Postgres. agentmemory needs no database at all and runs as one process.",
+ "Both offer MCP and a Claude Code integration. agentmemory adds native plugins for many coding agents, a live viewer, and four memory tiers with decay.",
+ ],
+ chooseThem: [
+ "You want to build a knowledge graph from documents, code and data sources.",
+ "You need Python, TypeScript and Rust clients in your own app.",
+ "You already run Postgres and want memory inside it.",
+ ],
+ chooseUs: [
+ "You want your coding sessions remembered without feeding data in by hand.",
+ "You want no database to run.",
+ "You want one memory shared across many coding agents.",
+ ],
+ },
+];
+
+export function getCompetitor(slug: string) {
+ return COMPETITORS.find((c) => c.slug === slug);
+}
diff --git a/website/lib/generated-changelog.json b/website/lib/generated-changelog.json
new file mode 100644
index 0000000000..2c3a61d89b
--- /dev/null
+++ b/website/lib/generated-changelog.json
@@ -0,0 +1,62 @@
+[
+ {
+ "version": "0.9.30",
+ "date": "2026-10-06",
+ "body": "Scale, durability and safety release. The iii engine moves from 0.11.2 to 0.22.1. The stores that grew without bound on shared daemons (graph provenance, the audit log, the vector index, the viewer stream backlog) are bounded and heal themselves at boot. Capture is durable end to end: the server accepts each observation into a persistent inbox with a restart-safe event id, and hooks keep an offline spool while the server is down. Vectors survive a force-kill through a pending log. The REST API requires auth by default. Redis becomes an opt-in state backend, and the viewer is rebuilt around one snapshot plus live stream events with a Health page backed by `GET /agentmemory/status`. Every publish now goes through a release gate that installs the packed tarballs and runs capture and recovery against them. Contributions from david-waltermire, a652, cbsincool, dmazhukov and Tyxiel, with earlier work by DaveCole, Srinath279, joyjit and cristianbdev carried into merged PRs.\n\n### Breaking changes\n\n- **Auth is on by default** (#1462). When `AGENTMEMORY_SECRET` is not set, the server generates a secret into `~/.agentmemory/secret` (mode 0600) on first start. The CLI, viewer, hooks, MCP server and shim, `agentmemory connect` configs and the bundled integrations read it for loopback URLs, so they keep working with no change. Hand-written requests to `:3111` now need `Authorization: Bearer $(cat ~/.agentmemory/secret)`. An explicit `AGENTMEMORY_SECRET` still wins, and mesh sync still requires an explicit one.\n- **File import and export paths are confined** (#1462). `/compress-file`, `/replay/import-jsonl`, `/graph/import-graphify`, the Obsidian export and `/migrate` resolve symlinks and only accept paths inside the data dir, `~/.agentmemory` or a directory listed in `AGENTMEMORY_IMPORT_ROOT`. `/replay/import-jsonl` also keeps its default `~/.claude/projects`.\n- **Browser writes need JSON and an allowed origin** (#1462). `POST`, `PUT`, `PATCH` and `DELETE` requests with a body must send `Content-Type: application/json`, and a present `Origin` header must be a loopback origin for the configured ports, the viewer's own origin, or listed in `VIEWER_ALLOWED_ORIGINS`. Clients that send no `Origin` (CLI, hooks, MCP, curl) are unaffected.\n- **`AGENTMEMORY_VECTOR_BACKFILL_MAX` is now a batch size** (#1467). Recovery re-embeds missing vectors in batches of this size until the backlog is empty, across restarts, instead of stopping at the cap once per boot.\n- **iii engine 0.22.1** (#1396, #1397). Keep the `iii-` prefixed builtin worker names (`iii-http`, `iii-state`, `iii-queue`, `iii-pubsub`, `iii-cron`) in any custom config: on 0.22.1 the bare names resolve to standalone registry workers.\n- **Hooks skip agentmemory's own tools** (#1452). PostToolUse no longer captures `memory_*` MCP calls or `toolsearch`, `listmcpresources` and `fetchmcpresource`.\n- **Changed response shapes.**\n - `mem::forget`, `mem::governance-delete` and `mem::governance-bulk` count only records that were really deleted. Absent ids come back in `notFound` and failed deletes in `failed` and `failures`, with `success: false` when anything failed. `governance-bulk` refuses an empty filter and unsupported keys on both the dry run and the live call (#1449).\n - `GET /agentmemory/audit` and the `memory_audit` MCP tool return `{ entries, legacyFrozen, legacyFrozenBytes }`; the MCP tool used to return a bare list (#1419).\n - `GET /agentmemory/memories` returns newest first and adds `nextCursor` (plus `search` and `facets` when requested) (#1433).\n - `GET /agentmemory/export` returns 413 with the refusal body (`oversized`, `bytes`, `limitBytes`, `stoppedAt`) instead of 200 when the export is too large (#1422, #1449).\n - `POST /agentmemory/session/end` for an unknown, malformed or already completed session returns 200 with `ended: false` and writes nothing (#1252).\n - `memory_patterns` / `mem::patterns` reads the 50 most recent sessions by default (`limit`, max 500) and stops after 5,000 observations (#1424).\n - Consolidation decay applies at most once per decay period, and `results.decay` reports `{ scanned, written }` per tier (#1417).\n\n### Upgrade notes\n\n- Scripts or tools that call the REST API by hand on `:3111`: add `Authorization: Bearer $(cat ~/.agentmemory/secret)`, or set your own `AGENTMEMORY_SECRET` and send that.\n- Imports or exports from folders outside `~/.agentmemory` and the data dir: list those folders in `AGENTMEMORY_IMPORT_ROOT` (separate several with `:`, or `;` on Windows).\n- A web page on another origin that writes through the viewer: add its origin to `VIEWER_ALLOWED_ORIGINS`.\n- Nothing else is required. Stores load unchanged, and the one-time migrations below run by themselves.\n\n### What happens on the first start\n\n- **Graph provenance is compacted once in the background.** Every node, edge, superseded edge and the cached snapshot is trimmed to 32 observation ids in slices, without blocking boot, search or the viewer. Progress is saved and resumes after a restart. `AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=false` skips it; `POST /agentmemory/graph/compact` runs it by hand (#1455).\n- **The audit log moves to monthly scopes** (`mem:audit:YYYY-MM`) with a one-time background migration. A legacy scope larger than `AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES` (default 32 MiB) or unreadable is left frozen and reported as `legacyFrozen` (#1419).\n- **The vector index migrates to buckets** (`AGENTMEMORY_VECTOR_BUCKET_SIZE`, default 500) by copying vectors, with no embedding calls. BM25 is no longer persisted and is rebuilt at every boot (#1416).\n- **State is saved every 2 s** instead of 5 s, and `agentmemory stop` waits for the engine flush, so it takes a few seconds longer (#1457, #1449).\n- **Stale sessions are marked abandoned** after `AGENTMEMORY_SESSION_SWEEP_STALE_HOURS` (default 24) by an hourly sweep that deletes nothing (#1453).\n- **Viewer stream groups.** Observations stop writing to per-session `mem-live` groups and the shared `viewer` group is capped at `AGENTMEMORY_VIEWER_STREAM_MAX` (default 500). Existing per-session groups are left in place (#1420).\n\n### Added\n\n- **Durable capture** (#1460). Hooks send a stable event id with every observation (the host tool use id when present, otherwise a hash of the event). The server writes each event to a capture inbox before storing it, keeps completed ids for `AGENTMEMORY_CAPTURE_DEDUP_HOURS`, and answers a replay with the existing observation. Failed writes retry with backoff, also after a restart, and end as dead letters shown on `/status`, the viewer Health page and `GET /agentmemory/capture`, with `POST /agentmemory/capture/retry` to retry them.\n- **Offline hook spool** (#1460, #1468). When the server is down, times out or returns a 5xx, hooks keep a copy of the observation in a bounded private spool under the data dir until the engine has saved it. The spool drains at boot and from the next hook that reaches the server. New: `agentmemory capture [--drain]` and `POST /agentmemory/capture/drain`.\n- **Vector pending log** (#1467). Every vector added to or removed from the live index is also written to a small pending log. Boot replays it after the snapshot with 0 embedding calls, and whatever is still missing is re-embedded as a durable backlog that resumes after a restart instead of stopping at a 500 cap. `/status` and the viewer show the log size and a paused backfill.\n- **Release gate** (#1463). `npm run release:gate` packs `@agentmemory/agentmemory` and `@agentmemory/mcp`, installs both tarballs into a clean home and runs named scenarios against the installed CLI: capture through the bundled hooks, offline capture recovered from the spool, replay dedup after a force kill, dead letters that survive a restart, vectors surviving a crash, stop and start, export and import, the MCP shim, the viewer and `/status`. A Release gate workflow runs it on Ubuntu and macOS.\n- **Capture cost bench** (#1464). `npm run bench:capture-costs` measures disk bytes per state scope, engine and worker memory and CPU, hook latency, provider requests, agent-visible context bytes and force-kill recovery, with separate capture and recovery budgets in `benchmark/capture-costs-budgets.json` and a figure in `docs/benchmarks/capture-costs.svg`. Optional Ollama, Redis and crash-offline variants.\n- **Codex plugin package** (#1459). The Codex plugin bundles a small stdio bridge that forwards tools, resources and prompts to the configured agentmemory daemon and reports connection errors instead of falling back to a separate store. Authenticated non-loopback connections require HTTPS. `npm run plugin:pack:codex` builds a local package with the six Codex hooks and a review package without lifecycle hooks, and `npm run plugin:verify:published` refuses a release whose runtime, MCP shim and iii versions do not match.\n- **Rebuilt viewer that streams every page** (#1433, #1407). One snapshot on connect (`GET /agentmemory/viewer/snapshot`, `GET /agentmemory/counts`), then live `.created/updated/deleted` events with no polling. 12 tabs in four groups with live counts, deep links, keyboard shortcuts and a mobile menu, a memories detail panel with version chain, diff and provenance, sessions with an inline timeline, and a searchable graph. Cursor pagination and facets on memories, sessions and observations, `GET /graph/node` and `GET /observations/locate` back it.\n- **`GET /agentmemory/status` and a Health tab in the viewer** (#1408). One report of what is wrong and how to fix it: providers and circuit breaker, failing functions, observations missing from the search index, index save state per leg (#1415), the state backend, graph compaction progress, capture inbox and spool, ports, the pinned engine version and every feature flag. HTML for browsers, JSON otherwise.\n- **`GET /agentmemory/consolidation/status`** and a \"Memory layers\" panel (#1407).\n- **Opt-in Redis backend for state and streams**: `AGENTMEMORY_STATE_BACKEND=file|redis` and `AGENTMEMORY_REDIS_URL` (#1425). Use one Redis server per instance, and move data with `agentmemory export` and `import` when switching.\n- **`POST /agentmemory/graph/compact`** trims oversized node, edge, edge history and snapshot provenance in slices (#1454, carries #1445 by david-waltermire), and **`AGENTMEMORY_GRAPH_COMPACT_ON_BOOT`** runs it once after upgrade (#1455).\n- **Stale session sweep**: `AGENTMEMORY_SESSION_SWEEP_ENABLED` and `AGENTMEMORY_SESSION_SWEEP_STALE_HOURS` (#1453, carries #1411 by cristianbdev).\n- **Capture filters for hooks**: `AGENTMEMORY_CAPTURE_ALLOW`, `AGENTMEMORY_CAPTURE_DENY`, `AGENTMEMORY_CAPTURE_OUTPUT_MAX` (default 8000) and `AGENTMEMORY_PRE_COMPACT_BUDGET` (default 1500, 0 disables) (#1452, carries #994 by joyjit).\n- **`AGENTMEMORY_AUDIT_INDEX_PERSIST`** (off by default) re-enables index persistence audit rows for debugging (#1182 by dmazhukov).\n- **`AGENTMEMORY_AUDIT_RETENTION_MONTHS`** and **`AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES`** for the monthly audit log (#1419).\n- **`AGENTMEMORY_STATE_SAVE_INTERVAL_MS`**, **`AGENTMEMORY_INDEX_SAVE_INTERVAL_MS`**, **`AGENTMEMORY_VECTOR_BUCKET_SIZE`**, **`AGENTMEMORY_VECTOR_BACKFILL`** and **`AGENTMEMORY_VIEWER_STREAM_MAX`** (#1457, #1415, #1416, #1420).\n- **`agentmemory console`** launches the iii web console through the pinned engine; the \"install iii console?\" prompt and the `skipConsoleInstall` preference are gone (#1397).\n- **Multi-instance installs**: `--instance N` gets its own port quartet, data directory and lifecycle state, and `--port` derives the other ports (#892).\n- Procedures are extracted from finished sessions when consolidation is on and an LLM provider is configured (#1407).\n- `memory_patterns` takes an optional `limit` (#1424). `POST /lessons` accepts `sourceIds`, and `mem::evolve` returns 409, 400 and 404 errors (#1433).\n- **OpenCode 2 support in the OpenCode plugin** (#1476, building on #1451 by Tyxiel). One `agentmemory-capture.ts` serves both plugin APIs: OpenCode 2 loads its `setup()` entry and OpenCode 1.x keeps the existing hooks. On OpenCode 2 it captures prompts, tool calls with their output, the assistant's answer, step and compaction events, injects memory on every model call, and requests a summary when a run finishes. Checked in live sessions on OpenCode 2.0.24, 1.18.34 and 1.17.10.\n\n### Fixed\n\n- **Repeated identical prompts are kept** (#1468). Hooks whose host sends no event id or time now include the hook timestamp in the id, so typing the same prompt twice stores it twice; retries still reuse the stored id.\n- **Cursor prompts are stored once** (#1470). A per-session prompt ledger matches the session-end transcript back-fill against live captures, so a back-filled prompt is answered as a duplicate instead of stored a second time. Live prompts are never deduped by content.\n- **Concurrent spool writers cannot overwrite each other** (#1468), and printed recovery commands (dead letter retry, spool drain, graph compact, the status page example) send the bearer token.\n- **Graph provenance is bounded.** Each node and edge records only its own observation ids, capped at 32, which stops huge graph rows from crash-looping the worker during search (#1454, carries #1445 by david-waltermire).\n- **Search skips graph retrieval when `AGENTMEMORY_GRAPH_WEIGHT=0`** (#1446 by david-waltermire).\n- **A failed graph snapshot read no longer zeroes the snapshot**; the delta is aborted instead (#1384 by cbsincool).\n- **The graph snapshot total can no longer be lower than the nodes it returns** (#1385 by cbsincool).\n- **Ending an unknown session no longer creates a partial row** that hung the sessions listing (#1252 by a652).\n- **Memories and vectors written just before `agentmemory stop` survive the restart** (#1449).\n- **Forget and governance deletes count and audit only real deletions** (#1449).\n- **Export refuses an oversized payload before assembling it** and the REST endpoint returns 413; the MCP shim surfaces the refusal (#1449, #1422).\n- **Session and graph read-modify-write paths take locks**, closing lost updates when several agents share one daemon (#1421).\n- **Hooks no longer exit before their observe request is sent** on a slow start (#1456).\n- **A fresh vector index is checkpointed within 5 s** and observations keep a bounded, sanitized copy of their source for replay and export (#1448).\n- **Runtime config is re-seeded on every start**, so `--port`, `--instance` and data-dir changes take effect after the first run (#1396, #1397).\n- **The \"Memory elevated\" alert no longer fires on a healthy process** (#1409).\n- **The viewer stops blinking and keeps data on a failed refresh**, and dashboard numbers match the API (#1407).\n- Consolidation and provider detection use the same check, and functions that need an LLM show as off instead of failed (#1433).\n- Worker shutdown no longer hangs when the engine is already gone (#1396).\n- Fresh installs are portable and persistent, and native and Docker removal stops the worker before the engine (#892).\n- **`OPENAI_EMBEDDING_API_KEY` is honored** when the embedding provider is auto-detected or chosen, and wins over `OPENAI_API_KEY`; blank keys count as unset (#1472).\n- **SessionStart context reaches hosts that expect structured hook output.** When the hook input names the `SessionStart` event, context is returned as `hookSpecificOutput.additionalContext`; hosts that send no event name still get plain text (#1472).\n\n### Security\n\n- **Request hardening** (#1462, supersedes #878 by DaveCole and #922 by Srinath279). Auth on by default, origin and content type checks on writes, and confined file paths, as described under Breaking changes. Confined files are replaced only after the new content is fully written, and a destination that is a symlink is refused.\n- **Scrubbing on every write** (#1462). Write functions run the secret scrubber on their input, and compression, summary, crystal, graph, replay, team share, session title, commit message and image description text is scrubbed before storage. New patterns cover PEM private key blocks and credentials in URLs. Stored text is escaped before it goes into the injected context block.\n- **Clients resolve the API secret the same way as the server** (#1462): environment first, then `~/.agentmemory/.env`, then the generated secret file, and the stored secret is only sent to loopback URLs.\n- **Supply chain** (#1461). The automatic engine installer verifies the downloaded archive against a SHA-256 pinned in the CLI for each platform before extracting it, and refuses an unpinned version or platform. `npm run engine:hashes` refreshes the pins. Installer paths reach the shell as arguments, so a home directory containing shell syntax is never evaluated. The CI workflow runs with read-only permissions, and the deploy Dockerfiles check that the copied iii binary matches `III_VERSION`.\n- `GET /agentmemory/status` serves HTML with no scripts under a strict CSP and the same bearer auth as the rest of the API (#1408).\n- The Redis URL stays out of files and output (#1425).\n- `mem::governance-bulk` cannot widen a dry run to the whole store (#1449).\n- The pinned engine starts with `--no-update-check` and iii's anonymous usage telemetry off (#1396).\n- A profile read no longer writes a `share` audit entry (#1433).\n\n### Performance\n\n- **Vectors are stored per key in fill-and-roll buckets**, so a save rewrites a few buckets instead of the whole index and the store no longer hits V8's string limit at about 49,000 vectors (#1416).\n- **Index saves are throttled and each leg reports its own state**, so one failing leg no longer skips the others (#1415).\n- **The audit log lives in monthly scopes** read newest first (#1419).\n- **Session start context and observation lookups use small secondary indexes** instead of listing every session (#1418).\n- **`mem::remember` calls the embedding provider outside the global save lock** (#1423).\n- **`mem::patterns` is bounded** to recent sessions and an observation budget (#1424).\n- **Consolidation decay writes only rows that changed** (#1417).\n- **The viewer stream backlog is bounded** (#1420).\n- **Faster state saves**, `MALLOC_ARENA_MAX=2` for the engine on Linux, and a higher open-file limit in Docker and deploy entrypoints (#1457).\n\n### Docs and internal\n\n- **agent-memory.dev is rebuilt** around use cases and sourced proof: agent sessions showing what memory changes, a view of the 1,571 tokens the next session gets out of a month of history, live GitHub and all-time npm numbers, and new /benchmarks, /security, /privacy, /changelog and /vs comparison pages. It ships robots.txt, a sitemap, llms.txt and llms-full.txt, and link previews now point at agent-memory.dev instead of a parked domain.\n- `npm run docs:sync` and `npm run docs:check` keep the documented counts and versions in README, the translated READMEs and AGENTS.md in step with the code.\n- The README documents auth by default, request rules, file path roots, the capture inbox and spool, and the pending vector log (#1460, #1462, #1467).\n- The README, the config skill reference and `agentmemory --help` document `AGENTMEMORY_III_CONFIG` and the engine bind address, including the Docker engine config (#1472).\n- Code and tests no longer cite issue or PR numbers (#1469).\n- The `index_persist` audit gating suite is restored against bucketed persistence and monthly audit scopes (#1477), originally written by dmazhukov in #1182.\n- Unit tests grew from about 1,700 to more than 2,400.\n- Dependabot no longer proposes `iii-sdk` bumps; the engine pin and the SDK move together by hand (#1396). `dotenv` 18.0.3 (#1430) and `@types/node` 26.6.2 (#1401, #1400).\n- The deploy Dockerfiles refuse to build when `III_VERSION` and `III_SDK_VERSION` differ (#1396).\n- Thanks to MarvinFS (discussion #1358), inix-x, sbynode-ux, ErikBPF and cmondragon023, whose measurements and earlier PRs shaped the scaling work."
+ },
+ {
+ "version": "0.9.29",
+ "date": "2026-08-16",
+ "body": "Release wave in two parts. Recall quality: hybrid ranking reaches the primary recall path, lessons get a real index, every record learns where it came from, the knowledge graph populates keyless, and agent scoping threads through all save paths — plus connector parity for pi and Codex, a new DeepSeek Harness connector, current provider model defaults, and a viewer clarity pass. Foundation: the `.env` file now applies everywhere, imports become searchable, consolidation runs on session stop, twelve MCP-only agents get activated on connect, and every capture surface agrees on what \"project\" means. No breaking changes; read the upgrade notes for behavior changes you will notice.\n\n### Upgrade notes\n\n- `~/.agentmemory/.env` values that were silently ignored by most modules now take effect on boot. If that file has stale entries from past experiments, review it before upgrading.\n- `agentmemory connect ` now writes a short memory-usage guideline into the agent's native rules file (Cursor, Cline, Continue, Zed, Warp, Kiro, Gemini CLI, Qwen, OpenCode, Droid, Copilot CLI, Antigravity) so MCP-only agents actually call the memory tools. Pass `--no-guidelines` to opt out.\n- Installs with an LLM key now run consolidation and crystallization on session stop (previously they never fired), debounced to once per 5 minutes (`AGENTMEMORY_CONSOLIDATION_COOLDOWN_MS`).\n- Local embeddings re-download once after the `@huggingface/transformers` migration (different model cache directory). Model IDs are unchanged.\n\n### Added\n\n- **Two new skills (15 → 17).** `memory-discipline` (reference) codifies the session loop the memory model expects: recall before nontrivial work, save decisions with their reasons at the moment they settle, route corrections into lessons. `/lesson` (invocable) distills a correction into a confidence-weighted rule via `memory_lesson_save`, echoing the saved rule back for veto.\n\n- **Devin support.** New `agentmemory connect devin` adapter wires the MCP entry into Devin CLI's user config, and `--with-hooks` installs six native auto-capture hooks (`SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `Stop`, `SessionEnd`) using Devin's lowercase tool matchers — the capitalized Claude Code matchers Devin also loads never match its tool names, so capture looked wired but never fired. A Devin plugin manifest at `plugin/.devin-plugin/plugin.json` registers all 17 skills as `/agentmemory:` slash commands plus the MCP server. Hook payloads now resolve the project from `DEVIN_PROJECT_DIR`, and session-start context injection answers each host in its own shape (Devin's `hookSpecificOutput.additionalContext`, Cursor's `additional_context`, Claude Code's raw stdout). Verified against Devin CLI 3000.1.23.\n\n- **Cursor plugin.** Full Cursor Marketplace plugin (`.cursor-plugin/`): 7 native auto-capture hooks (`sessionStart`, `beforeSubmitPrompt`, `preToolUse`, `postToolUse`, `postToolUseFailure`, `stop`, `sessionEnd`), all 17 skills, and the MCP server, with `AGENTMEMORY_URL` / `AGENTMEMORY_SECRET` declared as dashboard-managed plugin variables. Hook scripts accept Cursor's payload dialect (`conversation_id` session fallback, `workspace_roots` project attribution) without changing Claude Code behavior, and context injection answers each host in its own output shape. Cursor's CLI print mode never dispatches `beforeSubmitPrompt`, so session end backfills user prompts from the session transcript; server-side dedup absorbs the re-post where a live hook already captured the prompt. Verified end to end against Cursor 3.13.25, GUI and `cursor-agent` CLI.\n\n- **Write-time provenance on every record.** Each observation and memory carries an immutable origin block (channel `user` / `agent` / `tool` / `import` / `shared`, detail, capturedAt) stamped at capture, save, and import, and inherited through both compression paths. The base for trust-aware retrieval and ingest screening.\n- **`similarTo` advisory hint on save.** `mem::remember` reports a near-miss similarity match (0.4 to 0.7) back to the caller so agents can spot near-duplicates without the write being blocked.\n- **`AGENTMEMORY_LLM_NOTHINK=1`** (opt-in): asks local reasoning models to skip their hidden thinking pass during graph extraction. Extraction runs faster; relation quality can drop slightly. Default behavior unchanged; documented in `.env.example`.\n- **Keyless graph extraction.** `mem::graph-extract` always runs a deterministic structural pass first: files and concepts on compressed observations become nodes, and co-occurrence within an observation becomes a `related_to` edge. The graph now populates without any LLM key; `GRAPH_EXTRACTION_ENABLED` plus a provider key gates only the LLM pass that layers typed relations (fixes, depends_on, causes) on top. Session end fires extraction unconditionally.\n- **pi extension: capture parity with the Claude Code plugin.** Session registration on start (after the health check populates reachability, so it fires on the first session of a fresh process), prompt capture on submit (deduped in a 5-minute client window against auto-retry re-submissions; stored with user-channel provenance), per-tool observations from `tool_result` (server `inferType` classifies command_run / file_edit / file_read; `AGENTMEMORY_TOOL_OBSERVE=0` opts out), turn capture slices raised 500/4000 → 8000/8000, `memory_save` scoped to the current project instead of the global bucket, session end + one cross-session consolidate run on real quit only (`/new`, `/resume`, `/fork`, reloads excluded; no client-side summarize call — `session/end` already fans out the summary, avoiding the double-summarize the Stop hook had), status checks accept `status: \"ok\"`, and the status refresh no longer throws a stale-context error when the session is replaced mid-health-check. Live-verified on pi v0.84.2: prompt + turn observations landed and the session closed as `completed` on quit. Codex executes only hooks with a recorded `trusted_hash` and shows its \"Hooks need review\" approval prompt exclusively in the interactive TUI, so a `codex exec`-only workflow left the freshly installed hooks silently inert. `connect codex --with-hooks` now warns to launch `codex` once and choose \"Trust all and continue\" (and to re-approve after upgrades, since refreshed paths change the hash). Found by live-testing the documented flow end to end.\n- **`connect pi` actually installs.** The pi adapter was a stub that printed manual copy instructions because `integrations/` never shipped in the npm package. The extension source now ships, and `connect pi` copies it into `~/.pi/agent/extensions/agentmemory/`, which pi auto-discovers — no settings.json edit, `/reload` picks it up live. Idempotent by content compare; `--force` and stale copies refresh with a backup. `integrations/pi` is also a proper pi package now (`pi-package` keyword, `pi.extensions` manifest, peer deps on `@earendil-works/pi-coding-agent` + `typebox`; private, local installs only — `pi install ./integrations/pi` from a checkout), and the extension's type import moved off the renamed upstream package name.\n- **DeepSeek Harness connector.** `agentmemory connect dsh` appends an `@deepseek-ai/dsh-mcp-client` row to the home-level `$DSH_HOME/cordis.patch.yml`, the machine-local patch layer every Harness profile loads. `--with-hooks` adds full auto-capture: the bundled Claude Code hook scripts run through Harness's first-party `@deepseek-ai/dsh-hooks-claude-code` bridge (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop) via a manifest written to `$DSH_HOME/agentmemory.hooks.json` with absolute script paths. Idempotent, `--force` replaces the rows, honors `DSH_HOME`.\n- **Viewer clarity pass.** Two-pane session explorer (list beside a sticky detail panel on wide screens), dashboard stat cards that navigate to their tabs, memory and lesson rows that expand to the full stored record with raw JSON and origin provenance, type-clustered graph layout with label collision avoidance when relations are sparse, health notes translated from machine slugs into sentences, honest zero states for consolidation and graph, and the official icon as the favicon.\n- `--data-dir` flag and `AGENTMEMORY_DATA_DIR` so iii-engine state lives outside repositories, with gated legacy `./data` adoption and Docker-volume preservation (#314)\n- Native hooks adapter for Droid via `~/.factory/hooks.json`, reusing the bundled hook scripts (#1130)\n- Native hooks adapter for Antigravity CLI (agy) via a stdin bridge that normalizes agy's hook payloads onto the bundled hook scripts, with an explicit PreToolUse allow decision (#1146, thanks @berthojoris)\n- `mem::graph::import-graphify` and `POST /agentmemory/graph/import-graphify`: merge graphify's `graph.json` into the knowledge graph with confidence tags carried over as edge weights (#1136)\n- Connector guideline activation for twelve hook-less agents, with every rules-file path verified against the agent's official documentation (#1136)\n- Honest `memory_forget` reporting plus a real lesson delete path (`mem::lesson-delete`, `DELETE`-style REST route, MCP tool) (#1132)\n- `AGENTMEMORY_PROJECT_NAME` override in the OpenCode plugin (#1125)\n- Provider fetches retry 429/503 honoring `Retry-After` under a total-elapsed budget capped below the iii invocation timeout (#1136)\n\n### Changed\n\n- **Provider default models bumped to current generations.** OpenAI `gpt-4o-mini` → `gpt-5.6-luna`, Anthropic `claude-sonnet-4-20250514` (deprecated upstream, retires 2026-06-15) → `claude-sonnet-5`, Gemini `gemini-2.5-flash` → `gemini-3.7-flash` (current stable Flash), MiniMax `MiniMax-M2.7` → `MiniMax-M3`, OpenRouter `anthropic/claude-sonnet-4-20250514` → `anthropic/claude-sonnet-5`. The premium-model cost warning now also matches OpenAI's Sol flagship tier, and its cheap-alternative hint leads with `deepseek/deepseek-v4-flash-0731`. Explicit `*_MODEL` env overrides are unaffected. Embedding defaults are unchanged (`text-embedding-3-small`, `gemini-embedding-001`, local MiniLM are all current). README local-model picks refreshed to the Qwen 3 / gpt-oss / DeepSeek R1 generation.\n- Local embeddings migrate from `@xenova/transformers` to `@huggingface/transformers` v4 with Node 22+ support; CI now tests Node 20, 22, 24, and 26 (#479, #1096)\n\n### Fixed\n\n- **MCP protocol version negotiation.** The standalone MCP server hardcoded `protocolVersion: \"2024-11-05\"` and ignored the client's requested version, so hosts that drop that revision disconnected with `-32000` ([#908](https://github.com/rohitg00/agentmemory/issues/908)). `initialize` now echoes any supported revision (`2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05`) and answers with the latest supported otherwise.\n\n- **Hybrid ranking on the primary recall path.** `mem::search` (behind `memory_recall`) now ranks through the full BM25 + vector + graph fusion when the vector index is populated; it was keyword-only while only smart-search got hybrid ranking. Fusion weights normalize per item over the streams that actually ranked it, with an explicit cross-stream agreement bonus, replacing the every-enabled-stream denominator that permanently penalized single-stream hits. Result order is deterministic (score, best rank, id).\n- **Indexed lesson recall.** Lessons get a dedicated in-memory BM25 index built lazily from one KV list and maintained incrementally on save, delete, and decay; recall previously listed and substring-scanned the whole corpus per query. A record cache beside the index takes recall to zero KV round-trips.\n- **Superseded versions leave recall.** Superseded memory versions are removed from the BM25 and vector indexes; the version chain stays in KV for history, but recall no longer returns an outdated fact as if current. `mem::remember` also finds supersession candidates through the search index (top 50) instead of walking every memory per save, with a full-scan fallback while the index is cold.\n- **`agentId` threads through every save path** ([#1159](https://github.com/rohitg00/agentmemory/issues/1159), [#1160](https://github.com/rohitg00/agentmemory/issues/1160), [#1197](https://github.com/rohitg00/agentmemory/issues/1197)). REST `/agentmemory/remember` forwards `agentId` instead of dropping it; `memoryToObservation()` carries the memory's `agentId` into the search-index shape so saved memories are visible to agent-scoped search; the MCP `memory_save` schema exposes `agentId` and the standalone stdio package forwards both `agentId` and `project`.\n- **Per-session project attribution in the OpenCode plugin** ([#1188](https://github.com/rohitg00/agentmemory/issues/1188)). Project and cwd resolve from each session's own directory at `session.created` (pruned on session end) instead of module-level state that filed every session in a multi-directory OpenCode process under whichever repo loaded the plugin first.\n- **Prompt dedup no longer swallows prompts** ([#1173](https://github.com/rohitg00/agentmemory/issues/1173)). Hooks hash the payload when `tool_input` is absent, so prompt_submit, notification, and lifecycle events dedup on content instead of collapsing onto one shared key that silently dropped every prompt after the first in a TTL window.\n- **Stop hook no longer summarizes twice** ([#1203](https://github.com/rohitg00/agentmemory/issues/1203)). The direct `/agentmemory/summarize` POST is gone; `/session/end` already fans out `event::session::stopped`, which runs `mem::summarize`.\n- **Safe Docker-mode stop** ([#1151](https://github.com/rohitg00/agentmemory/issues/1151)). The CLI refuses to adopt or signal Docker/VM port holders (com.docker.backend, vpnkit, colima) as the native engine unless `--force`; Docker-mode teardown is scoped to agentmemory's own compose services instead of an unscoped `down`; the native worker is reaped before Docker teardown instead of deleting `worker.pid` with the process still running.\n- **Viewer live stream and freshness.** The stream WebSocket target resolves from `/agentmemory/livez` (new `streamsPort` field) instead of viewerPort-1 arithmetic, which pointed at the wrong server whenever the viewer bound a fallback port and silently degraded live updates to polling. Tab data refetches on entry (with a freshness gate), so a memory saved by the agent appears without a hard reload.\n- **Hermetic tests** ([#1178](https://github.com/rohitg00/agentmemory/issues/1178)). HOME/USERPROFILE are isolated for the whole vitest run so suites stop reading the developer's real `~/.agentmemory/.env`.\n- Boot hydrates `~/.agentmemory/.env` into `process.env`, closing the class of \"env var in .env is ignored\" bugs (#1136)\n- Imported and replayed observations are indexed into BM25 and the vector index, so imports are searchable (#1072, via #1136)\n- Snapshot timer actually runs, non-positive intervals clamp to the default, and snapshot creation is serialized across timer, REST, and MCP (#1006, via #1136)\n- CJK-aware dedup with NFC normalization and an exact-match fallback for short memories (#1021, via #1136)\n- OpenRouter embeddings no longer hardcode 1536 dimensions (#1002, via #1136)\n- Viewer decodes multibyte request bodies correctly (#930, via #1136)\n- Session-stop consolidation is debounced and no longer double-fires from the client hook; eviction recovery is bounded to one consolidation pass (#1087, #1131 class, via #1136)\n- `/agentmemory/sessions` no longer deadlocks on large session counts (#1100, via #1136)\n- Filesystem watcher validates roots before `fs.watch`, fixing Node 24/26 on Linux (#1136)\n- `GET /agentmemory/export` and `/agentmemory/mesh/export` refuse an over-frame response instead of shipping it: a payload past the engine 16 MiB transport frame used to drop the worker and 404 every endpoint for ~1s. They now fail that one request (413 for mesh, an `oversized` error for export) with a hint to narrow the range, keeping the daemon up (#1142, #890). Full pagination of the non-session collections is a follow-up.\n- Claude bridge writes `MEMORY.md` under the `memory/` subdirectory Claude Code actually reads (#1134)\n- Hook project-resolution tests no longer depend on the checkout directory name (#1137, #1138)\n- Project-scope parity: the OpenCode plugin, Hermes plugin, Pi extension, and JSONL replay now resolve `project` the same way the hooks do (env override, git toplevel basename, cwd basename) instead of sending raw filesystem paths, so the same repository shares one memory bucket across agents (#903, #1135); the filesystem watcher accepts `AGENTMEMORY_PROJECT_NAME` with the old `AGENTMEMORY_PROJECT` kept as a deprecated alias; replay handles Windows-recorded paths\n- OpenCode file enrichment matches the agent's lowercase tool names, which the previous capitalized set never did\n- Viewer surfaces health status from non-2xx health responses (#1046)\n- Documented REST endpoint count matches the registered routes again (130)"
+ },
+ {
+ "version": "0.9.28",
+ "date": "2026-07-19",
+ "body": "Patch release: hardens the hook runner against malformed payloads and closes a cross-agent context leak. No breaking changes; drop-in upgrade.\n\n### Security\n\n- **Cross-agent memory leak via `POST /agentmemory/context`** ([#1057](https://github.com/rohitg00/agentmemory/issues/1057)). `mem::context` and its `api::context` handler filtered candidate sessions by `project` only, so under `AGENTMEMORY_AGENT_SCOPE=isolated` one profile could receive another profile's session observations and summaries whenever they shared a project path — while `/search` and `/smart-search` already filtered correctly. `mem::context` now applies the same agent-scope filter as `mem::search` ([#817](https://github.com/rohitg00/agentmemory/issues/817)): explicit `agentId` pins, wildcard `agentId: \"*\"` bypasses, isolated mode falls back to env `AGENT_ID`, and the call fails closed if isolated mode is on with no resolvable agent id. All three callers (`api::context`, `api::session::start`, `event::session::started`) now forward `agentId`.\n\n### Fixed\n\n- **Hooks crashed with exit code 1 on a `null` JSON payload** ([#1047](https://github.com/rohitg00/agentmemory/issues/1047)). `JSON.parse(\"null\")` returns `null` without throwing, so the existing parse guard passed it through and the first `data.session_id` access threw a `TypeError`. Because each hook called `main()` bare, that became an unhandled rejection and the host CLI (Codex CLI, Claude Code) reported \"hook exited with code 1\" on every affected tool call. All 13 hook entrypoints now guard `if (!data || typeof data !== \"object\")` before dereferencing, and wrap the top-level `main()` in `.catch()` so any hook error fails closed (silent exit 0) instead of surfacing to the host tool loop.\n\n### Docs\n\n- Refreshed stale stats in README and AGENTS.md (AGENTS test count 950+ → 1,428+, iii-function count 50+ → 260+) plus the README source-file, LOC, function, and KV-scope counts, and regenerated the website meta snapshot for 0.9.28. Removed the rate-limited star-history chart from the README and all 11 translations."
+ },
+ {
+ "version": "0.9.27",
+ "date": "2026-06-07",
+ "body": "Wave release closing several breaking regressions reported against v0.9.26, plus an agent-scope isolation security fix, an iii version-pin audit fix, and a benchmark scorecard correction. No breaking changes; drop-in upgrade.\n\n### Security\n\n- **`AGENTMEMORY_AGENT_SCOPE=isolated` not enforced on `mem::search` / `POST /agentmemory/search` / `memory_recall` / `recall_context`** ([#817](https://github.com/rohitg00/agentmemory/issues/817)). PR #654's isolation work covered smart-search, `/memories`, `/observations`, and `/sessions` but missed the BM25-only recall path. An isolated worker booted with `AGENT_ID=B` could read agent A's memories via the standard MCP `memory_recall` tool. `mem::search` now applies the same filter as smart-search (wildcard `agentId: \"*\"` bypasses, explicit `agentId` pins, isolated mode falls back to env `AGENT_ID`). `recall_context` prompt also filters its kv.list memory feed by active agent. Fail-closed: if isolated mode is on and no agent id resolves from any source, the call throws rather than dropping the filter.\n\n### Fixed\n\n- **`/graph/query` and `/graph/stats` timed out with `\"Invocation stopped\"` on large existing corpora** ([#814](https://github.com/rohitg00/agentmemory/issues/814), [PR #816](https://github.com/rohitg00/agentmemory/pull/816)). The v0.9.25 fix from #753 paginated the response but the unbounded `kv.list` + `kv.list` pair still ran on every call. At 75K+ nodes the response payload exceeded the iii heartbeat budget and the worker was declared dead before the new wall-clock timer could fire. Refactored `mem::graph-extract` to maintain three side-indexes (`graphNameIndex`, `graphEdgeKey`, `graphNodeDegree`) so every extract path is O(1), never O(n). The hot path now reads exclusively from a precomputed top-degree snapshot updated inline on every extract. Same `kv.list` bottleneck was also blocking `mem::graph-extract` on every observation capture, so the fix immediately speeds up the observation pipeline too.\n- **All data lost on `agentmemory stop` followed by restart** ([#843](https://github.com/rohitg00/agentmemory/issues/843)). `runStop()` killed the iii engine first, then the worker. The worker's shutdown handler flushes BM25/vector snapshots and audit rows via `indexPersistence.save() -> kv.set() -> state::set`, which all routed through an iii engine that was already dead. Stop order inverted: worker first with a bumped 5s SIGTERM grace (gives a large index a real chance to commit), engine second. The \"Memories persisted to disk\" message now reflects actual disk state.\n- **`mem::graph-snapshot-rebuild` and `mem::graph-reset` heartbeat-crashed on legacy >25K-node corpora** ([#825](https://github.com/rohitg00/agentmemory/issues/825)). Both endpoints called `kv.list` up front. At 75K nodes the response payload blocks the event loop in `JSON.parse` and the iii heartbeat starves before any wall-clock budget timer can fire. `mem::graph-snapshot-rebuild` now refuses pre-flight when no prior snapshot exists, returning `{ legacyCorpus: true }` with operator guidance unless an explicit `force: true` flag is set. `mem::graph-reset` no longer enumerates anything: it writes an empty snapshot stamped with `resetAt` and returns. Legacy rows stay as on-disk orphans but post-reset `mem::graph-extract` calls compare each name-index hit's `createdAt` against `resetAt`, so older rows are treated as not-found and a fresh node is written instead of silently reconnecting to a pre-reset orphan.\n- **Multi-instance port collisions on one host** ([#750](https://github.com/rohitg00/agentmemory/issues/750), [PR #815](https://github.com/rohitg00/agentmemory/pull/815)). `--port N` only relocated REST + viewer; streams (3112) and iii engine (49134) stayed hardcoded so a second daemon collided on those WS ports regardless of `--port`. `loadConfig()` now derives streams = REST+1 and engine = REST+46023 (so the canonical 3111 → 3112/49134 default is unchanged, and `--port 3211` → 3212/49234). New `--instance N` shortcut picks a 100-port block: `--instance 1` → 3211/3212/3213/49234. Per-port env overrides (`III_STREAM_PORT`, `III_ENGINE_PORT`, `III_ENGINE_URL`) still win.\n- **iii console install pulled latest engine instead of the pinned v0.11.2** (audit). `III_CONSOLE_INSTALL_CMD` ran `curl -fsSL https://install.iii.dev/iii/main/install.sh | sh` with no version pin. A fresh first-run prompt could install a console build that talks a different protocol than the engine agentmemory pins. The install script reads a `VERSION` env var (`engine_version=\"${VERSION:-}\"` in install.sh), so the command now passes `VERSION=${IIPINNED_VERSION}`. Render path is platform-aware too: Windows users get a PowerShell-friendly hint instead of a POSIX command they can't run. Mismatch error text updated from \"reinstall the latest binary\" to reference the pinned version explicitly.\n\n### Docs\n\n- **Corrected coding-agent-life-v1 P@5 numbers in the published scorecard** ([#796](https://github.com/rohitg00/agentmemory/issues/796), [PR #805](https://github.com/rohitg00/agentmemory/pull/805)). The original scorecard reported P@5 = 0.578 / 0.267, generated before [PR #562](https://github.com/rohitg00/agentmemory/pull/562) changed the P@K denominator from `topK.length` to `k`. On the current formula those numbers are mathematically impossible (math ceiling at K=5 on this corpus is 0.240). Re-scored on v0.9.26: hybrid 0.240 / R@5 1.000, grep 0.227 / R@5 0.967. Reframed lift as recall + temporal not aggregate precision; aggregate P@5 saturates on a small / single-gold corpus and can't differentiate top-tier adapters.\n- **README refresh** ([PR #807](https://github.com/rohitg00/agentmemory/pull/807)). Stats line bumped to 174 files / 1,390+ tests / 258 functions. Corrected hero P@5 numbers. \"New in vX.Y.Z\" callout block removed since that pattern went stale every release; latest release notes link points at CHANGELOG.md.\n- **`import-jsonl` users warned about Claude Code's `cleanupPeriodDays`.** Default 30-day auto-deletion of `~/.claude/projects/*.jsonl` doesn't affect hook-wired installs (each turn lands in iii state while the session is live), but fresh installs on months-old Claude Code histories silently lost anything older than 30 days. README now flags this with three workarounds: cron the import, raise `cleanupPeriodDays`, or wire hooks.\n\n### Added\n\n- **`POST /agentmemory/graph/snapshot-rebuild`** — pays the full enumeration cost once on corpora ≤ 25K nodes, persists a top-degree subgraph + aggregate counts, refuses with `{ success: false, tooLarge: true, totalNodes, ceiling }` above the safe ceiling instead of killing the worker. Strict `force: true` boolean check bypasses the legacy-corpus pre-flight refusal.\n- **`POST /agentmemory/graph/reset`** — clean-restart escape hatch for legacy corpora. Enumeration-free: writes empty snapshot with `resetAt` epoch marker. Future extracts treat any pre-`resetAt` row as orphan via `createdAt` comparison.\n- **`--instance N` CLI flag** — multi-daemon convenience. Picks a 100-port block off the 3111 base. Max N=50.\n- **`GraphSnapshot.topDegrees`** — synchronous degree lookup keyed by nodeId so re-ranking after edge writes runs sync over numbers instead of async kv.get inside the sort comparator.\n- **`GraphSnapshot.resetAt`** — ISO timestamp set by `mem::graph-reset`. Drives post-reset orphan detection in extract.\n- **`GraphQueryResult.fromSnapshot`** + **`GraphQueryResult.warning`** — response fields the viewer can use to surface \"served from cache\" or \"rebuild needed\" banners instead of opaque 500s.\n\n### Changed\n\n- **REST endpoint count: 126 → 128**. `POST /agentmemory/graph/snapshot-rebuild` and `POST /agentmemory/graph/reset` added.\n- **`mem::graph-stats`** now reads exclusively from the snapshot. Returns `{ ..., fromSnapshot, warning }` envelope when snapshot is absent; never returns a 500.\n- **`mem::graph-query` empty-body / nodeType-only path** reads exclusively from the snapshot. `startNodeId` / `query` paths keep the live enumeration behind a 6s budget with snapshot-backed fallback on rejection.\n- **`mem::search` over-fetch** triggers when agentId filtering is active (not just project/cwd). Without it, isolated-mode pages were silently underfilled when same-agent matches ranked below cross-agent ones.\n\n### Known limitations\n\n- `mem::graph-query` BFS (`startNodeId`) and text-search (`query`) paths still call `kv.list` and degrade past ~25K nodes on fresh corpora ([#828](https://github.com/rohitg00/agentmemory/issues/828)). The hot path stays safe (snapshot-only). A per-node adjacency index is the right next fix; deferred to the structured graph migration milestone ([#309](https://github.com/rohitg00/agentmemory/issues/309)).\n- `/agentmemory:forget` skill still calls `memory_governance_delete` which only touches `KV.memories` and never observations ([#833](https://github.com/rohitg00/agentmemory/issues/833)). Skill rewrite + new `memory_forget` MCP tool tracked separately.\n- `crypto.randomUUID()` global-only on Node <19 ([#715](https://github.com/rohitg00/agentmemory/issues/715)). Drop-in import fix tracked."
+ },
+ {
+ "version": "0.9.26",
+ "date": "2026-06-03",
+ "body": "Hotfix on top of v0.9.25. The first-run boot crashed for users without a persisted index because the load path didn't handle `undefined` returns from iii-state adapters.\n\n### Fixed\n\n- **First boot crash: `TypeError: Cannot read properties of undefined (reading 'v')`** ([#797](https://github.com/rohitg00/agentmemory/issues/797)). The sharded index load path (`loadShardedData`) checked `manifest.value !== null` before forwarding to `loadManifestData`. Some iii-state adapters return `undefined` (not `null`) for a missing key, so `undefined !== null` was true and `loadManifestData(undefined, ...)` immediately threw on `manifest.v`. Now treats both `null` and `undefined` (plus non-object values) as \"no manifest\" and falls through to the legacy load path. Self-healing: the next debounced save rebuilds a fresh manifest, so the crash was already cosmetic for ongoing operation — but it scared every fresh upgrader. Tests cover both undefined and wrong-shape manifest rows."
+ },
+ {
+ "version": "0.9.25",
+ "date": "2026-06-03",
+ "body": "Bug-fix wave closing every breaking regression reported against 0.9.24, plus a feature lane (graph pagination + smart-search followup diagnostic + obsidian-export hardening + sharded index persistence). Eleven issues closed. No breaking changes; drop-in upgrade.\n\n### Fixed\n\n- **Cross-provider fallback always 404'd and tripped the circuit breaker** ([#778](https://github.com/rohitg00/agentmemory/issues/778), [PR #791](https://github.com/rohitg00/agentmemory/pull/791)). `createFallbackProvider` copied the primary provider's `model` into every fallback config. With OpenAI primary + Gemini fallback, Gemini was called with `gpt-4o-mini` and 404'd on every call, tripping the circuit breaker and blocking downstream LLM ops. Each fallback now resolves its own env-driven default (`OPENAI_MODEL` / `GEMINI_MODEL` / `ANTHROPIC_MODEL` / `MINIMAX_MODEL` / `OPENROUTER_MODEL`).\n- **`import-jsonl` aborted entire batch on legacy session row missing `id`** ([#775](https://github.com/rohitg00/agentmemory/issues/775), [PR #791](https://github.com/rohitg00/agentmemory/pull/791)). Existing-session branch re-keyed on `existing.id` which could be undefined for older rows. `JSON.stringify` dropped the key from the `state::set` payload, the engine returned `missing field \\`key\\``, and the rejection aborted the whole handler. Now re-keys on `parsed.sessionId` and backfills `existing.id`.\n- **`parseSummaryXml` silently dropped summaries wrapped in markdown fences** ([#783](https://github.com/rohitg00/agentmemory/issues/783), [PR #791](https://github.com/rohitg00/agentmemory/pull/791)). DeepSeek / GPT / occasionally Anthropic responses wrap structured XML in ` ```xml ... ``` ` fences with optional conversational text. The raw payload went straight to the tag regex and returned `parse_failed`. New `stripXmlWrappers()` peels markdown fences + pre/postamble; final-merge parse path retries once on failure (matching chunk-level behavior).\n- **`sdk.triggerVoid is not a function` on iii-sdk 0.11.2** ([#758](https://github.com/rohitg00/agentmemory/issues/758), [#726](https://github.com/rohitg00/agentmemory/issues/726), [PR #773](https://github.com/rohitg00/agentmemory/pull/773)). iii-sdk 0.11.2 removed `triggerVoid` in favor of `trigger({ action: TriggerAction.Void() })`. Nine call sites still used the removed API; six ran without try/catch and threw `TypeError`, breaking image lifecycle, disk-quota cleanup, vision embeddings, and observation write paths.\n- **pi integration recorded every observation as \"No content provided\"** ([#759](https://github.com/rohitg00/agentmemory/issues/759), [PR #772](https://github.com/rohitg00/agentmemory/pull/772)). pi sent `data.input` / `data.output` but `observe.ts` reads `data.tool_input` / `data.tool_output`. Field-name mismatch left `raw.toolInput` / `raw.toolOutput` undefined; the compress pipeline produced empty observations.\n- **Fresh global install refused to boot when PATH iii didn't match the runtime pin** ([#752](https://github.com/rohitg00/agentmemory/issues/752), [PR #774](https://github.com/rohitg00/agentmemory/pull/774)). The hard-pin enforcer told users to overwrite their global iii with v0.11.2, but the v0.11.2 release ships only `iii` (not `iii-init` / `iii-worker`) on some platforms. agentmemory now installs to `~/.agentmemory/bin/` and auto-falls-back to it when PATH iii mismatches the pin. User's existing iii install stays untouched.\n- **`mem::obsidian-export` HTTP 500 `[object Object]` on any record missing `id`** ([#729](https://github.com/rohitg00/agentmemory/issues/729), [PR #780](https://github.com/rohitg00/agentmemory/pull/780)). `sanitize(undefined.id)` threw outside the per-record try and escaped the whole handler. Four-layer hardening: id filter, safe-array / safe-string / safe-timestamp normalizers, outer try/catch, fail-safe session sort.\n- **Concurrent agent-sdk summarize chunks failed with `too_many_chunks_skipped`** ([#781](https://github.com/rohitg00/agentmemory/issues/781), [PR #782](https://github.com/rohitg00/agentmemory/pull/782)). `AGENTMEMORY_SDK_CHILD` recursion guard mutated `process.env` globally; concurrent chunks under `Promise.all` saw the marker and returned empty. Recursion guard now scoped to `AsyncLocalStorage`; the `process.env` marker stays for cross-process hook inheritance, reference-counted so overlapping calls don't race.\n- **Viewer #graph tab blank on large graphs** ([#753](https://github.com/rohitg00/agentmemory/issues/753), [PR #789](https://github.com/rohitg00/agentmemory/pull/789)). `POST /agentmemory/graph/query` with `{}` on an 11k+ node corpus returned HTTP 500 `Invocation stopped`. `graph/query` now accepts `limit` / `offset`, applies a default cap (500) ranked by node degree, restricts page edges to in-page endpoints, and returns `totalNodes` / `totalEdges` / `truncated`. The viewer issues a bounded initial query, distinguishes server-error from empty-corpus, renders an actionable error banner with Retry.\n\n### Added\n\n- **Sharded BM25/vector index persistence with manifest commit/rollback** ([#762](https://github.com/rohitg00/agentmemory/issues/762), [PR #764](https://github.com/rohitg00/agentmemory/pull/764), contributed by [@Rokurolize](https://github.com/Rokurolize)). Large BM25/vector snapshots used to save as monolithic strings and failed past the iii state size ceiling. Each snapshot now writes as bounded shards under a generation-scoped prefix, with a manifest published only after all shards commit. Rollback on shard-write failure, fail-closed on length mismatch, legacy snapshot load preserved for downgrade compat. 957 LOC + 25 tests covering rollback / partial-commit / fail-closed paths.\n- **Smart-search followup-rate diagnostic** ([#771](https://github.com/rohitg00/agentmemory/issues/771), [PR #786](https://github.com/rohitg00/agentmemory/pull/786)). Disambiguates retrieval bugs from reader bugs. When an agent issues a second `smart-search` within `AGENTMEMORY_FOLLOWUP_WINDOW_SECONDS` (default 30s) and the new result set has zero overlap with the prior one, counts as a directional \"first results didn't satisfy\" signal. OTEL counter `agentmemory.smart_search.followup_within_window_total`, `GET /agentmemory/diagnostics/followup` REST endpoint, `agentmemory status` surface, viewer-source exclusion via `X-Agentmemory-Source: viewer` header.\n\n### Changed\n\n- **Dependency bumps + zero `npm audit` vulnerabilities** ([PR #779](https://github.com/rohitg00/agentmemory/pull/779)). `@anthropic-ai/sdk` 0.93 → 0.100.1, `tsdown` 0.20.3 → 0.21.10 (stays on Node 20 floor), `@types/node` 25.7 → 25.9, website `next` 16.2.6 → 16.2.7 + React 19.2.7. `iii-sdk` stays pinned at 0.11.2. Transitive vulns closed via overrides: `qs ^6.15.2`, `ws ^8.21.0`, `protobufjs ^7.5.8`. `npm audit` root + website: 8 → **0**.\n- **REST endpoint count: 125 → 126** (new `/agentmemory/diagnostics/followup`).\n\n### Infrastructure\n\n- 1379 tests passing (up from 1314 in v0.9.24). 13 new test files covering the regressions + features above.\n- Removed `website/package-lock.json` from git tracking; root `.gitignore` already forbade lockfiles."
+ },
+ {
+ "version": "0.9.24",
+ "date": "2026-05-29",
+ "body": "Hotfix on top of v0.9.23. Two bugs surfaced in the first hour after v0.9.23 hit npm:\n\n### Fixed\n\n- **`agentmemory --version` silently launched the server instead of printing the version string**. `-v` flag was reserved by `--verbose`, and no `--version` literal was handled — falling through to the default `start` command. Now `--version` (and `-V` capital, per POSIX convention) prints `VERSION` and exits 0 before any side effects (engine boot, dir mkdir, env loading).\n- **iii-engine version pin was warn-only, not enforced**. When the engine on `PATH` didn't match agentmemory's pinned version (currently `v0.11.2`), the worker still booted against the mismatched engine and crashed at runtime with cryptic `state::list not found` (v0.13.0) or sandbox-everything traps (v0.11.6). `warnIfEngineVersionMismatch` renamed to `enforceEngineVersionPin` — now `p.log.error`s with the downgrade command and `process.exit(1)`. Override escape hatch via `AGENTMEMORY_III_VERSION=` env unchanged (already redefines `IIPINNED_VERSION` upstream so the comparison passes for users who knowingly run against a different engine)."
+ },
+ {
+ "version": "0.9.23",
+ "date": "2026-05-28",
+ "body": "Bug-fix + integration wave. GitHub Copilot CLI joins the supported agent matrix with plugin + hooks + MCP coverage. Three silent DX bugs fixed end-to-end: graph extraction never fired on session end, `agentmemory status` reported zero memories, consolidation defaulted off even with an LLM provider configured. Five additional adapters and a clearer local-LLM story for Ollama / LM Studio users. `agentmemory connect` now points users at `npx skills add` for the native-skills install path (50+ agents).\n\n### Added\n\n- **GitHub Copilot CLI** ([PR #534](https://github.com/rohitg00/agentmemory/pull/534)). Full first-class support: `plugin/plugin.json` manifest, `hooks.copilot.json` lifecycle hooks for all 11 Copilot events with camelCase payload normalization, `agentmemory connect copilot-cli` MCP path, first-run onboarding default-select via `COPILOT_CLI` / `COPILOT_AGENT_SESSION_ID` env detection, Windows-safe `cmd.exe /d /s /c npx` wrapper. Standalone MCP transport now speaks LSP-style `Content-Length` framed JSON-RPC alongside the existing newline-delimited form so Copilot's stdio init handshake works.\n- **Five new MCP adapters** ([PR #677](https://github.com/rohitg00/agentmemory/pull/677)). Warp, Cline, Continue, Zed, and Droid. `createJsonMcpAdapter` extended with `wrapperKey` (Zed uses `context_servers` instead of `mcpServers`) and `extraEntryFields` (Droid requires `type: \"stdio\"`). `ADAPTERS` count: 11 → 17.\n- **`/agentmemory/graph/build` endpoint** ([PR #698](https://github.com/rohitg00/agentmemory/pull/698)). Backfills the knowledge graph from existing compressed observations across every session in configurable batches. Wires up the viewer's \"Build Graph\" button that previously returned 404.\n- **11 README translations + language picker** ([PR #675](https://github.com/rohitg00/agentmemory/pull/675)). zh-CN, zh-TW, ja-JP, ko-KR, es-ES, pt-BR, fr-FR, de-DE, ru-RU, tr-TR, hi-IN.\n- **`npx skills add` hint in connect output** ([PR #709](https://github.com/rohitg00/agentmemory/pull/709)). After a successful `agentmemory connect `, the CLI now prints the matching `npx skills add rohitg00/agentmemory -y` command so users get the native-skills install alongside MCP wiring. The [`skills`](https://npmjs.com/package/skills) CLI covers 50+ agents including the 5 added in PR #677. README \"Other agents\" section gains a dedicated subsection explaining the two-step pattern (`connect` writes MCP config, `skills add` installs the 8 SKILL.md files into the agent's native skill directory).\n\n### Changed\n\n- **Consolidation auto-enables when an LLM provider is configured** ([PR #696](https://github.com/rohitg00/agentmemory/pull/696), closes [#612](https://github.com/rohitg00/agentmemory/discussions/612)). `CONSOLIDATION_ENABLED` defaulted to `false`, so users with a working provider got compression + summarization but zero graph nodes / crystals / lessons. Now defaults `true` whenever any of `ANTHROPIC_API_KEY` / `OPENAI_API_KEY` / `OPENROUTER_API_KEY` / `GEMINI_API_KEY` / `GOOGLE_API_KEY` / `MINIMAX_API_KEY` / `OPENAI_BASE_URL` is set, or `AGENTMEMORY_PROVIDER=agent-sdk`. Explicit `=false` / `AGENTMEMORY_PROVIDER=noop` still opt out. `OPENAI_API_KEY_FOR_LLM=false` honored (key scoped to embeddings).\n- **Fire-and-forget telemetry hooks** ([PR #688](https://github.com/rohitg00/agentmemory/pull/688), closes [#573](https://github.com/rohitg00/agentmemory/issues/573)). Nine telemetry-only hooks (notification, post-tool-failure, post-tool-use, prompt-submit, stop, session-end, subagent-start, subagent-stop, task-completed) switched to unawaited `fetch(...).catch(() => {})` paired with `setTimeout(() => process.exit(0), 500).unref()` (1500ms for the multi-fetch `stop` + `session-end` hooks). No longer blocks Claude Code's next-prompt boundary on every assistant turn.\n- **Observability defaults tamed** ([PR #686](https://github.com/rohitg00/agentmemory/pull/686), closes [#519](https://github.com/rohitg00/agentmemory/issues/519)). `iii-config.yaml` defaults: `sampling_ratio: 0.1`, `logs_console_output: false`. `findIiiConfig()` precedence reversed so `AGENTMEMORY_III_CONFIG` env > cwd > `~/.agentmemory/iii-config.yaml` > bundled.\n\n### Fixed\n\n- **Graph extraction never fires automatically** ([PR #698](https://github.com/rohitg00/agentmemory/pull/698), closes [#666](https://github.com/rohitg00/agentmemory/issues/666)). `event::session::stopped` listens on `agentmemory.session.stopped` but nothing in the codebase ever published that topic. `api::session::end` now directly calls `sdk.triggerVoid(\"event::session::stopped\", { sessionId })` (try/catch guarded so a fan-out error doesn't fail the HTTP response). Knowledge graphs now materialize automatically when sessions end.\n- **`agentmemory status` shows Memories/Observations = 0** ([PR #698](https://github.com/rohitg00/agentmemory/pull/698), closes [#666](https://github.com/rohitg00/agentmemory/issues/666)). CLI fetched `/agentmemory/export` for counts but that endpoint times out (>5s) on iii-engine's file-based KV under concurrent `kv.list()`. Switched to `/memories?count=true` (count-only, constant-time) + sum of `sessions[].observationCount`.\n- **Hooks send full filesystem path as `project` instead of repo basename** ([PR #687](https://github.com/rohitg00/agentmemory/pull/687), closes [#474](https://github.com/rohitg00/agentmemory/issues/474)). Native sessions, replay-import, and `memory_lesson_save` all use repo basename — the path/basename mismatch silently filtered out the bulk of relevant lessons from auto-injected context. New `resolveProject(cwd?)` helper: `AGENTMEMORY_PROJECT_NAME` env > `git rev-parse --show-toplevel` basename > `basename(cwd)`. Applied to 9 hooks.\n- **Cross-project memory leakage** ([PR #662](https://github.com/rohitg00/agentmemory/pull/662)). Memories created in one project leaking into recall on another. Wildcard guard pattern `(!project || !m.project || m.project === project)` preserves backward-compat for legacy unscoped memories while scoping new ones strictly.\n- **Graph parser tolerates reordered XML attributes** ([PR #685](https://github.com/rohitg00/agentmemory/pull/685), closes [#635](https://github.com/rohitg00/agentmemory/issues/635)). Order-dependent regex replaced with order-independent `parseAttrs` helper. Self-closing trailing-`/` handling preserved.\n- **Defensive null guards on `Memory.sessionIds`** ([PR #684](https://github.com/rohitg00/agentmemory/pull/684)). Older exports + hand-edited dumps can omit this field; now treated as empty array on read.\n- **Vector index Buffer slice metadata round-trip** ([PR #683](https://github.com/rohitg00/agentmemory/pull/683), closes [#587](https://github.com/rohitg00/agentmemory/issues/587), [#584](https://github.com/rohitg00/agentmemory/issues/584)). `byteOffset` + `byteLength` preserved on `Buffer.from` and `Float32Array` construction so base64 round-trips don't corrupt vectors stored as slices.\n- **Slots HTTP triggers return 503 not 500** ([PR #682](https://github.com/rohitg00/agentmemory/pull/682), closes [#678](https://github.com/rohitg00/agentmemory/issues/678)). Feature-flag-disabled responses now use the documented 503 shape with `enableHow` + `docsHref`. `.env` propagation fixed (now reads via `getEnvVar()` not raw `process.env`).\n- **`agentmemory doctor` points to correct iii install URL** ([PR #681](https://github.com/rohitg00/agentmemory/pull/681)).\n- **Separate `OPENAI_EMBEDDING_BASE_URL` + `OPENAI_EMBEDDING_API_KEY`** ([PR #503](https://github.com/rohitg00/agentmemory/pull/503)). Lets users route embeddings and LLM calls to different OpenAI-compatible endpoints (e.g. cloud OpenAI for embeddings + local LM Studio for LLM, or vice versa).\n- **Viewer Memories tab sorts newest first** ([PR #701](https://github.com/rohitg00/agentmemory/pull/701), closes [#674](https://github.com/rohitg00/agentmemory/issues/674)). Memories list rendered in KV-insertion order, hiding just-saved entries at the bottom of long lists. `loadMemories()` now sorts on `createdAt` desc (fallback `updatedAt`) before items reach state — matches the `localeCompare` pattern Sessions / Metrics tabs already use.\n\n### Docs\n\n- **Local-LLM section in README** ([PR #697](https://github.com/rohitg00/agentmemory/pull/697), closes [#671](https://github.com/rohitg00/agentmemory/discussions/671)). Dedicated \"Local models (Ollama / LM Studio / vLLM)\" subsection with copy-paste configs, model-pick table (qwen2.5-coder:7b, llama3.2:3b, mistral:7b-instruct, deepseek-r1:7b), and reasoning-model empty-content callout. Existing OpenAI-compatible support was buried in a one-line env comment.\n- **Three pipeline layers, not three primitives** ([PR #690](https://github.com/rohitg00/agentmemory/pull/690)). Website + README copy: the three primitives are worker / function / trigger (iii). HOOKS / RECALL / CONSOLIDATE are pipeline layers. Section anchor renamed `#primitives` → `#stack` to match the nav label.\n\n### Infrastructure\n\n- Hook scripts now bundle per-entry instead of sharing chunks, so `plugin/scripts/_project-*.mjs` hashed artifacts no longer churn the diff on every build.\n- `AGENTS.md` \"Hook Scripts\" section documents the two patterns (context-injecting vs telemetry-only) and the 500ms / 1500ms exit-delay rule for single vs multi-fetch hooks.\n- Test suite: 1271 → 1291 (+20 new tests covering project basename resolver, fire-and-forget wiring, consolidation default behavior, session-end → graph extraction, the graph-build endpoint, and the viewer memories sort)."
+ },
+ {
+ "version": "0.9.22",
+ "date": "2026-05-26",
+ "body": "Stability + ecosystem wave. Three install-broken bugs (`npm install` ERESOLVE, non-OpenAI base URLs, broken Claude bridge path) closed. Six runtime bugs from active users fixed end-to-end. Three new agent integrations (Qwen Code, Antigravity, Kiro). New `AGENT_ID` scope for multi-agent setups. Port mapping documented.\n\n### Fixed\n\n- **`npm install` ERESOLVE on fresh install** ([PR #649](https://github.com/rohitg00/agentmemory/pull/649), closes [#631](https://github.com/rohitg00/agentmemory/issues/631)). `@anthropic-ai/sdk` bumped from `^0.39.0` to `^0.93.0` so `claude-agent-sdk`'s peer is satisfied. Verified clean install with only the published `dependencies` block.\n\n- **Non-OpenAI base URLs silent-404** ([PR #649](https://github.com/rohitg00/agentmemory/pull/649), closes [#646](https://github.com/rohitg00/agentmemory/issues/646), [#628](https://github.com/rohitg00/agentmemory/issues/628)). `buildChatUrl` + `buildEmbeddingUrl` no longer blindly prepend `/v1/`. DeepSeek, SiliconFlow, Zhipu (`/api/paas/v4`), vLLM, LM Studio, Ollama all resolve correctly.\n\n- **`CLAUDE_MEMORY_BRIDGE` writes to a path Claude Code reads** ([PR #649](https://github.com/rohitg00/agentmemory/pull/649), closes [#625](https://github.com/rohitg00/agentmemory/issues/625)). Slug now preserves the leading `-` on POSIX absolute paths and drops the spurious `/memory/` subdir, matching `~/.claude/projects//MEMORY.md`.\n\n- **OpenAI provider reads `reasoning_content` for thinking models** ([PR #648](https://github.com/rohitg00/agentmemory/pull/648), closes [#627](https://github.com/rohitg00/agentmemory/issues/627)). DeepSeek V4 / Qwen3 / GLM / Kimi return `message.reasoning_content`. Previously only `message.reasoning` was checked — compress silently failed every call and tripped the circuit breaker.\n\n- **`agentmemory stop` reaps the worker process** ([PR #648](https://github.com/rohitg00/agentmemory/pull/648), closes [#640](https://github.com/rohitg00/agentmemory/issues/640), [#474](https://github.com/rohitg00/agentmemory/issues/474)). Worker pid is written to `~/.agentmemory/worker.pid` on boot; `stop` signals both engine + worker.\n\n- **OpenCode plugin implicit-creates the session on first observation** ([PR #648](https://github.com/rohitg00/agentmemory/pull/648), closes [#638](https://github.com/rohitg00/agentmemory/issues/638)). `mem::observe` creates the session row when one doesn't exist. No more orphan observations or `Session not found for summarize`.\n\n- **OpenCode plugin zero-config auto-context injection** ([PR #648](https://github.com/rohitg00/agentmemory/pull/648), closes [#431](https://github.com/rohitg00/agentmemory/issues/431)). `POST /session/start` context is cached per-session; the existing `experimental.chat.system.transform` hook reads from the cache.\n\n- **Viewer graph settles on 1000+ node graphs** ([PR #648](https://github.com/rohitg00/agentmemory/pull/648), closes [#563](https://github.com/rohitg00/agentmemory/issues/563)). Tick-decayed damping, per-node velocity cap, raf park on quiescence. Mousedown / wheel / zoom / recenter re-wake the parked loop.\n\n- **`/memories` + `/export` paginate** ([PR #648](https://github.com/rohitg00/agentmemory/pull/648), closes [#544](https://github.com/rohitg00/agentmemory/issues/544)). New `?count=true` and `?limit=N&offset=M` on `/memories`. `/export` forwards `?maxSessions` + `?offset`. Stops large corpora (8K+ memories) from timing out at the iii-engine invocation boundary.\n\n- **Claude Code drops the MCP server silently** ([PR #650](https://github.com/rohitg00/agentmemory/pull/650), closes [#510](https://github.com/rohitg00/agentmemory/issues/510)). `plugin/.mcp.json` env block uses `${VAR:-default}` form. Unset required vars no longer fail config parse.\n\n- **Full 51-tool MCP surface by default** ([PR #650](https://github.com/rohitg00/agentmemory/pull/650), closes [#553](https://github.com/rohitg00/agentmemory/issues/553)). `getVisibleTools()` default flipped from `core` (8) to `all` (51) to match what every plugin manifest advertises. `AGENTMEMORY_TOOLS=core` still gives the lean set.\n\n- **Connect adapters write `${VAR:-default}` env block** ([PR #650](https://github.com/rohitg00/agentmemory/pull/650)). `agentmemory connect` for Claude Code / Cursor / Gemini CLI / Windsurf writes the same default form.\n\n- **Hermes `memory status` no longer reports the plugin as Missing** ([PR #643](https://github.com/rohitg00/agentmemory/pull/643), closes [#520](https://github.com/rohitg00/agentmemory/issues/520)). Hermes plugin seeds `AGENTMEMORY_URL` to `http://localhost:3111` at import. Works for systemd-managed agentmemory where the env file is loaded via `EnvironmentFile=` and never reaches the interactive shell.\n\n- **Deleted memories cleared from BM25 + vector indices** ([PR #636](https://github.com/rohitg00/agentmemory/pull/636) by [@abhinav-m22](https://github.com/abhinav-m22), closes [#632](https://github.com/rohitg00/agentmemory/issues/632)). `SearchIndex.remove()` added and called from every delete path. Snapshot flushed synchronously so a SIGKILL between mutation + debounce can't resurrect deleted entries.\n\n- **PostToolUse hook reads `tool_response`, falls back to `tool_output`** ([PR #561](https://github.com/rohitg00/agentmemory/pull/561) by [@faraz152](https://github.com/faraz152), closes [#539](https://github.com/rohitg00/agentmemory/issues/539)). Claude Code's PostToolUse payload uses `tool_response`. Now reads `tool_response ?? tool_output` so legacy integrations keep working.\n\n- **iii-sdk pinned to exact `0.11.2`** ([PR #567](https://github.com/rohitg00/agentmemory/pull/567), closes [#555](https://github.com/rohitg00/agentmemory/issues/555)). `iii-sdk@0.11.6` introduced a routing regression where every `/agentmemory/*` route returned 404. Pin removes the caret.\n\n- **OpenAI provider sends explicit `stream: false`** ([PR #526](https://github.com/rohitg00/agentmemory/pull/526) by [@Ptah-CT](https://github.com/Ptah-CT)). Some OpenAI-compatible proxies default to `text/event-stream` when `stream` is absent.\n\n- **Viewer search uses NFKC normalisation for CJK / fullwidth input** ([PR #542](https://github.com/rohitg00/agentmemory/pull/542) by [@kaushalrog](https://github.com/kaushalrog)).\n\n- **Viewer splash shows actual bound viewer port** ([PR #560](https://github.com/rohitg00/agentmemory/pull/560) by [@Tanmay-008](https://github.com/Tanmay-008), closes [#521](https://github.com/rohitg00/agentmemory/issues/521)). `/agentmemory/livez` now returns `viewerPort` + `viewerSkipped`.\n\n- **Viewer tab bar height stable across tab switches** ([PR #325](https://github.com/rohitg00/agentmemory/pull/325) by [@hungtd119](https://github.com/hungtd119), closes [#324](https://github.com/rohitg00/agentmemory/issues/324)).\n\n- **Graph parser accepts self-closing `` tags** ([PR #494](https://github.com/rohitg00/agentmemory/pull/494) by [@Rex57](https://github.com/Rex57), closes [#492](https://github.com/rohitg00/agentmemory/issues/492)).\n\n- **Plugin MCP server inherits remote/auth env** ([PR #386](https://github.com/rohitg00/agentmemory/pull/386) by [@LaplaceYoung](https://github.com/LaplaceYoung), closes [#375](https://github.com/rohitg00/agentmemory/issues/375)).\n\n- **`@agentmemory/mcp` rejects literal `${VAR}` placeholders**. Any `AGENTMEMORY_URL` / `AGENTMEMORY_SECRET` value of the form `${...}` is treated as unset and falls back to `http://localhost:3111`.\n\n- **Codex `stop` hook closes session** ([PR #579](https://github.com/rohitg00/agentmemory/pull/579), closes [#493](https://github.com/rohitg00/agentmemory/issues/493)). `Stop` was missing from the Codex bundle; session never got marked completed.\n\n- **Claude Code `--with-hooks` works for MCP-standalone users** ([PR #581](https://github.com/rohitg00/agentmemory/pull/581), closes [#508](https://github.com/rohitg00/agentmemory/issues/508)).\n\n### Added\n\n- **`AGENT_ID` multi-agent memory isolation** ([PR #654](https://github.com/rohitg00/agentmemory/pull/654), closes [#554](https://github.com/rohitg00/agentmemory/issues/554)). Optional `AGENT_ID` env tags every Session / RawObservation / CompressedObservation / Memory. `AGENTMEMORY_AGENT_SCOPE=isolated` (opt-in; `shared` default) also filters every recall path (`mem::smart-search`, `/memories`, `/observations`, `/sessions`). Per-call overrides via request body + `?agentId=` / `?agentId=*` query params. `?includeOrphans=true` surfaces pre-tag rows.\n\n- **Qwen Code connect adapter** ([PR #651](https://github.com/rohitg00/agentmemory/pull/651), closes [#647](https://github.com/rohitg00/agentmemory/issues/647)). `agentmemory connect qwen` writes the standard `mcpServers` block to `~/.qwen/settings.json`.\n\n- **Antigravity connect adapter** ([PR #651](https://github.com/rohitg00/agentmemory/pull/651), closes [#614](https://github.com/rohitg00/agentmemory/issues/614)). Replacement for Gemini CLI (sunset 2026-06-18). Writes `mcp_config.json` to the platform-specific User dir.\n\n- **Kiro connect adapter** ([PR #651](https://github.com/rohitg00/agentmemory/pull/651), closes [#618](https://github.com/rohitg00/agentmemory/issues/618)). Writes user-level `~/.kiro/settings/mcp.json`.\n\n- **Cost-aware model selection** ([PR #654](https://github.com/rohitg00/agentmemory/pull/654), closes [#613](https://github.com/rohitg00/agentmemory/issues/613)). Runtime warning when `OPENROUTER_MODEL` matches the premium pattern. README cost-tier table with measured workload data. Suppress via `AGENTMEMORY_SUPPRESS_COST_WARNING=1`.\n\n- **Pluggable benchmark harness** ([PR #562](https://github.com/rohitg00/agentmemory/pull/562)). New `eval/` directory with the `coding-agent-life-v1` corpus (15 sessions + 15 graded queries) and three adapters (grep, OpenAI embeddings + cosine, agentmemory hybrid). LongMemEval support. Sandboxed agentmemory + iii-engine on alt ports via `eval/scripts/sandbox.sh`. Dev-only — no runtime impact.\n\n- **`agentmemory connect codex --with-hooks` opt-in flag** ([PR #564](https://github.com/rohitg00/agentmemory/pull/564), closes [#509](https://github.com/rohitg00/agentmemory/issues/509)). Workaround for [openai/codex#16430](https://github.com/openai/codex/issues/16430).\n\n- **Cross-platform CI matrix** ([PR #556](https://github.com/rohitg00/agentmemory/pull/556)). Ubuntu + macOS × Node 20 + 22, `paths-ignore`, per-branch concurrency cancellation.\n\n### Docs\n\n- **Port mapping table** ([PR #651](https://github.com/rohitg00/agentmemory/pull/651), closes [#629](https://github.com/rohitg00/agentmemory/issues/629)). `3111` REST / `3112` streams / `3113` viewer / `49134` engine WS + env overrides + stale-process cleanup recipe.\n\n- **Pairings recipe** ([PR #641](https://github.com/rohitg00/agentmemory/pull/641)). `docs/recipes/pairings.md` covers stacking agentmemory with codegraph, Understand Anything, and Graphify.\n\n- **Multi-agent README section** ([PR #654](https://github.com/rohitg00/agentmemory/pull/654)). `AGENT_ID` + `AGENTMEMORY_AGENT_SCOPE` semantics, per-endpoint behavior table.\n\n- **Supply-chain policy in SECURITY.md** ([PR #654](https://github.com/rohitg00/agentmemory/pull/654), closes [#540](https://github.com/rohitg00/agentmemory/issues/540)). Explains why no lockfile is committed (`dist/` ships pre-built) and what monitoring exists.\n\n- **README \"Config File\" section + Windows path** ([PR #321](https://github.com/rohitg00/agentmemory/pull/321) by [@aqilaziz](https://github.com/aqilaziz), closes [#293](https://github.com/rohitg00/agentmemory/issues/293)).\n\n- **README sudo install hint for `EACCES`** ([PR #454](https://github.com/rohitg00/agentmemory/pull/454) by [@kedar-1](https://github.com/kedar-1)).\n\n### Infrastructure\n\n- 108 test files, **1171 tests pass**.\n- Agent count: 8 → 11 (claude-code, codex, cursor, gemini-cli, qwen, antigravity, kiro, openclaw, hermes, pi, openhuman)."
+ },
+ {
+ "version": "0.9.21",
+ "date": "2026-05-19",
+ "body": "Quality + integration wave. Headline: native OpenCode plugin with full Claude Code hook parity ([#237](https://github.com/rohitg00/agentmemory/pull/237) by [@cl0ckt0wer](https://github.com/cl0ckt0wer)). Ten more PRs alongside: `memory_recall` returning the wrong shape, env-file `AGENTMEMORY_DROP_STALE_INDEX` silently ignored, hook scripts crashing on Windows usernames with spaces, viewer search inputs interrupting CJK IME composition, large sessions silently failing at the LLM context limit, lessons invisible to smart-search, Hermes plugin manifest missing hooks, cli onboarding crashing in non-TTY contexts, rebuildIndex blocking boot on large corpora, 25h embed-loop bottleneck during rebuild, and the v0.9.19 iii-console installer workaround can come out now that upstream is fixed.\n\n### Added\n\n- **OpenCode plugin with 22 auto-capture hooks** ([PR #237](https://github.com/rohitg00/agentmemory/pull/237) by [@cl0ckt0wer](https://github.com/cl0ckt0wer), closes [#236](https://github.com/rohitg00/agentmemory/issues/236) + [#244](https://github.com/rohitg00/agentmemory/issues/244)). Complete OpenCode plugin in `plugin/opencode/` matching Claude Code hook parity. Covers session lifecycle (8 hooks), messages (3), tool lifecycle (2), part tracking, permissions, task tracking, plus a two-layer enrichment pipeline (memory context on first turn, file enrichment on subsequent turns) and two slash commands (`/recall`, `/remember`). Full gap analysis in `plugin/opencode/README.md`.\n\n### Fixed\n\n- **`memory_recall` endpoint + format/token_budget forwarding** ([PR #516](https://github.com/rohitg00/agentmemory/pull/516) by [@serhiizghama](https://github.com/serhiizghama), closes [#507](https://github.com/rohitg00/agentmemory/issues/507) + [#440](https://github.com/rohitg00/agentmemory/issues/440)). MCP `memory_recall` always returned compact mode and dropped `format` + `token_budget` params. Two root causes fixed: standalone shim routed through `/agentmemory/smart-search` instead of `/agentmemory/search`, and the local-fallback path didn't read either param. Now routes correctly, forwards both params end-to-end, defaults `format` to `\"full\"` matching the MCP schema.\n\n- **env-file `AGENTMEMORY_DROP_STALE_INDEX` flag now honored** ([PR #461](https://github.com/rohitg00/agentmemory/pull/461) by [@honor2030](https://github.com/honor2030), closes [#456](https://github.com/rohitg00/agentmemory/issues/456)). Setting the flag in `~/.agentmemory/.env` was silently ignored because the boot path read `process.env` directly. New `isDropStaleIndexEnabled()` helper reads merged env. Combined with [#455](https://github.com/rohitg00/agentmemory/issues/455) + [#469](https://github.com/rohitg00/agentmemory/issues/469) reports, this is the unblock path for the stale-index server-crash recovery loop.\n\n- **Windows hook scripts quote plugin paths correctly** ([PR #487](https://github.com/rohitg00/agentmemory/pull/487) by [@honor2030](https://github.com/honor2030), closes [#477](https://github.com/rohitg00/agentmemory/issues/477)). Hook command strings referenced `${CLAUDE_PLUGIN_ROOT}/scripts/*.mjs` without quotes — Windows users with spaces in their username had every hook crash. Quotes added + regression test.\n\n- **Viewer search inputs honor IME composition** ([PR #517](https://github.com/rohitg00/agentmemory/pull/517) by [@jonathanzhan1975](https://github.com/jonathanzhan1975)). CJK users typing in the viewer's search inputs hit mid-character interruption — every keystroke fired the `oninput=` re-render handler, breaking IME composition mid-syllable. New `bindImeSafeSearch` helper defers re-render until `compositionend`.\n\n- **Chunk large sessions to fit LLM context window** ([PR #472](https://github.com/rohitg00/agentmemory/pull/472) by [@efenex](https://github.com/efenex)). Sessions with >7000 observations silently failed at the LLM provider's context limit — the consolidation pipeline silently skipped the session. New chunking splits oversized sessions across multiple compress calls + restitches the narrative via a `REDUCE_SYSTEM` prompt. Legacy single-call path preserved when obs count is under the chunk size. Backfill script under `scripts/` for users hitting the pre-fix bug.\n\n- **Surface lessons in smart-search + diagnose tally** ([PR #473](https://github.com/rohitg00/agentmemory/pull/473) by [@efenex](https://github.com/efenex)). Closes the lesson round-trip with [#458](https://github.com/rohitg00/agentmemory/pull/458) (lessons auto-injected into `mem::context`): lessons are now also returned alongside hybrid search results in a separate `lessons` field on `smart-search`, and the `diagnose` health surface tallies per-store counts so the trust-shock pattern (save succeeds, recall empty, diagnose says 0) goes away.\n\n- **Declare all Hermes plugin hooks** ([PR #486](https://github.com/rohitg00/agentmemory/pull/486) by [@honor2030](https://github.com/honor2030)). The Hermes `plugin.yaml` manifest only declared 3 of the 6 implemented hooks. All 6 now declared (`prefetch`, `sync_turn`, `on_session_end`, `on_pre_compress`, `on_memory_write`, `system_prompt_block`).\n\n- **`rebuildIndex` non-blocking on boot** ([PR #500](https://github.com/rohitg00/agentmemory/pull/500) by [@efenex](https://github.com/efenex)). Boot path previously `await`-ed `rebuildIndex(kv)`, so the viewer + later boot steps stalled — on large corpora this was 25h+ of blocked startup. Replaced with `void rebuildIndex(kv).then(...).catch(...)` so the rebuild runs in the background.\n\n- **Batched embed calls in `rebuildIndex` (25h → 3h on large corpora)** ([PR #504](https://github.com/rohitg00/agentmemory/pull/504) by [@efenex](https://github.com/efenex)). The rebuild loop made one embed call per observation, paying full HTTP RTT per item. New `vectorIndexAddBatchGuarded` helper batches embeds (default 32, configurable via `REBUILD_EMBED_BATCH_SIZE`) and try/catches per-item failures. Measured 25h → 3h on a 250k-observation corpus.\n\n- **CLI skips onboarding prompts without a tty** ([PR #491](https://github.com/rohitg00/agentmemory/pull/491) by [@honor2030](https://github.com/honor2030)). Onboarding prompts crashed in non-interactive contexts (CI, `docker run -d`, piped input). New guard short-circuits with sensible defaults when stdin/stdout aren't TTYs or `CI=1`.\n\n### Changed\n\n- **Drop iii-console installer `--next` workaround** ([PR #546](https://github.com/rohitg00/agentmemory/pull/546)). v0.9.19 routed first-run iii-console install through `bash -s -- --next` to dodge an upstream tag-prefix bug at [iii-hq/iii#1652](https://github.com/iii-hq/iii/issues/1652). Upstream [iii-hq/iii#1660](https://github.com/iii-hq/iii/pull/1660) shipped 2026-05-19; `install.iii.dev/console/main/install.sh` is a CDN proxy serving upstream main HEAD so the fix is live without an iii release tag. Reverted to canonical bare `curl ... | sh`.\n\n### Infrastructure\n\n- 95 test files (was 92), **1067 tests pass** (was 1038) on `chore(release): v0.9.21`.\n- Bundles 11 PRs: 1 contributor feature + 9 bug fixes across MCP / hooks / viewer / summarize / lessons / Hermes / rebuildIndex / CLI + 1 upstream-installer revert.\n- New contributors landing first PRs this release: [@cl0ckt0wer](https://github.com/cl0ckt0wer), [@serhiizghama](https://github.com/serhiizghama), [@jonathanzhan1975](https://github.com/jonathanzhan1975)."
+ },
+ {
+ "version": "0.9.20",
+ "date": "2026-05-18",
+ "body": "Hotfix: revert the Codex Stop → session-end chain shipped in v0.9.19.\n\n### Fixed\n\n- **Revert Codex Stop hook session-end chain** ([PR #501](https://github.com/rohitg00/agentmemory/pull/501) by [@Rex57](https://github.com/Rex57), reverts v0.9.19's [#495](https://github.com/rohitg00/agentmemory/pull/495), re-opens [#493](https://github.com/rohitg00/agentmemory/issues/493)). Post-merge field-testing surfaced the underlying issue: Codex `Stop` fires before the overall conversation is truly finished — multiple Stops bracket each assistant turn within one session. Chaining `session-end.mjs` from Stop marked sessions completed too early, with later observations still arriving against an `endedAt`-stamped record. Restored to summarize-only Stop; the SessionEnd-shaped solution stays open as [#493](https://github.com/rohitg00/agentmemory/issues/493)."
+ },
+ {
+ "version": "0.9.19",
+ "date": "2026-05-18",
+ "body": "Feature + hardening wave. Sessions now link to the git commits they shipped (forward + reverse lookup, REST + MCP surfaces). OpenAI provider transport collapses into one shared module with auto-detected Azure URL style (legacy `/openai/deployments/` and v1 `/openai/v1` both supported). Graph retrieval switches from BFS to Dijkstra over the weighted edge graph. Codex Stop hook chains session-end. Plugin MCP server inherits `AGENTMEMORY_URL` / `AGENTMEMORY_SECRET` from the shell. Point fix routes the bundled iii-console installer around an upstream tag-prefix bug. 1007+ tests pass.\n\n### Added\n\n- **Session-to-commit linking** ([PR #498](https://github.com/rohitg00/agentmemory/pull/498)). New `KV.commits` namespace keyed by full SHA holds `CommitLink` records (sha, shortSha, branch, repo, message, author, authoredAt, files, sessionIds). `Session.commitShas[]` provides the forward back-reference. REST: `POST /agentmemory/session/commit` upserts links (merges `sessionIds` on re-link, preserves `linkedAt`); `GET /agentmemory/commits/:sha` and `GET /agentmemory/commits` round-trip. MCP: `memory_commit_lookup` and `memory_commits` tools. Post-commit hook auto-captures the link on every commit in the working directory. Closes the loop on \"what session wrote this code\" / \"what commits did this session ship\" without leaving agentmemory.\n\n- **Azure OpenAI v1 URL pattern auto-detection** ([PR #462](https://github.com/rohitg00/agentmemory/pull/462), closes [#371](https://github.com/rohitg00/agentmemory/issues/371)). Both the LLM and embedding providers now route through `_openai-shared.ts` and auto-detect Azure URL style:\n - `OPENAI_BASE_URL=https://r.openai.azure.com/openai/deployments/` → legacy URL pattern, `api-version` query param via `OPENAI_API_VERSION` (default `2024-08-01-preview`).\n - `OPENAI_BASE_URL=https://r.openai.azure.com` (bare host, or `/openai`, or `/openai/v1`) → v1 GA pattern, `/openai/v1/`, deployment name carried in the request body as `model`.\n - Net effect: Azure embeddings work for the first time (LLM-side Azure shipped in v0.9.17; embedding was still hardcoded to `/v1/embeddings` + Bearer). Closes [#199](https://github.com/rohitg00/agentmemory/issues/199) (consolidation) as superseded.\n\n### Changed\n\n- **Graph retrieval: BFS → Dijkstra over weighted edges** ([PR #463](https://github.com/rohitg00/agentmemory/pull/463), closes [#328](https://github.com/rohitg00/agentmemory/issues/328) filed by [@Tanmay-008](https://github.com/Tanmay-008) with benchmark numbers showing the BFS edge-count semantics + O(n) `Array.shift()` profile). Memory graph edges carry weights 0.1–1.0; BFS visited by edge-count regardless, so a one-hop weak edge ranked the same as a two-hop strong chain. Dijkstra over `cost = 1/max(weight, 0.01)` selects weight-optimal paths instead. Adjacency map built once in O(V+E) and min-heap dequeue at O(log V) replace the prior O(V·E) + O(n) `Array.shift()` profile. `maxDepth` semantics preserved (still edge-count bound). The `startNode` path is excluded from returned paths so the dedicated `score=1.0` fallback loop in `searchByEntities` fires as designed (regression catch from the inline review).\n\n- **Codex Stop hook chains session-end** ([PR #495](https://github.com/rohitg00/agentmemory/pull/495) by [@Rex57](https://github.com/Rex57), fixes [#493](https://github.com/rohitg00/agentmemory/issues/493) also filed by [@Rex57](https://github.com/Rex57)). `hooks.codex.json` Stop now runs `stop.mjs` followed by `session-end.mjs`. Codex doesn't ship a separate `SessionEnd` lifecycle event, so the session would otherwise stay open after the user terminated the Codex session. Tests assert both commands appear in the Stop chain.\n\n- **Plugin MCP entry inherits shell env via passthrough** ([PR #460](https://github.com/rohitg00/agentmemory/pull/460), closes [#375](https://github.com/rohitg00/agentmemory/issues/375) filed by [@anthony-spruyt](https://github.com/anthony-spruyt)). `plugin/.mcp.json` and `AGENTMEMORY_MCP_BLOCK` (the template `agentmemory connect ` writes into `~/.claude.json`, `~/.cursor/mcp.json`, etc.) now declare `env: { AGENTMEMORY_URL: \"${AGENTMEMORY_URL}\", AGENTMEMORY_SECRET: \"${AGENTMEMORY_SECRET}\" }`. The MCP host substitutes shell values at server launch. When the vars are unset, the host passes empty strings; the standalone shim's `process.env[\"AGENTMEMORY_URL\"] || \"http://localhost:3111\"` falls back to localhost. One wired entry now covers both local and remote (k8s / reverse-proxied) deployments without `/doctor` \"duplicate server\" warnings.\n\n### Fixed\n\n- **`ensureIiiConsole()` install path** (`src/cli.ts`). The upstream `install.iii.dev/console/main/install.sh` script's jq predicate filters releases with `startswith(\"v\")` while `iii-hq/iii` tags as `iii/v0.12.0`. The script bails with `no stable iii release found` on every fresh install. Switched the install command to `curl ... | bash -s -- --next` until upstream patches the script — the `--next` codepath uses a regex on `-next.` without the buggy `startswith` constraint, so it succeeds against the same tag set. Inline comment documents the upstream bug + revert condition.\n\n### Infrastructure\n\n- 91 test files, 1007 tests pass on `chore(release): v0.9.19`.\n- Bundles five PRs ([#460](https://github.com/rohitg00/agentmemory/pull/460), [#462](https://github.com/rohitg00/agentmemory/pull/462), [#463](https://github.com/rohitg00/agentmemory/pull/463), [#495](https://github.com/rohitg00/agentmemory/pull/495), [#498](https://github.com/rohitg00/agentmemory/pull/498)) plus the inline iii-console installer workaround into one patch release."
+ }
+]
diff --git a/website/lib/generated-meta.json b/website/lib/generated-meta.json
index 5d045ca600..9d2e39d95a 100644
--- a/website/lib/generated-meta.json
+++ b/website/lib/generated-meta.json
@@ -1,8 +1,15 @@
{
- "version": "0.9.29",
+ "version": "0.9.30",
"mcpTools": 54,
"hooks": 12,
- "restEndpoints": 130,
- "testsPassing": 1654,
- "generatedAt": "2026-08-15T21:50:19.597Z"
+ "restEndpoints": 138,
+ "testsPassing": 2520,
+ "stars": 29164,
+ "forks": 2554,
+ "contributors": 48,
+ "releases": 51,
+ "npmWeekly": 6106,
+ "npmMonthly": 24228,
+ "npmAllTime": 461269,
+ "generatedAt": "2026-10-06T07:03:04.638Z"
}
diff --git a/website/lib/github.ts b/website/lib/github.ts
deleted file mode 100644
index 02def56ed6..0000000000
--- a/website/lib/github.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import "server-only";
-
-export interface RepoStats {
- stars: number;
- forks: number;
- issues: number;
-}
-
-const REPO = "rohitg00/agentmemory";
-
-export async function fetchRepoStats(): Promise {
- const fallback: RepoStats = { stars: 0, forks: 0, issues: 0 };
- try {
- const headers: Record = {
- accept: "application/vnd.github+json",
- "user-agent": "agentmemory-website",
- };
- if (process.env.GITHUB_TOKEN) {
- headers.authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
- }
- const res = await fetch(`https://api.github.com/repos/${REPO}`, {
- headers,
- next: { revalidate: 3600 },
- });
- if (!res.ok) return fallback;
- const data = (await res.json()) as {
- stargazers_count?: number;
- forks_count?: number;
- open_issues_count?: number;
- };
- return {
- stars: data.stargazers_count ?? 0,
- forks: data.forks_count ?? 0,
- issues: data.open_issues_count ?? 0,
- };
- } catch {
- return fallback;
- }
-}
diff --git a/website/lib/llms.ts b/website/lib/llms.ts
new file mode 100644
index 0000000000..8c4dfe0bbe
--- /dev/null
+++ b/website/lib/llms.ts
@@ -0,0 +1,138 @@
+import "server-only";
+import { COMPETITORS } from "./compare";
+import {
+ AGENTS,
+ AGENT_INSTALL_PROMPT,
+ FAQ,
+ GATE_SCENARIOS,
+ INSTALL_CMD,
+ LONGMEMEVAL,
+ REPO_URL,
+ SITE_URL,
+ TOKENS,
+ src,
+} from "./site";
+import { MCP_JSON } from "./rest";
+import { getProjectMeta } from "./meta";
+
+const SUMMARY =
+ "agentmemory is open-source persistent memory for AI coding agents. Hooks capture what an agent does during a session, the local server stores and indexes it on the user's machine, and the next session starts with the relevant memories already in context. It runs locally with no account and no API key, and is licensed Apache-2.0.";
+
+export function llmsTxt(): string {
+ const m = getProjectMeta();
+ return [
+ "# agentmemory",
+ "",
+ `> ${SUMMARY}`,
+ "",
+ `Current version: ${m.version}. Install: \`${INSTALL_CMD}\`.`,
+ "",
+ "## Pages",
+ "",
+ `- [Home](${SITE_URL}/): what agentmemory does and how it works`,
+ `- [Benchmarks](${SITE_URL}/benchmarks): retrieval recall and token cost, with methodology`,
+ `- [Security](${SITE_URL}/security): what runs where, auth, and how to report a vulnerability`,
+ `- [Privacy](${SITE_URL}/privacy): what is stored and what leaves the machine`,
+ `- [Changelog](${SITE_URL}/changelog): every release`,
+ `- [Compare](${SITE_URL}/vs): agentmemory side by side with other memory tools, with sources`,
+ ...COMPETITORS.map((c) => `- [agentmemory vs ${c.name}](${SITE_URL}/vs/${c.slug})`),
+ "",
+ "## Docs",
+ "",
+ `- [Documentation](${SITE_URL}/docs)`,
+ `- [README](${REPO_URL}/blob/main/README.md): full reference, configuration and API`,
+ `- [INSTALL_FOR_AGENTS.md](${REPO_URL}/blob/main/INSTALL_FOR_AGENTS.md): step-by-step install instructions written for coding agents`,
+ "",
+ "## Optional",
+ "",
+ `- [llms-full.txt](${SITE_URL}/llms-full.txt): the whole site as plain text`,
+ `- [Source code](${REPO_URL})`,
+ `- [npm package](${src.npm})`,
+ "",
+ ].join("\n");
+}
+
+export function llmsFullTxt(): string {
+ const m = getProjectMeta();
+ const plugins = AGENTS.filter((a) => a.support === "plugin");
+ const others = AGENTS.filter((a) => a.support !== "plugin");
+ const agentLine = (a: (typeof AGENTS)[number]) =>
+ `- ${a.name}: ${a.detail}${a.connect ? `. Wire it with \`agentmemory connect ${a.connect}\`` : ""}`;
+ const h = LONGMEMEVAL.hybrid;
+ const b = LONGMEMEVAL.bm25;
+ return [
+ "# agentmemory",
+ "",
+ SUMMARY,
+ "",
+ `Version ${m.version}. ${m.mcpTools} MCP tools, ${m.hooks} capture hooks, ${m.restEndpoints} REST endpoints, ${m.testsPassing.toLocaleString("en-US")} tests. Website: ${SITE_URL}. Source: ${REPO_URL}.`,
+ "",
+ "## Install",
+ "",
+ "Requires Node.js 20 or newer.",
+ "",
+ `1. Start the memory server: \`${INSTALL_CMD}\`. The first run installs the pinned engine, starts the server on port 3111 and the viewer on port 3113, and asks which agents to wire.`,
+ "2. Wire another agent at any time: `agentmemory connect `. Add `--with-hooks` for automatic capture where the agent supports it.",
+ `3. Or hand a coding agent this instruction: "${AGENT_INSTALL_PROMPT}"`,
+ "",
+ "Any other MCP client: merge this entry into its mcpServers object. With no variables set it talks to http://localhost:3111.",
+ "",
+ "```json",
+ MCP_JSON,
+ "```",
+ "",
+ "## How it works",
+ "",
+ "1. Capture. Hooks fire on every prompt and tool call. Each event is posted to the local server on port 3111 with a restart-safe id, or spooled to disk if the server is down.",
+ "2. Store. Each event becomes an observation in the local data directory: the tool, the file, a bounded copy of the output, and the session it came from. The data directory is ~/Library/Application Support/agentmemory on macOS, $XDG_DATA_HOME/agentmemory or ~/.local/share/agentmemory on Linux, and %APPDATA%\\agentmemory on Windows; AGENTMEMORY_DATA_DIR overrides it.",
+ "3. Index. Observations are indexed twice: BM25 terms for exact words and vectors for meaning. Local embeddings work with no API key.",
+ "4. Consolidate. When the session ends, related observations collapse into memories that keep links back to every observation they came from.",
+ "5. Recall. The next session opens with the relevant memories already in context.",
+ "",
+ "## Agents",
+ "",
+ `Native plugins (${plugins.length}), where hooks capture automatically:`,
+ "",
+ ...plugins.map(agentLine),
+ "",
+ `MCP and REST (${others.length}):`,
+ "",
+ ...others.map(agentLine),
+ "",
+ "## Benchmarks",
+ "",
+ `LongMemEval-S, ${LONGMEMEVAL.questions} questions, retrieval recall (does a gold session appear in the top K results). Embedding model: ${LONGMEMEVAL.embedding}. No LLM in the loop. This measures retrieval, not end-to-end question answering accuracy.`,
+ "",
+ `- BM25 plus vectors: recall@5 ${h.r5}%, recall@10 ${h.r10}%, recall@20 ${h.r20}%, NDCG@10 ${h.ndcg10}%, MRR ${h.mrr}%`,
+ `- BM25 only (keyless): recall@5 ${b.r5}%, recall@10 ${b.r10}%, recall@20 ${b.r20}%, NDCG@10 ${b.ndcg10}%, MRR ${b.mrr}%`,
+ `- Source and reproduction steps: ${src.longmemeval}`,
+ "",
+ `Token cost: recalling from agentmemory used ${TOKENS.agentmemory.toLocaleString("en-US")} tokens where loading the full history used ${TOKENS.fullContext.toLocaleString("en-US")}, about ${TOKENS.savedPct}% fewer, measured on v0.6.0. Source: ${src.tokens}`,
+ "",
+ "Release gate: every publish installs the packed package and runs these scenarios against it:",
+ "",
+ ...GATE_SCENARIOS.map((g) => `- ${g.id}: ${g.what}`),
+ "",
+ "## Privacy and security",
+ "",
+ "- Memories and captured activity are stored in the local data directory on the user's machine (~/Library/Application Support/agentmemory on macOS, $XDG_DATA_HOME/agentmemory or ~/.local/share/agentmemory on Linux, %APPDATA%\\agentmemory on Windows). ~/.agentmemory holds configuration and the generated secret. There is no account, no hosted service and no telemetry.",
+ "- Nothing leaves the machine unless the user configures an LLM or embedding provider; then that provider receives the text it needs. Local embeddings send nothing.",
+ "- The REST API requires a bearer token by default. A secret is generated into ~/.agentmemory/secret on first start when AGENTMEMORY_SECRET is unset.",
+ "- The bundled engine config binds to 127.0.0.1.",
+ `- Report vulnerabilities privately through GitHub Security Advisories, as described in ${REPO_URL}/blob/main/SECURITY.md`,
+ "",
+ "## FAQ",
+ "",
+ ...FAQ.flatMap((f) => [`### ${f.q}`, "", f.a, ""]),
+ "## Links",
+ "",
+ `- Benchmarks: ${SITE_URL}/benchmarks`,
+ `- Security: ${SITE_URL}/security`,
+ `- Privacy: ${SITE_URL}/privacy`,
+ `- Changelog: ${SITE_URL}/changelog`,
+ `- Compare: ${SITE_URL}/vs`,
+ `- Docs: ${SITE_URL}/docs`,
+ `- npm: ${src.npm}`,
+ "",
+ ].join("\n");
+}
diff --git a/website/lib/markdown.tsx b/website/lib/markdown.tsx
new file mode 100644
index 0000000000..cbe4e4e04b
--- /dev/null
+++ b/website/lib/markdown.tsx
@@ -0,0 +1,146 @@
+import type { ReactNode } from "react";
+
+type Block =
+ | { kind: "h"; level: number; text: string }
+ | { kind: "p"; text: string }
+ | { kind: "code"; text: string }
+ | { kind: "list"; items: { text: string; children: string[] }[] };
+
+function safeHref(href: string): string | null {
+ if (/^https?:\/\//i.test(href)) return href;
+ if (href.startsWith("#") || href.startsWith("/")) return href;
+ return null;
+}
+
+const INLINE = /(`[^`]+`)|(\*\*[^*]+\*\*)|(\[([^\]]+)\]\(([^)\s]+)\))/g;
+
+export function inline(text: string, key = "i"): ReactNode[] {
+ const out: ReactNode[] = [];
+ let last = 0;
+ let n = 0;
+ for (const m of text.matchAll(INLINE)) {
+ const at = m.index ?? 0;
+ if (at > last) out.push(text.slice(last, at));
+ const k = `${key}-${n++}`;
+ if (m[1]) out.push({m[1].slice(1, -1)});
+ else if (m[2]) out.push({inline(m[2].slice(2, -2), k)});
+ else if (m[3]) {
+ const href = safeHref(m[5]);
+ const label = inline(m[4], k);
+ out.push(
+ href ? (
+
+ {label}
+
+ ) : (
+ {label}
+ ),
+ );
+ }
+ last = at + m[0].length;
+ }
+ if (last < text.length) out.push(text.slice(last));
+ return out;
+}
+
+function parse(md: string): Block[] {
+ const lines = md.replace(/\r\n/g, "\n").split("\n");
+ const blocks: Block[] = [];
+ let para: string[] = [];
+ let list: { text: string; children: string[] }[] | null = null;
+
+ const flushPara = () => {
+ if (para.length) blocks.push({ kind: "p", text: para.join(" ") });
+ para = [];
+ };
+ const flushList = () => {
+ if (list) blocks.push({ kind: "list", items: list });
+ list = null;
+ };
+
+ for (let i = 0; i < lines.length; i++) {
+ const line = lines[i];
+ if (line.trim().startsWith("```")) {
+ flushPara();
+ flushList();
+ const body: string[] = [];
+ i++;
+ while (i < lines.length && !lines[i].trim().startsWith("```")) body.push(lines[i++]);
+ blocks.push({ kind: "code", text: body.join("\n") });
+ continue;
+ }
+ const h = line.match(/^(#{2,4})\s+(.*)$/);
+ if (h) {
+ flushPara();
+ flushList();
+ blocks.push({ kind: "h", level: h[1].length, text: h[2].trim() });
+ continue;
+ }
+ const nested = line.match(/^\s{2,}[-*]\s+(.*)$/);
+ if (nested && list && list.length) {
+ list[list.length - 1].children.push(nested[1]);
+ continue;
+ }
+ const li = line.match(/^[-*]\s+(.*)$/);
+ if (li) {
+ flushPara();
+ if (!list) list = [];
+ list.push({ text: li[1], children: [] });
+ continue;
+ }
+ if (!line.trim()) {
+ flushPara();
+ flushList();
+ continue;
+ }
+ if (list && list.length && /^\s+\S/.test(line)) {
+ list[list.length - 1].text += ` ${line.trim()}`;
+ continue;
+ }
+ flushList();
+ para.push(line.trim());
+ }
+ flushPara();
+ flushList();
+ return blocks;
+}
+
+export function Markdown({ source, idPrefix = "md" }: { source: string; idPrefix?: string }) {
+ return (
+ <>
+ {parse(source).map((b, i) => {
+ const k = `${idPrefix}-${i}`;
+ if (b.kind === "h") {
+ const content = inline(b.text, k);
+ return b.level <= 3 ?