@agentmemory/agentmemory 0.9.29 → 0.9.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/.env.example +83 -22
  2. package/AGENTS.md +17 -24
  3. package/README.md +447 -170
  4. package/dist/.env.example +83 -22
  5. package/dist/cli.d.mts.map +1 -1
  6. package/dist/cli.mjs +1221 -335
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/{connect-Qaeq15TQ.mjs → connect-B4_ca6BD.mjs} +30 -39
  9. package/dist/connect-B4_ca6BD.mjs.map +1 -0
  10. package/dist/docker-compose.yml +40 -14
  11. package/dist/hooks/_capture.d.mts +22 -0
  12. package/dist/hooks/_capture.d.mts.map +1 -0
  13. package/dist/hooks/_capture.mjs +908 -0
  14. package/dist/hooks/_capture.mjs.map +1 -0
  15. package/dist/hooks/antigravity-bridge.d.mts +1 -1
  16. package/dist/hooks/antigravity-bridge.d.mts.map +1 -1
  17. package/dist/hooks/antigravity-bridge.mjs +24 -15
  18. package/dist/hooks/antigravity-bridge.mjs.map +1 -1
  19. package/dist/hooks/notification.mjs +17 -25
  20. package/dist/hooks/notification.mjs.map +1 -1
  21. package/dist/hooks/post-commit.mjs +71 -1
  22. package/dist/hooks/post-commit.mjs.map +1 -1
  23. package/dist/hooks/post-tool-failure.mjs +59 -25
  24. package/dist/hooks/post-tool-failure.mjs.map +1 -1
  25. package/dist/hooks/post-tool-use.mjs +87 -35
  26. package/dist/hooks/post-tool-use.mjs.map +1 -1
  27. package/dist/hooks/pre-compact.mjs +83 -3
  28. package/dist/hooks/pre-compact.mjs.map +1 -1
  29. package/dist/hooks/pre-tool-use.mjs +71 -1
  30. package/dist/hooks/pre-tool-use.mjs.map +1 -1
  31. package/dist/hooks/prompt-submit.mjs +13 -21
  32. package/dist/hooks/prompt-submit.mjs.map +1 -1
  33. package/dist/hooks/session-end.mjs +25 -20
  34. package/dist/hooks/session-end.mjs.map +1 -1
  35. package/dist/hooks/session-start.mjs +80 -3
  36. package/dist/hooks/session-start.mjs.map +1 -1
  37. package/dist/hooks/stop.mjs +71 -1
  38. package/dist/hooks/stop.mjs.map +1 -1
  39. package/dist/hooks/subagent-start.mjs +16 -25
  40. package/dist/hooks/subagent-start.mjs.map +1 -1
  41. package/dist/hooks/subagent-stop.mjs +17 -25
  42. package/dist/hooks/subagent-stop.mjs.map +1 -1
  43. package/dist/hooks/task-completed.mjs +19 -27
  44. package/dist/hooks/task-completed.mjs.map +1 -1
  45. package/dist/iii-config.docker.yaml +10 -10
  46. package/dist/iii-config.yaml +3 -1
  47. package/dist/{image-refs-BKLmp_sD.mjs → image-refs-BaT-9oMU.mjs} +2 -2
  48. package/dist/image-refs-BaT-9oMU.mjs.map +1 -0
  49. package/dist/{image-refs-CJgZmb9X.mjs → image-refs-T_urbwHM.mjs} +3 -3
  50. package/dist/image-refs-T_urbwHM.mjs.map +1 -0
  51. package/dist/{keyed-mutex-DTHtcZrt.mjs → image-store-BsN4vyjr.mjs} +2 -14
  52. package/dist/image-store-BsN4vyjr.mjs.map +1 -0
  53. package/dist/index.mjs +12943 -6218
  54. package/dist/index.mjs.map +1 -1
  55. package/dist/{schema-BFZhNTF7.mjs → keyed-mutex-DchXsyfP.mjs} +28 -4
  56. package/dist/keyed-mutex-DchXsyfP.mjs.map +1 -0
  57. package/dist/secret-store-BnY3A50C.mjs +2348 -0
  58. package/dist/secret-store-BnY3A50C.mjs.map +1 -0
  59. package/dist/{src-G7yt8gGm.mjs → src-Jsq9LCeH.mjs} +5941 -2180
  60. package/dist/src-Jsq9LCeH.mjs.map +1 -0
  61. package/dist/{standalone-BqNJDJ04.mjs → standalone-DKCdrf1d.mjs} +39 -12
  62. package/dist/standalone-DKCdrf1d.mjs.map +1 -0
  63. package/dist/standalone.d.mts.map +1 -1
  64. package/dist/standalone.mjs +249 -14
  65. package/dist/standalone.mjs.map +1 -1
  66. package/dist/status-IRz7ta8-.mjs +2344 -0
  67. package/dist/status-IRz7ta8-.mjs.map +1 -0
  68. package/dist/viewer/index.html +7224 -2794
  69. package/docker-compose.yml +40 -14
  70. package/iii-config.docker.yaml +10 -10
  71. package/iii-config.yaml +3 -1
  72. package/integrations/pi/index.ts +2 -3
  73. package/integrations/pi/security.ts +52 -0
  74. package/package.json +13 -4
  75. package/plugin/.claude-plugin/plugin.json +2 -2
  76. package/plugin/.codex-plugin/plugin.json +26 -4
  77. package/plugin/.devin-plugin/plugin.json +1 -1
  78. package/plugin/.mcp.codex.json +12 -0
  79. package/plugin/.mcp.copilot.json +2 -7
  80. package/plugin/.mcp.json +2 -7
  81. package/plugin/assets/icon.svg +35 -0
  82. package/plugin/hooks/hooks.copilot.json +11 -11
  83. package/plugin/opencode/README.md +266 -30
  84. package/plugin/opencode/agentmemory-capture.ts +572 -3
  85. package/plugin/opencode/plugin.json +1 -1
  86. package/plugin/plugin.json +1 -1
  87. package/plugin/scripts/_capture.d.mts +22 -0
  88. package/plugin/scripts/_capture.d.mts.map +1 -0
  89. package/plugin/scripts/_capture.mjs +908 -0
  90. package/plugin/scripts/_capture.mjs.map +1 -0
  91. package/plugin/scripts/antigravity-bridge.d.mts +1 -1
  92. package/plugin/scripts/antigravity-bridge.d.mts.map +1 -1
  93. package/plugin/scripts/antigravity-bridge.mjs +24 -15
  94. package/plugin/scripts/antigravity-bridge.mjs.map +1 -1
  95. package/plugin/scripts/notification.mjs +17 -25
  96. package/plugin/scripts/notification.mjs.map +1 -1
  97. package/plugin/scripts/plugin-bridge.mjs +378 -0
  98. package/plugin/scripts/post-commit.mjs +71 -1
  99. package/plugin/scripts/post-commit.mjs.map +1 -1
  100. package/plugin/scripts/post-tool-failure.mjs +59 -25
  101. package/plugin/scripts/post-tool-failure.mjs.map +1 -1
  102. package/plugin/scripts/post-tool-use.mjs +87 -35
  103. package/plugin/scripts/post-tool-use.mjs.map +1 -1
  104. package/plugin/scripts/pre-compact.mjs +83 -3
  105. package/plugin/scripts/pre-compact.mjs.map +1 -1
  106. package/plugin/scripts/pre-tool-use.mjs +71 -1
  107. package/plugin/scripts/pre-tool-use.mjs.map +1 -1
  108. package/plugin/scripts/prompt-submit.mjs +13 -21
  109. package/plugin/scripts/prompt-submit.mjs.map +1 -1
  110. package/plugin/scripts/session-end.mjs +25 -20
  111. package/plugin/scripts/session-end.mjs.map +1 -1
  112. package/plugin/scripts/session-start.mjs +80 -3
  113. package/plugin/scripts/session-start.mjs.map +1 -1
  114. package/plugin/scripts/stop.mjs +71 -1
  115. package/plugin/scripts/stop.mjs.map +1 -1
  116. package/plugin/scripts/subagent-start.mjs +16 -25
  117. package/plugin/scripts/subagent-start.mjs.map +1 -1
  118. package/plugin/scripts/subagent-stop.mjs +17 -25
  119. package/plugin/scripts/subagent-stop.mjs.map +1 -1
  120. package/plugin/scripts/task-completed.mjs +19 -27
  121. package/plugin/scripts/task-completed.mjs.map +1 -1
  122. package/plugin/skills/_shared/TROUBLESHOOTING.md +22 -6
  123. package/plugin/skills/agentmemory-agents/REFERENCE.md +3 -3
  124. package/plugin/skills/agentmemory-config/REFERENCE.md +49 -1
  125. package/plugin/skills/agentmemory-config/SKILL.md +44 -7
  126. package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +1 -1
  127. package/plugin/skills/agentmemory-rest-api/REFERENCE.md +10 -2
  128. package/plugin/skills/handoff/SKILL.md +4 -2
  129. package/plugin/skills/memory-discipline/SKILL.md +13 -5
  130. package/dist/connect-Qaeq15TQ.mjs.map +0 -1
  131. package/dist/image-refs-BKLmp_sD.mjs.map +0 -1
  132. package/dist/image-refs-CJgZmb9X.mjs.map +0 -1
  133. package/dist/keyed-mutex-DTHtcZrt.mjs.map +0 -1
  134. package/dist/logger-BEB7pCI9.mjs +0 -43
  135. package/dist/logger-BEB7pCI9.mjs.map +0 -1
  136. package/dist/schema-BFZhNTF7.mjs.map +0 -1
  137. package/dist/src-G7yt8gGm.mjs.map +0 -1
  138. package/dist/standalone-BqNJDJ04.mjs.map +0 -1
  139. package/dist/tools-registry-BV_2bu7z.mjs +0 -1405
  140. package/dist/tools-registry-BV_2bu7z.mjs.map +0 -1
package/README.md CHANGED
@@ -11,18 +11,39 @@
11
11
  </p>
12
12
 
13
13
  <p align="center">
14
- <a href="README.md">English</a> |
15
- <a href="READMEs/README.zh-CN.md">简体中文</a> |
16
- <a href="READMEs/README.zh-TW.md">繁體中文</a> |
17
- <a href="READMEs/README.ja-JP.md">日本語</a> |
18
- <a href="READMEs/README.ko-KR.md">한국어</a> |
19
- <a href="READMEs/README.es-ES.md">Español</a> |
20
- <a href="READMEs/README.tr-TR.md">Türkçe</a> |
21
- <a href="READMEs/README.ru-RU.md">Русский</a> |
22
- <a href="READMEs/README.hi-IN.md">हिन्दी</a> |
23
- <a href="READMEs/README.pt-BR.md">Português</a> |
24
- <a href="READMEs/README.fr-FR.md">Français</a> |
25
- <a href="READMEs/README.de-DE.md">Deutsch</a>
14
+ <a href="README.md">🇬🇧 English</a> •
15
+ <a href="READMEs/README.zh-CN.md">🇨🇳 简体中文</a> •
16
+ <a href="READMEs/README.zh-TW.md">🇹🇼 繁體中文</a> •
17
+ <a href="READMEs/README.ja-JP.md">🇯🇵 日本語</a> •
18
+ <a href="READMEs/README.ko-KR.md">🇰🇷 한국어</a> •
19
+ <a href="READMEs/README.pt-PT.md">🇵🇹 Português</a> •
20
+ <a href="READMEs/README.pt-BR.md">🇧🇷 Português (Brasil)</a> •
21
+ <a href="READMEs/README.es-ES.md">🇪🇸 Español</a> •
22
+ <a href="READMEs/README.de-DE.md">🇩🇪 Deutsch</a> •
23
+ <a href="READMEs/README.fr-FR.md">🇫🇷 Français</a> •
24
+ <a href="READMEs/README.it-IT.md">🇮🇹 Italiano</a> •
25
+ <a href="READMEs/README.nl-NL.md">🇳🇱 Nederlands</a> •
26
+ <a href="READMEs/README.pl-PL.md">🇵🇱 Polski</a> •
27
+ <a href="READMEs/README.cs-CZ.md">🇨🇿 Čeština</a> •
28
+ <a href="READMEs/README.ro-RO.md">🇷🇴 Română</a> •
29
+ <a href="READMEs/README.hu-HU.md">🇭🇺 Magyar</a> •
30
+ <a href="READMEs/README.el-GR.md">🇬🇷 Ελληνικά</a> •
31
+ <a href="READMEs/README.sv-SE.md">🇸🇪 Svenska</a> •
32
+ <a href="READMEs/README.da-DK.md">🇩🇰 Dansk</a> •
33
+ <a href="READMEs/README.nb-NO.md">🇳🇴 Norsk</a> •
34
+ <a href="READMEs/README.fi-FI.md">🇫🇮 Suomi</a> •
35
+ <a href="READMEs/README.ru-RU.md">🇷🇺 Русский</a> •
36
+ <a href="READMEs/README.uk-UA.md">🇺🇦 Українська</a> •
37
+ <a href="READMEs/README.tr-TR.md">🇹🇷 Türkçe</a> •
38
+ <a href="READMEs/README.he-IL.md">🇮🇱 עברית</a> •
39
+ <a href="READMEs/README.ar-SA.md">🇸🇦 العربية</a> •
40
+ <a href="READMEs/README.hi-IN.md">🇮🇳 हिन्दी</a> •
41
+ <a href="READMEs/README.bn-BD.md">🇧🇩 বাংলা</a> •
42
+ <a href="READMEs/README.ur-PK.md">🇵🇰 اردو</a> •
43
+ <a href="READMEs/README.th-TH.md">🇹🇭 ไทย</a> •
44
+ <a href="READMEs/README.vi-VN.md">🇻🇳 Tiếng Việt</a> •
45
+ <a href="READMEs/README.id-ID.md">🇮🇩 Bahasa Indonesia</a> •
46
+ <a href="READMEs/README.tl-PH.md">🇵🇭 Tagalog</a>
26
47
  </p>
27
48
 
28
49
  <p align="center">
@@ -50,7 +71,7 @@
50
71
  <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>
51
72
  <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>
52
73
  <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>
53
- <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="1,674+ tests passing" height="38" /></picture>
74
+ <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="2,500+ tests passing" height="38" /></picture>
54
75
  </p>
55
76
 
