#1 Persistent memory for AI coding agents based on real-world benchmarks
TypeScript agentmemoryagentsaiclaudeclaudecodecodexcopilotcursorgenaiharnesshermesmemoryompopenclawopencodepi
fix: rank paired search candidates with actual model logits (#1543)
Rohit Ghumare36eb328e1297
diff --git a/AGENTS.md b/AGENTS.mdindex d09ab75c..1e8b63b6 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -101,7 +101,7 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).## Testing-- Before every commit run, in order: `npm run build`, `npm run skills:gen`, `npm run docs:sync`, `npm run skills:check`, `npm test` (3,200+ tests). Commit anything the generators changed. CI runs the same build, skills check and tests.+- Before every commit run, in order: `npm run build`, `npm run skills:gen`, `npm run docs:sync`, `npm run skills:check`, `npm test` (3,300+ 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@@ -114,4 +114,4 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).- 6 MCP resources, 3 MCP prompts- 12 hooks, 17 skills- 312+ iii functions-- 3,200+ tests+- 3,300+ testsdiff --git a/README.md b/README.mdindex 49b285db..0e449c7e 100644--- a/README.md+++ b/README.md@@ -72,7 +72,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tools.svg"><img src="assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-hooks.svg"><img src="assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-deps.svg"><img src="assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1435,7 +1435,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Custom plugin systems | `iii worker add <name>` |-**230 source files · ~55,000 LOC · 3,200+ tests · 312 functions · 62 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.+**232 source files · ~55,000 LOC · 3,300+ tests · 312 functions · 62 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.---@@ -1867,7 +1867,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.ar-SA.md b/READMEs/README.ar-SA.mdindex 2e44223c..a659b109 100644--- a/READMEs/README.ar-SA.md+++ b/READMEs/README.ar-SA.md@@ -73,7 +73,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1439,7 +1439,7 @@ fi| Prometheus / Grafana | OTEL في iii + مراقب الحالة الصحية || أنظمة إضافات مخصصة | `iii worker add <name>` |-**230 ملف مصدري · ~55,000 سطر برمجي · 3,200+ اختبار · 312 دالة · 62 نطاق KV**، كل ذلك على ثلاث بنى أساسية. لا يوجد أمر `agentmemory plugin install`. نظام الإضافات هو iii نفسه.+**232 ملف مصدري · ~55,000 سطر برمجي · 3,300+ اختبار · 312 دالة · 62 نطاق KV**، كل ذلك على ثلاث بنى أساسية. لا يوجد أمر `agentmemory plugin install`. نظام الإضافات هو iii نفسه.---@@ -1863,7 +1863,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.bn-BD.md b/READMEs/README.bn-BD.mdindex e7af5228..7157c590 100644--- a/READMEs/README.bn-BD.md+++ b/READMEs/README.bn-BD.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP টুল" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 অটো হুক" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 এক্সটার্নাল ডিবি" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ টেস্ট পাস" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ টেস্ট পাস" height="38" /></picture></p><p align="center">@@ -1437,7 +1437,7 @@ fi| Prometheus / Grafana | iii OTEL + হেলথ মনিটর || কাস্টম প্লাগইন সিস্টেম | `iii worker add <name>` |-**230 সোর্স ফাইল · ~55,000 LOC · 3,200+ টেস্ট · 312 ফাংশন · 62 KV স্কোপ**, সবকিছু তিনটি প্রিমিটিভের উপর। কোনো `agentmemory plugin install` নেই। প্লাগইন সিস্টেমটাই iii নিজে।+**232 সোর্স ফাইল · ~55,000 LOC · 3,300+ টেস্ট · 312 ফাংশন · 62 KV স্কোপ**, সবকিছু তিনটি প্রিমিটিভের উপর। কোনো `agentmemory plugin install` নেই। প্লাগইন সিস্টেমটাই iii নিজে।---@@ -1861,7 +1861,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.cs-CZ.md b/READMEs/README.cs-CZ.mdindex 7329b489..2009836a 100644--- a/READMEs/README.cs-CZ.md+++ b/READMEs/README.cs-CZ.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP nástrojů" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 automatických hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 externích databází" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ testů úspěšně proběhlo" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ testů úspěšně proběhlo" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Vlastní systémy pluginů | `iii worker add <name>` |-**230 zdrojových souborů · ~55,000 řádků kódu · 3,200+ testů · 312 funkcí · 62 KV scopes**, vše na třech primitivech. Žádné `agentmemory plugin install`. Systém pluginů je samo iii.+**232 zdrojových souborů · ~55,000 řádků kódu · 3,300+ testů · 312 funkcí · 62 KV scopes**, vše na třech primitivech. Žádné `agentmemory plugin install`. Systém pluginů je samo iii.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.da-DK.md b/READMEs/README.da-DK.mdindex 6c314940..803774ef 100644--- a/READMEs/README.da-DK.md+++ b/READMEs/README.da-DK.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP-værktøjer" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 automatiske hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 eksterne databaser" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ beståede tests" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ beståede tests" height="38" /></picture></p><p align="center">@@ -1436,7 +1436,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Custom plugin-systemer | `iii worker add <name>` |-**230 kildefiler · ~55,000 LOC · 3,200+ tests · 312 funktioner · 62 KV-scopes**, alt på tre primitiver. Intet `agentmemory plugin install`. Plugin-systemet er iii selv.+**232 kildefiler · ~55,000 LOC · 3,300+ tests · 312 funktioner · 62 KV-scopes**, alt på tre primitiver. Intet `agentmemory plugin install`. Plugin-systemet er iii selv.---@@ -1860,7 +1860,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.de-DE.md b/READMEs/README.de-DE.mdindex 757028ec..56028c04 100644--- a/READMEs/README.de-DE.md+++ b/READMEs/README.de-DE.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP-Tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 Auto-Hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 externe DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ bestandene Tests" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ bestandene Tests" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + Health-Monitor || Eigene Plugin-Systeme | `iii worker add <name>` |-**230 Quelldateien · ~55,000 LOC · 3,200+ Tests · 312 Funktionen · 62 KV-Scopes**, alles auf drei Primitiven. Kein `agentmemory plugin install`. Das Plugin-System ist iii selbst.+**232 Quelldateien · ~55,000 LOC · 3,300+ Tests · 312 Funktionen · 62 KV-Scopes**, alles auf drei Primitiven. Kein `agentmemory plugin install`. Das Plugin-System ist iii selbst.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.el-GR.md b/READMEs/README.el-GR.mdindex 3d5c9a0e..37c39a70 100644--- a/READMEs/README.el-GR.md+++ b/READMEs/README.el-GR.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 εργαλεία MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 αυτόματα hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 εξωτερικές βάσεις δεδομένων" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ επιτυχημένες δοκιμές" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ επιτυχημένες δοκιμές" height="38" /></picture></p><p align="center">@@ -1438,7 +1438,7 @@ fi| Prometheus / Grafana | iii OTEL + monitor υγείας || Προσαρμοσμένα συστήματα plugin | `iii worker add <name>` |-**230 αρχεία πηγαίου κώδικα · ~55,000 LOC · 3,200+ δοκιμές · 312 functions · 62 KV scopes**, όλα πάνω σε τρία primitives. Δεν υπάρχει `agentmemory plugin install`. Το σύστημα plugin είναι το ίδιο το iii.+**232 αρχεία πηγαίου κώδικα · ~55,000 LOC · 3,300+ δοκιμές · 312 functions · 62 KV scopes**, όλα πάνω σε τρία primitives. Δεν υπάρχει `agentmemory plugin install`. Το σύστημα plugin είναι το ίδιο το iii.---@@ -1862,7 +1862,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.es-ES.md b/READMEs/README.es-ES.mdindex c7aaf340..59e996a8 100644--- a/READMEs/README.es-ES.md+++ b/READMEs/README.es-ES.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 tools MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 hooks automáticos" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 bases de datos externas" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests superados" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests superados" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + monitor de salud || Sistemas de plugins propios | `iii worker add <name>` |-**230 ficheros de código · ~55,000 LOC · 3,200+ tests · 312 funciones · 62 scopes KV**, todo sobre tres primitivos. No hay `agentmemory plugin install`. El sistema de plugins es iii mismo.+**232 ficheros de código · ~55,000 LOC · 3,300+ tests · 312 funciones · 62 scopes KV**, todo sobre tres primitivos. No hay `agentmemory plugin install`. El sistema de plugins es iii mismo.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.fi-FI.md b/READMEs/README.fi-FI.mdindex 3c79b516..7c9445fd 100644--- a/READMEs/README.fi-FI.md+++ b/READMEs/README.fi-FI.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP-työkalua" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 automaattista hookia" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 ulkoista tietokantaa" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ testiä läpäisty" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ testiä läpäisty" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + terveysmonitori || Mukautetut plugin-järjestelmät | `iii worker add <name>` |-**230 lähdetiedostoa · ~55,000 LOC · 3,200+ testiä · 312 funktiota · 62 KV-scopea**, kaikki kolmen primitiivin päällä. Ei `agentmemory plugin install` -komentoa. Plugin-järjestelmä on iii itse.+**232 lähdetiedostoa · ~55,000 LOC · 3,300+ testiä · 312 funktiota · 62 KV-scopea**, kaikki kolmen primitiivin päällä. Ei `agentmemory plugin install` -komentoa. Plugin-järjestelmä on iii itse.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.fr-FR.md b/READMEs/README.fr-FR.mdindex 071f0fd4..3316bff2 100644--- a/READMEs/README.fr-FR.md+++ b/READMEs/README.fr-FR.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1448,7 +1448,7 @@ fi| Prometheus / Grafana | iii OTEL + moniteur de santé || Systèmes de plugins custom | `iii worker add <name>` |-**230 fichiers sources · ~55,000 LOC · 3,200+ tests · 312 fonctions · 62 scopes KV**, tout sur trois primitives. Pas de `agentmemory plugin install`. Le système de plugins, c'est iii lui-même.+**232 fichiers sources · ~55,000 LOC · 3,300+ tests · 312 fonctions · 62 scopes KV**, tout sur trois primitives. Pas de `agentmemory plugin install`. Le système de plugins, c'est iii lui-même.---@@ -1872,7 +1872,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.he-IL.md b/READMEs/README.he-IL.mdindex 4743e4ff..850be463 100644--- a/READMEs/README.he-IL.md+++ b/READMEs/README.he-IL.md@@ -73,7 +73,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 כלי MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 hooks אוטומטיים" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 מסדי נתונים חיצוניים" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ בדיקות עוברות" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ בדיקות עוברות" height="38" /></picture></p><p align="center">@@ -1439,7 +1439,7 @@ fi| Prometheus / Grafana | iii OTEL + מוניטור health || מערכות plugin מותאמות אישית | `iii worker add <name>` |-**230 קבצי מקור · ~55,000 LOC · 3,200+ בדיקות · 312 פונקציות · 62 תחומי KV**, הכול על שלושה primitives. אין `agentmemory plugin install`. מערכת ה-plugin היא iii עצמו.+**232 קבצי מקור · ~55,000 LOC · 3,300+ בדיקות · 312 פונקציות · 62 תחומי KV**, הכול על שלושה primitives. אין `agentmemory plugin install`. מערכת ה-plugin היא iii עצמו.---@@ -1863,7 +1863,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.hi-IN.md b/READMEs/README.hi-IN.mdindex bae20190..893c9e94 100644--- a/READMEs/README.hi-IN.md+++ b/READMEs/README.hi-IN.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1449,7 +1449,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Custom plugin systems | `iii worker add <name>` |-**230 source files · ~55,000 LOC · 3,200+ tests · 312 functions · 62 KV scopes**, सब कुछ तीन primitives पर। कोई `agentmemory plugin install` नहीं। Plugin system iii स्वयं है।+**232 source files · ~55,000 LOC · 3,300+ tests · 312 functions · 62 KV scopes**, सब कुछ तीन primitives पर। कोई `agentmemory plugin install` नहीं। Plugin system iii स्वयं है।---@@ -1873,7 +1873,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.hu-HU.md b/READMEs/README.hu-HU.mdindex 12496fa7..50cfa084 100644--- a/READMEs/README.hu-HU.md+++ b/READMEs/README.hu-HU.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP eszköz" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 automatikus hook" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 külső adatbázis" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ sikeres teszt" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ sikeres teszt" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ A `/agentmemory/export` emellett elfogadja a `?maxSessions=`-t és a `?offset=`-| Prometheus / Grafana | iii OTEL + egészségfigyelő || Egyéni plugin-rendszerek | `iii worker add <name>` |-**230 forrásfájl · ~55,000 LOC · 3,200+ teszt · 312 funkció · 62 KV-hatókör**, mindez három primitíven. Nincs `agentmemory plugin install`. A plugin-rendszer maga az iii.+**232 forrásfájl · ~55,000 LOC · 3,300+ teszt · 312 funkció · 62 KV-hatókör**, mindez három primitíven. Nincs `agentmemory plugin install`. A plugin-rendszer maga az iii.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.id-ID.md b/READMEs/README.id-ID.mdindex f085ede8..ff5e4b8c 100644--- a/READMEs/README.id-ID.md+++ b/READMEs/README.id-ID.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 tool MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 hook otomatis" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 DB eksternal" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ pengujian lolos" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ pengujian lolos" height="38" /></picture></p><p align="center">@@ -1447,7 +1447,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Sistem plugin custom | `iii worker add <name>` |-**230 file sumber · ~55,000 LOC · 3,200+ pengujian · 312 fungsi · 62 scope KV**, semua di atas tiga primitif. Tidak ada `agentmemory plugin install`. Sistem plugin-nya adalah iii itu sendiri.+**232 file sumber · ~55,000 LOC · 3,300+ pengujian · 312 fungsi · 62 scope KV**, semua di atas tiga primitif. Tidak ada `agentmemory plugin install`. Sistem plugin-nya adalah iii itu sendiri.---@@ -1871,7 +1871,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.it-IT.md b/READMEs/README.it-IT.mdindex 16848b83..69b95006 100644--- a/READMEs/README.it-IT.md+++ b/READMEs/README.it-IT.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + monitor di salute || Sistemi di plugin personalizzati | `iii worker add <name>` |-**230 file sorgente · ~55,000 righe di codice · 3,200+ test · 312 funzioni · 62 scope KV**, tutto su tre primitive. Nessun `agentmemory plugin install`. Il sistema di plugin è iii stesso.+**232 file sorgente · ~55,000 righe di codice · 3,300+ test · 312 funzioni · 62 scope KV**, tutto su tre primitive. Nessun `agentmemory plugin install`. Il sistema di plugin è iii stesso.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.ja-JP.md b/READMEs/README.ja-JP.mdindex 06fbb5c6..17025d83 100644--- a/READMEs/README.ja-JP.md+++ b/READMEs/README.ja-JP.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP ツール" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 自動 hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="外部 DB 0 個" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ 件のテストが成功" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ 件のテストが成功" height="38" /></picture></p><p align="center">@@ -1445,7 +1445,7 @@ fi| Prometheus / Grafana | iii OTEL + ヘルスモニタ || カスタムプラグインシステム | `iii worker add <name>` |-**230 ソースファイル · ~55,000 LOC · 3,200+ テスト · 312 functions · 62 KV スコープ** — すべて 3 つのプリミティブの上に。`agentmemory plugin install` はありません。プラグインシステムは iii そのものです。+**232 ソースファイル · ~55,000 LOC · 3,300+ テスト · 312 functions · 62 KV スコープ** — すべて 3 つのプリミティブの上に。`agentmemory plugin install` はありません。プラグインシステムは iii そのものです。---@@ -1869,7 +1869,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.ko-KR.md b/READMEs/README.ko-KR.mdindex 001410a8..bc43b221 100644--- a/READMEs/README.ko-KR.md+++ b/READMEs/README.ko-KR.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + health 모니터 || 커스텀 플러그인 시스템 | `iii worker add <name>` |-**소스 파일 230개 · LOC ~55,000줄 · 테스트 3,200+개 · 함수 312개 · KV 스코프 62개**, 모두 세 가지 프리미티브 위에서 동작합니다. `agentmemory plugin install` 같은 것은 없습니다. 플러그인 시스템은 곧 iii 자체입니다.+**소스 파일 232개 · LOC ~55,000줄 · 테스트 3,300+개 · 함수 312개 · KV 스코프 62개**, 모두 세 가지 프리미티브 위에서 동작합니다. `agentmemory plugin install` 같은 것은 없습니다. 플러그인 시스템은 곧 iii 자체입니다.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.nb-NO.md b/READMEs/README.nb-NO.mdindex e27f84ab..9cd549c8 100644--- a/READMEs/README.nb-NO.md+++ b/READMEs/README.nb-NO.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1447,7 +1447,7 @@ fi| Prometheus / Grafana | iii OTEL + helseovervåker || Egendefinerte plugin-systemer | `iii worker add <name>` |-**230 kildefiler · ~55,000 LOC · 3,200+ tester · 312 funksjoner · 62 KV-scopes**, alt på tre primitiver. Ingen `agentmemory plugin install`. Plugin-systemet er iii selv.+**232 kildefiler · ~55,000 LOC · 3,300+ tester · 312 funksjoner · 62 KV-scopes**, alt på tre primitiver. Ingen `agentmemory plugin install`. Plugin-systemet er iii selv.---@@ -1871,7 +1871,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.nl-NL.md b/READMEs/README.nl-NL.mdindex c1076205..6a64e786 100644--- a/READMEs/README.nl-NL.md+++ b/READMEs/README.nl-NL.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Custom plugin-systemen | `iii worker add <name>` |-**230 bronbestanden · ~55,000 LOC · 3,200+ tests · 312 functies · 62 KV-scopes**, allemaal op drie primitieven. Geen `agentmemory plugin install`. Het pluginsysteem is iii zelf.+**232 bronbestanden · ~55,000 LOC · 3,300+ tests · 312 functies · 62 KV-scopes**, allemaal op drie primitieven. Geen `agentmemory plugin install`. Het pluginsysteem is iii zelf.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.pl-PL.md b/READMEs/README.pl-PL.mdindex 28ccd098..7845fa52 100644--- a/READMEs/README.pl-PL.md+++ b/READMEs/README.pl-PL.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 narzędzia MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 automatycznych hooków" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 zewnętrznych baz danych" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ zaliczonych testów" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ zaliczonych testów" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + monitor stanu || Niestandardowe systemy pluginów | `iii worker add <name>` |-**230 plików źródłowych · ~55,000 LOC · 3,200+ testów · 312 funkcji · 62 zakresy KV**, wszystko na trzech prymitywach. Nie ma `agentmemory plugin install`. Systemem pluginów jest sam iii.+**232 plików źródłowych · ~55,000 LOC · 3,300+ testów · 312 funkcji · 62 zakresy KV**, wszystko na trzech prymitywach. Nie ma `agentmemory plugin install`. Systemem pluginów jest sam iii.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.pt-BR.md b/READMEs/README.pt-BR.mdindex d85a2c1e..8f645853 100644--- a/READMEs/README.pt-BR.md+++ b/READMEs/README.pt-BR.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1447,7 +1447,7 @@ fi| Prometheus / Grafana | iii OTEL + monitor de saúde || Sistemas de plugin customizados | `iii worker add <name>` |-**230 arquivos de código · ~55,000 LOC · 3,200+ testes · 312 funções · 62 escopos KV**, tudo em cima de três primitivos. Sem `agentmemory plugin install`. O sistema de plugins é o próprio iii.+**232 arquivos de código · ~55,000 LOC · 3,300+ testes · 312 funções · 62 escopos KV**, tudo em cima de três primitivos. Sem `agentmemory plugin install`. O sistema de plugins é o próprio iii.---@@ -1871,7 +1871,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.pt-PT.md b/READMEs/README.pt-PT.mdindex 6a607969..fffb16f0 100644--- a/READMEs/README.pt-PT.md+++ b/READMEs/README.pt-PT.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 ferramentas MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 hooks automáticos" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 bases de dados externas" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ testes aprovados" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ testes aprovados" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ O `/agentmemory/export` também aceita `?maxSessions=` e `?offset=` para dividir| Prometheus / Grafana | iii OTEL + monitor de saúde || Sistemas de plugins personalizados | `iii worker add <name>` |-**230 ficheiros de código-fonte · ~55,000 LOC · 3,200+ testes · 312 funções · 62 âmbitos de KV**, tudo sobre três primitivos. Sem `agentmemory plugin install`. O sistema de plugins é o próprio iii.+**232 ficheiros de código-fonte · ~55,000 LOC · 3,300+ testes · 312 funções · 62 âmbitos de KV**, tudo sobre três primitivos. Sem `agentmemory plugin install`. O sistema de plugins é o próprio iii.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.ro-RO.md b/READMEs/README.ro-RO.mdindex c2e2f023..04968638 100644--- a/READMEs/README.ro-RO.md+++ b/READMEs/README.ro-RO.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 de instrumente MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 hook-uri automate" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 baze de date externe" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ teste trecute" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ teste trecute" height="38" /></picture></p><p align="center">@@ -1430,7 +1430,7 @@ fi| Prometheus / Grafana | iii OTEL + monitor de sănătate || Sisteme de plugin-uri personalizate | `iii worker add <name>` |-**230 fișiere sursă · ~55,000 LOC · 3,200+ teste · 312 funcții · 62 de domenii KV**, toate pe trei primitive. Niciun `agentmemory plugin install`. Sistemul de plugin-uri este chiar iii.+**232 fișiere sursă · ~55,000 LOC · 3,300+ teste · 312 funcții · 62 de domenii KV**, toate pe trei primitive. Niciun `agentmemory plugin install`. Sistemul de plugin-uri este chiar iii.---@@ -1854,7 +1854,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.ru-RU.md b/READMEs/README.ru-RU.mdindex 7e0fb08f..3a5e2edc 100644--- a/READMEs/README.ru-RU.md+++ b/READMEs/README.ru-RU.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ fi| Prometheus / Grafana | iii OTEL + монитор состояния || Самописные плагинные системы | `iii worker add <name>` |-**230 исходных файлов · ~55,000 LOC · 3,200+ тестов · 312 функций · 62 KV-scope**, всё на трёх примитивах. Никакого `agentmemory plugin install`. Плагинная система — это сам iii.+**232 исходных файлов · ~55,000 LOC · 3,300+ тестов · 312 функций · 62 KV-scope**, всё на трёх примитивах. Никакого `agentmemory plugin install`. Плагинная система — это сам iii.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.sv-SE.md b/READMEs/README.sv-SE.mdindex 82d0923c..3de47dea 100644--- a/READMEs/README.sv-SE.md+++ b/READMEs/README.sv-SE.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP-verktyg" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 automatiska hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 externa databaser" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ godkända tester" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ godkända tester" height="38" /></picture></p><p align="center">@@ -1437,7 +1437,7 @@ fi| Prometheus / Grafana | iii OTEL + hälsoövervakare || Anpassade pluginsystem | `iii worker add <name>` |-**230 källkodsfiler · ~55,000 LOC · 3,200+ tester · 312 funktioner · 62 KV-scopes**, allt på tre primitiv. Inget `agentmemory plugin install`. Pluginsystemet är iii självt.+**232 källkodsfiler · ~55,000 LOC · 3,300+ tester · 312 funktioner · 62 KV-scopes**, allt på tre primitiv. Inget `agentmemory plugin install`. Pluginsystemet är iii självt.---@@ -1861,7 +1861,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.th-TH.md b/READMEs/README.th-TH.mdindex 7834e5c7..305a9c36 100644--- a/READMEs/README.th-TH.md+++ b/READMEs/README.th-TH.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 เครื่องมือ MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 hook อัตโนมัติ" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="ไม่ต้องพึ่ง external DB เลย" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="ผ่านการทดสอบ 3,200+ รายการ" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="ผ่านการทดสอบ 3,300+ รายการ" height="38" /></picture></p><p align="center">@@ -1444,7 +1444,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Custom plugin systems | `iii worker add <name>` |-**230 source file · ~55,000 LOC · 3,200+ การทดสอบ · 312 function · 62 KV scope** ทั้งหมดอยู่บน primitive สามตัว ไม่มี `agentmemory plugin install` ระบบ plugin ก็คือ iii เองนั่นแหละ+**232 source file · ~55,000 LOC · 3,300+ การทดสอบ · 312 function · 62 KV scope** ทั้งหมดอยู่บน primitive สามตัว ไม่มี `agentmemory plugin install` ระบบ plugin ก็คือ iii เองนั่นแหละ---@@ -1868,7 +1868,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.tl-PH.md b/READMEs/README.tl-PH.mdindex e6cce952..aee04d7b 100644--- a/READMEs/README.tl-PH.md+++ b/READMEs/README.tl-PH.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tool" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 awtomatikong hook" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 panlabas na DB" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ pumapasang test" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ pumapasang test" height="38" /></picture></p><p align="center">@@ -1446,7 +1446,7 @@ Tinatanggap din ng `/agentmemory/export` ang `?maxSessions=` at `?offset=` para| Prometheus / Grafana | iii OTEL + health monitor || Custom na plugin system | `iii worker add <name>` |-**230 na source file · ~55,000 LOC · 3,200+ na test · 312 na function · 62 na KV scope**, lahat sa tatlong primitive. Walang `agentmemory plugin install`. Ang plugin system mismo ay ang iii.+**232 na source file · ~55,000 LOC · 3,300+ na test · 312 na function · 62 na KV scope**, lahat sa tatlong primitive. Walang `agentmemory plugin install`. Ang plugin system mismo ay ang iii.---@@ -1870,7 +1870,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.tr-TR.md b/READMEs/README.tr-TR.mdindex 7605adc0..ba9d984d 100644--- a/READMEs/README.tr-TR.md+++ b/READMEs/README.tr-TR.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1437,7 +1437,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Custom eklenti sistemleri | `iii worker add <name>` |-**230 kaynak dosya · ~55,000 LOC · 3,200+ test · 312 fonksiyon · 62 KV scope**, hepsi üç primitif üzerinde. `agentmemory plugin install` yok. Eklenti sistemi, iii'nin kendisidir.+**232 kaynak dosya · ~55,000 LOC · 3,300+ test · 312 fonksiyon · 62 KV scope**, hepsi üç primitif üzerinde. `agentmemory plugin install` yok. Eklenti sistemi, iii'nin kendisidir.---@@ -1861,7 +1861,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.uk-UA.md b/READMEs/README.uk-UA.mdindex 848bee13..587cc23e 100644--- a/READMEs/README.uk-UA.md+++ b/READMEs/README.uk-UA.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 інструменти MCP" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 автоматичних хуків" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 зовнішніх БД" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ тестів пройдено" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ тестів пройдено" height="38" /></picture></p><p align="center">@@ -1447,7 +1447,7 @@ fi| Prometheus / Grafana | iii OTEL + монітор стану здоров'я || Власні системи плагінів | `iii worker add <name>` |-**230 вихідних файлів · ~55,000 LOC · 3,200+ тестів · 312 функцій · 62 KV-скоупів**, усе на трьох примітивах. Жодного `agentmemory plugin install`. Система плагінів — це сам iii.+**232 вихідних файлів · ~55,000 LOC · 3,300+ тестів · 312 функцій · 62 KV-скоупів**, усе на трьох примітивах. Жодного `agentmemory plugin install`. Система плагінів — це сам iii.---@@ -1871,7 +1871,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.ur-PK.md b/READMEs/README.ur-PK.mdindex 9b9959aa..4199b7a4 100644--- a/READMEs/README.ur-PK.md+++ b/READMEs/README.ur-PK.md@@ -73,7 +73,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP ٹولز" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 خودکار ہکس" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 خارجی ڈیٹابیسز" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ ٹیسٹس پاس ہو رہے ہیں" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ ٹیسٹس پاس ہو رہے ہیں" height="38" /></picture></p><p align="center">@@ -1432,7 +1432,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || کسٹم plugin سسٹمز | `iii worker add <name>` |-**230 سورس فائلز · ~55,000 لائنز کوڈ · 3,200+ ٹیسٹس · 312 فنکشنز · 62 KV اسکوپس**، سب تین primitives پر۔ کوئی `agentmemory plugin install` نہیں۔ plugin سسٹم خود iii ہی ہے۔+**232 سورس فائلز · ~55,000 لائنز کوڈ · 3,300+ ٹیسٹس · 312 فنکشنز · 62 KV اسکوپس**، سب تین primitives پر۔ کوئی `agentmemory plugin install` نہیں۔ plugin سسٹم خود iii ہی ہے۔---@@ -1854,7 +1854,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.vi-VN.md b/READMEs/README.vi-VN.mdindex 89609570..780ce1f0 100644--- a/READMEs/README.vi-VN.md+++ b/READMEs/README.vi-VN.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ tests passing" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ tests passing" height="38" /></picture></p><p align="center">@@ -1437,7 +1437,7 @@ fi| Prometheus / Grafana | iii OTEL + health monitor || Hệ thống plugin tùy chỉnh | `iii worker add <name>` |-**230 file source · ~55,000 LOC · 3,200+ test · 312 function · 62 KV scope**, tất cả trên ba primitive. Không có `agentmemory plugin install`. Hệ thống plugin chính là iii.+**232 file source · ~55,000 LOC · 3,300+ test · 312 function · 62 KV scope**, tất cả trên ba primitive. Không có `agentmemory plugin install`. Hệ thống plugin chính là iii.---@@ -1861,7 +1861,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.zh-CN.md b/READMEs/README.zh-CN.mdindex 4f272fb7..78323988 100644--- a/READMEs/README.zh-CN.md+++ b/READMEs/README.zh-CN.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 个 MCP 工具" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 个自动 hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 个外部数据库" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ 项测试通过" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ 项测试通过" height="38" /></picture></p><p align="center">@@ -1444,7 +1444,7 @@ fi| Prometheus / Grafana | iii OTEL + 健康监控 || Custom plugin systems | `iii worker add <name>` |-**230 个源文件 · ~55,000 行代码 · 3,200+ 个测试 · 312 个函数 · 62 个 KV 作用域**,全部基于三种原语。没有 `agentmemory plugin install`。插件系统就是 iii 本身。+**232 个源文件 · ~55,000 行代码 · 3,300+ 个测试 · 312 个函数 · 62 个 KV 作用域**,全部基于三种原语。没有 `agentmemory plugin install`。插件系统就是 iii 本身。---@@ -1868,7 +1868,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/READMEs/README.zh-TW.md b/READMEs/README.zh-TW.mdindex 8d61a3f5..2d7b3969 100644--- a/READMEs/README.zh-TW.md+++ b/READMEs/README.zh-TW.md@@ -71,7 +71,7 @@<picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tools.svg"><img src="../assets/tags/stat-tools.svg" alt="54 個 MCP 工具" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-hooks.svg"><img src="../assets/tags/stat-hooks.svg" alt="12 個自動 hooks" height="38" /></picture><picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-deps.svg"><img src="../assets/tags/stat-deps.svg" alt="0 個外部資料庫" height="38" /></picture>- <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,200+ 測試通過" height="38" /></picture>+ <picture><source media="(prefers-color-scheme: dark)" srcset="../assets/tags/light/stat-tests.svg"><img src="../assets/tags/stat-tests.svg" alt="3,300+ 測試通過" height="38" /></picture></p><p align="center">@@ -1430,7 +1430,7 @@ fi| Prometheus / Grafana | iii OTEL + 健康監控 || 自訂外掛系統 | `iii worker add <name>` |-**230 個原始檔 · ~55,000 行程式碼 · 3,200+ 測試 · 312 個函式 · 62 個 KV 範圍**,全部基於三種原語。沒有 `agentmemory plugin install`。外掛系統就是 iii 本身。+**232 個原始檔 · ~55,000 行程式碼 · 3,300+ 測試 · 312 個函式 · 62 個 KV 範圍**,全部基於三種原語。沒有 `agentmemory plugin install`。外掛系統就是 iii 本身。---@@ -1854,7 +1854,7 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a```bashnpm run dev # Hot reloadnpm run build # Production build-npm test # 3,200+ tests+npm test # 3,300+ testsnpm run test:integration # API tests (requires running services)```diff --git a/assets/tags/light/stat-tests.svg b/assets/tags/light/stat-tests.svgindex 6c9c337d..e76f85a0 100644--- a/assets/tags/light/stat-tests.svg+++ b/assets/tags/light/stat-tests.svg@@ -1,5 +1,5 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 48" fill="none" role="img" aria-label="TESTS PASSING: 3200+">+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 48" fill="none" role="img" aria-label="TESTS PASSING: 3300+"><rect x="0" y="0" width="140" height="48" rx="10" fill="#FFFFFF" stroke="#E5E7EB" stroke-width="1"/>- <text x="70" y="24" fill="#16A34A" font-family='ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif' font-size="18" font-weight="900" text-anchor="middle" letter-spacing="-0.3">3200+</text>+ <text x="70" y="24" fill="#16A34A" font-family='ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif' font-size="18" font-weight="900" text-anchor="middle" letter-spacing="-0.3">3300+</text><text x="70" y="38" fill="#64748B" font-family='ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif' font-size="9" font-weight="600" text-anchor="middle" letter-spacing="1.5">TESTS PASSING</text></svg>diff --git a/assets/tags/stat-tests.svg b/assets/tags/stat-tests.svgindex e125da91..ef2d19a0 100644--- a/assets/tags/stat-tests.svg+++ b/assets/tags/stat-tests.svg@@ -1,5 +1,5 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 48" fill="none" role="img" aria-label="TESTS PASSING: 3200+">+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 48" fill="none" role="img" aria-label="TESTS PASSING: 3300+"><rect x="0" y="0" width="140" height="48" rx="10" fill="#1A1A1A" stroke="#2A2A2A" stroke-width="1"/>- <text x="70" y="24" fill="#00D26A" font-family='ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif' font-size="18" font-weight="900" text-anchor="middle" letter-spacing="-0.3">3200+</text>+ <text x="70" y="24" fill="#00D26A" font-family='ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif' font-size="18" font-weight="900" text-anchor="middle" letter-spacing="-0.3">3300+</text><text x="70" y="38" fill="#9CA3AF" font-family='ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif' font-size="9" font-weight="600" text-anchor="middle" letter-spacing="1.5">TESTS PASSING</text></svg>diff --git a/docs/reranking.md b/docs/reranking.mdnew file mode 100644index 00000000..06f8ada4--- /dev/null+++ b/docs/reranking.md@@ -0,0 +1,11 @@+# Optional local reranking++Set `RERANK_ENABLED=true` to rerank the first 20 hybrid-search candidates with the local `Xenova/ms-marco-MiniLM-L-6-v2` cross-encoder. The optional `@huggingface/transformers` dependency and model weights are required. The first search can download the model; subsequent searches reuse the loaded model.++The reranker uses the query and document as separate BERT segments. It limits each pair to 512 tokens using longest-first content truncation while preserving both segment separators. Long queries therefore retain document tokens. This is a token limit, not a character limit.++Result order reflects reranking within that candidate window. Candidates after the window keep their original order. The public search score remains the hybrid retrieval score; it is not a model probability. Internally, `rerankScore` records the cross-encoder's raw single logit, which may be negative, and `rerankPosition` records its position. Equal model scores retain their input order.++Expanded queries first merge their hybrid results, then rerank the merged window once against the original query. Model logits from different queries are not blended with hybrid retrieval scores.++If any candidate fails inference or returns an invalid score, the entire request keeps its original hybrid ordering and scores. A failed model load also preserves those results; a later search may retry loading after a one-minute cooldown. Concurrent searches share model loading. Reranking stays disabled unless explicitly enabled.diff --git a/scripts/docs-sync.state.json b/scripts/docs-sync.state.jsonindex 6985a97a..a718cb68 100644--- a/scripts/docs-sync.state.json+++ b/scripts/docs-sync.state.json@@ -20,13 +20,13 @@"12"],"tests": [- "3200+"+ "3300+"],"functions": ["312"],"sourceFiles": [- "230"+ "232"],"loc": ["55000"diff --git a/src/state/hybrid-search.ts b/src/state/hybrid-search.tsindex 7df7743d..cb0a730f 100644--- a/src/state/hybrid-search.ts+++ b/src/state/hybrid-search.ts@@ -59,8 +59,9 @@ export class HybridSearch {];const graphQuery = this.graphRetrieval.createQuery();+ const retrievalLimit = this.rerankEnabled ? Math.max(limit, 20) : limit;const resultSets = await Promise.all(- allQueries.map((q) => this.tripleStreamSearch(q, limit, targetLayer, graphQuery, allEntities)),+ allQueries.map((q) => this.tripleStreamSearch(q, retrievalLimit, targetLayer, graphQuery, allEntities, false)),);const merged = new Map<string, HybridSearchResult>();@@ -73,13 +74,13 @@ export class HybridSearch {}}- return Array.from(merged.values())+ const combined = Array.from(merged.values()).sort((a, b) =>b.combinedScore - a.combinedScore ||(a.observation.id < b.observation.id ? -1 : a.observation.id > b.observation.id ? 1 : 0),- )- .slice(0, limit);+ );+ return this.rerankResults(query, combined, limit);}private async tripleStreamSearch(@@ -88,8 +89,10 @@ export class HybridSearch {targetLayer: SearchLayer,graphQuery: GraphQuery,entityHints?: string[],+ applyReranking = true,): Promise<HybridSearchResult[]> {- const bm25Results = this.bm25.search(query, limit * 2, targetLayer);+ const retrievalLimit = this.rerankEnabled ? Math.max(limit, 20) : limit;+ const bm25Results = this.bm25.search(query, retrievalLimit * 2, targetLayer);let vectorResults: Array<{obsId: string;@@ -101,7 +104,7 @@ export class HybridSearch {if (this.vector && this.embeddingProvider && this.vector.size > 0) {try {queryEmbedding = await this.embeddingProvider.embed(query);- vectorResults = this.vector.search(queryEmbedding, limit * 2, targetLayer, (id) => this.bm25.layerOf(id));+ vectorResults = this.vector.search(queryEmbedding, retrievalLimit * 2, targetLayer, (id) => this.bm25.layerOf(id));} catch {// fall through to BM25-only}@@ -120,7 +123,7 @@ export class HybridSearch {graphResults = await graphQuery.searchByEntities(entities,2,- limit,+ retrievalLimit,targetLayer,);} catch {@@ -250,22 +253,21 @@ export class HybridSearch {}));const retrievalDepth = Math.max(limit, 20);- const rerankWindow = 20;const diversified = this.diversifyBySession(combined, retrievalDepth);const enriched = await this.enrichResults(diversified, retrievalDepth);- if (this.rerankEnabled && enriched.length > 1) {+ return applyReranking ? this.rerankResults(query, enriched, limit) : enriched.slice(0, limit);+ }++ private async rerankResults(query: string, results: HybridSearchResult[], limit: number): Promise<HybridSearchResult[]> {+ if (this.rerankEnabled && results.length > 1) {try {- const head = enriched.slice(0, rerankWindow);- const tail = enriched.slice(rerankWindow);- const reranked = await rerank(query, head, rerankWindow);- return reranked.concat(tail).slice(0, limit);+ return (await rerank(query, results, 20)).slice(0, limit);} catch {- return enriched.slice(0, limit);+ return results.slice(0, limit);}}-- return enriched.slice(0, limit);+ return results.slice(0, limit);}private diversifyBySession(diff --git a/src/state/reranker.ts b/src/state/reranker.tsindex ae92f8e4..efd842e5 100644--- a/src/state/reranker.ts+++ b/src/state/reranker.ts@@ -1,34 +1,67 @@import type { HybridSearchResult } from "../types.js";-let pipeline: any = null;-let pipelineLoading: Promise<any> | null = null;-let pipelineUnavailable = false;+const MODEL = "Xenova/ms-marco-MiniLM-L-6-v2";+const MAX_TOKENS = 512;+const LOAD_RETRY_MS = 60_000;+type ScorePair = (query: string, document: string) => Promise<number>;-async function loadPipeline(): Promise<any> {- if (pipelineUnavailable) return null;- if (pipeline) return pipeline;- if (pipelineLoading) return pipelineLoading;+let scorer: ScorePair | null = null;+let scorerLoading: Promise<ScorePair | null> | null = null;+let retryAfter = 0;- pipelineLoading = (async () => {+async function loadScorer(): Promise<ScorePair | null> {+ if (scorer) return scorer;+ if (scorerLoading) return scorerLoading;+ if (Date.now() < retryAfter) return null;++ scorerLoading = (async () => {try {- const { pipeline: createPipeline } = await import(+ const { AutoTokenizer, AutoModelForSequenceClassification, Tensor } = await import("@huggingface/transformers");- pipeline = await createPipeline(- "text-classification",- "Xenova/ms-marco-MiniLM-L-6-v2",- { dtype: "q8" },- );- return pipeline;+ const tokenizer = await AutoTokenizer.from_pretrained(MODEL);+ const model = await AutoModelForSequenceClassification.from_pretrained(MODEL, { dtype: "q8" });+ scorer = async (query, document) => {+ const encoded = tokenizer(query, {+ text_pair: document,+ return_tensor: false,+ return_token_type_ids: true,+ });+ const length = encoded.input_ids.length;+ const boundary = encoded.token_type_ids.indexOf(1);+ if (boundary < 2 || boundary >= length) throw new Error("Invalid BERT pair encoding");++ // This model uses [CLS] query [SEP] document [SEP]. Transformers.js+ // slices combined sequences, so truncate content while retaining both segments.+ let queryLength = boundary - 2;+ let documentLength = length - boundary - 1;+ while (queryLength + documentLength > MAX_TOKENS - 3) {+ if (queryLength > documentLength) queryLength--;+ else documentLength--;+ }+ const inputs = Object.fromEntries(Object.entries(encoded).map(([key, values]) => {+ const tokens = [+ ...values.slice(0, queryLength + 1), values[boundary - 1],+ ...values.slice(boundary, boundary + documentLength), values[length - 1],+ ];+ return [key, new Tensor("int64", BigInt64Array.from(tokens, BigInt), [1, tokens.length])];+ }));+ const { logits } = await model(inputs);+ if (logits?.dims.length !== 2 || logits.dims[0] !== 1 || logits.dims[1] !== 1+ || logits.data.length !== 1 || !Number.isFinite(logits.data[0])) {+ throw new Error("Invalid cross-encoder score");+ }+ return Number(logits.data[0]);+ };+ return scorer;} catch {- pipeline = null;- pipelineUnavailable = true;+ retryAfter = Date.now() + LOAD_RETRY_MS;return null;} finally {- pipelineLoading = null;+ scorerLoading = null;}})();- return pipelineLoading;+ return scorerLoading;}export async function rerank(@@ -36,39 +69,29 @@ export async function rerank(results: HybridSearchResult[],topK = 20,): Promise<HybridSearchResult[]> {- if (results.length <= 1) return results;-- const reranker = await loadPipeline();- if (!reranker) return results;-- const candidates = results.slice(0, Math.min(results.length, topK));-- const pairs = candidates.map((r) => ({- text: `${query} [SEP] ${r.observation.title || ""} ${r.observation.narrative || ""}`.slice(0, 512),- result: r,- }));+ if (results.length <= 1 || !query.trim() || !Number.isSafeInteger(topK) || topK <= 1) return results;- const scores: Array<{ result: HybridSearchResult; rerankScore: number }> = [];-- for (const pair of pairs) {- try {- const output = await reranker(pair.text);- const score = Array.isArray(output) ? output[0]?.score ?? 0 : 0;- scores.push({ result: pair.result, rerankScore: score });- } catch {- scores.push({ result: pair.result, rerankScore: pair.result.combinedScore });+ const scorePair = await loadScorer();+ if (!scorePair) return results;+ const candidates = results.slice(0, topK);+ const scores: Array<{ result: HybridSearchResult; score: number; position: number }> = [];+ try {+ for (const [position, result] of candidates.entries()) {+ const document = `${result.observation.title || ""} ${result.observation.narrative || ""}`.trim();+ scores.push({ result, score: await scorePair(query, document), position });}+ } catch {+ // A partially scored window cannot compare model logits with hybrid scores.+ return results;}-- scores.sort((a, b) => b.rerankScore - a.rerankScore);-- return scores.map((s, i) => ({- ...s.result,- combinedScore: s.rerankScore,+ scores.sort((a, b) => b.score - a.score || a.position - b.position);+ return scores.map(({ result, score }, i) => ({+ ...result,+ rerankScore: score,rerankPosition: i + 1,- }));+ })).concat(results.slice(candidates.length));}export function isRerankerAvailable(): boolean {- return pipeline !== null;+ return scorer !== null;}diff --git a/src/types.ts b/src/types.tsindex 912c27af..87d171b1 100644--- a/src/types.ts+++ b/src/types.ts@@ -312,6 +312,8 @@ export interface HybridSearchResult {combinedScore: number;sessionId: string;graphContext?: string;+ rerankScore?: number;+ rerankPosition?: number;}export interface CompactSearchResult {diff --git a/test/hybrid-search-rerank.test.ts b/test/hybrid-search-rerank.test.tsnew file mode 100644index 00000000..4d1955f3--- /dev/null+++ b/test/hybrid-search-rerank.test.ts@@ -0,0 +1,80 @@+import { beforeEach, describe, expect, it, vi } from "vitest";+import { HybridSearch } from "../src/state/hybrid-search.js";+import { SearchIndex } from "../src/state/search-index.js";+import type { CompressedObservation, HybridSearchResult } from "../src/types.js";++const { rerank } = vi.hoisted(() => ({ rerank: vi.fn() }));+vi.mock("../src/state/reranker.js", () => ({ rerank }));++function setup(enabled = true) {+ const index = new SearchIndex();+ const observations = new Map<string, CompressedObservation>();+ for (let i = 0; i < 25; i++) {+ const observation: CompressedObservation = {+ id: `obs-${i}`, sessionId: `session-${i}`, title: `query result ${i}`, narrative: "query variation", timestamp: "2026-01-01T00:00:00Z", type: "other", facts: [], concepts: [], files: [], importance: 5,+ };+ index.add(observation);+ observations.set(observation.id, observation);+ }+ const kv = { get: async (_scope: string, id: string) => observations.get(id) ?? null };+ return new HybridSearch(index, null, null, kv as never, 0.4, 0.6, 0, enabled);+}+const expansion = { original: "query", reformulations: ["query variation"], temporalConcretizations: [], entityExtractions: [] };++beforeEach(() => {+ rerank.mockReset();+ rerank.mockImplementation(async (_query: string, results: HybridSearchResult[], topK: number) =>+ results.slice(0, topK).reverse().map((r, i) => ({ ...r, rerankScore: -i, rerankPosition: i + 1 })).concat(results.slice(topK)),+ );+});++describe("hybrid cross-encoder ordering", () => {+ it("reranks expanded-query fusion once against the original query without duplicates or lost tails", async () => {+ const baseline = await setup(false).searchWithExpansion("query", 25, expansion);+ const output = await setup().searchWithExpansion("query", 25, expansion);+ expect(rerank).toHaveBeenCalledTimes(1);+ expect(rerank.mock.calls[0][0]).toBe("query");+ expect(rerank.mock.calls[0][1]).toEqual(baseline);+ expect(output.map((r) => r.observation.id)).toEqual([...baseline.slice(0, 20).reverse(), ...baseline.slice(20)].map((r) => r.observation.id));+ expect(new Set(output.map((r) => r.observation.id)).size).toBe(25);+ expect(output.slice(20)).toEqual(baseline.slice(20));+ for (const item of output) expect(item.combinedScore).toBe(baseline.find((r) => r.observation.id === item.observation.id)!.combinedScore);+ });++ it("keeps direct-search limits and all candidates beyond the reranking window", async () => {+ const baseline = await setup(false).search("query", 25);+ const output = await setup().search("query", 25);+ expect(output).toHaveLength(25);+ expect(output.slice(20)).toEqual(baseline.slice(20));+ expect(rerank.mock.calls[0][2]).toBe(20);+ });++ it("retains a full candidate window before applying a small expanded-query limit", async () => {+ const baseline = await setup(false).searchWithExpansion("query", 20, expansion);+ const output = await setup().searchWithExpansion("query", 1, expansion);+ expect(rerank.mock.calls[0][1]).toHaveLength(20);+ expect(output).toHaveLength(1);+ expect(output[0].observation.id).toBe(baseline[19].observation.id);+ });++ it("retains a full candidate window before applying a small direct-search limit", async () => {+ const baseline = await setup(false).search("query", 20);+ const output = await setup().search("query", 1);+ expect(rerank.mock.calls[0][1]).toHaveLength(20);+ expect(output).toHaveLength(1);+ expect(output[0].observation.id).toBe(baseline[19].observation.id);+ });++ it("preserves merged hybrid ranking when reranking fails", async () => {+ const baseline = await setup(false).searchWithExpansion("query", 25, expansion);+ rerank.mockRejectedValue(new Error("optional model failed"));+ expect(await setup().searchWithExpansion("query", 25, expansion)).toEqual(baseline);+ });++ it("does not load or invoke the reranker when disabled", async () => {+ const output = await setup(false).searchWithExpansion("query", 5, expansion);+ expect(output).toHaveLength(5);+ expect(rerank).not.toHaveBeenCalled();+ expect(output.every((r) => r.rerankScore === undefined)).toBe(true);+ });+});diff --git a/test/reflect.test.ts b/test/reflect.test.tsindex 909bd2a5..4e5f78bd 100644--- a/test/reflect.test.ts+++ b/test/reflect.test.ts@@ -440,12 +440,15 @@ describe("Reflect", () => {await kv.set("mem:graph:edges", "edge_ga", makeEdge("gamma", "alpha"));await kv.set("mem:graph:edges", "edge_de", makeEdge("delta", "epsilon"));- await kv.set("mem:semantic", "sem_a1", makeSemantic("alpha beta gamma pipeline"));- await kv.set("mem:semantic", "sem_a2", makeSemantic("alpha caching layer"));- await kv.set("mem:semantic", "sem_a3", makeSemantic("beta gamma queue"));- await kv.set("mem:semantic", "sem_b1", makeSemantic("delta epsilon storage"));- await kv.set("mem:semantic", "sem_b2", makeSemantic("delta epsilon index"));- await kv.set("mem:semantic", "sem_b3", makeSemantic("epsilon delta flush"));+ await kv.set("mem:semantic", "sem_a1", makeSemantic("alpha beta gamma pipeline", "sem_a1"));+ await kv.set("mem:semantic", "sem_a2", makeSemantic("alpha caching layer", "sem_a2"));+ await kv.set("mem:semantic", "sem_a3", makeSemantic("beta gamma queue", "sem_a3"));+ await kv.set("mem:semantic", "sem_b1", makeSemantic("delta epsilon storage", "sem_b1"));+ await kv.set("mem:semantic", "sem_b2", makeSemantic("delta epsilon index", "sem_b2"));+ await kv.set("mem:semantic", "sem_b3", makeSemantic("epsilon delta flush", "sem_b3"));+ provider.summarize+ .mockResolvedValueOnce('<insights><insight confidence="0.8" title="Pipeline caching" sources="F1,F2">The alpha pipeline includes a caching layer.</insight></insights>')+ .mockResolvedValueOnce('<insights><insight confidence="0.8" title="Storage indexing" sources="F1,F2">Delta and epsilon provide storage and indexing.</insight></insights>');const result = (await sdk.trigger("mem::reflect", {})) as {clustersProcessed: number;@@ -455,6 +458,10 @@ describe("Reflect", () => {expect(result.clustersProcessed).toBe(2);expect(result.newInsights).toBe(2);expect(provider.summarize).toHaveBeenCalledTimes(2);+ expect(await kv.list<Insight>("mem:insights")).toMatchObject([+ { title: "Pipeline caching", sourceMemoryIds: ["sem_a1", "sem_a2"] },+ { title: "Storage indexing", sourceMemoryIds: ["sem_b1", "sem_b2"] },+ ]);});it("stops at the maxClusters bound even when more groups exist", async () => {@@ -468,12 +475,13 @@ describe("Reflect", () => {await kv.set("mem:graph:edges", "edge_ga", makeEdge("gamma", "alpha"));await kv.set("mem:graph:edges", "edge_de", makeEdge("delta", "epsilon"));- await kv.set("mem:semantic", "sem_a1", makeSemantic("alpha beta gamma pipeline"));- await kv.set("mem:semantic", "sem_a2", makeSemantic("alpha caching layer"));- await kv.set("mem:semantic", "sem_a3", makeSemantic("beta gamma queue"));- await kv.set("mem:semantic", "sem_b1", makeSemantic("delta epsilon storage"));- await kv.set("mem:semantic", "sem_b2", makeSemantic("delta epsilon index"));- await kv.set("mem:semantic", "sem_b3", makeSemantic("epsilon delta flush"));+ await kv.set("mem:semantic", "sem_a1", makeSemantic("alpha beta gamma pipeline", "sem_a1"));+ await kv.set("mem:semantic", "sem_a2", makeSemantic("alpha caching layer", "sem_a2"));+ await kv.set("mem:semantic", "sem_a3", makeSemantic("beta gamma queue", "sem_a3"));+ await kv.set("mem:semantic", "sem_b1", makeSemantic("delta epsilon storage", "sem_b1"));+ await kv.set("mem:semantic", "sem_b2", makeSemantic("delta epsilon index", "sem_b2"));+ await kv.set("mem:semantic", "sem_b3", makeSemantic("epsilon delta flush", "sem_b3"));+ provider.summarize.mockResolvedValue('<insights><insight confidence="0.8" title="Pipeline caching" sources="F1,F2">The alpha pipeline includes a caching layer.</insight></insights>');const result = (await sdk.trigger("mem::reflect", { maxClusters: 1 })) as {clustersProcessed: number;@@ -481,6 +489,9 @@ describe("Reflect", () => {expect(result.clustersProcessed).toBe(1);expect(provider.summarize).toHaveBeenCalledTimes(1);+ expect(await kv.list<Insight>("mem:insights")).toMatchObject([+ { title: "Pipeline caching", sourceMemoryIds: ["sem_a1", "sem_a2"] },+ ]);});it("falls back to Jaccard grouping when graph is empty", async () => {diff --git a/test/reranker.test.ts b/test/reranker.test.tsindex 904a1980..cf6796a1 100644--- a/test/reranker.test.ts+++ b/test/reranker.test.ts@@ -1,91 +1,232 @@-import { describe, it, expect, vi, afterEach } from "vitest";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import type { HybridSearchResult } from "../src/types.js";-vi.mock("@huggingface/transformers", () => {- throw new Error("not installed");-});+const transformers = await vi.importActual<typeof import("@huggingface/transformers")>("@huggingface/transformers").catch(() => null);++function result(id: string, combinedScore = 0.5, narrative = ""): HybridSearchResult {+ return {+ observation: { id, title: id, narrative, sessionId: "session", timestamp: "2026-01-01T00:00:00Z", type: "other", facts: [], concepts: [], files: [], importance: 5 },+ bm25Score: 0.3, vectorScore: 0.4, graphScore: 0, combinedScore, sessionId: "session",+ };+}-import { rerank, isRerankerAvailable } from "../src/state/reranker.js";--describe("reranker", () => {- it("returns results unchanged when @huggingface/transformers is unavailable", async () => {- const results = [- {- observation: {- id: "o1",- title: "First",- narrative: "First result",- },- bm25Score: 0.5,- vectorScore: 0.6,- graphScore: 0,- combinedScore: 0.8,- sessionId: "s1",- },- {- observation: {- id: "o2",- title: "Second",- narrative: "Second result",- },- bm25Score: 0.3,- vectorScore: 0.4,- graphScore: 0,- combinedScore: 0.5,- sessionId: "s1",- },- ] as any;-- const reranked = await rerank("test query", results);- expect(reranked).toEqual(results);+class Tensor {+ constructor(public type: string, public data: ArrayLike<number | bigint>, public dims: number[]) {}+}++function fixture() {+ const tokenizer = vi.fn((query: string, options: { text_pair: string }) => {+ const ids = (text: string) => text.trim() ? text.trim().split(/\s+/).map((token) => ({ relevant: 5, irrelevant: 6, query: 7, "[CLS]": 1, "[SEP]": 2 }[token] ?? 8)) : [];+ const queryIds = ids(query), documentIds = ids(options.text_pair);+ const input_ids = [1, ...queryIds, 2, ...documentIds, 2];+ return { input_ids, attention_mask: input_ids.map(() => 1), token_type_ids: [...Array(queryIds.length + 2).fill(0), ...Array(documentIds.length + 1).fill(1)] };+ });+ const model = vi.fn(async (inputs: Record<string, Tensor>) => {+ const ids = Array.from(inputs.input_ids.data, Number);+ const types = Array.from(inputs.token_type_ids.data, Number);+ const document = ids.filter((_, i) => types[i] === 1);+ return { logits: new Tensor("float32", [document.includes(5) ? 8 : -9], [1, 1]) };});+ const loadTokenizer = vi.fn(async () => tokenizer);+ const loadModel = vi.fn(async () => model);+ vi.doMock("@huggingface/transformers", () => ({+ AutoTokenizer: { from_pretrained: loadTokenizer },+ AutoModelForSequenceClassification: { from_pretrained: loadModel },+ Tensor,+ }));+ return { tokenizer, model, loadTokenizer, loadModel };+}- it("isRerankerAvailable returns false when not loaded", () => {+beforeEach(() => vi.resetModules());+afterEach(() => { vi.doUnmock("@huggingface/transformers"); vi.useRealTimers(); });++describe("cross-encoder reranker", () => {+ it("falls back when the optional dependency is unavailable", async () => {+ vi.doMock("@huggingface/transformers", () => { throw new Error("not installed"); });+ const { rerank, isRerankerAvailable } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant")];+ expect(await rerank("query", input)).toBe(input);expect(isRerankerAvailable()).toBe(false);});- it("handles single result gracefully", async () => {- const results = [- {- observation: { id: "o1", title: "Only" },- combinedScore: 1.0,- },- ] as any;+ it("does not load for empty/single results, blank queries or unusable windows", async () => {+ const { loadTokenizer } = fixture();+ const { rerank } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant")];+ expect(await rerank("query", [])).toEqual([]);+ expect(await rerank("query", input.slice(0, 1))).toEqual(input.slice(0, 1));+ expect(await rerank(" \n", input)).toBe(input);+ for (const topK of [0, 1, -1, 1.5, NaN, Infinity]) expect(await rerank("query", input, topK)).toBe(input);+ expect(loadTokenizer).not.toHaveBeenCalled();+ });- const reranked = await rerank("query", results);- expect(reranked).toHaveLength(1);+ it("ranks raw single logits without replacing hybrid scores or mutating inputs", async () => {+ const { loadModel, tokenizer } = fixture();+ const { rerank, isRerankerAvailable } = await import("../src/state/reranker.js");+ const input = [result("irrelevant", 0.99), result("relevant", 0.1)];+ const before = structuredClone(input);+ const output = await rerank("query", input);+ expect(output.map((item) => [item.observation.id, item.rerankScore, item.combinedScore, item.rerankPosition]))+ .toEqual([["relevant", 8, 0.1, 1], ["irrelevant", -9, 0.99, 2]]);+ expect(input).toEqual(before);+ expect(loadModel).toHaveBeenCalledWith("Xenova/ms-marco-MiniLM-L-6-v2", { dtype: "q8" });+ expect(tokenizer).toHaveBeenCalledWith("query", { text_pair: "relevant", return_tensor: false, return_token_type_ids: true });+ expect(isRerankerAvailable()).toBe(true);});- it("handles empty results", async () => {- const reranked = await rerank("query", []);- expect(reranked).toHaveLength(0);+ it("keeps every tail candidate in its original order", async () => {+ const { model } = fixture();+ const { rerank } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant"), result("tail-a"), result("tail-b")];+ const output = await rerank("query", input, 2);+ expect(output.map((item) => item.observation.id)).toEqual(["relevant", "irrelevant", "tail-a", "tail-b"]);+ expect(output.slice(2)).toEqual(input.slice(2));+ expect(output[2]).toBe(input[2]);+ expect(model).toHaveBeenCalledTimes(2);});-});-describe("reranker with loaded pipeline", () => {- afterEach(() => {- vi.doUnmock("@huggingface/transformers");- vi.resetModules();+ it("preserves ties and supports a window larger than the result set", async () => {+ fixture();+ const { rerank } = await import("../src/state/reranker.js");+ const input = [result("second", 0.1), result("first", 0.99)];+ expect((await rerank("query", input, 100)).map((item) => item.observation.id)).toEqual(["second", "first"]);});- it("invokes the @huggingface/transformers pipeline and reorders by score", async () => {- const mockPipeline = vi.fn(async (text: string) => [- { score: text.includes("First") ? 0.9 : 0.1 },- ]);- vi.doMock("@huggingface/transformers", () => ({- pipeline: () => Promise.resolve(mockPipeline),- }));- vi.resetModules();+ it("falls back as a whole on partial failure and recovers on the next request", async () => {+ const { model } = fixture();+ model.mockResolvedValueOnce({ logits: new Tensor("float32", [9], [1, 1]) }).mockRejectedValueOnce(new Error("inference failed"));+ const { rerank } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant"), result("tail")];+ expect(await rerank("query", input, 2)).toBe(input);+ expect((await rerank("query", input, 2))[0].observation.id).toBe("relevant");+ });+ it.each([+ { logits: new Tensor("float32", [NaN], [1, 1]) },+ { logits: new Tensor("float32", [Infinity], [1, 1]) },+ { logits: new Tensor("float32", [-Infinity], [1, 1]) },+ { logits: new Tensor("float32", [], [1, 1]) },+ { logits: new Tensor("float32", [1, 2], [1, 2]) },+ { logits: new Tensor("float32", [1], [1]) },+ { logits: null },+ {},+ ])("rejects invalid model output without dropping candidates (%#)", async (output) => {+ const { model } = fixture();+ model.mockResolvedValue(output as never);const { rerank } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant"), result("tail")];+ expect(await rerank("query", input, 2)).toBe(input);+ });- const results = [- { observation: { id: "o2", title: "Second", narrative: "" }, combinedScore: 0.9 },- { observation: { id: "o1", title: "First", narrative: "" }, combinedScore: 0.5 },- ] as any;+ it("shares model loading across concurrent queries without sharing their tokens", async () => {+ const { loadModel, tokenizer } = fixture();+ const { rerank } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant")];+ const outputs = await Promise.all([rerank("query one", input), rerank("query two", input)]);+ expect(loadModel).toHaveBeenCalledTimes(1);+ expect(outputs.map((items) => items[0].observation.id)).toEqual(["relevant", "relevant"]);+ expect(new Set(tokenizer.mock.calls.map(([query]) => query))).toEqual(new Set(["query one", "query two"]));+ });- const reranked = await rerank("query", results);+ it.each(["loadTokenizer", "loadModel"] as const)("retries %s after a cooldown while coalescing concurrent retries", async (stage) => {+ vi.useFakeTimers();+ const loaders = fixture();+ const failedLoad = loaders[stage];+ failedLoad.mockRejectedValueOnce(new Error("download unavailable"));+ const { rerank, isRerankerAvailable } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant")];+ expect(await Promise.all([rerank("query", input), rerank("query", input)])).toEqual([input, input]);+ expect(await rerank("query", input)).toBe(input);+ expect(failedLoad).toHaveBeenCalledTimes(1);+ expect(isRerankerAvailable()).toBe(false);+ vi.advanceTimersByTime(60_000);+ const outputs = await Promise.all([rerank("query", input), rerank("query", input)]);+ expect(failedLoad).toHaveBeenCalledTimes(2);+ expect(outputs[0][0].observation.id).toBe("relevant");+ });++ it("isolates an inference failure from a concurrent query", async () => {+ const { model } = fixture();+ model.mockRejectedValueOnce(new Error("one request failed"));+ const { rerank } = await import("../src/state/reranker.js");+ const input = [result("irrelevant"), result("relevant")];+ const outputs = await Promise.all([rerank("query one", input), rerank("query two", input)]);+ expect(outputs[0]).toBe(input);+ expect(outputs[1][0].observation.id).toBe("relevant");+ });++ it("retains both segments and separators for long queries and documents", async () => {+ const { model } = fixture();+ const { rerank } = await import("../src/state/reranker.js");+ await rerank("query ".repeat(700), [result("relevant", 0.1, "word ".repeat(700)), result("irrelevant")]);+ for (const [inputs] of model.mock.calls) {+ const ids = Array.from(inputs.input_ids.data, Number), types = Array.from(inputs.token_type_ids.data, Number);+ expect(ids).toHaveLength(512);+ expect(ids[0]).toBe(1);+ expect(ids.at(-1)).toBe(2);+ const boundary = types.indexOf(1);+ expect(boundary).toBeGreaterThan(1);+ expect(ids[boundary - 1]).toBe(2);+ expect(ids[boundary]).toBe(inputs === model.mock.calls[0][0] ? 5 : 6);+ expect(inputs.attention_mask.dims).toEqual(inputs.input_ids.dims);+ }+ });- expect(mockPipeline).toHaveBeenCalled();- expect(reranked[0].observation.id).toBe("o1");+ it("keeps literal special tokens in the correct segment and handles empty documents", async () => {+ const { model } = fixture();+ const { rerank } = await import("../src/state/reranker.js");+ await rerank("[SEP] query [CLS]", [result("relevant", 0.5, "[CLS] [SEP]"), result("")]);+ const first = model.mock.calls[0][0];+ expect(Array.from(first.input_ids.data, Number)).toEqual([1, 2, 7, 1, 2, 5, 1, 2, 2]);+ expect(Array.from(first.token_type_ids.data, Number)).toEqual([0, 0, 0, 0, 0, 1, 1, 1, 1]);+ expect(Array.from(model.mock.calls[1][0].input_ids.data, Number)).toEqual([1, 2, 7, 1, 2, 2]);});++ it("passes evidence beyond 512 characters to tokenization", async () => {+ const { tokenizer } = fixture();+ const { rerank } = await import("../src/state/reranker.js");+ const narrative = "context ".repeat(100) + "relevant";+ expect((await rerank("query", [result("irrelevant"), result("", 0.5, narrative)]))[0].observation.narrative).toBe(narrative);+ expect(tokenizer.mock.calls[1][1].text_pair).toBe(narrative);+ });+});++it.skipIf(!transformers)("uses the real paired tokenizer and bypasses single-logit classification softmax", async () => {+ const actual = transformers!;+ const vocab = { "[PAD]": 0, "[UNK]": 1, "[CLS]": 2, "[SEP]": 3, "[MASK]": 4, query: 5, relevant: 6, irrelevant: 7 };+ const tokenizer = new actual.BertTokenizer({+ added_tokens: Object.entries(vocab).slice(0, 5).map(([content, id]) => ({ content, id, special: true, normalized: false, single_word: false, lstrip: false, rstrip: false })),+ normalizer: { type: "BertNormalizer", lowercase: true, strip_accents: true, handle_chinese_chars: true, clean_text: true },+ pre_tokenizer: { type: "BertPreTokenizer" },+ post_processor: { type: "BertProcessing", sep: ["[SEP]", 3], cls: ["[CLS]", 2] },+ decoder: { type: "WordPiece", prefix: "##", cleanup: true },+ model: { type: "WordPiece", vocab, unk_token: "[UNK]", continuing_subword_prefix: "##", max_input_chars_per_word: 100 },+ }, { model_max_length: 512, cls_token: "[CLS]", sep_token: "[SEP]", pad_token: "[PAD]", unk_token: "[UNK]", mask_token: "[MASK]" });+ const nativeModel = Object.assign(vi.fn(async (inputs: Record<string, InstanceType<typeof actual.Tensor>>) => ({+ logits: new actual.Tensor("float32", new Float32Array([Array.from(inputs.input_ids.data, Number).includes(6) ? 8 : -9]), [1, 1]),+ })), { config: { id2label: { 0: "LABEL_0" } } });+ const classifier = new actual.TextClassificationPipeline({ task: "text-classification", tokenizer, model: nativeModel as never });+ expect((await Promise.all([classifier("query [SEP] relevant"), classifier("query [SEP] irrelevant")])).map((items) => items[0].score)).toEqual([1, 1]);+ vi.doMock("@huggingface/transformers", () => ({+ AutoTokenizer: { from_pretrained: async () => tokenizer },+ AutoModelForSequenceClassification: { from_pretrained: async () => nativeModel },+ Tensor: actual.Tensor,+ pipeline: async () => classifier,+ }));+ const { rerank } = await import("../src/state/reranker.js");+ const output = await rerank("query", [result("irrelevant"), result("relevant")]);+ expect(output.map((item) => item.rerankScore)).toEqual([8, -9]);+ expect(output[0].observation.id).toBe("relevant");+ nativeModel.mockClear();+ await rerank("[SEP] [CLS] " + "query ".repeat(700), [result("relevant", 0.5, "[SEP] [CLS] " + "query ".repeat(700)), result("")]);+ for (const [inputs] of nativeModel.mock.calls) {+ const ids = Array.from(inputs.input_ids.data, Number), types = Array.from(inputs.token_type_ids.data, Number);+ expect(ids).toHaveLength(512);+ expect(ids.slice(0, 3)).toEqual([2, 3, 2]);+ expect(ids.at(-1)).toBe(3);+ const boundary = types.indexOf(1);+ expect(boundary).toBeGreaterThan(2);+ expect(ids[boundary - 1]).toBe(3);+ }+ expect(Array.from(nativeModel.mock.calls[0][0].input_ids.data, Number).slice(257, 260)).toEqual([6, 3, 2]);});