56
77
  <p align="center">
@@ -75,21 +96,33 @@
75
96
 
76
97
  ## Install
77
98
 
78
- One command:
99
+ Requirements:
100
+
101
+ - Node.js 20 or newer with npm and npx (`node -v`, `npm -v`, and `npx -v`).
102
+ - macOS/Linux automatic iii-engine installation also needs `curl`, a POSIX `sh`, and `tar`. Minimal images such as `node:20-slim` may not include them.
103
+ - Native Windows requires the pinned iii-engine v0.22.1 `iii.exe` to be installed manually. WSL2 or Docker Desktop are the other supported paths.
104
+
105
+ Canonical fresh-install command:
79
106
 
80
107
  ```bash
81
- npx @agentmemory/agentmemory
108
+ npx -y @agentmemory/agentmemory@latest
82
109
  ```
83
110
 
84
- The first run is an interactive setup: pick the agents to wire (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, ...), pick an LLM provider or stay keyless, and it seeds the config, starts the memory server on `:3111`, and offers to install globally so the bare `agentmemory` command works everywhere afterwards.
111
+ The first run is an interactive setup: pick the agents to wire (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, ...), pick an LLM provider or stay keyless, and it seeds the config, starts the memory server and its pinned iii engine, and offers to install globally so the bare `agentmemory` command works everywhere afterward. `-y` accepts npx's package prompt and `@latest` avoids a stale cached release. A provider makes LLM features available, but LLM-written observation compression starts only when `AGENTMEMORY_AUTO_COMPRESS=true` is also set.
112
+
113
+ Keyless mode disables vector embeddings. `memory_recall` (the `mem::search` path) uses BM25, while `memory_smart_search` can also fuse structural graph matches when graph data already exists. For free on-device semantic recall, set `EMBEDDING_PROVIDER=local` in `~/.agentmemory/.env` and restart. The first embedding request downloads `Xenova/all-MiniLM-L6-v2`; inference runs locally after that initial model download.
114
+
115
+ The local runtime uses four ports: `3111` for REST/MCP HTTP, `3112` for iii streams, `3113` for the viewer, and `49134` for the iii worker WebSocket. Persistent iii state lives in `~/Library/Application Support/agentmemory` on macOS, `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` on Linux, and `%APPDATA%\agentmemory` on Windows. Use `--data-dir <path>` or `AGENTMEMORY_DATA_DIR` to override it, and reuse the same value on every restart. For backward compatibility, an existing `./data/state_store.db` or `./data/iii-config.yaml` takes precedence over the platform default for instance 0; an explicit flag or environment override still wins.
85
116
 
86
117
  Then prove recall works and give your agent its skills:
87
118
 
88
119
  ```bash
89
- agentmemory demo --serve # seed sample sessions + watch recall find them
120
+ npx -y @agentmemory/agentmemory@latest demo # seed sample sessions + exercise recall
90
121
  npx skills add rohitg00/agentmemory -y # 17 native skills so your agent knows when to reach for memory
91
122
  ```
92
123
 
124
+ The keyword searches should hit in default keyless mode through BM25. The demo's `database performance optimization` query is intentionally semantic and can return zero until an embedding provider is configured.
125
+
93
126
  Prefer to let a coding agent do the whole thing? Hand it one instruction:
94
127
 
95
128
  > Retrieve and follow the instructions at: https://raw.githubusercontent.com/rohitg00/agentmemory/main/INSTALL_FOR_AGENTS.md
@@ -99,7 +132,7 @@ Wire more agents any time with `agentmemory connect <agent>` — 20 adapters lis
99
132
  <details>
100
133
  <summary><strong>Windows</strong></summary>
101
134
 
102
- The fast path is WSL2. Native Windows engine setup is manual (about 10 to 20 minutes) and `agentmemory connect` is currently unsupported there. See the [Windows notes](#windows) for the step-by-step.
135
+ The fast path is WSL2. Native Windows engine setup requires the pinned v0.22.1 ZIP to be downloaded and `iii.exe` extracted manually; the CLI does not auto-extract it. Docker Desktop is also supported. See the [Windows notes](#windows) for the step-by-step.
103
136
 
104
137
  </details>
105
138
 
@@ -107,11 +140,11 @@ The fast path is WSL2. Native Windows engine setup is manual (about 10 to 20 min
107
140
  <summary><strong>Global install / EACCES</strong></summary>
108
141
 
109
142
  ```bash
110
- npm install -g @agentmemory/agentmemory
111
- # If you hit EACCES on macOS/Linux system Node installs:
112
- sudo npm install -g @agentmemory/agentmemory
143
+ npm install -g @agentmemory/agentmemory@latest
113
144
  ```
114
145
 
146
+ The npx command above remains the canonical fresh-install path and avoids global-prefix permission issues.
147
+
115
148
  </details>
116
149
 
117
150
  <details>
@@ -124,7 +157,7 @@ npx caches per version. Force the latest with `npx -y @agentmemory/agentmemory@l
124
157
  <details>
125
158
  <summary><strong>Already running your own iii engine</strong></summary>
126
159
 
127
- agentmemory pins iii-engine v0.11.2 and won't attach to a different version (the worker can't speak another engine's protocol). Stop the other engine, then run `npx -y @agentmemory/agentmemory@latest`. It installs and runs the pinned v0.11.2 in `~/.agentmemory/bin`, leaving your own `iii` untouched.
160
+ agentmemory pins iii-engine v0.22.1 and won't attach to a different version (the worker can't speak another engine's protocol). Stop the other engine, then run `npx -y @agentmemory/agentmemory@latest`. It installs and runs the pinned v0.22.1 in `~/.agentmemory/bin`, leaving your own `iii` untouched.
128
161
 
129
162
  </details>
130
163
 
@@ -136,99 +169,138 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
136
169
 
137
170
  <table>
138
171
  <tr>
139
- <td align="center" width="12.5%">
172
+ <td align="center" width="20%">
140
173
  <a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Claude Code" width="48" height="48" /></a><br/>
141
174
  <strong>Claude Code</strong><br/>
142
175
  <sub>native plugin + 12 hooks + MCP</sub>
143
176
  </td>
144
- <td align="center" width="12.5%">
177
+ <td align="center" width="20%">
145
178
  <a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="Codex CLI" width="48" height="48" /></a><br/>
146
179
  <strong>Codex CLI</strong><br/>
147
180
  <sub>native plugin + 6 hooks + MCP</sub>
148
181
  </td>
149
- <td align="center" width="12.5%">
150
- <a href="https://github.com/features/copilot"><img src="https://github.githubassets.com/images/modules/site/copilot/copilot.png" alt="GitHub Copilot CLI" width="48" height="48" /></a><br/>
182
+ <td align="center" width="20%">
183
+ <a href="https://github.com/features/copilot"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/github_dark.svg"><img src="https://svgl.app/library/github_light.svg" alt="GitHub Copilot CLI" width="48" height="48" /></picture></a><br/>
151
184
  <strong>GitHub Copilot CLI</strong><br/>
152
185
  <sub>MCP + plugin hooks/skills</sub>
153
186
  </td>
154
- <td align="center" width="12.5%">
187
+ <td align="center" width="20%">
188
+ <a href="https://cursor.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/cursor_dark.svg"><img src="https://svgl.app/library/cursor_light.svg" alt="Cursor" width="48" height="48" /></picture></a><br/>
189
+ <strong>Cursor</strong><br/>
190
+ <sub>native plugin + 7 hooks + MCP</sub>
191
+ </td>
192
+ <td align="center" width="20%">
193
+ <a href="plugin/opencode/"><img src="https://raw.githubusercontent.com/rohitg00/agentmemory/main/website/public/opencode.png" alt="OpenCode" width="48" height="48" /></a><br/>
194
+ <strong>OpenCode</strong><br/>
195
+ <sub>capture plugin + MCP</sub>
196
+ </td>
197
+ </tr>
198
+ <tr>
199
+ <td align="center" width="20%">
200
+ <a href="https://devin.ai"><img src="https://raw.githubusercontent.com/rohitg00/agentmemory/main/website/public/devin.png" alt="Devin" width="48" height="48" /></a><br/>
201
+ <strong>Devin</strong><br/>
202
+ <sub>6 hooks + skills + MCP</sub>
203
+ </td>
204
+ <td align="center" width="20%">
155
205
  <a href="integrations/openclaw/"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /></a><br/>
156
206
  <strong>OpenClaw</strong><br/>
157
207
  <sub>native plugin + MCP</sub>
158
208
  </td>
159
- <td align="center" width="12.5%">
209
+ <td align="center" width="20%">
160
210
  <a href="integrations/hermes/"><img src="https://github.com/NousResearch.png?size=120" alt="Hermes" width="48" height="48" /></a><br/>
161
211
  <strong>Hermes</strong><br/>
162
212
  <sub>native plugin + MCP</sub>
163
213
  </td>
164
- <td align="center" width="12.5%">
214
+ <td align="center" width="20%">
165
215
  <a href="integrations/pi/"><img src="assets/agents/pi.svg" alt="pi" width="48" height="48" /></a><br/>
166
216
  <strong>pi</strong><br/>
167
217
  <sub>native plugin + MCP</sub>
168
218
  </td>
169
- <td align="center" width="12.5%">
170
- <a href="https://github.com/tinyhumansai/openhuman"><img src="https://raw.githubusercontent.com/tinyhumansai/openhuman/main/app/src-tauri/icons/128x128.png" alt="OpenHuman" width="48" height="48" /></a><br/>
219
+ <td align="center" width="20%">
220
+ <a href="https://github.com/tinyhumansai/openhuman"><img src="https://github.com/tinyhumansai.png?size=120" alt="OpenHuman" width="48" height="48" /></a><br/>
171
221
  <strong>OpenHuman</strong><br/>
172
222
  <sub>native Memory trait backend</sub>
173
223
  </td>
174
- <td align="center" width="12.5%">
175
- <a href="https://cursor.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/cursor_dark.svg"><img src="https://svgl.app/library/cursor_light.svg" alt="Cursor" width="48" height="48" /></picture></a><br/>
176
- <strong>Cursor</strong><br/>
177
- <sub>native plugin + MCP</sub>
178
- </td>
179
- <td align="center" width="12.5%">
224
+ </tr>
225
+ <tr>
226
+ <td align="center" width="20%">
180
227
  <a href="https://github.com/google-gemini/gemini-cli"><img src="https://github.com/google-gemini.png?size=120" alt="Gemini CLI" width="48" height="48" /></a><br/>
181
228
  <strong>Gemini CLI</strong><br/>
182
229
  <sub>MCP server</sub>
183
230
  </td>
231
+ <td align="center" width="20%">
232
+ <a href="https://antigravity.google"><img src="https://svgl.app/library/antigravity.svg" alt="Antigravity" width="48" height="48" /></a><br/>
233
+ <strong>Antigravity</strong><br/>
234
+ <sub>MCP + hooks</sub>
235
+ </td>
236
+ <td align="center" width="20%">
237
+ <a href="https://claude.ai/download"><img src="https://github.com/anthropics.png?size=120" alt="Claude Desktop" width="48" height="48" /></a><br/>
238
+ <strong>Claude Desktop</strong><br/>
239
+ <sub>MCP server</sub>
240
+ </td>
241
+ <td align="center" width="20%">
242
+ <a href="https://www.warp.dev"><img src="https://svgl.app/library/warp.svg" alt="Warp" width="48" height="48" /></a><br/>
243
+ <strong>Warp</strong><br/>
244
+ <sub>connect + MCP + skills</sub>
245
+ </td>
246
+ <td align="center" width="20%">
247
+ <a href="https://zed.dev"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/zed-logo_dark.svg"><img src="https://svgl.app/library/zed-logo.svg" alt="Zed" width="48" height="48" /></picture></a><br/>
248
+ <strong>Zed</strong><br/>
249
+ <sub>MCP server</sub>
250
+ </td>
184
251
  </tr>
185
252
  <tr>
186
- <td align="center" width="12.5%">
187
- <a href="https://github.com/opencode-ai/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode" width="48" height="48" /></picture></a><br/>
188
- <strong>OpenCode</strong><br/>
189
- <sub>22 hooks + MCP + plugin</sub>
190
- </td>
191
- <td align="center" width="12.5%">
253
+ <td align="center" width="20%">
192
254
  <a href="https://github.com/cline/cline"><img src="https://github.com/cline.png?size=120" alt="Cline" width="48" height="48" /></a><br/>
193
255
  <strong>Cline</strong><br/>
194
256
  <sub>MCP server</sub>
195
257
  </td>
196
- <td align="center" width="12.5%">
197
- <a href="https://github.com/block/goose"><img src="https://github.com/block.png?size=120" alt="Goose" width="48" height="48" /></a><br/>
198
- <strong>Goose</strong><br/>
258
+ <td align="center" width="20%">
259
+ <a href="https://continue.dev"><img src="https://github.com/continuedev.png?size=120" alt="Continue" width="48" height="48" /></a><br/>
260
+ <strong>Continue</strong><br/>
199
261
  <sub>MCP server</sub>
200
262
  </td>
201
- <td align="center" width="12.5%">
202
- <a href="https://github.com/Kilo-Org/kilocode"><img src="https://github.com/Kilo-Org.png?size=120" alt="Kilo Code" width="48" height="48" /></a><br/>
203
- <strong>Kilo Code</strong><br/>
263
+ <td align="center" width="20%">
264
+ <a href="https://docs.factory.ai/cli"><img src="https://www.factory.ai/favicon.svg" alt="Droid" width="48" height="48" /></a><br/>
265
+ <strong>Droid</strong><br/>
204
266
  <sub>MCP server</sub>
205
267
  </td>
206
- <td align="center" width="12.5%">
207
- <a href="https://github.com/Aider-AI/aider"><img src="https://github.com/Aider-AI.png?size=120" alt="Aider" width="48" height="48" /></a><br/>
208
- <strong>Aider</strong><br/>
209
- <sub>REST API</sub>
268
+ <td align="center" width="20%">
269
+ <a href="https://kiro.dev"><img src="https://kiro.dev/favicon.ico" alt="Kiro" width="48" height="48" /></a><br/>
270
+ <strong>Kiro</strong><br/>
271
+ <sub>MCP server</sub>
210
272
  </td>
211
- <td align="center" width="12.5%">
212
- <a href="https://claude.ai/download"><img src="https://github.com/anthropics.png?size=120" alt="Claude Desktop" width="48" height="48" /></a><br/>
213
- <strong>Claude Desktop</strong><br/>
273
+ <td align="center" width="20%">
274
+ <a href="https://github.com/QwenLM/qwen-code"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/qwen_dark.svg"><img src="https://svgl.app/library/qwen_light.svg" alt="Qwen Code" width="48" height="48" /></picture></a><br/>
275
+ <strong>Qwen Code</strong><br/>
214
276
  <sub>MCP server</sub>
215
277
  </td>
216
- <td align="center" width="12.5%">
217
- <a href="https://devin.ai"><img src="https://raw.githubusercontent.com/rohitg00/agentmemory/main/website/public/devin.png" alt="Devin" width="48" height="48" /></a><br/>
218
- <strong>Devin</strong><br/>
219
- <sub>6 hooks + MCP</sub>
278
+ </tr>
279
+ <tr>
280
+ <td align="center" width="20%">
281
+ <a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://svgl.app/library/deepseek.svg" alt="DeepSeek Harness" width="48" height="48" /></a><br/>
282
+ <strong>DeepSeek Harness</strong><br/>
283
+ <sub>MCP server</sub>
220
284
  </td>
221
- <td align="center" width="12.5%">
285
+ <td align="center" width="20%">
222
286
  <a href="https://github.com/RooCodeInc/Roo-Code"><img src="https://github.com/RooCodeInc.png?size=120" alt="Roo Code" width="48" height="48" /></a><br/>
223
287
  <strong>Roo Code</strong><br/>
224
288
  <sub>MCP server</sub>
225
289
  </td>
226
- </tr>
227
- <tr>
228
- <td align="center" width="12.5%">
229
- <a href="https://www.warp.dev"><img src="https://github.com/warpdotdev.png?size=120" alt="Warp" width="48" height="48" /></a><br/>
230
- <strong>Warp</strong><br/>
231
- <sub>connect + MCP + skills</sub>
290
+ <td align="center" width="20%">
291
+ <a href="https://github.com/Kilo-Org/kilocode"><img src="https://github.com/Kilo-Org.png?size=120" alt="Kilo Code" width="48" height="48" /></a><br/>
292
+ <strong>Kilo Code</strong><br/>
293
+ <sub>MCP server</sub>
294
+ </td>
295
+ <td align="center" width="20%">
296
+ <a href="https://github.com/block/goose"><img src="https://github.com/block.png?size=120" alt="Goose" width="48" height="48" /></a><br/>
297
+ <strong>Goose</strong><br/>
298
+ <sub>MCP server</sub>
299
+ </td>
300
+ <td align="center" width="20%">
301
+ <a href="https://github.com/Aider-AI/aider"><img src="https://github.com/Aider-AI.png?size=120" alt="Aider" width="48" height="48" /></a><br/>
302
+ <strong>Aider</strong><br/>
303
+ <sub>REST API</sub>
232
304
  </td>
233
305
  </tr>
234
306
  </table>
@@ -244,16 +316,18 @@ You explain the same architecture every session. You re-discover the same bugs.
244
316
  **What changes:** Session 1 you set up JWT auth. Session 2 you ask for rate limiting. The agent already knows your auth uses jose middleware in `src/middleware/auth.ts`, your tests cover token validation, and you chose jose over jsonwebtoken for Edge compatibility, with no re-explaining and no copy-pasting.
245
317
 
246
318
  ```bash
247
- npx @agentmemory/agentmemory
319
+ npx -y @agentmemory/agentmemory@latest
248
320
  ```
249
321
 
250
- By default, agentmemory stores iii-engine state outside the repository you start it from: `~/Library/Application Support/agentmemory` on macOS, `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` on Linux, and `%APPDATA%\agentmemory` on Windows. To choose a location, pass `--data-dir <path>` or set `AGENTMEMORY_DATA_DIR`:
322
+ By default, agentmemory stores iii-engine state outside the repository you start it from: `~/Library/Application Support/agentmemory` on macOS, `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` on Linux, and `%APPDATA%\agentmemory` on Windows. An existing legacy `./data/state_store.db` or `./data/iii-config.yaml` is reused for instance 0 before that platform default. To choose a location explicitly, pass `--data-dir <path>` or set `AGENTMEMORY_DATA_DIR`; either explicit setting takes precedence over legacy discovery:
251
323
 
252
324
  ```bash
253
- npx @agentmemory/agentmemory --data-dir ~/.agentmemory-projects/main
254
- AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx @agentmemory/agentmemory
325
+ npx -y @agentmemory/agentmemory@latest --data-dir ~/.agentmemory-projects/main
326
+ AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx -y @agentmemory/agentmemory@latest
255
327
  ```
256
328
 
329
+ Native and Docker launches use this same resolved host directory; Docker bind-mounts it at `/data`. `--instance 1` appends `instance-1` to the resolved directory and selects the separate default port quartet `3211/3212/3213/49234`.
330
+
257
331
  Latest release notes: [CHANGELOG.md](CHANGELOG.md).
258
332
 
259
333
  ---
@@ -482,29 +556,54 @@ None of these auto-capture from coding-agent hooks, ship a local-first viewer, o
482
556
 
483
557
  <h2 id="quick-start"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-quickstart.svg"><img src="assets/tags/section-quickstart.svg" alt="Quick Start" height="32" /></picture></h2>
484
558
 
485
- Compatibility: this release targets stable `iii-sdk` `^0.11.0` and iii-engine v0.11.x.
559
+ Compatibility: this release targets `iii-sdk` 0.22.1 and pins iii-engine v0.22.1.
486
560
 
487
561
  ### Try it in 30 seconds
488
562
 
489
563
  ```bash
490
564
  # Terminal 1: start the server
491
- npx @agentmemory/agentmemory
565
+ npx -y @agentmemory/agentmemory@latest
492
566
 
493
567
  # Terminal 2: seed sample data and see recall in action
494
- npx @agentmemory/agentmemory demo
568
+ npx -y @agentmemory/agentmemory@latest demo
495
569
  ```
496
570
 
497
- `demo` seeds 3 realistic sessions (JWT auth, N+1 query fix, rate limiting) and runs semantic searches against them. You'll see it find "N+1 query fix" when you search "database performance optimization", which keyword matching cannot do.
571
+ `demo` seeds 3 realistic sessions (JWT auth, N+1 query fix, rate limiting) and runs searches against them. Keyless installs disable vectors, so the `mem::search` keyword queries should hit through BM25 while `database performance optimization` can return zero. `smart-search` may additionally return structural graph matches when graph data exists. To make the semantic query find the N+1 fix through vectors, set `EMBEDDING_PROVIDER=local`, restart, and allow the first model download to finish.
498
572
 
499
573
  Open `http://localhost:3113` to watch the memory build live.
500
574
 
575
+ ### Validate a fresh install and restart persistence
576
+
577
+ With the server running, validate REST, health, the viewer, and the iii-backed runtime status:
578
+
579
+ ```bash
580
+ curl -fsS http://localhost:3111/agentmemory/livez
581
+ curl -fsS http://localhost:3111/agentmemory/health
582
+ curl -fsS -o /dev/null http://localhost:3113/
583
+ npx -y @agentmemory/agentmemory@latest status
584
+ ```
585
+
586
+ The startup ready panel accounts for all four ports: REST/MCP HTTP on 3111, iii streams on 3112, the viewer on 3113, and the iii worker WebSocket on 49134. `status` confirms agentmemory health and the active provider/embedding mode. Save a probe and confirm it is searchable:
587
+
588
+ ```bash
589
+ curl -fsS -X POST http://localhost:3111/agentmemory/remember \
590
+ -H 'Content-Type: application/json' \
591
+ -d '{"content":"agentmemory restart persistence probe","concepts":["install-check"]}'
592
+
593
+ curl -fsS -X POST http://localhost:3111/agentmemory/smart-search \
594
+ -H 'Content-Type: application/json' \
595
+ -d '{"query":"restart persistence probe","limit":5}'
596
+ ```
597
+
598
+ Then run `npx -y @agentmemory/agentmemory@latest stop`, start the canonical command again in Terminal 1, wait for `/agentmemory/livez`, and repeat the search. The probe must still be returned. If you selected a custom `--data-dir`, pass the same directory on the restart.
599
+
501
600
  ### Everyday commands
502
601
 
503
602
  Install and setup live in [Install](#install) above (the first run walks you through it). Day to day:
504
603
 
505
604
  ```bash
506
605
  agentmemory # start the server
507
- agentmemory stop # tear it down
606
+ agentmemory stop # stop it cleanly
508
607
  agentmemory connect <agent> # wire another agent
509
608
  agentmemory doctor # interactive diagnostics + fix prompts
510
609
  agentmemory remove # uninstall everything we created
@@ -518,10 +617,10 @@ To bring in older Claude Code JSONL transcripts:
518
617
 
519
618
  ```bash
520
619
  # Import everything under the default ~/.claude/projects
521
- npx @agentmemory/agentmemory import-jsonl
620
+ npx -y @agentmemory/agentmemory@latest import-jsonl
522
621
 
523
622
  # Or import a single file
524
- npx @agentmemory/agentmemory import-jsonl ~/.claude/projects/-my-project/abc123.jsonl
623
+ npx -y @agentmemory/agentmemory@latest import-jsonl ~/.claude/projects/-my-project/abc123.jsonl
525
624
  ```
526
625
 
527
626
  Imported sessions show up in the Replay picker alongside native ones. Under the hood each entry routes through the `mem::replay::load`, `mem::replay::sessions`, and `mem::replay::import-jsonl` iii functions, with no side-channel servers. Each imported transcript is indexed for search, stamped with origin channel `import`, and mined for a session crystal and lessons.
@@ -533,17 +632,17 @@ Imported sessions show up in the Replay picker alongside native ones. Under the
533
632
  Use the maintenance command when you intentionally want to update your local runtime:
534
633
 
535
634
  ```bash
536
- npx @agentmemory/agentmemory upgrade
635
+ npx -y @agentmemory/agentmemory@latest upgrade
537
636
  ```
538
637
 
539
- Warning: this command mutates the current workspace/runtime. It can update JavaScript dependencies and pull the pinned `iiidev/iii:0.11.2` Docker image. It never installs an unpinned or newer iii engine.
638
+ Warning: this command mutates the current workspace/runtime. It can update JavaScript dependencies and pull the pinned `iiidev/iii:0.22.1` Docker image. It never installs an unpinned or newer iii engine.
540
639
 
541
640
  Implementation details live in `src/cli.ts` (see `runUpgrade` around the `src/cli.ts:544-595` region).
542
641
 
543
642
  ### Claude Code (one block, paste it)
544
643
 
545
644
  ```text
546
- Install agentmemory: run `npx @agentmemory/agentmemory` in a separate terminal to start the memory server. Then run `/plugin marketplace add rohitg00/agentmemory` and `/plugin install agentmemory` — the plugin registers all 12 hooks, 17 skills, AND auto-wires the `@agentmemory/mcp` stdio server via its `.mcp.json`, so you get 54 MCP tools (memory_smart_search, memory_save, memory_sessions, memory_governance_delete, etc.) without any extra config step. Verify with `curl http://localhost:3111/agentmemory/health`. The real-time viewer is at http://localhost:3113.
645
+ Install agentmemory: run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server and its pinned iii engine. Then run `/plugin marketplace add rohitg00/agentmemory` and `/plugin install agentmemory` — the plugin registers all 12 hooks, 17 skills, AND auto-wires the `@agentmemory/mcp` stdio server via its `.mcp.json`, so you get 54 MCP tools (memory_smart_search, memory_save, memory_sessions, memory_governance_delete, etc.) without any extra config step. Verify with `curl http://localhost:3111/agentmemory/health`. The real-time viewer is at http://localhost:3113. Keyless mode disables vectors: `memory_recall` uses BM25, and `memory_smart_search` can also use existing structural graph data. Set `EMBEDDING_PROVIDER=local` in `~/.agentmemory/.env` and restart to opt into on-device semantic recall.
547
646
  ```
548
647
 
549
648
  #### Claude Code without the plugin install (MCP-standalone path)
@@ -563,7 +662,7 @@ For remote or protected deployments, launch Claude Code with `AGENTMEMORY_URL` a
563
662
 
564
663
  ```bash
565
664
  # 1. start the memory server in a separate terminal
566
- npx @agentmemory/agentmemory
665
+ npx -y @agentmemory/agentmemory@latest
567
666
 
568
667
  # 2. register the agentmemory marketplace and install the plugin
569
668
  codex plugin marketplace add rohitg00/agentmemory
@@ -572,41 +671,43 @@ codex plugin add agentmemory@agentmemory
572
671
 
573
672
  The Codex plugin ships from the same `plugin/` directory as the Claude Code plugin. It registers:
574
673
 
575
- - `@agentmemory/mcp` as an MCP server (proxies all 54 tools when `AGENTMEMORY_URL` points at a running agentmemory server; falls back to 7 tools locally when no server is reachable)
674
+ - A bundled stdio MCP bridge to the running daemon, with no npm download or fallback store. See the [local Codex guide](docs/plugins/codex-local.md) to test an unreleased build.
576
675
  - 6 lifecycle hooks: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PreCompact`, `Stop`
577
676
  - 9 invocable skills: `/recall`, `/remember`, `/session-history`, `/forget`, `/recap`, `/handoff`, `/lesson`, `/commit-context`, `/commit-history`, plus 8 reference skills the agent loads on demand (memory discipline, MCP tools, REST API, config, agents, hooks, architecture, and the skill-authoring guide)
578
677
 
579
678
  Codex's hook engine injects `CLAUDE_PLUGIN_ROOT` into hook subprocesses (per [`codex-rs/hooks/src/engine/discovery.rs`](https://github.com/openai/codex/blob/main/codex-rs/hooks/src/engine/discovery.rs)), so the same hook scripts work across both hosts without duplication. Subagent / SessionEnd / Notification / TaskCompleted / PostToolUseFailure events are Claude-Code-only and are not registered for Codex.
580
679
 
581
- #### Codex Desktop: plugin hooks currently silent (workaround available)
680
+ #### Codex hook trust and compatibility
582
681
 
583
- `CodexHooks` and `PluginHooks` are both stable + default-enabled in [`codex-rs/features/src/lib.rs`](https://github.com/openai/codex/blob/main/codex-rs/features/src/lib.rs), but Codex Desktop builds currently do not dispatch plugin-local `hooks.json` ([openai/codex#16430](https://github.com/openai/codex/issues/16430)). MCP tools still work; only the lifecycle observations are missing.
682
+ Native plugin hook dispatch is verified with Codex CLI 0.150.1. Trust the plugin hooks before expecting capture. Desktop behavior depends on its bundled runtime; check `/hooks` and confirm a captured event before enabling a workaround.
584
683
 
585
- Until upstream lands the fix, mirror the same hook commands into the global `~/.codex/hooks.json`:
684
+ If your host requires global hooks, mirror the commands into `~/.codex/hooks.json`. When MCP is already wired, the current connector needs `--force` to reach hook installation:
586
685
 
587
686
  ```bash
588
- agentmemory connect codex --with-hooks
687
+ agentmemory connect codex --with-hooks --force
589
688
  ```
590
689
 
591
- This adds an idempotent block to `~/.codex/hooks.json` referencing absolute paths to the bundled scripts (no `${CLAUDE_PLUGIN_ROOT}` expansion needed at user-scope). Re-run the same command after upgrading agentmemory to refresh paths. User entries in the same file are preserved; only previous agentmemory entries are replaced.
690
+ This merges global hooks and rewrites the agentmemory MCP entry, preserving unrelated entries. Review any custom agentmemory endpoint settings before using `--force`. Re-run after upgrading to refresh script paths. Enable either native plugin hooks or global copies to avoid duplicate capture.
592
691
 
593
692
  ### GitHub Copilot CLI
594
693
 
694
+ For VS Code agent mode, use the [Copilot MCP and automatic-capture guide](docs/plugins/copilot.md#vs-code-copilot-local-agent-sessions). The CLI connector does not configure VS Code.
695
+
595
696
  ```bash
596
697
  # MCP-only wiring
597
698
  agentmemory connect copilot-cli
598
699
 
599
- # Full hooks/skills plugin from the GitHub subdir
700
+ # Alternatively, full hooks/skills plugin from the GitHub subdir
600
701
  copilot plugin install rohitg00/agentmemory:plugin
601
702
  ```
602
703
 
603
- `agentmemory connect copilot-cli` merges `mcpServers.agentmemory` into `~/.copilot/mcp-config.json` (or `$COPILOT_HOME/mcp-config.json` when `COPILOT_HOME` is set) and preserves existing servers. This adapter is Windows-safe even though other `connect` adapters still require manual Windows setup. Copilot picks up the MCP server on next launch or after `/mcp`. Install the plugin as well when you want the full hook/skill experience.
704
+ `agentmemory connect copilot-cli` merges `mcpServers.agentmemory` into `~/.copilot/mcp-config.json` (or `$COPILOT_HOME/mcp-config.json` when `COPILOT_HOME` is set) and preserves existing servers. On native Windows this is the only automated `connect` adapter; configure every other native Windows agent manually. WSL `connect` is supported only when the target agent is installed in that same WSL environment. Copilot picks up the MCP server on next launch or after `/mcp`. Install the plugin as well when you want the full hook/skill experience.
604
705
 
605
706
  <details>
606
707
  <summary><b>OpenClaw (paste this prompt)</b></summary>
607
708
 
608
709
  ```text
609
- Install agentmemory for OpenClaw. Run `npx @agentmemory/agentmemory` in a separate terminal to start the memory server on localhost:3111. Then add this to my OpenClaw MCP config so agentmemory is available with all 54 memory tools:
710
+ Install agentmemory for OpenClaw. Run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server on localhost:3111. Then add this to my OpenClaw MCP config so agentmemory is available with all 54 memory tools:
610
711
 
611
712
  {
612
713
  "mcpServers": {
@@ -631,7 +732,7 @@ Full guide: [`integrations/openclaw/`](integrations/openclaw/)
631
732
  <summary><b>Hermes Agent (paste this prompt)</b></summary>
632
733
 
633
734
  ```text
634
- Install agentmemory for Hermes. Run `npx @agentmemory/agentmemory` in a separate terminal to start the memory server on localhost:3111. Then add this to ~/.hermes/config.yaml so Hermes can use agentmemory as an MCP server with all 54 memory tools:
735
+ Install agentmemory for Hermes. Run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server on localhost:3111. Then add this to ~/.hermes/config.yaml so Hermes can use agentmemory as an MCP server with all 54 memory tools:
635
736
 
636
737
  mcp_servers:
637
738
  agentmemory:
@@ -650,7 +751,7 @@ Full guide: [`integrations/hermes/`](integrations/hermes/)
650
751
 
651
752
  ### Other agents
652
753
 
653
- Start the memory server: `npx @agentmemory/agentmemory`
754
+ Start the memory server: `npx -y @agentmemory/agentmemory@latest`
654
755
 
655
756
  #### Native skills via `npx skills add` (50+ agents)
656
757
 
@@ -700,14 +801,14 @@ The agentmemory entry is the **same MCP server block** across every host that us
700
801
  | **GitHub Copilot CLI (full plugin)** | Copilot plugin install | `copilot plugin install rohitg00/agentmemory:plugin` for the plugin from the GitHub subdir. |
701
802
  | **OpenClaw** | OpenClaw MCP config | Same `mcpServers` block. Deeper: `openclaw plugins install ./integrations/openclaw` claims OpenClaw's memory slot (auto-switches from `memory-core`); set `plugins.entries.agentmemory.hooks.allowConversationAccess=true` or turn capture is silently blocked. See [`integrations/openclaw`](integrations/openclaw/). |
702
803
  | **Codex CLI (MCP only)** | `.codex/config.toml` | TOML shape: `codex mcp add agentmemory -- npx -y @agentmemory/mcp`, or add `[mcp_servers.agentmemory]` manually. |
703
- | **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, Stop) + 17 skills. On Codex Desktop, also run `agentmemory connect codex --with-hooks` until [openai/codex#16430](https://github.com/openai/codex/issues/16430) lands; plugin hooks are currently silent there. |
804
+ | **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks + 17 skills. Trust hooks and verify capture in your host; see [Codex setup and validation](docs/plugins/codex-local.md). |
704
805
  | **OpenCode (MCP only)** | `opencode.json` | Different shape: top-level `mcp` key, command as array: `{"mcp": {"agentmemory": {"type": "local", "command": ["npx", "-y", "@agentmemory/mcp"], "enabled": true}}}`. |
705
806
  | **OpenCode (full plugin)** | `plugin/opencode/` | 22 auto-capture hooks covering session lifecycle, messages, tools, errors. Project attribution is per-session, so one OpenCode process spanning several repositories files each session under its own project. Two slash commands (`/recall`, `/remember`). Copy `plugin/opencode/` into your OpenCode workspace and add the plugin entry to `opencode.json`. See [`plugin/opencode/README.md`](plugin/opencode/README.md) for the full hook table + gap analysis. |
706
807
  | **pi** | `~/.pi/agent/extensions/agentmemory` | `agentmemory connect pi` installs the bundled extension into pi's auto-discovery directory (recall on agent start, capture on agent end, `memory_search` / `memory_save` / `memory_health` tools, `/agentmemory-status`). `/reload` in a running pi picks it up. [`integrations/pi`](integrations/pi/) is also a pi package (`pi install ./integrations/pi` from a checkout). |
707
808
  | **Hermes Agent** | `~/.hermes/config.yaml` | `cp -r integrations/hermes ~/.hermes/plugins/agentmemory` + `memory.provider: agentmemory` gives the 6-hook memory provider (prefetch, turn capture, session end, pre-compress, MEMORY.md mirroring, system prompt block). Validate with `hermes plugins doctor` and `hermes memory status`. See [`integrations/hermes`](integrations/hermes/). |
708
809
  | **Qwen Code** | `~/.qwen/settings.json` | `agentmemory connect qwen` writes the standard `mcpServers` block. Hook payload is field-compatible with Claude Code, so the existing 12-hook scripts work without modification; wire them via the `hooks` section in the same `settings.json`. |
709
- | **Antigravity** (replaces Gemini CLI) | `mcp_config.json` (in Antigravity's User dir) | `agentmemory connect antigravity` writes the standard `mcpServers` block. macOS: `~/Library/Application Support/Antigravity/User/`. Linux: `~/.config/Antigravity/User/`. Use after the 2026-06-18 Gemini CLI sunset. |
710
- | **Antigravity CLI** (`agy`) | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity-cli`. The `agy` CLI keeps its own config under `~/.gemini/`, separate from the Antigravity IDE above. Pass `--with-hooks` for native auto-capture via `~/.gemini/config/hooks.json`. |
810
+ | **Antigravity IDE / 2.0** | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity --with-hooks` installs MCP and capture hooks in the shared customization directory. See [Antigravity setup and limits](docs/plugins/antigravity.md). |
811
+ | **Antigravity CLI** (`agy`) | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity-cli --with-hooks` uses the same MCP and hook configuration as current IDE versions. Existing installations should refresh with `--force`; see the [upgrade notes](docs/plugins/antigravity.md). |
711
812
  | **Kiro** | `~/.kiro/settings/mcp.json` | `agentmemory connect kiro` writes the user-level config. Workspace overrides go in `.kiro/settings/mcp.json` next to your code. |
712
813
  | **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills/`; once the Claude Code plugin is installed the 8 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. |
713
814
  | **Cline (CLI)** | `~/.cline/mcp.json` | `agentmemory connect cline` writes the standard `mcpServers` block. VS Code extension users: paste the same block via Cline Settings → MCP Servers → Edit JSON. |
@@ -752,39 +853,43 @@ git clone https://github.com/rohitg00/agentmemory.git && cd agentmemory
752
853
  npm install && npm run build && npm start
753
854
  ```
754
855
 
755
- This starts agentmemory with a local `iii-engine` if `iii` is already installed, or falls back to Docker Compose if Docker is available. REST, streams, and the viewer bind to `127.0.0.1` by default.
856
+ This starts agentmemory with a local `iii-engine` if the pinned binary is already installed, or uses Docker Compose when selected. REST, streams, and the viewer bind to `127.0.0.1` by default. The automatic macOS/Linux binary path requires `curl`, a POSIX `sh`, and `tar`.
756
857
 
757
- Install `iii-engine` manually. **agentmemory currently pins `iii-engine` to `v0.11.2`**. `v0.11.6` introduces a new sandbox-everything-via-`iii worker add` model that agentmemory hasn't been refactored for yet. Pin lifts once the refactor lands. Override with `AGENTMEMORY_III_VERSION=<version>` if you've migrated to the sandbox model manually.
858
+ Install `iii-engine` manually. **agentmemory currently pins `iii-engine` to `v0.22.1`**, the same release as its `iii-sdk` dependency; the worker speaks that engine's wire protocol, and 0.20.0 reorganized the SDK surface, so the two move together in agentmemory releases. Override with `AGENTMEMORY_III_VERSION=<version>` if you run your own engine and know it matches.
758
859
 
759
- - **macOS arm64:** `mkdir -p ~/.local/bin && curl -fsSL https://github.com/iii-hq/iii/releases/download/iii/v0.11.2/iii-aarch64-apple-darwin.tar.gz | tar -xz -C ~/.local/bin && chmod +x ~/.local/bin/iii`
860
+ - **macOS arm64:** `mkdir -p ~/.local/bin && curl -fsSLo iii.tar.gz https://github.com/iii-hq/iii/releases/download/iii/v0.22.1/iii-aarch64-apple-darwin.tar.gz && echo "2b309019b909a896cae874dc947e2cdf877b4f3c51dd026b79850af858517fa4 iii.tar.gz" | shasum -a 256 -c - && tar -xzf iii.tar.gz -C ~/.local/bin && chmod +x ~/.local/bin/iii`
760
861
  - **macOS x64:** swap `aarch64-apple-darwin` for `x86_64-apple-darwin`
761
862
  - **Linux x64:** swap for `x86_64-unknown-linux-gnu`
762
863
  - **Linux arm64:** swap for `aarch64-unknown-linux-gnu`
763
- - **Windows:** download `iii-x86_64-pc-windows-msvc.zip` from [iii-hq/iii releases v0.11.2](https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.11.2), extract `iii.exe`, add to PATH
864
+ - **Windows:** download `iii-x86_64-pc-windows-msvc.zip` from [iii-hq/iii releases v0.22.1](https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.22.1) and extract `iii.exe` to `%USERPROFILE%\.agentmemory\bin\iii.exe`
865
+
866
+ Every archive has a matching `.sha256` file on the release page; when you swap the platform, use that file's hash in the check above (on Windows: `Get-FileHash`). The automatic installer in `npx @agentmemory/agentmemory` pins these hashes and refuses an archive that does not match.
764
867
 
765
- Or use Docker (the bundled `docker-compose.yml` pulls `iiidev/iii:0.11.2`). Full docs: [iii.dev/docs](https://iii.dev/docs).
868
+ Or use Docker (the bundled `docker-compose.yml` pulls `iiidev/iii:0.22.1`). Full docs: [iii.dev/docs](https://iii.dev/docs).
766
869
 
767
870
  ### Windows
768
871
 
769
- agentmemory runs on Windows 10/11, but the Node.js package alone isn't enough; you also need the `iii-engine` runtime (a separate native binary) as a background process. The official upstream installer is a `sh` script and there is no PowerShell installer or scoop/winget package today, so Windows users have two paths:
872
+ agentmemory runs on Windows 10/11, but the Node.js package alone isn't enough; you also need the pinned iii-engine v0.22.1 runtime as a background process. The CLI does not auto-extract the Windows ZIP, so native Windows users must install `iii.exe` manually, use WSL2, or choose Docker Desktop.
873
+
874
+ Native Windows automated MCP wiring supports only `agentmemory connect copilot-cli`. For Claude Code, Codex, Cursor, and every other native Windows agent, copy the manual MCP block from [Other agents](#other-agents) into that agent's Windows config. Running `connect` in WSL is appropriate only when the target agent is also installed in the same WSL environment; it does not edit a Windows-host agent's configuration.
770
875
 
771
876
  **Option A: prebuilt Windows binary (recommended)**
772
877
 
773
878
  ```powershell
774
- # 1. Open https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.11.2 in your browser
775
- # (we pin to v0.11.2 until agentmemory refactors for the new sandbox
776
- # model that engine v0.11.6+ requires)
879
+ # 1. Open https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.22.1 in your browser
880
+ # (agentmemory pins the engine to the same release as its iii-sdk;
881
+ # v0.22.1 is the current pair)
777
882
  # 2. Download iii-x86_64-pc-windows-msvc.zip
778
883
  # (or iii-aarch64-pc-windows-msvc.zip if you're on an ARM machine)
779
- # 3. Extract iii.exe somewhere on PATH, or place it at:
780
- # %USERPROFILE%\.local\bin\iii.exe
781
- # (agentmemory checks that location automatically)
884
+ # 3. Extract iii.exe to agentmemory's private engine directory:
885
+ New-Item -ItemType Directory -Force "$HOME\.agentmemory\bin"
886
+ # Copy iii.exe to $HOME\.agentmemory\bin\iii.exe
782
887
  # 4. Verify:
783
- iii --version
784
- # Should print: 0.11.2
888
+ & "$HOME\.agentmemory\bin\iii.exe" --version
889
+ # Should print: 0.22.1
785
890
 
786
891
  # 5. Then run agentmemory as usual:
787
- npx -y @agentmemory/agentmemory
892
+ npx -y @agentmemory/agentmemory@latest
788
893
  ```
789
894
 
790
895
  **Option B: Docker Desktop**
@@ -792,28 +897,29 @@ npx -y @agentmemory/agentmemory
792
897
  ```powershell
793
898
  # 1. Install Docker Desktop for Windows
794
899
  # 2. Start Docker Desktop and make sure the engine is running
795
- # 3. Run agentmemory — it will auto-start the bundled compose file:
796
- npx -y @agentmemory/agentmemory
900
+ # 3. Select Docker explicitly and run agentmemory:
901
+ $env:AGENTMEMORY_USE_DOCKER = "1"
902
+ npx -y @agentmemory/agentmemory@latest
797
903
  ```
798
904
 
799
905
  **Option C: standalone MCP only (no engine).** If you only need the MCP tools for your agent and don't need the REST API, viewer, or cron jobs, skip the engine entirely:
800
906
 
801
907
  ```powershell
802
- npx -y @agentmemory/agentmemory mcp
908
+ npx -y @agentmemory/agentmemory@latest mcp
803
909
  # or via the shim package:
804
910
  npx -y @agentmemory/mcp
805
911
  ```
806
912
 
807
- **Diagnostics for Windows:** if `npx @agentmemory/agentmemory` fails, re-run with `--verbose` to see the actual engine stderr. Common failure modes:
913
+ **Diagnostics for Windows:** if `npx -y @agentmemory/agentmemory@latest` fails, re-run it with `--verbose` to see the actual engine stderr. Common failure modes:
808
914
 
809
915
  | Symptom | Fix |
810
916
  |---|---|
811
- | `iii-engine process started` then `did not become ready within 15s` | Engine crashed on startup; re-run with `--verbose`, check stderr |
917
+ | `The engine process started but the REST API never responded.` | Confirm all four derived ports are free, verify the pinned `iii.exe` stayed alive, then re-run with `--verbose` and inspect the captured engine stderr |
812
918
  | `Could not start iii-engine` | Neither `iii.exe` nor Docker is installed. See Option A or B above |
813
919
  | Port conflict | `netstat -ano \| findstr :3111` to see what's bound, then kill it or use `--port <N>` |
814
920
  | Docker fallback skipped even though Docker is installed | Make sure Docker Desktop is actually running (system tray icon) |
815
921
 
816
- > Note: the iii **engine** is a prebuilt binary, not a cargo crate, so don't try to `cargo install` it. (The iii **SDKs** are published on crates.io, npm, and PyPI, but agentmemory doesn't need them.) Supported engine install methods, all pinned to v0.11.2: the prebuilt v0.11.2 binary above, the upstream sh install script **with the version pin** `curl -fsSL https://install.iii.dev/iii/main/install.sh | VERSION=0.11.2 sh` (macOS/Linux), and the Docker image `iiidev/iii:0.11.2`. A bare `install.sh | sh` installs the **latest** engine, which agentmemory does not support; always pass `VERSION=0.11.2`. Easiest of all: just run `npx @agentmemory/agentmemory`, which fetches the pinned engine into `~/.agentmemory/bin` for you.
922
+ > Note: the iii **engine** is a prebuilt binary, not a cargo crate, so don't try to `cargo install` it. (The iii **SDKs** are published on crates.io, npm, and PyPI, but agentmemory doesn't need them.) Supported engine install methods are all pinned to v0.22.1: the prebuilt binary above, agentmemory's macOS/Linux auto-install path (`curl`, POSIX `sh`, and `tar` required), and the Docker image `iiidev/iii:0.22.1`. A bare upstream `install.sh | sh` installs the latest engine, which agentmemory does not support. Use `npx -y @agentmemory/agentmemory@latest`; on macOS/Linux it fetches the pinned engine into `~/.agentmemory/bin`.
817
923
 
818
924
  ---
819
925
 
@@ -897,9 +1003,10 @@ PostToolUse hook fires
897
1003
  -> SHA-256 dedup (5min window)
898
1004
  -> Privacy filter (strip secrets, API keys)
899
1005
  -> Store raw observation
900
- -> LLM compress -> structured facts + concepts + narrative
901
- -> Vector embedding (6 providers + local)
902
- -> Index in BM25 + vector
1006
+ -> Synthetic compression by default
1007
+ (LLM-written compression only with a provider + AGENTMEMORY_AUTO_COMPRESS=true)
1008
+ -> Vector embedding when an embedding provider is active
1009
+ -> Index in BM25, plus vectors when enabled
903
1010
 
904
1011
  Stop / SessionEnd hook fires
905
1012
  -> Summarize session
@@ -974,21 +1081,25 @@ Triple-stream retrieval combining three signals:
974
1081
 
975
1082
  Fused with Reciprocal Rank Fusion (RRF, k=60) and session-diversified (max 3 results per session).
976
1083
 
977
- Hybrid ranking applies to the primary recall path, not just `smart-search`: `mem::search` (behind `memory_recall`) ranks through the same BM25 + vector + graph fusion once the vector index is populated. Lesson recall runs on a dedicated in-memory BM25 index instead of scanning the whole corpus per query. Superseded memory versions are excluded from every recall path; the version chain keeps their history.
1084
+ When a vector index is populated, `mem::search` (behind `memory_recall`) uses the hybrid BM25 + vector ranker. Without embeddings it uses BM25. `smart-search` can additionally fuse structural graph matches when graph data exists, including in keyless mode. Lesson recall runs on a dedicated in-memory BM25 index instead of scanning the whole corpus per query. Superseded memory versions are excluded from every recall path; the version chain keeps their history.
1085
+
1086
+ Vectors survive a crash or force-kill. The vector index is saved in buckets at most every `AGENTMEMORY_INDEX_SAVE_INTERVAL_MS` (10 minutes). Every vector added or removed in between is also written right away to a small pending log in the state store, and the next start replays it without calling the embedding provider. Each successful save empties the log. Documents that still have no vector after the replay are re-embedded in the background in batches of `AGENTMEMORY_VECTOR_BACKFILL_MAX` (500) until none are left, and a backfill that is stopped continues at the next start. `/agentmemory/status` and the viewer show the pending log size and the backfill state. Keyless installs write nothing.
978
1087
 
979
1088
  BM25 tokenizes Greek, Cyrillic, Hebrew, Arabic, and accented Latin out of the box. For Chinese / Japanese / Korean memories, install the optional segmenters (`npm install @node-rs/jieba tiny-segmenter`) to split CJK runs into word-level tokens; without them, agentmemory soft-falls to whole-run tokenization and prints a one-time hint on stderr.
980
1089
 
981
1090
  ### Embedding providers
982
1091
 
983
- agentmemory auto-detects your provider. For best results, install local embeddings (free):
1092
+ Keyless installs disable vector embeddings: `mem::search` uses BM25, while `smart-search` can also use existing structural graph data. To opt into free on-device semantic embeddings, add this to `~/.agentmemory/.env` and restart agentmemory:
984
1093
 
985
- ```bash
986
- npm install @huggingface/transformers
1094
+ ```env
1095
+ EMBEDDING_PROVIDER=local
987
1096
  ```
988
1097
 
1098
+ The normal npm install includes the optional `@huggingface/transformers` runtime. The first embedding request downloads `Xenova/all-MiniLM-L6-v2`, so it needs network access and can take longer; subsequent inference runs on-device. Remote providers are auto-detected from their keys unless `EMBEDDING_PROVIDER` overrides them.
1099
+
989
1100
  | Provider | Model | Cost | Notes |
990
1101
  |---|---|---|---|
991
- | **Local (recommended)** | `all-MiniLM-L6-v2` | Free | Offline, +8pp recall over BM25-only |
1102
+ | **Local (recommended opt-in)** | `all-MiniLM-L6-v2` | Free | On-device after the first model download, +8pp recall over BM25-only |
992
1103
  | Gemini | `gemini-embedding-001` | Free tier | 100+ languages, 768/1536/3072 dims (MRL), 2048-token input. Replaces `text-embedding-004` ([deprecated, shutdown Jan 14, 2026](https://ai.google.dev/gemini-api/docs/deprecations)) |
993
1104
  | OpenAI | `text-embedding-3-small` | $0.02/1M | Highest quality |
994
1105
  | Voyage AI | `voyage-code-3` | Paid | Optimized for code |
@@ -1001,7 +1112,7 @@ npm install @huggingface/transformers
1001
1112
 
1002
1113
  54 tools, 6 resources, 3 prompts, and 17 skills.
1003
1114
 
1004
- > **MCP shim vs full server:** the published `@agentmemory/mcp` package is a thin shim. It exposes the full 54-tool surface **only when it can reach a running agentmemory server** via `AGENTMEMORY_URL` (proxy mode). With no server reachable, the shim falls back to a 7-tool local set (`memory_save`, `memory_recall`, `memory_smart_search`, `memory_sessions`, `memory_export`, `memory_audit`, `memory_governance_delete`). The `AGENTMEMORY_TOOLS=core|all` env var is a *server-side* flag; setting it in the shim's `env` block has no effect. If you see only 7 tools in Cursor / OpenCode / Gemini CLI, start `npx @agentmemory/agentmemory` (or the Docker stack) and set `AGENTMEMORY_URL=http://localhost:3111`.
1115
+ > **MCP shim vs full server:** the published `@agentmemory/mcp` package is a thin shim. It exposes the full 54-tool surface **only when it can reach a running agentmemory server** via `AGENTMEMORY_URL` (proxy mode). With no server reachable, the shim falls back to a 7-tool local set (`memory_save`, `memory_recall`, `memory_smart_search`, `memory_sessions`, `memory_export`, `memory_audit`, `memory_governance_delete`). The `AGENTMEMORY_TOOLS=core|all` env var is a *server-side* flag; setting it in the shim's `env` block has no effect. If you see only 7 tools in Cursor / OpenCode / Gemini CLI, start `npx -y @agentmemory/agentmemory@latest` (or the Docker stack) and set `AGENTMEMORY_URL=http://localhost:3111`.
1005
1116
 
1006
1117
  ### 54 Tools
1007
1118
 
@@ -1093,7 +1204,7 @@ The table shows the four core skills. The full set is 9 invocable skills plus 8
1093
1204
  Run without the full server, for any MCP client. Either of these works:
1094
1205
 
1095
1206
  ```bash
1096
- npx -y @agentmemory/agentmemory mcp # canonical (always available)
1207
+ npx -y @agentmemory/agentmemory@latest mcp # canonical (always available)
1097
1208
  npx -y @agentmemory/mcp # shim package alias
1098
1209
  ```
1099
1210
 
@@ -1141,13 +1252,20 @@ cp plugin/opencode/commands/*.md ~/.config/opencode/commands/
1141
1252
 
1142
1253
  <h2 id="real-time-viewer"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-viewer.svg"><img src="assets/tags/section-viewer.svg" alt="Real-Time Viewer" height="32" /></picture></h2>
1143
1254
 
1144
- Auto-starts on port `3113`. Live observation stream with a stream status indicator, a two-pane session explorer (list beside a sticky detail panel on wide screens), memory and lesson rows that expand to the full stored record including raw JSON and origin provenance, a knowledge graph that clusters nodes by type while relations are sparse, session replay, and a health dashboard.
1255
+ Auto-starts on port `3113`. The viewer loads one snapshot when it connects (`GET /agentmemory/viewer/snapshot`) and then applies live stream events: new memories, lessons, observations, audit entries, graph changes and health updates appear without polling or page reloads. The only other requests are the actions you click, "load more" pages and searches. When the stream drops, the viewer shows how old its numbers are, reconnects with backoff and resyncs from one snapshot.
1256
+
1257
+ - **12 tabs in four groups** with live counts, deep links (`#memories/<id>`, `#sessions/<id>?obs=<id>`, `#graph/<id>`, `#health/consolidation`), keyboard shortcuts and a mobile menu.
1258
+ - **Memories:** server-side search, filters by project, agent and type, a detail panel with the version chain and a word diff, provenance links, copy buttons for the id, the MCP call and a curl command, edit (a new version), forget with confirmation, bulk forget and JSON export.
1259
+ - **Sessions:** an inline observation timeline with readable tool input and output, filters and paging, and the memories and lessons each session produced.
1260
+ - **Graph:** search, node detail with relations and sources, a legend that does not rely on colour alone, and zoom controls.
1261
+ - **Health:** the live version of `GET /agentmemory/status`. Every problem comes with its fix, plus the state backend, index save state, graph provenance compaction progress and a consolidation explainer with the real thresholds.
1262
+ - **Audit, Activity, Profile, Replay, Lessons, Actions and Crystals** pages, each with an empty state that says what the section is, why it is empty and the command that fills it, and a `?` glossary tooltip on every term and number.
1145
1263
 
1146
1264
  ```bash
1147
1265
  open http://localhost:3113
1148
1266
  ```
1149
1267
 
1150
- The viewer server binds to `127.0.0.1` by default. The REST-served `/agentmemory/viewer` endpoint follows the normal `AGENTMEMORY_SECRET` bearer-token rules. CSP headers use a per-response script nonce and disable inline handler attributes (`script-src-attr 'none'`).
1268
+ The viewer server binds to `127.0.0.1` by default and attaches the server secret when it forwards requests to the REST API, so it needs no setup. The REST-served `/agentmemory/viewer` endpoint follows the normal bearer-token rules and redirects browsers without a token to the viewer port. CSP headers use a per-response script nonce and disable inline handler attributes (`script-src-attr 'none'`).
1151
1269
 
1152
1270
  ---
1153
1271
 
@@ -1165,22 +1283,20 @@ agentmemory ships this for free because every function call and trigger fires th
1165
1283
  <em>Workers page: every connected worker, including agentmemory itself, with PID, function count, runtime, and last-seen.</em>
1166
1284
  </p>
1167
1285
 
1168
- **Already installed.** The console ships with `iii`; no separate installer.
1286
+ **Already installed.** The console ships with the pinned `iii` engine (0.22+); nothing separate to install. The first launch downloads the console binary next to the engine.
1169
1287
 
1170
1288
  **Launch alongside agentmemory:**
1171
1289
 
1172
1290
  ```bash
1173
- # agentmemory viewer holds port 3113, so run the console on 3114.
1174
- # Engine REST (3111), WebSocket (3112), and bridge (49134) defaults match agentmemory.
1175
- iii console --port 3114
1291
+ agentmemory console
1176
1292
  ```
1177
1293
 
1178
- Then open `http://localhost:3114`. Add `--enable-flow` for the experimental architecture-graph page.
1294
+ This runs the pinned engine's `iii console` against the ports agentmemory resolved (REST, streams, bridge) and serves it one port above the viewer, `http://localhost:3114` by default. `--console-port N` picks another port; `--port` and `--instance` select the agentmemory instance the same way they do for `stop`; any other flag is passed through, for example `--enable-flow` for the experimental architecture-graph page.
1179
1295
 
1180
- Override engine endpoints only if you've moved them:
1296
+ The same thing by hand, useful when `agentmemory` is not on PATH:
1181
1297
 
1182
1298
  ```bash
1183
- iii console --port 3114 \
1299
+ ~/.agentmemory/bin/iii console --port 3114 \
1184
1300
  --engine-port 3111 \
1185
1301
  --ws-port 3112 \
1186
1302
  --bridge-port 49134
@@ -1209,7 +1325,7 @@ iii console --port 3114 \
1209
1325
 
1210
1326
  **Traces are already on:**
1211
1327
 
1212
- `iii-config.yaml` ships with the `iii-observability` worker enabled (`exporter: memory`, `sampling_ratio: 1.0`, metrics + logs). No extra config needed; the moment agentmemory starts, every memory operation emits a trace span and a structured log the console can read.
1328
+ `iii-config.yaml` ships with the `iii-observability` worker enabled (`exporter: memory`, `sampling_ratio: 0.1`, metrics + logs). No extra config needed; the moment agentmemory starts, every memory operation emits a structured log the console can read, and one in ten of them (`sampling_ratio: 0.1`) also emits a trace span.
1213
1329
 
1214
1330
  If you want to export to Jaeger/Honeycomb/Grafana Tempo instead, change `exporter: memory` to `exporter: otlp` and set the collector endpoint per iii's observability docs.
1215
1331
 
@@ -1223,32 +1339,102 @@ agentmemory is **already a running [iii](https://iii.dev) instance**. Three prim
1223
1339
 
1224
1340
  That means one more command extends agentmemory with an entire new capability.
1225
1341
 
1226
- ### Extend agentmemory with one command
1342
+ ### Extend agentmemory with more workers
1227
1343
 
1228
- ```bash
1229
- iii worker add iii-pubsub # fan memory writes out to every connected instance
1230
- iii worker add iii-cron # scheduled consolidation, decay sweeps, snapshot rotation
1231
- iii worker add iii-queue # durable retries for embedding + compression jobs
1232
- iii worker add iii-observability # OTEL traces on every memory op (default on)
1233
- iii worker add iii-sandbox # run recalled code inside an isolated microVM
1234
- iii worker add iii-database # swap in a SQL-backed state adapter
1235
- iii worker add mcp # generic MCP host alongside the agentmemory MCP
1236
- ```
1344
+ The builtins agentmemory needs are already in `iii-config.yaml` and boot with it: `iii-state` (KV), `iii-queue` (durable retries for the event subscribers), `iii-pubsub`, `iii-cron`, `iii-stream`, and `iii-observability` (OTEL traces, metrics and logs on every function). Anything else from the [iii worker registry](https://workers.iii.dev) plugs into the same engine: copy `iii-config.yaml` to `~/.agentmemory/iii-config.yaml` (the CLI prefers that file over the bundled one and still renders ports and data paths into it), add the entry, install the worker runtime once with `~/.agentmemory/bin/iii update worker`, and restart agentmemory.
1237
1345
 
1238
- Each `iii worker add` registers new functions and triggers into the same engine agentmemory is already running on. The viewer and console pick them up immediately: no reload, no new integration, no new container.
1346
+ ```yaml
1347
+ workers:
1348
+ # ...the bundled entries...
1349
+ - name: database # SQL-backed state adapter when you outgrow the KV defaults
1350
+ - name: iii-sandbox # run code that came out of memory_recall inside a throwaway VM
1351
+ - name: mcp # extra MCP servers next to agentmemory's, same engine
1352
+ ```
1239
1353
 
1240
- | `iii worker add` | What you get on top of agentmemory |
1354
+ | Worker | What you get on top of agentmemory |
1241
1355
  |---|---|
1242
- | [`iii-pubsub`](https://workers.iii.dev/workers/iii-pubsub) | Multi-instance memory: every `remember` fans out, every `search` reads the union |
1243
- | [`iii-cron`](https://workers.iii.dev/workers/iii-cron) | Scheduled lifecycle: nightly consolidation, weekly snapshots, decay on a fixed clock |
1244
- | [`iii-queue`](https://workers.iii.dev/workers/iii-queue) | Durable retries: failed embedding + compression jobs survive restart, no lost observations |
1245
- | [`iii-observability`](https://workers.iii.dev/workers/iii-observability) | OTEL traces, metrics, logs on every function, wired in `iii-config.yaml` from day one |
1356
+ | [`database`](https://workers.iii.dev/workers/database) | SQL-backed state adapter when you outgrow the in-memory KV defaults |
1246
1357
  | [`iii-sandbox`](https://workers.iii.dev/workers/iii-sandbox) | Code that came out of `memory_recall` runs inside a throwaway VM, not your shell |
1247
- | [`iii-database`](https://workers.iii.dev/workers/iii-database) | SQL-backed state adapter when you outgrow the in-memory KV defaults |
1248
1358
  | [`mcp`](https://workers.iii.dev/workers/mcp) | Stand up extra MCP servers next to agentmemory's, share the same engine |
1249
1359
 
1360
+ On engine 0.22.x keep the `iii-` prefixed names for the builtins above; the unprefixed `http`, `state`, `queue`, `pubsub` and `cron` entries are the standalone registry workers agentmemory moves to with the 0.23 migration.
1361
+
1250
1362
  Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there composes through the same primitives agentmemory uses, and the agentmemory you already have is one of them.
1251
1363
 
1364
+ ### Engine config and bind address
1365
+
1366
+ `agentmemory start` reads the engine config from the first file that exists: `AGENTMEMORY_III_CONFIG`, `./iii-config.yaml` in the current directory, `~/.agentmemory/iii-config.yaml`, then the bundled `iii-config.yaml`. On every start it renders that file (data paths, ports, state backend) into `~/.agentmemory/data/iii-config.runtime.yaml` and launches the engine with the rendered copy, so edit the source file, not the rendered one. The `host:` values of the source file are kept as written.
1367
+
1368
+ The bundled `iii-config.yaml` binds `127.0.0.1` on purpose, and that default also applies inside a container. A CLI started in a container listens on the container's loopback, so published ports reach nothing. To serve a containerized CLI through published ports, set `AGENTMEMORY_III_CONFIG` to a config that binds `0.0.0.0`. The packaged `iii-config.docker.yaml` is one: it binds `iii-http`, `iii-stream` and the engine port to `0.0.0.0` and stores state under `/data`, so mount a writable volume there. Keep `AGENTMEMORY_SECRET` set, and publish only the ports you need, on `127.0.0.1` or behind a proxy you trust.
1369
+
1370
+ This repo's `docker-compose.yml` does not go through the CLI's config lookup: it mounts `iii-config.docker.yaml` at `/app/config.yaml`, and the `iii-engine` container starts with `--config /app/config.yaml`. The one-click [deploy templates](deploy/) write their own `0.0.0.0` config in their entrypoints.
1371
+
1372
+ ### Storage backend: file (default) vs redis
1373
+
1374
+ `iii-state` and `iii-stream` default to iii-engine's bundled file-based KV store: one JSON file per scope, held in the engine process's memory and rewritten to disk on a timer. That's the right default for a single-user local install; a shared daemon with several concurrent writers gets real per-key writes from Redis instead, at the cost of a network round trip per operation (every `state::*` call still serializes on one Redis connection, so this trades the file store's lock for a socket, not for parallelism).
1375
+
1376
+ Set `AGENTMEMORY_STATE_BACKEND=redis` (plus `AGENTMEMORY_REDIS_URL`) to switch both workers to iii-engine's built-in `redis` adapter, which stores each key as a Redis hash field (`HSET`) instead of rewriting a whole scope on every write:
1377
+
1378
+ ```env
1379
+ # ~/.agentmemory/.env
1380
+ AGENTMEMORY_STATE_BACKEND=redis
1381
+ AGENTMEMORY_REDIS_URL=redis://localhost:6379
1382
+ ```
1383
+
1384
+ `AGENTMEMORY_STATE_BACKEND` defaults to `file`; leaving it unset keeps today's behavior unchanged, and an unrecognized value (anything other than `file` or `redis`) is a startup error rather than a silent fallback. `/agentmemory/status` and the viewer's Health page (the State store row) report which backend is active and whether it answers, never the URL.
1385
+
1386
+ **Plain `redis://` only.** The pinned engine (0.22.1) builds its Redis client without TLS support, so a `rediss://` URL (most managed Redis offerings, such as Upstash, Redis Cloud, and ElastiCache with in-transit encryption, default to TLS-only) fails to connect. The connection is unencrypted, so the Redis password and every stored memory cross the wire in clear text: point at a local Redis or one on a private network you trust. For any other Redis, run an encrypted tunnel (stunnel, SSH, or a VPN) on the agentmemory host, so the plain `redis://` hop stays on that host and the tunnel's upstream connection is encrypted and authenticated. If a Redis password contains a single quote, percent-encode it (`%27`); the engine expands the URL into its YAML config before parsing it.
1387
+
1388
+ **One Redis server per `--instance`.** The engine's Redis key prefixes (`state:<scope>`, `stream:<name>:<group>`) are fixed, so two agentmemory instances (`--instance 1`, `--instance 2`, ...) pointed at the same database overwrite each other's data. A separate database index (`redis://localhost:6379/1`) keeps the stored data apart, but the engine relays live viewer events over one Redis pub/sub channel (`stream::events`), and Redis pub/sub ignores the database index, so each instance's viewer would still show the other's live events. Give each instance its own Redis server (or port) when you run more than one.
1389
+
1390
+ **What stays the same, and what differs.** Every agentmemory feature works on Redis: sessions, observations, memories (remember, supersede, evolve, forget), search and the index buckets, lessons, the graph, the audit log and its monthly scopes, export and import, governance deletes, consolidation status, the viewer snapshot and its live stream, and the health monitor. The engine stores each scope as one Redis hash (`HSET`/`HGET`/`HGETALL`) and fires the same state triggers as the file store. Three engine differences are handled inside agentmemory:
1391
+
1392
+ - Redis returns a scope's records in no fixed order. agentmemory sorts them oldest first (by the creation time in the record id, then its timestamp) so lists, paging and export chunks come back in the same order as on the file store.
1393
+ - The engine applies partial updates on Redis in a Lua script that turns empty arrays into empty objects. agentmemory applies those updates itself (read, change, write under a per-key lock) on Redis, so fields like `tags: []` stay arrays.
1394
+ - The legacy audit log check reads the old scope from Redis instead of looking for the file store's file on disk.
1395
+
1396
+ One difference needs you: **after Redis restarts, the engine stops relaying live events** to the viewer until agentmemory restarts. Data is still saved and read normally. The health monitor sends a test event through Redis every 30 seconds; when it does not come back, `/agentmemory/status` and the viewer's Health page show "Live updates are not reaching the viewer" with the fix: restart agentmemory. If Redis is down, the status report shows "The state store is not answering" and how to check it (`redis-cli -u "$AGENTMEMORY_REDIS_URL" ping`). Listing a very large scope reads the whole hash in one `HGETALL`, the same cost as the file store holding it in memory.
1397
+
1398
+ **Recommended Redis settings.** The default `save 3600 1 300 100 60 10000` snapshot policy can lose minutes of writes on a crash, worse than the file store's 5s flush window. Set `appendonly yes` for anything you'd mind losing. Set `maxmemory-policy noeviction`; `allkeys-lru` or similar silently drops memories once Redis hits its memory limit.
1399
+
1400
+ A native (non-Docker) start, and every one-click [deploy template](deploy/) (they overwrite the bundled `iii-config.yaml` and start natively), read `AGENTMEMORY_STATE_BACKEND`/`AGENTMEMORY_REDIS_URL` and render them into the launched `iii-config`. The URL itself is never written to that rendered file, only a `${AGENTMEMORY_REDIS_URL}` reference that the engine process expands from its own environment at boot. Only this repo's own Docker Compose path (`AGENTMEMORY_USE_DOCKER=1`, or resuming an engine already started that way) mounts `iii-config.docker.yaml` read-only and never renders; `agentmemory start` warns when it detects that combination. Switch that file by hand, following the same `name: redis` / `config: redis_url: ...` shape shown in the [iii-state](https://workers.iii.dev/workers/iii-state) and [iii-stream](https://workers.iii.dev/workers/iii-stream) worker docs, and point `redis_url` at a Redis reachable from the container. `docker-compose.yml` passes `AGENTMEMORY_REDIS_URL` into the engine container, so `redis_url: '${AGENTMEMORY_REDIS_URL}'` works there and keeps the URL out of the mounted file.
1401
+
1402
+ The rendered config keeps the URL out of `~/.agentmemory/data/iii-config.runtime.yaml`, but the engine's own configuration worker still persists the *expanded* value to `~/.agentmemory/config/iii-state.yaml` and `iii-stream.yaml` once it boots (iii-engine's `${VAR}` expansion happens before that worker stores its seed, and it stores the resolved value, not the reference). Treat that directory as holding a credential: `chmod 700 ~/.agentmemory` on any shared host, and prefer a Redis ACL user scoped to what agentmemory needs over the database's admin credentials.
1403
+
1404
+ **Migration is not automatic.** Switching `AGENTMEMORY_STATE_BACKEND` starts from an empty store on either side; nothing copies existing data from file to Redis or back. Export from the backend you're leaving and import into the one you're moving to. This runs identically under bash and zsh (including `bash -u`). An array like `AUTH=(${AGENTMEMORY_SECRET:+-H "Authorization: Bearer $AGENTMEMORY_SECRET"})` does not: zsh keeps the header as one malformed word where bash splits it into two, so both requests 401 whenever `AGENTMEMORY_SECRET` is set:
1405
+
1406
+ ```bash
1407
+ # 0. Use the generated secret when none is exported:
1408
+ AGENTMEMORY_SECRET="${AGENTMEMORY_SECRET:-$(cat ~/.agentmemory/secret 2>/dev/null)}"
1409
+
1410
+ # 1. On the old backend, while agentmemory is still running on it:
1411
+ if [ -n "${AGENTMEMORY_SECRET:-}" ]; then
1412
+ curl -fsS -H "Authorization: Bearer $AGENTMEMORY_SECRET" http://localhost:3111/agentmemory/export > backup.json
1413
+ else
1414
+ curl -fsS http://localhost:3111/agentmemory/export > backup.json
1415
+ fi
1416
+
1417
+ # 2. Confirm backup.json is a usable export before switching backends:
1418
+ jq -e '.version and .exportedAt' backup.json > /dev/null || {
1419
+ echo "backup.json is not a valid export; do not switch backends" >&2
1420
+ exit 1
1421
+ }
1422
+
1423
+ # 3. Switch AGENTMEMORY_STATE_BACKEND (and AGENTMEMORY_REDIS_URL if needed),
1424
+ # restart agentmemory against the new backend, then:
1425
+ if [ -n "${AGENTMEMORY_SECRET:-}" ]; then
1426
+ jq -n --slurpfile d backup.json '{exportData: $d[0], strategy: "merge"}' | \
1427
+ curl -fsS -H "Authorization: Bearer $AGENTMEMORY_SECRET" -X POST http://localhost:3111/agentmemory/import \
1428
+ -H 'Content-Type: application/json' -d @-
1429
+ else
1430
+ jq -n --slurpfile d backup.json '{exportData: $d[0], strategy: "merge"}' | \
1431
+ curl -fsS -X POST http://localhost:3111/agentmemory/import \
1432
+ -H 'Content-Type: application/json' -d @-
1433
+ fi
1434
+ ```
1435
+
1436
+ `/agentmemory/export` also accepts `?maxSessions=` and `?offset=` for chunking a large corpus across several calls; `strategy` on import is `merge` (default-safe), `replace`, or `skip`.
1437
+
1252
1438
  ### What iii replaces
1253
1439
 
1254
1440
  | Traditional stack | agentmemory uses |
@@ -1260,7 +1446,7 @@ Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there co
1260
1446
  | Prometheus / Grafana | iii OTEL + health monitor |
1261
1447
  | Custom plugin systems | `iii worker add <name>` |
1262
1448
 
1263
- **184 source files · ~42,200 LOC · 1,674 tests · 264 functions · 50 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
1449
+ **219 source files · ~52,000 LOC · 2,500+ tests · 311 functions · 60 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
1264
1450
 
1265
1451
  ---
1266
1452
 
@@ -1268,11 +1454,11 @@ Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there co
1268
1454
 
1269
1455
  ### LLM Providers
1270
1456
 
1271
- agentmemory auto-detects from your environment. By default, no LLM calls are made unless you configure a provider or explicitly opt in to the Claude subscription fallback.
1457
+ agentmemory auto-detects providers from your environment. A provider makes LLM-backed operations available, but provider configuration alone does not enable LLM-written observation compression. That path requires both a provider and `AGENTMEMORY_AUTO_COMPRESS=true`.
1272
1458
 
1273
1459
  | Provider | Config | Notes |
1274
1460
  |----------|--------|-------|
1275
- | **No-op (default)** | No config needed | LLM-backed compress/summarize is DISABLED. Synthetic BM25 compression + recall still work. See `AGENTMEMORY_ALLOW_AGENT_SDK` below if you used to rely on the Claude-subscription fallback. |
1461
+ | **No-op (default)** | No config needed | LLM-backed compress/summarize is disabled. Synthetic compression and BM25 recall still work. See `AGENTMEMORY_ALLOW_AGENT_SDK` below if you used to rely on the Claude-subscription fallback. |
1276
1462
  | Anthropic API | `ANTHROPIC_API_KEY` | Per-token billing |
1277
1463
  | MiniMax | `MINIMAX_API_KEY` | Anthropic-compatible |
1278
1464
  | Gemini | `GEMINI_API_KEY` | Also enables embeddings |
@@ -1326,11 +1512,11 @@ Qwen 3 models think by default and can burn the whole token budget on reasoning
1326
1512
 
1327
1513
  Reasoning-class models (`o1`-style with `<think>` blocks) can return empty `content` with a `reasoning` field your local server may not surface. If extractions come back blank, switch to a non-reasoning model first. The `OPENAI_REASONING_EFFORT=none` env can also disable thinking on Ollama Cloud thinking models that mirror the OpenAI reasoning schema.
1328
1514
 
1329
- Local embeddings ship out of the box via `@huggingface/transformers`: `EMBEDDING_PROVIDER=local` (default) gives you `Xenova/all-MiniLM-L6-v2` (384-dim) entirely on-device. No extra config needed.
1515
+ Local embeddings ship as an optional dependency but are not enabled by default. Set `EMBEDDING_PROVIDER=local` to opt into `Xenova/all-MiniLM-L6-v2` (384-dim). The first embedding request downloads the model; inference is on-device afterward. Without that setting or a remote embedding key, vectors stay disabled, `mem::search` uses BM25, and `smart-search` can still add existing graph matches.
1330
1516
 
1331
1517
  ### Cost-aware model selection
1332
1518
 
1333
- Background compression runs on every observation, so model choice meaningfully changes monthly spend. Captured workload data: 635 requests / 888K tokens / 35 hours of active use, run against three OpenRouter models at 2026-05-23 pricing.
1519
+ When LLM-written background compression is enabled with both a provider and `AGENTMEMORY_AUTO_COMPRESS=true`, it runs on every observation, so model choice meaningfully changes monthly spend. Captured workload data: 635 requests / 888K tokens / 35 hours of active use, run against three OpenRouter models at 2026-05-23 pricing.
1334
1520
 
1335
1521
  | Tier | Model | Input / 1M | Output / 1M | Cost for the captured 35h | Notes |
1336
1522
  |------|-------|------------|-------------|---------------------------|-------|
@@ -1382,9 +1568,13 @@ agentmemory + iii-engine bind four ports by default. If a restart fails with `po
1382
1568
  | Port | Process | Purpose | Env override |
1383
1569
  |------|---------|---------|--------------|
1384
1570
  | `3111` | agentmemory | REST API + MCP HTTP + `/agentmemory/health` + `/agentmemory/livez` | `III_REST_PORT` |
1385
- | `3112` | iii-engine | Internal streams worker (consumed by agentmemory + viewer) | `III_STREAMS_PORT` |
1386
- | `3113` | agentmemory | Real-time viewer (`http://localhost:3113`) | `AGENTMEMORY_VIEWER_PORT` |
1387
- | `49134` | iii-engine | WebSocket; workers register here, OTel telemetry flows over it | `III_ENGINE_URL` (full URL, default `ws://localhost:49134`) |
1571
+ | `3112` | iii-engine | Internal streams worker (consumed by agentmemory + viewer) | `III_STREAM_PORT` (preferred) or legacy `III_STREAMS_PORT` |
1572
+ | `3113` | agentmemory | Real-time viewer (`http://localhost:3113`) | `III_VIEWER_PORT` or `AGENTMEMORY_VIEWER_URL` for the reported URL |
1573
+ | `49134` | iii-engine | WebSocket; workers register here, OTel telemetry flows over it | `III_ENGINE_PORT` or `III_ENGINE_URL` |
1574
+
1575
+ `--port <N>` changes the REST anchor and derives streams `N+1`, viewer `N+2`, and engine WebSocket `N+46023` only where the corresponding explicit port or URL above is unset. It does not create an isolated lifecycle namespace. Use `--instance 1` for a second daemon; it uses anchor 3211, defaults to `3211/3212/3213/49234`, and receives a separate `instance-1` data and lifecycle directory. Instances 1 through 50 follow the same pattern.
1576
+
1577
+ The pinned engine starts with `--no-update-check` (no update or security-advisory lookups against GitHub at boot) and with iii's anonymous usage telemetry off: agentmemory sets `III_TELEMETRY_ENABLED=false` for the engine it spawns unless you export the variable yourself, and the bundled compose file does the same.
1388
1578
 
1389
1579
  Stale-process cleanup when ports stay bound after a crashed run:
1390
1580
 
@@ -1399,7 +1589,7 @@ netstat -ano | findstr ":3111 :3112 :3113 :49134"
1399
1589
  taskkill /F /PID <pid>
1400
1590
  ```
1401
1591
 
1402
- `agentmemory stop` reaps both the worker and the engine pidfile cleanly on graceful shutdown. In Docker mode it tears down only agentmemory's own compose services and reaps the native worker before the Docker teardown; the CLI also refuses to adopt or signal Docker or VM port holders (Docker backend, vpnkit, colima) as the native engine unless `--force` is passed. The manual cleanup above is only for the post-crash case where neither pidfile is left behind.
1592
+ `agentmemory stop` reaps both the worker and the engine pidfile cleanly on graceful native shutdown. In Docker mode it flushes the native worker, stops the exact validated engine container, and preserves both the container and its `/data` mount for a lossless restart; the next start validates and resumes that same container. Docker-backed uninstall requires `agentmemory remove --keep-data`: it removes shared agentmemory-managed files while preserving the validated container, its data mount, and the lifecycle record needed to recover them. Destructive Docker data deletion is intentionally left to the operator after a backup. The CLI also refuses to adopt or signal Docker or VM port holders (Docker backend, vpnkit, colima) as the native engine unless `--force` is passed. The manual cleanup above is only for the post-crash case where neither pidfile is left behind.
1403
1593
 
1404
1594
  ### Config File
1405
1595
 
@@ -1421,6 +1611,8 @@ AGENTMEMORY_ALLOW_AGENT_SDK=true
1421
1611
  AGENTMEMORY_AUTO_COMPRESS=true
1422
1612
  ```
1423
1613
 
1614
+ LLM-written observation compression requires both lines: access to an LLM provider (including this explicit subscription fallback) and `AGENTMEMORY_AUTO_COMPRESS=true`. A provider by itself leaves the default synthetic compression path in place.
1615
+
1424
1616
  Consolidation (graph nodes, lessons, crystals) is on by default whenever an LLM provider is configured. Explicitly opt out with `CONSOLIDATION_ENABLED=false` if you want LLM-free operation. Graph extraction is a separate flag:
1425
1617
 
1426
1618
  ```env
@@ -1467,13 +1659,15 @@ Create `~/.agentmemory/.env`:
1467
1659
  # leave OFF unless you understand the Stop-hook recursion risk:
1468
1660
  # AGENTMEMORY_ALLOW_AGENT_SDK=true
1469
1661
 
1470
- # Embedding provider (auto-detected, or override)
1662
+ # Embedding provider (BM25-only when unset; local is an explicit opt-in)
1471
1663
  # EMBEDDING_PROVIDER=local
1472
1664
  # VOYAGE_API_KEY=...
1473
1665
  # OPENAI_API_KEY=sk-...
1474
1666
  # OPENAI_BASE_URL=https://api.openai.com # Override for Azure / vLLM / LM Studio / proxies
1475
1667
  # OPENAI_EMBEDDING_MODEL=text-embedding-3-small
1476
1668
  # OPENAI_EMBEDDING_DIMENSIONS=1536 # Required when the model is not in the known-models table
1669
+ # OPENAI_EMBEDDING_BASE_URL=https://... # Embeddings only; falls back to OPENAI_BASE_URL
1670
+ # OPENAI_EMBEDDING_API_KEY=sk-... # Embeddings only; wins over OPENAI_API_KEY when set
1477
1671
 
1478
1672
  # Outbound LLM / embedding timeout
1479
1673
  # AGENTMEMORY_LLM_TIMEOUT_MS=60000 # Default: 60 000 ms (60 s). Applies to every
@@ -1491,14 +1685,20 @@ Create `~/.agentmemory/.env`:
1491
1685
  # VECTOR_WEIGHT=0.6
1492
1686
  # TOKEN_BUDGET=2000
1493
1687
 
1494
- # Auth
1688
+ # Auth (generated into ~/.agentmemory/secret on first start when unset)
1495
1689
  # AGENTMEMORY_SECRET=your-secret
1690
+ # VIEWER_ALLOWED_ORIGINS=https://memory.example.com
1691
+ # AGENTMEMORY_IMPORT_ROOT=~/projects
1496
1692
 
1497
1693
  # Ports (defaults: 3111 API, 3113 viewer)
1498
1694
  # III_REST_PORT=3111
1499
1695
 
1696
+ # Engine usage telemetry (iii). Off unless you set it; true opts in.
1697
+ # III_TELEMETRY_ENABLED=false
1698
+
1500
1699
  # Features
1501
- # AGENTMEMORY_AUTO_COMPRESS=false # OFF by default. When on,
1700
+ # AGENTMEMORY_AUTO_COMPRESS=false # OFF by default. Requires an LLM
1701
+ # provider as well. When both are on,
1502
1702
  # every PostToolUse hook calls your
1503
1703
  # LLM provider to compress the
1504
1704
  # observation — expect significant
@@ -1546,6 +1746,36 @@ Create `~/.agentmemory/.env`:
1546
1746
  # CLAUDE_MEMORY_BRIDGE=false
1547
1747
  # SNAPSHOT_ENABLED=false
1548
1748
 
1749
+ # Storage and durability
1750
+ # AGENTMEMORY_STATE_BACKEND=file # file (default) or redis; see "Storage backend" below
1751
+ # AGENTMEMORY_REDIS_URL=redis://localhost:6379 # Required with redis, plain redis:// only
1752
+ # AGENTMEMORY_STATE_SAVE_INTERVAL_MS=2000 # How often the engine writes file state to disk.
1753
+ # A hard kill loses at most this window.
1754
+ # AGENTMEMORY_INDEX_SAVE_INTERVAL_MS=600000 # Minimum time between search index saves;
1755
+ # shutdown and deletes still save at once.
1756
+ # AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=true # One-time background trim of oversized graph
1757
+ # provenance; false skips it
1758
+
1759
+ # Sessions
1760
+ # AGENTMEMORY_SESSION_SWEEP_ENABLED=true # Hourly sweep marks sessions left active past
1761
+ # the threshold as abandoned. Deletes nothing;
1762
+ # new activity makes the session active again.
1763
+ # AGENTMEMORY_SESSION_SWEEP_STALE_HOURS=24
1764
+
1765
+ # Capture filters (hooks)
1766
+ # AGENTMEMORY_CAPTURE_ALLOW= # Comma or space list of tool names or globs;
1767
+ # when set, only these tools are captured
1768
+ # AGENTMEMORY_CAPTURE_DENY= # Extra names or globs to skip, added to the
1769
+ # defaults: memory_*, toolsearch,
1770
+ # listmcpresources, fetchmcpresource
1771
+ # AGENTMEMORY_CAPTURE_OUTPUT_MAX=8000 # Max characters of tool output per observation
1772
+ # AGENTMEMORY_PRE_COMPACT_BUDGET=1500 # Token budget for PreCompact context; 0 disables
1773
+
1774
+ # Audit log
1775
+ # AGENTMEMORY_AUDIT_RETENTION_MONTHS=0 # Drop month scopes older than N months; 0 keeps all
1776
+ # AGENTMEMORY_AUDIT_INDEX_PERSIST=false # 1 or true records index migration and cleanup
1777
+ # rows (debugging only)
1778
+
1549
1779
  # Team
1550
1780
  # TEAM_ID=
1551
1781
  # USER_ID=
@@ -1559,7 +1789,19 @@ Create `~/.agentmemory/.env`:
1559
1789
 
1560
1790
  <h2 id="api"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-api.svg"><img src="assets/tags/section-api.svg" alt="API" height="32" /></picture></h2>
1561
1791
 
1562
- 130 endpoints on port `3111`. The REST API binds to `127.0.0.1` by default. Protected endpoints require `Authorization: Bearer <secret>` when `AGENTMEMORY_SECRET` is set, and mesh sync endpoints require `AGENTMEMORY_SECRET` on both peers.
1792
+ 138 endpoints on port `3111`. The REST API binds to `127.0.0.1` by default. Protected endpoints require `Authorization: Bearer <secret>`, and mesh sync endpoints require an explicitly set `AGENTMEMORY_SECRET` on both peers.
1793
+
1794
+ **Authentication is on by default.** When `AGENTMEMORY_SECRET` is not set (in the shell or in `~/.agentmemory/.env`), the server generates a random secret on first start and stores it in `~/.agentmemory/secret` with mode `0600`. Every bundled client reads it from there when it talks to a local server: the CLI, the viewer, the hooks under `plugin/scripts`, the MCP server and the `@agentmemory/mcp` shim, the configs written by `agentmemory connect`, and the bundled OpenCode, Pi, OpenClaw, Hermes and filesystem-watcher integrations. The stored secret is only sent to loopback URLs (`localhost`, `127.0.0.0/8`, `::1`). An explicit `AGENTMEMORY_SECRET` always wins, and remote clients still need it set. Docker and the `deploy/` entrypoints already generate and export their own secret. To call the API by hand:
1795
+
1796
+ ```bash
1797
+ curl -H "Authorization: Bearer $(cat ~/.agentmemory/secret)" http://localhost:3111/agentmemory/health
1798
+ ```
1799
+
1800
+ **Request rules for writes.** `POST`, `PUT`, `PATCH` and `DELETE` requests to the REST API and the viewer must send `Content-Type: application/json` (a `charset` parameter is fine) whenever they carry a body, and an `Origin` header, when present, must be a loopback origin for the configured REST or viewer port or be listed in `VIEWER_ALLOWED_ORIGINS` (comma-separated, e.g. `https://memory.example.com`). Clients that send no `Origin` header (CLI, hooks, MCP, curl, server-to-server) are unaffected. The viewer also accepts its own origin.
1801
+
1802
+ **File paths.** Endpoints that read or write files (`/compress-file`, `/replay/import-jsonl`, `/graph/import-graphify`) only accept paths under `~/.agentmemory`, the instance data directory, or a directory listed in `AGENTMEMORY_IMPORT_ROOT` (separate several with `:`, or `;` on Windows). `/replay/import-jsonl` also accepts its default `~/.claude/projects`. `/obsidian/export` stays inside `AGENTMEMORY_EXPORT_ROOT` and `/migrate` inside `~/.agentmemory`. Symlinks are resolved before every check.
1803
+
1804
+ **Secret scrubbing.** API keys, bearer tokens, PEM private key blocks and credentials embedded in URLs (`scheme://user:password@host`) are redacted before text is stored, on every write path: observations, remember, evolve, slots, lessons, actions, sketches, signals, checkpoints, imports, jsonl replay, mesh sync, team shares, compression and summary output, crystals and graph nodes.
1563
1805
 
1564
1806
  <details>
1565
1807
  <summary>Key endpoints</summary>
@@ -1567,9 +1809,14 @@ Create `~/.agentmemory/.env`:
1567
1809
  | Method | Path | Description |
1568
1810
  |--------|------|-------------|
1569
1811
  | `GET` | `/agentmemory/health` | Health check (always public) |
1812
+ | `GET` | `/agentmemory/status` | What is wrong and how to fix it (HTML for browsers, JSON otherwise) |
1813
+ | `GET` | `/agentmemory/viewer/snapshot` | Everything the viewer shows, in one response |
1570
1814
  | `POST` | `/agentmemory/session/start` | Start session + get context |
1571
1815
  | `POST` | `/agentmemory/session/end` | End session |
1572
- | `POST` | `/agentmemory/observe` | Capture observation |
1816
+ | `POST` | `/agentmemory/observe` | Capture observation (see capture delivery below) |
1817
+ | `GET` | `/agentmemory/capture` | Capture inbox, dead letters and offline spool |
1818
+ | `POST` | `/agentmemory/capture/retry` | Retry dead-letter captures |
1819
+ | `POST` | `/agentmemory/capture/drain` | Send the local offline spool now |
1573
1820
  | `POST` | `/agentmemory/smart-search` | Hybrid search |
1574
1821
  | `POST` | `/agentmemory/context` | Generate context |
1575
1822
  | `POST` | `/agentmemory/remember` | Save to long-term memory |
@@ -1579,6 +1826,7 @@ Create `~/.agentmemory/.env`:
1579
1826
  | `GET` | `/agentmemory/export` | Export all data |
1580
1827
  | `POST` | `/agentmemory/import` | Import from JSON |
1581
1828
  | `POST` | `/agentmemory/graph/query` | Knowledge graph query |
1829
+ | `POST` | `/agentmemory/graph/compact` | Trim oversized graph provenance |
1582
1830
  | `POST` | `/agentmemory/team/share` | Share with team |
1583
1831
  | `GET` | `/agentmemory/audit` | Audit trail |
1584
1832
 
@@ -1586,6 +1834,35 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
1586
1834
 
1587
1835
  </details>
1588
1836
 
1837
+ **Capture delivery.** Hooks send each observation once to `POST /agentmemory/observe` with an `eventId`. It is the host's own id for the call when the payload has one (for example Claude Code's `tool_use_id`), otherwise a hash of the session, hook type, tool name, input, output and host timestamp. The server writes the event to a capture inbox in the state store, stores the observation, then removes the inbox entry. The status code says what happened:
1838
+
1839
+ | Status | `status` field | Meaning |
1840
+ |---|---|---|
1841
+ | `201` | `accepted` | Stored. `observationId` is the new observation. |
1842
+ | `202` | `accepted` (`state: "retrying"`) | Accepted, but storing failed. The server retries it, also after a restart. |
1843
+ | `200` | `duplicate` | This `eventId` was already accepted. `observationId` is the existing observation; nothing new is stored. |
1844
+ | `400` / `422` | `rejected` | Invalid payload, or storing failed for good (the event is kept as a dead letter). |
1845
+ | `503` | `rejected` (`retryable: true`) | The inbox is full (`AGENTMEMORY_CAPTURE_INBOX_MAX`). Hooks spool the event and send it later. |
1846
+
1847
+ Failed events are retried every `AGENTMEMORY_CAPTURE_RETRY_INTERVAL_MS` (10 s) with doubling backoff, up to `AGENTMEMORY_CAPTURE_MAX_ATTEMPTS` (5). Events that still fail stay in the inbox as dead letters, are listed on `/agentmemory/status` and the viewer Health page, and can be retried with `POST /agentmemory/capture/retry` (`{"eventId": "..."}` or `{"all": true}`). Accepted event ids are remembered for `AGENTMEMORY_CAPTURE_DEDUP_HOURS` (168 hours, at most `AGENTMEMORY_CAPTURE_EVENTS_MAX` ids), so a hook replayed after a timeout or a restart is stored once, while two separate tool calls with their own host ids are stored twice even when their content is identical. When an observation is deleted (forget, session delete, eviction, auto-forget or an import that replaces the store), its event is marked as deleted before the observation is removed, so a replay of that event inside the same window is answered as a duplicate and stores nothing. The state store writes to disk every 2 seconds, so an answered event can still be only in memory for a moment. To cover that, every `2xx` answer also carries the server's `bootId` (new at every start), `acceptedAt` and `durableAfterMs` (the save interval plus 1.5 s on the file store, 1.5 s on redis, where persistence is the operator's setting). Hooks keep the event in the local spool until that window has passed and delete it on a later call without another request. If the `bootId` has changed by then, the server restarted, so the hook sends the event again with the same `eventId`; an event that did reach the disk is not stored twice. The server also sends such events itself at start and every retry interval, so a restart loses nothing even when no hook runs afterwards. Older hooks ignore the extra fields, and new hooks against an older server discard the event on `2xx` as before.
1848
+
1849
+ When the server is down, does not answer in time or returns a 5xx, the hook appends the observation to a local spool file, `<data dir>/capture-spool/<host>-<port>.jsonl` (override the folder with `AGENTMEMORY_CAPTURE_SPOOL_DIR`). The file is private to your user (mode 600), secrets are redacted the same way the server redacts them, it holds at most `AGENTMEMORY_CAPTURE_SPOOL_MAX_BYTES` (5 MiB) and drops entries older than `AGENTMEMORY_CAPTURE_SPOOL_MAX_AGE_HOURS` (168). When it is full, new entries are dropped and counted, and `/agentmemory/status` reports it. The hook still exits 0 within its time limit and adds no request when the server is healthy. The spool is sent at the next start and by the first hook that reaches the server again, in a background process so the agent does not wait. Event ids make this safe: an observation that did arrive before a timeout is not stored twice. `npx @agentmemory/agentmemory capture` shows the spool and the server inbox, `--drain` sends the spool now, and `GET /agentmemory/capture` returns the same as JSON. Set `AGENTMEMORY_CAPTURE_SPOOL=false` to turn the spool off.
1850
+
1851
+ **Compacting graph provenance.** Each knowledge graph node and edge keeps the ids of the newest 32 observations it came from. Stores written before that cap can hold thousands of ids per hot node, which makes graph search and the viewer slow or drops the worker. agentmemory fixes this by itself: on the first start after upgrading it trims every node, edge, superseded edge (the temporal graph history) and the cached snapshot to the cap in the background, in small slices with a pause between them, so search, capture and the viewer keep working. It saves its progress, resumes after a restart and never runs again once it has finished. `/agentmemory/status` and the viewer Health page show it as pending, running (with the current scope and position), done or failed. Set `AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=false` to turn it off.
1852
+
1853
+ To run it by hand, call `POST /agentmemory/graph/compact`. It walks the name and edge-key indexes instead of listing every node and edge, and is safe to re-run. When it trims ids it writes a `graph_compact` audit entry.
1854
+
1855
+ ```bash
1856
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: application/json" -d '{}'
1857
+ ```
1858
+
1859
+ On a large store, or when the call returns 504, run it in slices. Send `scope` (`nodes`, `edges` or `history`), `offset` and `limit`, then call again with the returned `nextOffset` until it is `null`. Do this for `nodes`, `edges` and `history`, and finish with one `{"scope":"snapshot"}` call, because a sliced run does not touch the cached snapshot.
1860
+
1861
+ ```bash
1862
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: application/json" -d '{"scope":"nodes","offset":0,"limit":200}'
1863
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: application/json" -d '{"scope":"snapshot"}'
1864
+ ```
1865
+
1589
1866
  ---
1590
1867
 
1591
1868
  <h2 id="development"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-development.svg"><img src="assets/tags/section-development.svg" alt="Development" height="32" /></picture></h2>
@@ -1593,11 +1870,11 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
1593
1870
  ```bash
1594
1871
  npm run dev # Hot reload
1595
1872
  npm run build # Production build
1596
- npm test # 1,674 tests
1873
+ npm test # 2,500+ tests
1597
1874
  npm run test:integration # API tests (requires running services)
1598
1875
  ```
1599
1876
 
1600
- **Prerequisites:** Node.js >= 20, [iii-engine](https://iii.dev/docs) or Docker
1877
+ **Prerequisites:** Node.js >= 20 with npm/npx; [iii-engine](https://iii.dev/docs) v0.22.1 or Docker. The macOS/Linux automatic engine install also requires `curl`, a POSIX `sh`, and `tar`; native Windows uses the manual pinned `iii.exe`, WSL2, or Docker Desktop.
1601
1878
 
1602
1879
  <h2 id="license"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-license.svg"><img src="assets/tags/section-license.svg" alt="License" height="32" /></picture></h2>
1603
1880