@agentmemory/agentmemory 0.9.30 → 0.9.32

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 (334) hide show
  1. package/.env.example +57 -48
  2. package/AGENTS.md +8 -8
  3. package/README.md +256 -819
  4. package/dist/.env.example +57 -48
  5. package/dist/cli.d.mts.map +1 -1
  6. package/dist/cli.mjs +2257 -1027
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/compression-recovery-CZh63Jmz.mjs +5997 -0
  9. package/dist/compression-recovery-CZh63Jmz.mjs.map +1 -0
  10. package/dist/{connect-B4_ca6BD.mjs → connect-BX3njQ3Y.mjs} +897 -276
  11. package/dist/connect-BX3njQ3Y.mjs.map +1 -0
  12. package/dist/hooks/_capture.d.mts +5 -1
  13. package/dist/hooks/_capture.d.mts.map +1 -1
  14. package/dist/hooks/_capture.mjs +141 -26
  15. package/dist/hooks/_capture.mjs.map +1 -1
  16. package/dist/hooks/notification.mjs +20 -6
  17. package/dist/hooks/notification.mjs.map +1 -1
  18. package/dist/hooks/post-commit.mjs +83 -10
  19. package/dist/hooks/post-commit.mjs.map +1 -1
  20. package/dist/hooks/post-tool-failure.mjs +19 -6
  21. package/dist/hooks/post-tool-failure.mjs.map +1 -1
  22. package/dist/hooks/post-tool-use.mjs +19 -6
  23. package/dist/hooks/post-tool-use.mjs.map +1 -1
  24. package/dist/hooks/pre-compact.mjs +104 -22
  25. package/dist/hooks/pre-compact.mjs.map +1 -1
  26. package/dist/hooks/pre-tool-use.mjs +83 -10
  27. package/dist/hooks/pre-tool-use.mjs.map +1 -1
  28. package/dist/hooks/prompt-submit.mjs +12 -4
  29. package/dist/hooks/prompt-submit.mjs.map +1 -1
  30. package/dist/hooks/session-end.mjs +59 -17
  31. package/dist/hooks/session-end.mjs.map +1 -1
  32. package/dist/hooks/session-start.mjs +95 -15
  33. package/dist/hooks/session-start.mjs.map +1 -1
  34. package/dist/hooks/stop.mjs +75 -72
  35. package/dist/hooks/stop.mjs.map +1 -1
  36. package/dist/hooks/subagent-start.mjs +13 -5
  37. package/dist/hooks/subagent-start.mjs.map +1 -1
  38. package/dist/hooks/subagent-stop.mjs +32 -10
  39. package/dist/hooks/subagent-stop.mjs.map +1 -1
  40. package/dist/hooks/task-completed.mjs +21 -6
  41. package/dist/hooks/task-completed.mjs.map +1 -1
  42. package/dist/{image-refs-T_urbwHM.mjs → image-refs-Cyta4Lf9.mjs} +2 -2
  43. package/dist/{image-refs-T_urbwHM.mjs.map → image-refs-Cyta4Lf9.mjs.map} +1 -1
  44. package/dist/index.mjs +16390 -11530
  45. package/dist/index.mjs.map +1 -1
  46. package/dist/integrations/dsh.d.mts +55 -0
  47. package/dist/integrations/dsh.d.mts.map +1 -0
  48. package/dist/integrations/dsh.mjs +1172 -0
  49. package/dist/integrations/dsh.mjs.map +1 -0
  50. package/dist/{keyed-mutex-DchXsyfP.mjs → keyed-mutex-DCUh7PG-.mjs} +58 -9
  51. package/dist/keyed-mutex-DCUh7PG-.mjs.map +1 -0
  52. package/dist/{secret-store-BnY3A50C.mjs → secret-store-iYXRcrO8.mjs} +717 -474
  53. package/dist/secret-store-iYXRcrO8.mjs.map +1 -0
  54. package/dist/session-arguments-zxsbbd8y.mjs +113 -0
  55. package/dist/session-arguments-zxsbbd8y.mjs.map +1 -0
  56. package/dist/{src-Jsq9LCeH.mjs → src-C23nMpda.mjs} +5263 -4667
  57. package/dist/src-C23nMpda.mjs.map +1 -0
  58. package/dist/{standalone-DKCdrf1d.mjs → standalone-BYo5USDb.mjs} +379 -63
  59. package/dist/standalone-BYo5USDb.mjs.map +1 -0
  60. package/dist/standalone.d.mts +1 -1
  61. package/dist/standalone.d.mts.map +1 -1
  62. package/dist/standalone.mjs +864 -81
  63. package/dist/standalone.mjs.map +1 -1
  64. package/dist/viewer/index.html +337 -168
  65. package/integrations/hermes/README.md +94 -0
  66. package/integrations/hermes/__init__.py +670 -0
  67. package/integrations/hermes/plugin.yaml +27 -0
  68. package/integrations/omp/LICENSE +190 -0
  69. package/integrations/omp/README.md +76 -0
  70. package/integrations/omp/capture.ts +1 -0
  71. package/integrations/omp/dist/index.mjs +1477 -0
  72. package/integrations/omp/index.ts +488 -0
  73. package/integrations/omp/package.json +13 -0
  74. package/integrations/omp/security.ts +67 -0
  75. package/integrations/omp/skills/agentmemory-agents/REFERENCE.md +32 -0
  76. package/integrations/omp/skills/agentmemory-agents/SKILL.md +48 -0
  77. package/integrations/omp/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  78. package/integrations/omp/skills/agentmemory-architecture/SKILL.md +37 -0
  79. package/integrations/omp/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  80. package/integrations/omp/skills/agentmemory-config/REFERENCE.md +91 -0
  81. package/integrations/omp/skills/agentmemory-config/SKILL.md +98 -0
  82. package/integrations/omp/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  83. package/integrations/omp/skills/agentmemory-hooks/REFERENCE.md +20 -0
  84. package/integrations/omp/skills/agentmemory-hooks/SKILL.md +60 -0
  85. package/integrations/omp/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  86. package/integrations/omp/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  87. package/integrations/omp/skills/agentmemory-mcp-tools/SKILL.md +52 -0
  88. package/integrations/omp/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  89. package/integrations/omp/skills/agentmemory-rest-api/REFERENCE.md +159 -0
  90. package/integrations/omp/skills/agentmemory-rest-api/SKILL.md +49 -0
  91. package/integrations/omp/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  92. package/integrations/omp/skills/commit-context/EXAMPLES.md +71 -0
  93. package/integrations/omp/skills/commit-context/SKILL.md +64 -0
  94. package/integrations/omp/skills/commit-context/TROUBLESHOOTING.md +70 -0
  95. package/integrations/omp/skills/commit-history/EXAMPLES.md +71 -0
  96. package/integrations/omp/skills/commit-history/SKILL.md +62 -0
  97. package/integrations/omp/skills/commit-history/TROUBLESHOOTING.md +70 -0
  98. package/integrations/omp/skills/forget/EXAMPLES.md +40 -0
  99. package/integrations/omp/skills/forget/SKILL.md +73 -0
  100. package/integrations/omp/skills/forget/TROUBLESHOOTING.md +70 -0
  101. package/integrations/omp/skills/handoff/EXAMPLES.md +57 -0
  102. package/integrations/omp/skills/handoff/SKILL.md +75 -0
  103. package/integrations/omp/skills/handoff/TROUBLESHOOTING.md +70 -0
  104. package/integrations/omp/skills/lesson/SKILL.md +64 -0
  105. package/integrations/omp/skills/lesson/TROUBLESHOOTING.md +70 -0
  106. package/integrations/omp/skills/memory-discipline/SKILL.md +65 -0
  107. package/integrations/omp/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  108. package/integrations/omp/skills/recall/EXAMPLES.md +74 -0
  109. package/integrations/omp/skills/recall/SKILL.md +74 -0
  110. package/integrations/omp/skills/recall/TROUBLESHOOTING.md +70 -0
  111. package/integrations/omp/skills/recap/EXAMPLES.md +62 -0
  112. package/integrations/omp/skills/recap/SKILL.md +68 -0
  113. package/integrations/omp/skills/recap/TROUBLESHOOTING.md +70 -0
  114. package/integrations/omp/skills/remember/EXAMPLES.md +67 -0
  115. package/integrations/omp/skills/remember/SKILL.md +66 -0
  116. package/integrations/omp/skills/remember/TROUBLESHOOTING.md +70 -0
  117. package/integrations/omp/skills/session-history/EXAMPLES.md +59 -0
  118. package/integrations/omp/skills/session-history/SKILL.md +67 -0
  119. package/integrations/omp/skills/session-history/TROUBLESHOOTING.md +70 -0
  120. package/integrations/omp/skills/write-agentmemory-skill/SKILL.md +41 -0
  121. package/integrations/omp/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  122. package/integrations/openclaw/LICENSE +190 -0
  123. package/integrations/openclaw/README.md +98 -0
  124. package/integrations/openclaw/openclaw.plugin.json +71 -0
  125. package/integrations/openclaw/package.json +38 -0
  126. package/integrations/openclaw/plugin.mjs +425 -0
  127. package/integrations/openclaw/plugin.yaml +26 -0
  128. package/integrations/openclaw/skills/agentmemory-agents/REFERENCE.md +32 -0
  129. package/integrations/openclaw/skills/agentmemory-agents/SKILL.md +48 -0
  130. package/integrations/openclaw/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  131. package/integrations/openclaw/skills/agentmemory-architecture/SKILL.md +37 -0
  132. package/integrations/openclaw/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  133. package/integrations/openclaw/skills/agentmemory-config/REFERENCE.md +91 -0
  134. package/integrations/openclaw/skills/agentmemory-config/SKILL.md +98 -0
  135. package/integrations/openclaw/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  136. package/integrations/openclaw/skills/agentmemory-hooks/REFERENCE.md +20 -0
  137. package/integrations/openclaw/skills/agentmemory-hooks/SKILL.md +60 -0
  138. package/integrations/openclaw/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  139. package/integrations/openclaw/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  140. package/integrations/openclaw/skills/agentmemory-mcp-tools/SKILL.md +52 -0
  141. package/integrations/openclaw/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  142. package/integrations/openclaw/skills/agentmemory-rest-api/REFERENCE.md +159 -0
  143. package/integrations/openclaw/skills/agentmemory-rest-api/SKILL.md +49 -0
  144. package/integrations/openclaw/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  145. package/integrations/openclaw/skills/commit-context/EXAMPLES.md +71 -0
  146. package/integrations/openclaw/skills/commit-context/SKILL.md +64 -0
  147. package/integrations/openclaw/skills/commit-context/TROUBLESHOOTING.md +70 -0
  148. package/integrations/openclaw/skills/commit-history/EXAMPLES.md +71 -0
  149. package/integrations/openclaw/skills/commit-history/SKILL.md +62 -0
  150. package/integrations/openclaw/skills/commit-history/TROUBLESHOOTING.md +70 -0
  151. package/integrations/openclaw/skills/forget/EXAMPLES.md +40 -0
  152. package/integrations/openclaw/skills/forget/SKILL.md +73 -0
  153. package/integrations/openclaw/skills/forget/TROUBLESHOOTING.md +70 -0
  154. package/integrations/openclaw/skills/handoff/EXAMPLES.md +57 -0
  155. package/integrations/openclaw/skills/handoff/SKILL.md +75 -0
  156. package/integrations/openclaw/skills/handoff/TROUBLESHOOTING.md +70 -0
  157. package/integrations/openclaw/skills/lesson/SKILL.md +64 -0
  158. package/integrations/openclaw/skills/lesson/TROUBLESHOOTING.md +70 -0
  159. package/integrations/openclaw/skills/memory-discipline/SKILL.md +65 -0
  160. package/integrations/openclaw/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  161. package/integrations/openclaw/skills/recall/EXAMPLES.md +74 -0
  162. package/integrations/openclaw/skills/recall/SKILL.md +74 -0
  163. package/integrations/openclaw/skills/recall/TROUBLESHOOTING.md +70 -0
  164. package/integrations/openclaw/skills/recap/EXAMPLES.md +62 -0
  165. package/integrations/openclaw/skills/recap/SKILL.md +68 -0
  166. package/integrations/openclaw/skills/recap/TROUBLESHOOTING.md +70 -0
  167. package/integrations/openclaw/skills/remember/EXAMPLES.md +67 -0
  168. package/integrations/openclaw/skills/remember/SKILL.md +66 -0
  169. package/integrations/openclaw/skills/remember/TROUBLESHOOTING.md +70 -0
  170. package/integrations/openclaw/skills/session-history/EXAMPLES.md +59 -0
  171. package/integrations/openclaw/skills/session-history/SKILL.md +67 -0
  172. package/integrations/openclaw/skills/session-history/TROUBLESHOOTING.md +70 -0
  173. package/integrations/openclaw/skills/write-agentmemory-skill/SKILL.md +41 -0
  174. package/integrations/openclaw/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  175. package/integrations/pi/LICENSE +190 -0
  176. package/integrations/pi/README.md +46 -51
  177. package/integrations/pi/dist/index.mjs +1460 -0
  178. package/integrations/pi/index.ts +192 -175
  179. package/integrations/pi/package.json +17 -7
  180. package/integrations/pi/security.ts +6 -26
  181. package/integrations/pi/skills/agentmemory-agents/REFERENCE.md +32 -0
  182. package/integrations/pi/skills/agentmemory-agents/SKILL.md +48 -0
  183. package/integrations/pi/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  184. package/integrations/pi/skills/agentmemory-architecture/SKILL.md +37 -0
  185. package/integrations/pi/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  186. package/integrations/pi/skills/agentmemory-config/REFERENCE.md +91 -0
  187. package/integrations/pi/skills/agentmemory-config/SKILL.md +98 -0
  188. package/integrations/pi/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  189. package/integrations/pi/skills/agentmemory-hooks/REFERENCE.md +20 -0
  190. package/integrations/pi/skills/agentmemory-hooks/SKILL.md +60 -0
  191. package/integrations/pi/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  192. package/integrations/pi/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  193. package/integrations/pi/skills/agentmemory-mcp-tools/SKILL.md +52 -0
  194. package/integrations/pi/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  195. package/integrations/pi/skills/agentmemory-rest-api/REFERENCE.md +159 -0
  196. package/integrations/pi/skills/agentmemory-rest-api/SKILL.md +49 -0
  197. package/integrations/pi/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  198. package/integrations/pi/skills/commit-context/EXAMPLES.md +71 -0
  199. package/integrations/pi/skills/commit-context/SKILL.md +64 -0
  200. package/integrations/pi/skills/commit-context/TROUBLESHOOTING.md +70 -0
  201. package/integrations/pi/skills/commit-history/EXAMPLES.md +71 -0
  202. package/integrations/pi/skills/commit-history/SKILL.md +62 -0
  203. package/integrations/pi/skills/commit-history/TROUBLESHOOTING.md +70 -0
  204. package/integrations/pi/skills/forget/EXAMPLES.md +40 -0
  205. package/integrations/pi/skills/forget/SKILL.md +73 -0
  206. package/integrations/pi/skills/forget/TROUBLESHOOTING.md +70 -0
  207. package/integrations/pi/skills/handoff/EXAMPLES.md +57 -0
  208. package/integrations/pi/skills/handoff/SKILL.md +75 -0
  209. package/integrations/pi/skills/handoff/TROUBLESHOOTING.md +70 -0
  210. package/integrations/pi/skills/lesson/SKILL.md +64 -0
  211. package/integrations/pi/skills/lesson/TROUBLESHOOTING.md +70 -0
  212. package/integrations/pi/skills/memory-discipline/SKILL.md +65 -0
  213. package/integrations/pi/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  214. package/integrations/pi/skills/recall/EXAMPLES.md +74 -0
  215. package/integrations/pi/skills/recall/SKILL.md +74 -0
  216. package/integrations/pi/skills/recall/TROUBLESHOOTING.md +70 -0
  217. package/integrations/pi/skills/recap/EXAMPLES.md +62 -0
  218. package/integrations/pi/skills/recap/SKILL.md +68 -0
  219. package/integrations/pi/skills/recap/TROUBLESHOOTING.md +70 -0
  220. package/integrations/pi/skills/remember/EXAMPLES.md +67 -0
  221. package/integrations/pi/skills/remember/SKILL.md +66 -0
  222. package/integrations/pi/skills/remember/TROUBLESHOOTING.md +70 -0
  223. package/integrations/pi/skills/session-history/EXAMPLES.md +59 -0
  224. package/integrations/pi/skills/session-history/SKILL.md +67 -0
  225. package/integrations/pi/skills/session-history/TROUBLESHOOTING.md +70 -0
  226. package/integrations/pi/skills/write-agentmemory-skill/SKILL.md +41 -0
  227. package/integrations/pi/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  228. package/package.json +33 -11
  229. package/plugin/.claude-plugin/plugin.json +16 -3
  230. package/plugin/.codex-plugin/plugin.json +4 -3
  231. package/plugin/.devin-plugin/plugin.json +6 -5
  232. package/plugin/.mcp.json +5 -1
  233. package/plugin/README.md +71 -0
  234. package/plugin/cursor/hooks.json +23 -8
  235. package/plugin/hooks/hooks.json +24 -12
  236. package/plugin/hooks.json +67 -0
  237. package/plugin/opencode/README.md +1 -1
  238. package/plugin/opencode/agentmemory-capture.ts +25 -11
  239. package/plugin/opencode/plugin.json +1 -1
  240. package/plugin/plugin.json +1 -1
  241. package/plugin/scripts/_capture.d.mts +5 -1
  242. package/plugin/scripts/_capture.d.mts.map +1 -1
  243. package/plugin/scripts/_capture.mjs +141 -26
  244. package/plugin/scripts/_capture.mjs.map +1 -1
  245. package/plugin/scripts/cursor/run-detached.mjs +786 -0
  246. package/plugin/scripts/cursor/run-detached.mjs.map +1 -0
  247. package/plugin/scripts/cursor/run-hook.d.mts +1 -0
  248. package/plugin/scripts/cursor/run-hook.mjs +704 -0
  249. package/plugin/scripts/cursor/run-hook.mjs.map +1 -0
  250. package/plugin/scripts/notification.mjs +20 -6
  251. package/plugin/scripts/notification.mjs.map +1 -1
  252. package/plugin/scripts/plugin-bridge.mjs +61 -11
  253. package/plugin/scripts/post-tool-failure.mjs +19 -6
  254. package/plugin/scripts/post-tool-failure.mjs.map +1 -1
  255. package/plugin/scripts/post-tool-use.mjs +19 -6
  256. package/plugin/scripts/post-tool-use.mjs.map +1 -1
  257. package/plugin/scripts/pre-compact.mjs +104 -22
  258. package/plugin/scripts/pre-compact.mjs.map +1 -1
  259. package/plugin/scripts/pre-tool-use.mjs +83 -10
  260. package/plugin/scripts/pre-tool-use.mjs.map +1 -1
  261. package/plugin/scripts/prompt-submit.mjs +12 -4
  262. package/plugin/scripts/prompt-submit.mjs.map +1 -1
  263. package/plugin/scripts/session-end.mjs +59 -17
  264. package/plugin/scripts/session-end.mjs.map +1 -1
  265. package/plugin/scripts/session-start.mjs +95 -15
  266. package/plugin/scripts/session-start.mjs.map +1 -1
  267. package/plugin/scripts/stop.mjs +75 -72
  268. package/plugin/scripts/stop.mjs.map +1 -1
  269. package/plugin/scripts/subagent-start.mjs +13 -5
  270. package/plugin/scripts/subagent-start.mjs.map +1 -1
  271. package/plugin/scripts/subagent-stop.mjs +32 -10
  272. package/plugin/scripts/subagent-stop.mjs.map +1 -1
  273. package/plugin/scripts/task-completed.mjs +21 -6
  274. package/plugin/scripts/task-completed.mjs.map +1 -1
  275. package/plugin/skills/_shared/TROUBLESHOOTING.md +21 -7
  276. package/plugin/skills/agentmemory-agents/REFERENCE.md +8 -7
  277. package/plugin/skills/agentmemory-agents/SKILL.md +19 -5
  278. package/plugin/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  279. package/plugin/skills/agentmemory-architecture/SKILL.md +8 -4
  280. package/plugin/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  281. package/plugin/skills/agentmemory-config/REFERENCE.md +13 -15
  282. package/plugin/skills/agentmemory-config/SKILL.md +34 -10
  283. package/plugin/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  284. package/plugin/skills/agentmemory-hooks/SKILL.md +31 -10
  285. package/plugin/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  286. package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +5 -5
  287. package/plugin/skills/agentmemory-mcp-tools/SKILL.md +16 -3
  288. package/plugin/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  289. package/plugin/skills/agentmemory-rest-api/REFERENCE.md +10 -1
  290. package/plugin/skills/agentmemory-rest-api/SKILL.md +12 -6
  291. package/plugin/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  292. package/plugin/skills/commit-context/SKILL.md +1 -1
  293. package/plugin/skills/commit-context/TROUBLESHOOTING.md +70 -0
  294. package/plugin/skills/commit-history/SKILL.md +1 -1
  295. package/plugin/skills/commit-history/TROUBLESHOOTING.md +70 -0
  296. package/plugin/skills/forget/EXAMPLES.md +19 -54
  297. package/plugin/skills/forget/SKILL.md +16 -12
  298. package/plugin/skills/forget/TROUBLESHOOTING.md +70 -0
  299. package/plugin/skills/handoff/EXAMPLES.md +5 -4
  300. package/plugin/skills/handoff/SKILL.md +10 -5
  301. package/plugin/skills/handoff/TROUBLESHOOTING.md +70 -0
  302. package/plugin/skills/lesson/SKILL.md +1 -1
  303. package/plugin/skills/lesson/TROUBLESHOOTING.md +70 -0
  304. package/plugin/skills/memory-discipline/SKILL.md +1 -1
  305. package/plugin/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  306. package/plugin/skills/recall/SKILL.md +18 -7
  307. package/plugin/skills/recall/TROUBLESHOOTING.md +70 -0
  308. package/plugin/skills/recap/EXAMPLES.md +5 -3
  309. package/plugin/skills/recap/SKILL.md +11 -6
  310. package/plugin/skills/recap/TROUBLESHOOTING.md +70 -0
  311. package/plugin/skills/remember/EXAMPLES.md +3 -3
  312. package/plugin/skills/remember/SKILL.md +1 -1
  313. package/plugin/skills/remember/TROUBLESHOOTING.md +70 -0
  314. package/plugin/skills/session-history/EXAMPLES.md +2 -2
  315. package/plugin/skills/session-history/SKILL.md +10 -4
  316. package/plugin/skills/session-history/TROUBLESHOOTING.md +70 -0
  317. package/plugin/skills/write-agentmemory-skill/SKILL.md +2 -1
  318. package/plugin/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  319. package/dist/connect-B4_ca6BD.mjs.map +0 -1
  320. package/dist/docker-compose.yml +0 -73
  321. package/dist/iii-config.docker.yaml +0 -53
  322. package/dist/iii-config.yaml +0 -63
  323. package/dist/keyed-mutex-DchXsyfP.mjs.map +0 -1
  324. package/dist/secret-store-BnY3A50C.mjs.map +0 -1
  325. package/dist/src-Jsq9LCeH.mjs.map +0 -1
  326. package/dist/standalone-DKCdrf1d.mjs.map +0 -1
  327. package/dist/status-IRz7ta8-.mjs +0 -2344
  328. package/dist/status-IRz7ta8-.mjs.map +0 -1
  329. package/docker-compose.yml +0 -73
  330. package/iii-config.docker.yaml +0 -53
  331. package/iii-config.yaml +0 -63
  332. package/plugin/scripts/post-commit.mjs +0 -184
  333. package/plugin/scripts/post-commit.mjs.map +0 -1
  334. /package/plugin/scripts/{post-commit.d.mts → cursor/run-detached.d.mts} +0 -0
package/README.md CHANGED
@@ -4,10 +4,9 @@
4
4
 
5
5
  <p align="center">
6
6
  <strong>
7
- Your coding agent remembers everything. No more re-explaining.
8
- Built on <a href="https://github.com/iii-hq/iii">iii engine</a>
7
+ Persistent memory across coding sessions and agents.
9
8
  </strong><br/>
10
- Persistent memory for Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, pi, OpenCode, and any MCP client.
9
+ Persistent memory for Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, pi, Oh My Pi, OpenCode, DeepSeek Harness, and any MCP client.
11
10
  </p>
12
11
 
13
12
  <p align="center">
@@ -51,7 +50,7 @@
51
50
  </p>
52
51
 
53
52
  <p align="center">
54
- <a href="https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1.6k%20stars%20%2F%20230%20forks-FF6B35?style=for-the-badge&logo=github&logoColor=white&labelColor=1a1a1a" alt="Design doc: 1.6k stars / 230 forks on the gist" /></a>
53
+ <a href="https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1.7k%20stars%20%2F%20240%20forks-FF6B35?style=for-the-badge&logo=github&logoColor=white&labelColor=1a1a1a" alt="Design doc: 1.7k stars / 240 forks on the gist" /></a>
55
54
  </p>
56
55
 
57
56
  <p align="center">
@@ -63,19 +62,20 @@
63
62
  <a href="https://github.com/rohitg00/agentmemory/actions"><img src="https://img.shields.io/github/actions/workflow/status/rohitg00/agentmemory/ci.yml?label=tests&style=for-the-badge&logo=github" alt="CI" /></a>
64
63
  <a href="https://github.com/rohitg00/agentmemory/blob/main/LICENSE"><img src="https://img.shields.io/github/license/rohitg00/agentmemory?color=blue&style=for-the-badge" alt="License" /></a>
65
64
  <a href="https://github.com/rohitg00/agentmemory/stargazers"><img src="https://img.shields.io/github/stars/rohitg00/agentmemory?style=for-the-badge&color=yellow&logo=github" alt="Stars" /></a>
65
+ <a href="https://skills.sh/rohitg00/agentmemory"><img src="https://skills.sh/b/rohitg00/agentmemory?style=for-the-badge" alt="skills.sh installs" /></a>
66
66
  </p>
67
67
 
68
68
  <p align="center">
69
- <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-recall.svg"><img src="assets/tags/stat-recall.svg" alt="95.2% retrieval R@5" height="38" /></picture>
70
- <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tokens.svg"><img src="assets/tags/stat-tokens.svg" alt="92% fewer tokens" height="38" /></picture>
71
69
  <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>
72
70
  <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>
73
71
  <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>
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>
72
+ <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="4,400+ tests passing" height="38" /></picture>
75
73
  </p>
76
74
 
77
75
  <p align="center">
78
- <img src="assets/demo.gif" alt="agentmemory demo" width="720" />
76
+ <a href="assets/demo.gif">
77
+ <img src="assets/demo.gif" alt="AgentMemory viewer: memories, knowledge graph, sessions and replay in dark and light themes" width="960" />
78
+ </a>
79
79
  </p>
80
80
 
81
81
  <p align="center">
@@ -87,32 +87,38 @@
87
87
  <a href="#how-it-works">How It Works</a> &bull;
88
88
  <a href="#mcp-server">MCP</a> &bull;
89
89
  <a href="#real-time-viewer">Viewer</a> &bull;
90
- <a href="#powered-by-iii">Powered by iii</a> &bull;
91
90
  <a href="#configuration">Config</a> &bull;
92
91
  <a href="#api">API</a>
93
92
  </p>
94
93
 
95
94
  ---
96
95
 
96
+ AgentMemory captures coding sessions, makes decisions and fixes searchable, and lets your agents recall them later. Keep one memory store across tools, inspect what was saved, and choose how much context reaches the model.
97
+
98
+ - **Capture:** native hooks and plugins record supported session events, with secret scrubbing and offline replay.
99
+ - **Recall:** keyword search works without an API key; local or remote embeddings add semantic search.
100
+ - **Continue:** retrieve project history, lessons and session handoffs from another agent.
101
+ - **Inspect:** browse, edit, export and forget memories in the live viewer.
102
+
97
103
  ## Install
98
104
 
99
105
  Requirements:
100
106
 
101
107
  - 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.
108
+ - macOS/Linux also need `curl`, a POSIX `sh`, and `tar` for automatic runtime setup.
109
+ - Windows users can use WSL2 or follow the [native Windows setup](#windows).
104
110
 
105
- Canonical fresh-install command:
111
+ Start setup:
106
112
 
107
113
  ```bash
108
114
  npx -y @agentmemory/agentmemory@latest
109
115
  ```
110
116
 
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.
117
+ Choose your agents and either a provider or keyless mode. Setup writes the configuration, starts the memory server, and offers a global install for the `agentmemory` command. `-y` accepts the npm package prompt; `@latest` selects the current release. LLM-written observation compression is opt-in with a provider and `AGENTMEMORY_AUTO_COMPRESS=true`.
112
118
 
113
119
  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
120
 
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.
121
+ The API is at `http://localhost:3111` and the live viewer at `http://localhost:3113`. Both bind to loopback by default. Configuration lives in `~/.agentmemory/.env`; see [data storage](#data-storage) for memory locations and separate instances.
116
122
 
117
123
  Then prove recall works and give your agent its skills:
118
124
 
@@ -127,14 +133,7 @@ Prefer to let a coding agent do the whole thing? Hand it one instruction:
127
133
 
128
134
  > Retrieve and follow the instructions at: https://raw.githubusercontent.com/rohitg00/agentmemory/main/INSTALL_FOR_AGENTS.md
129
135
 
130
- Wire more agents any time with `agentmemory connect <agent>` — 20 adapters listed at [Works with every agent](#works-with-every-agent). Full command reference at [Quick Start](#quick-start).
131
-
132
- <details>
133
- <summary><strong>Windows</strong></summary>
134
-
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.
136
-
137
- </details>
136
+ Connect another agent with `agentmemory connect <agent>`. See [supported integrations](#works-with-every-agent) and [everyday commands](#everyday-commands).
138
137
 
139
138
  <details>
140
139
  <summary><strong>Global install / EACCES</strong></summary>
@@ -154,13 +153,6 @@ npx caches per version. Force the latest with `npx -y @agentmemory/agentmemory@l
154
153
 
155
154
  </details>
156
155
 
157
- <details>
158
- <summary><strong>Already running your own iii engine</strong></summary>
159
-
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.
161
-
162
- </details>
163
-
164
156
  ---
165
157
 
166
158
  <h2 id="works-with-every-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>
@@ -187,7 +179,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
187
179
  <td align="center" width="20%">
188
180
  <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
181
  <strong>Cursor</strong><br/>
190
- <sub>native plugin + 7 hooks + MCP</sub>
182
+ <sub>native plugin + lifecycle hooks + MCP</sub>
191
183
  </td>
192
184
  <td align="center" width="20%">
193
185
  <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/>
@@ -214,7 +206,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
214
206
  <td align="center" width="20%">
215
207
  <a href="integrations/pi/"><img src="assets/agents/pi.svg" alt="pi" width="48" height="48" /></a><br/>
216
208
  <strong>pi</strong><br/>
217
- <sub>native plugin + MCP</sub>
209
+ <sub>native recall + capture + skills</sub>
218
210
  </td>
219
211
  <td align="center" width="20%">
220
212
  <a href="https://github.com/tinyhumansai/openhuman"><img src="https://github.com/tinyhumansai.png?size=120" alt="OpenHuman" width="48" height="48" /></a><br/>
@@ -280,7 +272,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
280
272
  <td align="center" width="20%">
281
273
  <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
274
  <strong>DeepSeek Harness</strong><br/>
283
- <sub>MCP server</sub>
275
+ <sub>native capture + MCP</sub>
284
276
  </td>
285
277
  <td align="center" width="20%">
286
278
  <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/>
@@ -303,6 +295,12 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
303
295
  <sub>REST API</sub>
304
296
  </td>
305
297
  </tr>
298
+ <tr>
299
+ <td align="center" colspan="5">
300
+ <a href="integrations/omp/"><strong>Oh My Pi</strong></a><br/>
301
+ <sub>native recall + capture + skills + optional MCP</sub>
302
+ </td>
303
+ </tr>
306
304
  </table>
307
305
 
308
306
  <p align="center">
@@ -311,253 +309,75 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
311
309
 
312
310
  ---
313
311
 
314
- You explain the same architecture every session. You re-discover the same bugs. You re-teach the same preferences. Built-in memory (CLAUDE.md, .cursorrules) caps out at 200 lines and goes stale. agentmemory fixes this. It silently captures what your agent does, compresses it into searchable memory, and injects the right context when the next session starts. One command. Works across agents.
312
+ ### Data storage
315
313
 
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.
314
+ Memories stay outside your repository by default:
317
315
 
318
- ```bash
319
- npx -y @agentmemory/agentmemory@latest
320
- ```
316
+ | Platform | Data directory |
317
+ |---|---|
318
+ | macOS | `~/Library/Application Support/agentmemory` |
319
+ | Linux | `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` |
320
+ | Windows | `%APPDATA%\agentmemory` |
321
321
 
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:
322
+ An existing `./data/state_store.db` is reused for instance 0. Choose another directory with `--data-dir <path>` or `AGENTMEMORY_DATA_DIR`. Keep the same directory when restarting or upgrading.
323
323
 
324
324
  ```bash
325
- npx -y @agentmemory/agentmemory@latest --data-dir ~/.agentmemory-projects/main
326
- AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx -y @agentmemory/agentmemory@latest
325
+ agentmemory --data-dir ~/.agentmemory-projects/main
326
+ agentmemory --instance 1
327
327
  ```
328
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`.
329
+ `--instance 1` uses an `instance-1` subdirectory, API port `3211` and viewer port `3213`. See [storage and backups](docs/reliability/state-storage.md) for Redis and backend migration.
330
330
 
331
331
  Latest release notes: [CHANGELOG.md](CHANGELOG.md).
332
332
 
333
333
  ---
334
334
 
335
- <h2 id="benchmarks"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-benchmarks.svg"><img src="assets/tags/section-benchmarks.svg" alt="Benchmarks" height="32" /></picture></h2>
336
-
337
- <table>
338
- <tr>
339
- <td width="50%">
340
-
341
- ### Retrieval Accuracy
335
+ ### What's new in 0.9.32
342
336
 
343
- **coding-agent-life-v1** (in-house corpus, sandbox-reproducible)
337
+ - **Providers are opt-in:** a key alone sends nothing out. Set `AGENTMEMORY_LLM_PROVIDER` for LLM features and `EMBEDDING_PROVIDER` for cloud embeddings.
338
+ - **Native Windows works:** Worker Compose starts, iii installs itself, and `doctor` never waits on a prompt in scripts.
339
+ - **Reliable boot:** agentmemory waits for the state worker, so slow starts keep their search index and vectors.
340
+ - **Better recall:** CJK queries, scoped smart-search and project isolation fixes.
344
341
 
345
- | Adapter | P@5 | R@5 | Top-5 hit rate | p50 latency |
346
- |---|---|---|---|---|
347
- | **agentmemory hybrid** | **0.240** | **1.000** | **15 / 15** | 14 ms |
348
- | grep baseline | 0.227 | 0.967 | 15 / 15 | 0 ms |
342
+ [Release notes and contributor credits](https://github.com/rohitg00/agentmemory/releases/tag/v0.9.32).
349
343
 
350
- 100% top-5 hit rate at the **P@5 math ceiling** for this corpus (0.240, see scorecard). Hybrid retrieves every gold session; grep misses 1 of 2 gold on the multi-session temporal query. Lift is **recall + temporal**, not aggregate precision. This benchmark is small and gold-sparse; the larger LongMemEval-S below differentiates better. Full per-type breakdown + correction note: [`docs/benchmarks/2026-05-20-coding-agent-life-v1.md`](docs/benchmarks/2026-05-20-coding-agent-life-v1.md).
351
-
352
- **LongMemEval-S** (ICLR 2025, 500 questions)
353
-
354
- | System | R@5 | R@10 | MRR |
355
- |---|---|---|---|
356
- | **agentmemory** | **95.2%** | **98.6%** | **88.2%** |
357
- | BM25-only fallback | 86.2% | 94.6% | 71.5% |
358
-
359
- </td>
360
- <td width="50%">
361
-
362
- ### Token Savings
363
-
364
- | Approach | Tokens/yr | Cost/yr |
365
- |---|---|---|
366
- | Paste full context | 19.5M+ | Impossible (exceeds window) |
367
- | LLM-summarized | ~650K | ~$500 |
368
- | **agentmemory** | **~170K** | **~$10** |
369
- | agentmemory + local embeddings | ~170K | **$0** |
344
+ <h2 id="benchmarks"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-benchmarks.svg"><img src="assets/tags/section-benchmarks.svg" alt="Benchmarks" height="32" /></picture></h2>
370
345
 
371
- </td>
372
- </tr>
373
- </table>
346
+ **Useful recall without a model API.** On LongMemEval-S, AgentMemory's keyless BM25 component found at least one relevant source for **96.2%** of answerable questions and **every required source for 84.7%**.
374
347
 
375
- > Embedding model: `all-MiniLM-L6-v2` (local, free, no API key). Full reports: [`benchmark/LONGMEMEVAL.md`](benchmark/LONGMEMEVAL.md), [`benchmark/QUALITY.md`](benchmark/QUALITY.md), [`benchmark/SCALE.md`](benchmark/SCALE.md). Competitor comparison: [`benchmark/COMPARISON.md`](benchmark/COMPARISON.md) covering agentmemory vs mem0, Letta, Khoj, supermemory, TencentDB Agent Memory, MemPalace, Zep/Graphiti, Cognee, Hippo.
348
+ | LongMemEval-S, top 5 distinct sessions | AgentMemory BM25 | Lexical baseline |
349
+ |---|---:|---:|
350
+ | Every required source found (strict recall-all@5) | **84.7%** | 72.1% |
351
+ | At least one relevant source found (any-hit@5) | **96.2%** | 88.7% |
376
352
 
377
- **Reproduce locally:** [`eval/README.md`](eval/README.md), an adapter-pluggable harness for LongMemEval `_s` (public 500-Q) + `coding-agent-life-v1` (in-house 15-session corpus). Grep / vector / agentmemory adapters score side-by-side, NDJSON output, published scorecards land in [`docs/benchmarks/`](docs/benchmarks/).
353
+ That is **12.6 percentage points higher complete-source retrieval** than the lexical baseline on the same inputs, with no embedding model or paid API. Measured on 2026-10-28: 500 questions per adapter, 470 answerable, 30 excluded from retrieval scoring, zero execution failures.
378
354
 
379
- **Pairs with [codegraph](https://github.com/colbymchenry/codegraph), [Understand Anything](https://github.com/Lum1104/Understand-Anything), and [Graphify](https://github.com/safishamsi/graphify).** Code-graph indexing, multi-agent build pipelines, and broader knowledge graphs across docs / PDFs / images / videos. agentmemory remembers the work; those three projects light up the rest of the context layer. Recipes + question-routing table: [`docs/recipes/pairings.md`](docs/recipes/pairings.md).
355
+ This component test measures retrieval from supplied sessions. Full-system answer quality, hybrid retrieval and competitor rankings require separate evaluations. [Read the complete results, including the smaller coding fixture, limitations and reproduction steps](docs/benchmarks/2026-10-28-retrieval-evaluation.md).
380
356
 
381
357
  ---
382
358
 
383
359
  <h2 id="vs-competitors"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-competitors.svg"><img src="assets/tags/section-competitors.svg" alt="vs Competitors" height="32" /></picture></h2>
384
360
 
385
- <table>
386
- <tr>
387
- <th></th>
388
- <th>agentmemory</th>
389
- <th>mem0 (63K ⭐)</th>
390
- <th>Letta / MemGPT (24K ⭐)</th>
391
- <th>Khoj (36K ⭐)</th>
392
- <th>supermemory (29K ⭐)</th>
393
- <th>TencentDB Agent Memory (22K ⭐)</th>
394
- <th>MemPalace (54K ⭐)</th>
395
- <th>oracleagentmemory</th>
396
- <th>Hippo</th>
397
- <th>Built-in (CLAUDE.md)</th>
398
- </tr>
399
- <tr>
400
- <td><strong>Type</strong></td>
401
- <td>Memory engine + MCP server</td>
402
- <td>Memory layer API</td>
403
- <td>Full agent runtime</td>
404
- <td>Personal AI</td>
405
- <td>Memory API + app</td>
406
- <td>Team memory hub (LLM proxy)</td>
407
- <td>Vector memory (OSS)</td>
408
- <td>Memory engine (Oracle DB)</td>
409
- <td>Memory system</td>
410
- <td>Static file</td>
411
- </tr>
412
- <tr>
413
- <td><strong>Retrieval R@5</strong></td>
414
- <td><strong>95.2%</strong></td>
415
- <td>68.5% (LoCoMo)</td>
416
- <td>83.2% (LoCoMo)</td>
417
- <td>N/A</td>
418
- <td>Self-reported</td>
419
- <td>PersonaMem 76% (self-reported)</td>
420
- <td>~96.6% (self-reported)</td>
421
- <td>94.4% (self-reported)</td>
422
- <td>N/A</td>
423
- <td>N/A (grep)</td>
424
- </tr>
425
- <tr>
426
- <td><strong>Auto-capture</strong></td>
427
- <td>12 hooks (zero manual effort)</td>
428
- <td>Manual <code>add()</code> calls</td>
429
- <td>Agent self-edits</td>
430
- <td>Manual</td>
431
- <td>API-side extraction</td>
432
- <td>Proxy interception (base-URL swap)</td>
433
- <td>Manual</td>
434
- <td>API extraction</td>
435
- <td>Manual</td>
436
- <td>Manual editing</td>
437
- </tr>
438
- <tr>
439
- <td><strong>Search</strong></td>
440
- <td>BM25 + Vector + Graph (RRF fusion)</td>
441
- <td>Vector + Graph</td>
442
- <td>Vector (archival)</td>
443
- <td>Semantic</td>
444
- <td>Vector + RAG</td>
445
- <td>4 asset types (Chat / Skill / Wiki / CodeGraph)</td>
446
- <td>Vector-only</td>
447
- <td>Vector + semantic</td>
448
- <td>Decay-weighted</td>
449
- <td>Loads everything into context</td>
450
- </tr>
451
- <tr>
452
- <td><strong>Multi-agent</strong></td>
453
- <td>MCP + REST + leases + signals</td>
454
- <td>API (no coordination)</td>
455
- <td>Within Letta runtime only</td>
456
- <td>No</td>
457
- <td>No</td>
458
- <td>Team roles + shared assets</td>
459
- <td>No</td>
460
- <td>Scoped only</td>
461
- <td>Multi-agent shared</td>
462
- <td>Per-agent files</td>
463
- </tr>
464
- <tr>
465
- <td><strong>Framework lock-in</strong></td>
466
- <td>None (any MCP client)</td>
467
- <td>None</td>
468
- <td>High (must use Letta)</td>
469
- <td>Standalone</td>
470
- <td>None</td>
471
- <td>Proxy fronts every model call</td>
472
- <td>None</td>
473
- <td>Oracle Database</td>
474
- <td>None</td>
475
- <td>Per-agent format</td>
476
- </tr>
477
- <tr>
478
- <td><strong>External deps</strong></td>
479
- <td>None (SQLite + iii-engine)</td>
480
- <td>Qdrant / pgvector</td>
481
- <td>Postgres + vector DB</td>
482
- <td>Multiple</td>
483
- <td>Managed cloud</td>
484
- <td>Docker stack (Core + Hub + Proxy)</td>
485
- <td>Vector store</td>
486
- <td>Oracle AI Database</td>
487
- <td>None</td>
488
- <td>None</td>
489
- </tr>
490
- <tr>
491
- <td><strong>Memory lifecycle</strong></td>
492
- <td>4-tier consolidation + decay + auto-forget</td>
493
- <td>Passive extraction</td>
494
- <td>Agent-managed</td>
495
- <td>Manual</td>
496
- <td>Auto-forget</td>
497
- <td>Manual review; auto-routing in progress</td>
498
- <td>None</td>
499
- <td>Not stated</td>
500
- <td>Decay + consolidation</td>
501
- <td>Manual pruning</td>
502
- </tr>
503
- <tr>
504
- <td><strong>Token efficiency</strong></td>
505
- <td>~1,900 tokens/session ($10/yr)</td>
506
- <td>Varies by integration</td>
507
- <td>Core memory in context</td>
508
- <td>Varies</td>
509
- <td>Cloud pricing</td>
510
- <td>Not stated</td>
511
- <td>No token budget</td>
512
- <td>LLM-backed (varies)</td>
513
- <td>Varies</td>
514
- <td>22K+ tokens at 240 obs</td>
515
- </tr>
516
- <tr>
517
- <td><strong>Real-time viewer</strong></td>
518
- <td>Yes (port 3113)</td>
519
- <td>Cloud dashboard</td>
520
- <td>Cloud dashboard</td>
521
- <td>Web UI</td>
522
- <td>Cloud dashboard</td>
523
- <td>Hub web UI</td>
524
- <td>No</td>
525
- <td>No</td>
526
- <td>No</td>
527
- <td>No</td>
528
- </tr>
529
- <tr>
530
- <td><strong>Self-hosted</strong></td>
531
- <td>Yes (default)</td>
532
- <td>Optional</td>
533
- <td>Optional</td>
534
- <td>Yes</td>
535
- <td>No (cloud-only)</td>
536
- <td>Yes (Docker)</td>
537
- <td>Yes</td>
538
- <td>Yes (Oracle DB)</td>
539
- <td>Yes</td>
540
- <td>Yes</td>
541
- </tr>
542
- </table>
361
+ **AgentMemory is built for the coding workflow you already have.** Capture supported agent activity automatically, share project history across tools, retrieve scoped memories, and inspect the original sources in a local viewer. Lessons, actions, versioned memories and import/export ship in the Apache-2.0 project; keyword recall needs no account or model API key.
543
362
 
544
- <sub>Benchmark note: only agentmemory's R@5 is our own measured result (LongMemEval-S, reproducible from <a href="benchmark/COMPARISON.md"><code>benchmark/COMPARISON.md</code></a>). The mem0 and Letta figures are their published LoCoMo numbers (a different dataset); the MemPalace, supermemory, TencentDB (PersonaMem), and oracleagentmemory figures are vendor self-reported claims we have not independently reproduced (oracleagentmemory's run used GPT-5.5 against an Oracle AI Database). Shown side by side for ballpark only, not a head-to-head on identical data. Star counts are approximate and drift over time.</sub>
363
+ Choose by workload and deployment. Other products also offer local deployment or agent plugins, so those alone are not useful differentiators.
545
364
 
546
- **Newer entrants** worth knowing, compared in depth in [`benchmark/COMPARISON.md`](benchmark/COMPARISON.md):
547
-
548
- | System | ⭐ | Angle |
549
- |--------|---|-------|
550
- | Zep / Graphiti | 30K | Temporal knowledge graph; strongest published temporal-query results (LongMemEval 63.8%), but graph builds asynchronously so fresh facts can lag |
551
- | Cognee | 30K | Document-to-knowledge-graph ingestion, Python-only, built for structured entity extraction rather than session capture |
365
+ | Project | Best starting point for |
366
+ |---|---|
367
+ | **AgentMemory** | Shared local memory for existing coding agents, automatic capture, scoped recall and a live viewer |
368
+ | [Mem0](https://docs.mem0.ai/introduction) | Memory APIs, hosted or self-hosted, with SDKs and agent plugins |
369
+ | [Supermemory](https://supermemory.ai/docs/self-hosting/overview) | Memory and document context through a hosted API or local server |
370
+ | [Zep / Graphiti](https://github.com/getzep/graphiti) | Enterprise context and temporal knowledge graphs |
371
+ | [Letta](https://docs.letta.com/) | Building stateful agents with their own managed memory |
372
+ | [Cognee](https://github.com/topoteretes/cognee) | Turning documents, code and conversations into searchable knowledge |
373
+ | [claude-mem](https://github.com/thedotmack/claude-mem) | Capturing and summarizing coding sessions across supported agents |
552
374
 
553
- None of these auto-capture from coding-agent hooks, ship a local-first viewer, or run keyless — the combination agentmemory is built around.
375
+ [Detailed comparison and sources](benchmark/COMPARISON.md), checked 2026-10-28. Deployment options, provider costs and integrations vary; scores from different datasets and metrics are not a head-to-head ranking.
554
376
 
555
377
  ---
556
378
 
557
379
  <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>
558
380
 
559
- Compatibility: this release targets `iii-sdk` 0.22.1 and pins iii-engine v0.22.1.
560
-
561
381
  ### Try it in 30 seconds
562
382
 
563
383
  ```bash
@@ -574,7 +394,7 @@ Open `http://localhost:3113` to watch the memory build live.
574
394
 
575
395
  ### Validate a fresh install and restart persistence
576
396
 
577
- With the server running, validate REST, health, the viewer, and the iii-backed runtime status:
397
+ With the server running, check health, the viewer and status:
578
398
 
579
399
  ```bash
580
400
  curl -fsS http://localhost:3111/agentmemory/livez
@@ -583,14 +403,20 @@ curl -fsS -o /dev/null http://localhost:3113/
583
403
  npx -y @agentmemory/agentmemory@latest status
584
404
  ```
585
405
 
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:
406
+ `status` reports server health, provider and embedding mode, capture delivery, and recovery state. Save a probe and confirm it is searchable. Protected REST requests require the daemon secret. If you configured `AGENTMEMORY_SECRET`, use that value in this terminal; otherwise load the generated local secret:
407
+
408
+ ```bash
409
+ read -r AGENTMEMORY_SECRET < "$HOME/.agentmemory/secret"
410
+ ```
587
411
 
588
412
  ```bash
589
413
  curl -fsS -X POST http://localhost:3111/agentmemory/remember \
414
+ -H "Authorization: Bearer $AGENTMEMORY_SECRET" \
590
415
  -H 'Content-Type: application/json' \
591
416
  -d '{"content":"agentmemory restart persistence probe","concepts":["install-check"]}'
592
417
 
593
418
  curl -fsS -X POST http://localhost:3111/agentmemory/smart-search \
419
+ -H "Authorization: Bearer $AGENTMEMORY_SECRET" \
594
420
  -H 'Content-Type: application/json' \
595
421
  -d '{"query":"restart persistence probe","limit":5}'
596
422
  ```
@@ -604,7 +430,10 @@ Install and setup live in [Install](#install) above (the first run walks you thr
604
430
  ```bash
605
431
  agentmemory # start the server
606
432
  agentmemory stop # stop it cleanly
607
- agentmemory connect <agent> # wire another agent
433
+ agentmemory status # health, providers and recovery state
434
+ agentmemory capture # inspect capture inbox and offline spool
435
+ agentmemory capture --drain # replay queued observations
436
+ agentmemory connect <agent> # connect another agent
608
437
  agentmemory doctor # interactive diagnostics + fix prompts
609
438
  agentmemory remove # uninstall everything we created
610
439
  ```
@@ -623,7 +452,7 @@ npx -y @agentmemory/agentmemory@latest import-jsonl
623
452
  npx -y @agentmemory/agentmemory@latest import-jsonl ~/.claude/projects/-my-project/abc123.jsonl
624
453
  ```
625
454
 
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.
455
+ Imported sessions appear alongside native sessions in Replay. Transcripts are indexed for search and marked with origin channel `import`; session processing can also produce crystals and lessons.
627
456
 
628
457
  > **Heads-up if you rely on `import-jsonl` as your primary capture path:** Claude Code's `cleanupPeriodDays` (in `~/.claude/settings.json`, default **30**) auto-deletes JSONL transcripts older than that window from `~/.claude/projects/`. If you install agentmemory fresh on a months-old Claude Code history, anything older than 30 days is already gone before the first import. Either run `import-jsonl` on a cron, raise `cleanupPeriodDays` to something higher, or wire the auto-capture hooks (the default plugin install path) so each turn lands in agentmemory while the session is live and the JSONL cleanup stops mattering.
629
458
 
@@ -635,14 +464,12 @@ Use the maintenance command when you intentionally want to update your local run
635
464
  npx -y @agentmemory/agentmemory@latest upgrade
636
465
  ```
637
466
 
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.
639
-
640
- Implementation details live in `src/cli.ts` (see `runUpgrade` around the `src/cli.ts:544-595` region).
467
+ This updates the local runtime and may update JavaScript dependencies in the current workspace. Back up your data and read the [upgrade guide](docs/upgrades/iii-0.25.md) before updating an existing installation.
641
468
 
642
469
  ### Claude Code (one block, paste it)
643
470
 
644
471
  ```text
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.
472
+ Install agentmemory: run `npx -y @agentmemory/agentmemory@latest` 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. 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.
646
473
  ```
647
474
 
648
475
  #### Claude Code without the plugin install (MCP-standalone path)
@@ -656,10 +483,13 @@ agentmemory connect claude-code --with-hooks
656
483
  ```
657
484
 
658
485
  This merges the same hook commands into `~/.claude/settings.json` with absolute paths resolved to the bundled `plugin/` directory of the currently installed `@agentmemory/agentmemory` package. Re-run the command after upgrading agentmemory to refresh the paths. User entries in the same file are preserved; only previous agentmemory entries are replaced. Using the `/plugin install` path remains the recommended approach.
659
- For remote or protected deployments, launch Claude Code with `AGENTMEMORY_URL` and `AGENTMEMORY_SECRET` set. The plugin passes both values through to its bundled MCP server; when `AGENTMEMORY_URL` is empty, the MCP shim uses `http://localhost:3111`.
486
+
487
+ For a remote server with the plugin, enter its `https://` URL and secret in the plugin settings that Claude Code asks for when you enable the plugin. The hooks and the bundled MCP server read both from there. With the URL setting empty, they use `AGENTMEMORY_URL` from your environment, then `http://localhost:3111`; with the secret setting empty, they send only the local server's own secret, and only to a loopback address. With `agentmemory connect claude-code` there are no plugin settings: set `AGENTMEMORY_URL` and `AGENTMEMORY_SECRET` in the environment that starts Claude Code.
660
488
 
661
489
  ### Codex CLI (Codex plugin platform)
662
490
 
491
+ Agent Memory is listed in the [OpenAI plugin directory](https://chatgpt.com/plugins/plugins_6ac50a1b89948191906ff15c72357972). That listing adds the 17 skills only. Start the memory server and wire its MCP server with `agentmemory connect codex` so the skills can call the memory tools. For the MCP server, hooks and skills in one plugin, use the repository marketplace below.
492
+
663
493
  ```bash
664
494
  # 1. start the memory server in a separate terminal
665
495
  npx -y @agentmemory/agentmemory@latest
@@ -703,59 +533,74 @@ copilot plugin install rohitg00/agentmemory:plugin
703
533
 
704
534
  `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.
705
535
 
706
- <details>
707
- <summary><b>OpenClaw (paste this prompt)</b></summary>
536
+ ### Cursor
708
537
 
709
- ```text
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:
538
+ ```bash
539
+ # MCP wiring
540
+ agentmemory connect cursor
541
+ ```
711
542
 
712
- {
713
- "mcpServers": {
714
- "agentmemory": {
715
- "command": "npx",
716
- "args": ["-y", "@agentmemory/mcp"],
717
- "env": {
718
- "AGENTMEMORY_URL": "http://localhost:3111"
719
- }
720
- }
721
- }
722
- }
543
+ Then add the native hooks: **Settings → Plugins → Add marketplace** → select an agentmemory checkout (the directory containing `.cursor-plugin/plugin.json`), enable the **agentmemory** plugin, and reload the window.
544
+
545
+ The plugin provides lifecycle capture, workspace-aware project attribution, skills and MCP. Enable either the plugin hooks or manual hooks in `~/.cursor/hooks.json` to avoid duplicate capture.
723
546
 
724
- Restart OpenClaw. Verify with `curl http://localhost:3111/agentmemory/health`. Open http://localhost:3113 for the real-time viewer. For deeper memory-slot integration, copy `integrations/openclaw` to `~/.openclaw/extensions/agentmemory` and enable `plugins.slots.memory = "agentmemory"` in `~/.openclaw/openclaw.json`.
547
+ Full guide: [`integrations/cursor/`](integrations/cursor/)
548
+
549
+ ### Pi, Oh My Pi and DeepSeek Harness
550
+
551
+ ```bash
552
+ agentmemory connect pi --with-mcp
553
+ agentmemory connect omp --with-mcp
554
+ agentmemory connect dsh --with-hooks
725
555
  ```
726
556
 
727
- Full guide: [`integrations/openclaw/`](integrations/openclaw/)
557
+ Choose the command for your host. Pi and OMP install native recall/capture, offline replay and 17 skills; `--with-mcp` adds the full toolset. Run `/reload` in Pi or restart OMP, then check `/agentmemory-status`. DSH installs MCP and the bundled capture plugin; restart DSH after connecting.
728
558
 
729
- </details>
559
+ Pi also supports an installable `@agentmemory/pi` package. See the [Pi package guide](integrations/pi/) for local installation and npm availability. Use one installation method per host.
730
560
 
731
- <details>
732
- <summary><b>Hermes Agent (paste this prompt)</b></summary>
561
+ Guides: [Pi](integrations/pi/), [Oh My Pi](integrations/omp/), [DSH](docs/dsh.md).
733
562
 
734
- ```text
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:
563
+ ### OpenClaw (ClawHub)
736
564
 
737
- mcp_servers:
738
- agentmemory:
739
- command: npx
740
- args: ["-y", "@agentmemory/mcp"]
565
+ agentmemory is listed on ClawHub: [clawhub.ai/plugins/agentmemory](https://clawhub.ai/plugins/agentmemory).
741
566
 
742
- memory:
743
- provider: agentmemory
567
+ ```bash
568
+ # 1. start the memory server in a separate terminal
569
+ npx -y @agentmemory/agentmemory@latest
744
570
 
745
- Verify with `curl http://localhost:3111/agentmemory/health`. Open http://localhost:3113 for the real-time viewer. For deeper 6-hook memory provider integration (pre-LLM context injection, turn capture, MEMORY.md mirroring, system prompt block), copy integrations/hermes from the agentmemory repo to ~/.hermes/plugins/agentmemory.
571
+ # 2. install the plugin from ClawHub
572
+ openclaw plugins install clawhub:agentmemory
746
573
  ```
747
574
 
748
- Full guide: [`integrations/hermes/`](integrations/hermes/)
575
+ Then select agentmemory as the memory plugin and allow it to read conversations in `~/.openclaw/openclaw.json`: set `plugins.slots.memory` to `"agentmemory"` and `plugins.entries.agentmemory.hooks.allowConversationAccess` to `true`. Without conversation access, capture is blocked. Restart OpenClaw and run `openclaw config validate`.
749
576
 
750
- </details>
577
+ `agentmemory connect openclaw` does the same from an installed package: it installs the plugin and skills, selects the memory slot and grants conversation access. Add `--with-mcp` for the full MCP tool set. Full guide: [`integrations/openclaw/`](integrations/openclaw/).
578
+
579
+ ### Hermes Agent (Hermes plugin catalog)
580
+
581
+ agentmemory is listed in the Hermes plugin catalog: [hermes-agent.nousresearch.com/marketplace/agentmemory](https://hermes-agent.nousresearch.com/marketplace/agentmemory).
582
+
583
+ ```bash
584
+ # 1. start the memory server in a separate terminal
585
+ npx -y @agentmemory/agentmemory@latest
586
+
587
+ # 2. install the reviewed catalog entry, then select it as the memory provider
588
+ hermes plugins install agentmemory
589
+ hermes memory setup
590
+ hermes memory status
591
+ ```
592
+
593
+ In `hermes memory setup`, select AgentMemory and enter the server URL and its secret. Hermes Desktop can install it from the link `hermes://plugin/install?catalog=agentmemory`. The catalog installs the commit that Hermes reviewed, so it can lag the latest npm release.
594
+
595
+ `agentmemory connect hermes` installs the provider and the bundled skills from the installed package instead. Add `--with-mcp` for the full MCP tool set. Full guide: [`integrations/hermes/`](integrations/hermes/).
751
596
 
752
597
  ### Other agents
753
598
 
754
599
  Start the memory server: `npx -y @agentmemory/agentmemory@latest`
755
600
 
756
- #### Native skills via `npx skills add` (50+ agents)
601
+ #### Native skills via `npx skills add`
757
602
 
758
- agentmemory ships 17 skills in the Claude-Code-style `<dir>/SKILL.md` format: 9 invocable action skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `lesson`, `commit-context`, `commit-history`, `session-history`) and 8 reference skills the agent loads on demand (`memory-discipline`, `agentmemory-mcp-tools`, `agentmemory-rest-api`, `agentmemory-config`, `agentmemory-agents`, `agentmemory-hooks`, `agentmemory-architecture`, `write-agentmemory-skill`). The reference skills carry data tables generated from source, so they never drift. The [`skills`](https://npmjs.com/package/skills) CLI by vercel-labs auto-installs them into the calling agent's native skill directory across 50+ agents (Claude Code, Cursor, Cline, Continue, Droid, Warp, Codex, Antigravity, Kiro, OpenCode, Goose, Roo, Trae, Windsurf, and more):
603
+ agentmemory ships 17 skills in the Claude-Code-style `<dir>/SKILL.md` format: 9 invocable action skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `lesson`, `commit-context`, `commit-history`, `session-history`) and 8 reference skills the agent loads on demand (`memory-discipline`, `agentmemory-mcp-tools`, `agentmemory-rest-api`, `agentmemory-config`, `agentmemory-agents`, `agentmemory-hooks`, `agentmemory-architecture`, `write-agentmemory-skill`). The reference skills carry data tables generated from source, so they never drift. The [`skills`](https://npmjs.com/package/skills) CLI by vercel-labs auto-installs them into the calling agent's native skill directory across supported agents (Claude Code, Cursor, Cline, Continue, Droid, Warp, Codex, Antigravity, Kiro, OpenCode, Goose, Roo, Trae, Windsurf, and more):
759
604
 
760
605
  ```bash
761
606
  npx skills add rohitg00/agentmemory -y # auto-detects the calling agent
@@ -765,8 +610,8 @@ npx skills add rohitg00/agentmemory -y -a '*' # install to every installed age
765
610
 
766
611
  This is **complementary** to `agentmemory connect <agent>`:
767
612
 
768
- - `agentmemory connect <agent>` writes the MCP server config so the tools are available.
769
- - `npx skills add rohitg00/agentmemory` installs the skills so the agent knows when to call them.
613
+ - `agentmemory connect <agent>` normally writes the MCP server config. Hermes, OpenClaw, Pi and Oh My Pi install their native integration and bundled skills by default; MCP is opt-in with `--with-mcp`.
614
+ - `npx skills add rohitg00/agentmemory` installs skills for agents without native bundled skills. Skip this step for Hermes, OpenClaw, Pi and Oh My Pi; their native connectors already install the skills.
770
615
 
771
616
  For the few agents the skills CLI doesn't cover yet (Zed v1.3.x and below), drop the 17 SKILL.md files under the agent's native skill directory yourself; the same format works everywhere.
772
617
 
@@ -790,61 +635,45 @@ The agentmemory entry is the **same MCP server block** across every host that us
790
635
  | Agent | Config file | Notes |
791
636
  |---|---|---|
792
637
  | **Cursor (MCP only)** | `~/.cursor/mcp.json` | Merge into `mcpServers`, or `agentmemory connect cursor`. One-click deeplink also available on the website. |
793
- | **Cursor (full plugin)** | `.cursor-plugin/` | Cursor Marketplace listing (submission in review) or Cursor Settings → Plugins → local checkout. Registers 7 auto-capture hooks (sessionStart, beforeSubmitPrompt, preToolUse, postToolUse, postToolUseFailure, stop, sessionEnd) + 17 skills + the MCP server, with `AGENTMEMORY_URL` / `AGENTMEMORY_SECRET` managed in Cursor's plugin dashboard. Works in the Cursor IDE and `cursor-agent` CLI; CLI print-mode prompts are backfilled from the session transcript at session end. |
638
+ | **Cursor (full plugin)** | `.cursor-plugin/` | Cursor Marketplace listing or Settings → Plugins → local checkout. Registers lifecycle hooks via a thin adapter that delegates to the canonical `plugin/scripts/*.mjs`, plus skills and MCP. The adapter resolves the workspace Cursor does not reliably report. See [Cursor](#cursor). Works in the Cursor IDE and `cursor-agent` CLI. |
794
639
  | **Claude Desktop** | `claude_desktop_config.json` (Application Support) | Merge into `mcpServers`. Restart Claude Desktop after editing. |
795
640
  | **Cline / Roo Code / Kilo Code** | Cline MCP settings (Settings UI → MCP Servers → Edit) | Same `mcpServers` block. |
796
- | **Devin CLI (MCP + hooks)** | `~/.config/devin/config.json` | `agentmemory connect devin` merges the MCP entry; `--with-hooks` adds six native auto-capture hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd) with Devin'"'"'s lowercase tool matchers. Verify with `devin mcp list` and `/hooks` inside devin. |
641
+ | **Devin CLI (MCP + hooks)** | `~/.config/devin/config.json` | `agentmemory connect devin` merges the MCP entry; `--with-hooks` adds six native auto-capture hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd) with Devin's lowercase tool matchers. Verify with `devin mcp list` and `/hooks` inside devin. |
797
642
  | **Devin CLI (full plugin)** | `plugin/.devin-plugin/` | `devin plugins install ./plugin` from a checkout registers all 17 skills as `/agentmemory:<skill>` slash commands plus the MCP server. Devin plugin hooks cannot fire `SessionStart`/`SessionEnd`, so pair it with `connect devin --with-hooks` for full session capture. |
798
643
  | **Devin (cloud)** | Settings → Connections → MCP servers | Add a custom MCP (STDIO): command `npx`, args `-y @agentmemory/mcp@latest`, env `AGENTMEMORY_URL` pointing at a network-reachable agentmemory deployment plus `AGENTMEMORY_SECRET` (cloud sessions cannot reach localhost — see [`deploy/`](deploy/)). Store the secret in Devin Secrets, then use "Test listing tools" to verify all 54 tools appear. |
799
644
  | **Gemini CLI** | `~/.gemini/settings.json` | `gemini mcp add agentmemory npx -y @agentmemory/mcp --scope user` (auto-merges). |
800
645
  | **GitHub Copilot CLI (MCP only)** | `~/.copilot/mcp-config.json` | `agentmemory connect copilot-cli` merges `mcpServers.agentmemory`; Copilot picks it up on next launch or `/mcp`. |
801
646
  | **GitHub Copilot CLI (full plugin)** | Copilot plugin install | `copilot plugin install rohitg00/agentmemory:plugin` for the plugin from the GitHub subdir. |
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/). |
647
+ | **OpenClaw** | `~/.openclaw/openclaw.json` | `openclaw plugins install clawhub:agentmemory` installs the [ClawHub listing](https://clawhub.ai/plugins/agentmemory); `agentmemory connect openclaw` installs the same plugin and also selects `plugins.slots.memory` and grants `hooks.allowConversationAccess`, without which capture is blocked. Add `--with-mcp` for the full tool set. See [`integrations/openclaw`](integrations/openclaw/). |
803
648
  | **Codex CLI (MCP only)** | `.codex/config.toml` | TOML shape: `codex mcp add agentmemory -- npx -y @agentmemory/mcp`, or add `[mcp_servers.agentmemory]` manually. |
649
+ | **Codex CLI (skills, official listing)** | [OpenAI plugin directory](https://chatgpt.com/plugins/plugins_6ac50a1b89948191906ff15c72357972) | Adds the 17 skills. Pair it with `agentmemory connect codex` for the MCP server. |
804
650
  | **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). |
805
651
  | **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}}}`. |
806
652
  | **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. |
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). |
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/). |
653
+ | **pi** | Active Pi agent directory, default `~/.pi/agent` | `agentmemory connect pi --with-mcp` installs native recall/capture, offline replay, 17 skills and the full MCP toolset. Or build `integrations/pi` and use `pi install ./integrations/pi`; after npm publication, `pi install npm:@agentmemory/pi`. Use one method and run `/reload`. See [setup and migration](integrations/pi/). |
654
+ | **Oh My Pi (OMP)** | Active OMP agent directory, default `~/.omp/agent/config.yml` | `agentmemory connect omp --with-mcp` installs native recall/capture, offline replay, 17 skills and the full MCP toolset. Restart OMP and run `/agentmemory-status`. See [setup, profiles and commands](integrations/omp/). |
655
+ | **Hermes Agent** | `$HERMES_HOME/config.yaml`, default `~/.hermes/config.yaml` | `hermes plugins install agentmemory` installs the [Hermes catalog entry](https://hermes-agent.nousresearch.com/marketplace/agentmemory) at its reviewed commit. `agentmemory connect hermes` installs the native provider and skills. Configure its scoped credentials with `hermes memory setup`. Add `--with-mcp` for the wider tool surface. See [setup and scope](integrations/hermes/). |
809
656
  | **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`. |
810
657
  | **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
658
  | **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). |
812
659
  | **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. |
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. |
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. |
815
- | **Continue.dev** | `~/.continue/config.yaml` (preferred) or `config.json` (legacy) | `agentmemory connect continue` creates `config.yaml` from scratch when neither exists, or modifies existing `config.json`. **If you already have `config.yaml`** the adapter prints the exact block to paste under `mcpServers:`; it won't silently rewrite your yaml because preserving comments and anchors safely needs a YAML parser the package doesn't ship. Continue uses array form (not object) for `mcpServers`. |
660
+ | **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 9 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `lesson`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. |
661
+ | **Cline (CLI)** | `~/.cline/data/settings/cline_mcp_settings.json` | `agentmemory connect cline` writes the standard `mcpServers` block. Set `CLINE_MCP_SETTINGS_PATH` to use another settings file. VS Code extension users: paste the same block via Cline Settings → MCP Servers → Edit JSON. |
662
+ | **Continue.dev** | `~/.continue/config.yaml` (preferred) or `config.json` (legacy) | `agentmemory connect continue` creates `config.yaml` from scratch when neither exists, or modifies existing `config.json`. **If you already have `config.yaml`** the adapter prints the exact block to paste under `mcpServers:`; it won't silently rewrite your yaml so your existing comments and anchors are preserved. Continue uses array form (not object) for `mcpServers`. |
816
663
  | **Zed** | `~/.config/zed/settings.json` | `agentmemory connect zed` writes under `context_servers` (Zed's key, NOT `mcpServers`). Remote MCP servers can be wired via `{"url": "..."}` instead. |
817
664
  | **Droid (Factory.ai)** | `~/.factory/mcp.json` | `agentmemory connect droid` writes the standard `mcpServers` block. Project-scoped overrides go in `<repo>/.factory/mcp.json`. Pass `--with-hooks` for native auto-capture. |
818
- | **DeepSeek Harness** | `$DSH_HOME/cordis.patch.yml` | `agentmemory connect dsh` appends an `@deepseek-ai/dsh-mcp-client` row to the home-level patch layer every Harness profile loads; tools register as `mcp__agentmemory__*`. Pass `--with-hooks` to also wire auto-capture: the bundled Claude Code hook scripts run through Harness's first-party `@deepseek-ai/dsh-hooks-claude-code` bridge (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop) via a manifest written to `$DSH_HOME/agentmemory.hooks.json`. Defaults to `~/.dsh` when `DSH_HOME` is unset. |
665
+ | **DeepSeek Harness** | `$DSH_HOME/cordis.patch.yml` | `agentmemory connect dsh` enables MCP tools. Add `--with-hooks` to load the native capture plugin bundled with AgentMemory. No separate plugin package is needed. [DSH](docs/dsh.md). |
819
666
  | **Goose** | Goose MCP settings UI | Same `mcpServers` block; use `goose configure` → Add Extension → MCP. Direct YAML edit at `~/.config/goose/config.yaml` is supported but the schema uses `extensions:` + `cmd` (not `mcpServers:` + `command`). |
820
- | **Aider** | n/a | Talk to the REST API directly: `curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}'`. |
821
- | **Any agent (32+)** | n/a | `npx skillkit install agentmemory` auto-detects the host and merges. |
667
+ | **Aider** | n/a | Use the [authenticated REST examples](#validate-a-fresh-install-and-restart-persistence) to save and search memory from scripts. |
668
+ | **Supported agents** | Skills only | `npx skills add rohitg00/agentmemory`; choose the skills and agents to install to. |
822
669
 
823
670
  **Sandboxed MCP clients** (Flatpak / Snap / restrictive containers) that can't reach the host's `localhost`: also set `"AGENTMEMORY_FORCE_PROXY": "1"` in the `env` block, and point `AGENTMEMORY_URL` at a route the sandbox can actually reach (e.g. your LAN IP).
824
671
 
825
- ### Programmatic access (Python / Rust / Node)
826
-
827
- agentmemory registers its core operations as iii functions (`mem::remember`, `mem::observe`, `mem::context`, `mem::smart-search`, `mem::forget`). Any language with an iii SDK can call them directly over `ws://localhost:49134`, with no separate REST client per language.
828
-
829
- ```bash
830
- pip install iii-sdk # Python
831
- cargo add iii-sdk # Rust
832
- npm install iii-sdk # Node
833
- ```
834
-
835
- ```python
836
- from iii import register_worker
837
-
838
- iii = register_worker("ws://localhost:49134")
839
- iii.connect()
672
+ ### Programmatic access
840
673
 
841
- iii.trigger({
842
- "function_id": "mem::smart-search",
843
- "payload": {"project": "demo", "query": "how do tokens refresh"},
844
- })
845
- ```
674
+ Use the [REST API](#api) from any language or the [MCP tools](#mcp-server) from an agent. REST requests use JSON and bearer authentication; see the [save and search example](#validate-a-fresh-install-and-restart-persistence).
846
675
 
847
- Worked example: [`examples/python/`](examples/python/) (quickstart + observation/recall flow). REST on `:3111` remains available for hosts without an iii runtime.
676
+ For direct runtime integration, see the [Python examples](examples/python/).
848
677
 
849
678
  ### From source
850
679
 
@@ -853,91 +682,33 @@ git clone https://github.com/rohitg00/agentmemory.git && cd agentmemory
853
682
  npm install && npm run build && npm start
854
683
  ```
855
684
 
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`.
857
-
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.
859
-
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`
861
- - **macOS x64:** swap `aarch64-apple-darwin` for `x86_64-apple-darwin`
862
- - **Linux x64:** swap for `x86_64-unknown-linux-gnu`
863
- - **Linux arm64:** swap for `aarch64-unknown-linux-gnu`
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.
867
-
868
- Or use Docker (the bundled `docker-compose.yml` pulls `iiidev/iii:0.22.1`). Full docs: [iii.dev/docs](https://iii.dev/docs).
685
+ `npm start` launches the same local server as the installed CLI. Dependencies for automatic setup are listed under [Install](#install); the API and viewer bind to `127.0.0.1`.
869
686
 
870
687
  ### Windows
871
688
 
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.
689
+ agentmemory runs on Windows 10/11. WSL2 follows the Linux path and can install the pinned engine automatically. Native Windows requires the pinned iii-engine v0.25.0 binary installed manually; download the matching archive from the [iii v0.25.0 release page](https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.25.0), verify its checksum, and place `iii.exe` on `PATH` (for example `%USERPROFILE%\.local\bin\iii.exe`). The CLI does not extract the Windows ZIP automatically.
873
690
 
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.
691
+ Native Windows automated MCP wiring supports only `agentmemory connect copilot-cli`. For other native Windows agents, use the manual MCP block from [Other agents](#other-agents). Run `connect` inside WSL only when the target agent is installed in that same WSL environment.
875
692
 
876
- **Option A: prebuilt Windows binary (recommended)**
877
-
878
- ```powershell
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)
882
- # 2. Download iii-x86_64-pc-windows-msvc.zip
883
- # (or iii-aarch64-pc-windows-msvc.zip if you're on an ARM machine)
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
887
- # 4. Verify:
888
- & "$HOME\.agentmemory\bin\iii.exe" --version
889
- # Should print: 0.22.1
890
-
891
- # 5. Then run agentmemory as usual:
892
- npx -y @agentmemory/agentmemory@latest
893
- ```
894
-
895
- **Option B: Docker Desktop**
896
-
897
- ```powershell
898
- # 1. Install Docker Desktop for Windows
899
- # 2. Start Docker Desktop and make sure the engine is running
900
- # 3. Select Docker explicitly and run agentmemory:
901
- $env:AGENTMEMORY_USE_DOCKER = "1"
902
- npx -y @agentmemory/agentmemory@latest
903
- ```
904
-
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:
693
+ **Standalone MCP only (no engine).** If you only need MCP tools and do not need the REST API, viewer, or runtime services:
906
694
 
907
695
  ```powershell
908
696
  npx -y @agentmemory/agentmemory@latest mcp
909
- # or via the shim package:
697
+ # or
910
698
  npx -y @agentmemory/mcp
911
699
  ```
912
700
 
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:
914
-
915
- | Symptom | Fix |
916
- |---|---|
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 |
918
- | `Could not start iii-engine` | Neither `iii.exe` nor Docker is installed. See Option A or B above |
919
- | Port conflict | `netstat -ano \| findstr :3111` to see what's bound, then kill it or use `--port <N>` |
920
- | Docker fallback skipped even though Docker is installed | Make sure Docker Desktop is actually running (system tray icon) |
921
-
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`.
701
+ **Diagnostics:** Run `agentmemory doctor` or restart with `--verbose`. Use `--port <N>` or `--instance <N>` if the default ports are occupied. See the [upgrade guide](docs/upgrades/iii-0.25.md) for runtime compatibility and recovery.
923
702
 
924
703
  ---
925
704
 
926
705
  <h2 id="deploy">Deploy</h2>
927
706
 
928
- One-click templates for managed hosts. Each one ships a self-contained
929
- Dockerfile that pulls `@agentmemory/agentmemory` from npm and copies
930
- the iii engine binary in from the official `iiidev/iii` Docker Hub
931
- image; no pre-built agentmemory image required. Persistent storage
932
- mounts at `/data`; the first-boot entrypoint overwrites the
933
- npm-bundled iii config (which binds `127.0.0.1`) with a deploy-tuned
934
- one that binds `0.0.0.0` and uses absolute `/data` paths, generates
935
- the HMAC secret, then drops privileges from `root` to `node` via
936
- `gosu` before exec'ing the agentmemory CLI.
707
+ Self-host with Docker Compose or the platform templates below. Persistent memory and credentials live on the `/data` volume. Back up and reuse that volume when upgrading. See the [deployment guide](deploy/README.md) for authentication, network access, backups and migration.
937
708
 
938
709
  <p>
939
- <a href="https://fly.io/launch?repo=https://github.com/rohitg00/agentmemory&path=deploy/fly"><img src="https://img.shields.io/badge/Deploy%20to-fly.io-8b5cf6?style=for-the-badge&logo=fly.io&logoColor=white" alt="Deploy to fly.io" /></a>
940
- <a href="https://railway.com/new/template?template=https%3A%2F%2Fgithub.com%2Frohitg00%2Fagentmemory&rootDirectory=deploy%2Frailway"><img src="https://img.shields.io/badge/Deploy%20to-Railway-0B0D0E?style=for-the-badge&logo=railway&logoColor=white" alt="Deploy to Railway" /></a>
710
+ <a href="https://fly.io/launch?repo=https://github.com/rohitg00/agentmemory"><img src="https://img.shields.io/badge/Deploy%20to-fly.io-8b5cf6?style=for-the-badge&logo=fly.io&logoColor=white" alt="Deploy to fly.io" /></a>
711
+ <a href="https://railway.com/new/template?template=https%3A%2F%2Fgithub.com%2Frohitg00%2Fagentmemory"><img src="https://img.shields.io/badge/Deploy%20to-Railway-0B0D0E?style=for-the-badge&logo=railway&logoColor=white" alt="Deploy to Railway" /></a>
941
712
  </p>
942
713
 
943
714
  Render's one-click deploy button requires `render.yaml` at the repository root, which we deliberately keep clean. Use the Render Blueprint flow documented in [`deploy/render/`](./deploy/render/README.md) to point at the in-repo blueprint manually.
@@ -955,41 +726,39 @@ cost floors) live in [`deploy/`](./deploy/README.md):
955
726
  own VPS via [Coolify](https://coolify.io/self-hosted); same Docker
956
727
  Compose stack, you own the host and the data.
957
728
 
958
- Only port `3111` is published. The viewer on `3113` stays bound to
959
- loopback inside the container; every template's README documents the
960
- SSH-tunnel pattern for reaching it.
729
+ REST uses port `3111`; the viewer uses `3113`. Keep both private or protect them with authentication and TLS. Platform-specific exposure settings and [legacy Docker migration](deploy/README.md#migrating-from-the-legacy-cli-docker-mode) are covered in the deployment guide.
961
730
 
962
731
  ---
963
732
 
964
733
  <h2 id="why-agentmemory"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-why.svg"><img src="assets/tags/section-why.svg" alt="Why agentmemory" height="32" /></picture></h2>
965
734
 
966
- Every coding agent forgets everything when the session ends, and each new session starts with you re-explaining your stack. agentmemory runs in the background and removes that step.
735
+ Project knowledge gets scattered across chats and instruction files. AgentMemory makes past decisions, fixes and lessons searchable from the agent you are using now.
967
736
 
968
737
  ```text
969
738
  Session 1: "Add auth to the API"
970
739
  Agent writes code, runs tests, fixes bugs
971
- agentmemory silently captures every tool use
972
- Session ends -> observations compressed into structured memory
740
+ Connected hooks capture supported tool events
741
+ Observations become searchable project history
973
742
 
974
743
  Session 2: "Now add rate limiting"
975
- Agent already knows:
744
+ Agent recalls:
976
745
  - Auth uses JWT middleware in src/middleware/auth.ts
977
746
  - Tests in test/auth.test.ts cover token validation
978
747
  - You chose jose over jsonwebtoken for Edge compatibility
979
- Zero re-explaining. Starts working immediately.
748
+ Continues with the earlier decisions in context.
980
749
  ```
981
750
 
982
751
  ### vs built-in agent memory
983
752
 
984
- Every AI coding agent ships with built-in memory: Claude Code has `MEMORY.md`, Cursor has notepads, Cline has memory bank. These work like sticky notes. agentmemory is the searchable database behind the sticky notes.
753
+ Agent instructions and memory files remain useful for stable project guidance. AgentMemory adds searchable session history, source-linked memories and coordination across connected agents.
985
754
 
986
755
  | | Built-in (CLAUDE.md) | agentmemory |
987
756
  |---|---|---|
988
- | Scale | 200-line cap | Unlimited |
757
+ | Upkeep | Manually curated instructions | Indexed session history and memories |
989
758
  | Search | Loads everything into context | BM25 + vector + graph (top-K only) |
990
- | Token cost | 22K+ at 240 observations | ~1,900 tokens (92% less) |
759
+ | Context budget | Depends on the files included | Configurable recall budget with source expansion |
991
760
  | Cross-agent | Per-agent files | MCP + REST (any agent) |
992
- | Coordination | None | Leases, signals, actions, routines |
761
+ | Coordination | Depends on the agent | Leases, signals, actions, routines |
993
762
  | Observability | Read files manually | Real-time viewer on :3113 |
994
763
 
995
764
  ---
@@ -1000,7 +769,7 @@ Every AI coding agent ships with built-in memory: Claude Code has `MEMORY.md`, C
1000
769
 
1001
770
  ```text
1002
771
  PostToolUse hook fires
1003
- -> SHA-256 dedup (5min window)
772
+ -> Stable event ID, durable capture inbox, offline spool when unavailable
1004
773
  -> Privacy filter (strip secrets, API keys)
1005
774
  -> Store raw observation
1006
775
  -> Synthetic compression by default
@@ -1009,15 +778,15 @@ PostToolUse hook fires
1009
778
  -> Index in BM25, plus vectors when enabled
1010
779
 
1011
780
  Stop / SessionEnd hook fires
1012
- -> Summarize session
781
+ -> Incremental summary when new observations are available
1013
782
  -> Knowledge graph extraction (if GRAPH_EXTRACTION_ENABLED=true)
1014
- -> Slot reflection (if SLOT_REFLECT_ENABLED=true)
783
+ -> Slot reflection (if AGENTMEMORY_SLOTS=true and AGENTMEMORY_REFLECT=true)
1015
784
 
1016
785
  SessionStart hook fires
1017
786
  -> Load project profile (top concepts, files, patterns)
1018
787
  -> Hybrid search (BM25 + vector + graph)
1019
788
  -> Token budget (default: 2000 tokens)
1020
- -> Inject into conversation
789
+ -> Inject context when enabled by the integration
1021
790
  ```
1022
791
 
1023
792
  ### 4-Tier Memory Consolidation
@@ -1035,6 +804,8 @@ Memories decay over time (Ebbinghaus curve). Frequently accessed memories streng
1035
804
 
1036
805
  ### What Gets Captured
1037
806
 
807
+ The table below describes the Claude Code hook surface. Other integrations capture the events their host provides; see the individual setup guides. Automatic context injection through the shared hooks is opt-in with `AGENTMEMORY_INJECT_CONTEXT=true`.
808
+
1038
809
  | Hook | Captures |
1039
810
  |------|----------|
1040
811
  | `SessionStart` | Project path, session ID |
@@ -1044,14 +815,14 @@ Memories decay over time (Ebbinghaus curve). Frequently accessed memories streng
1044
815
  | `PostToolUseFailure` | Error context |
1045
816
  | `PreCompact` | Re-injects memory before compaction |
1046
817
  | `SubagentStart/Stop` | Sub-agent lifecycle |
1047
- | `Stop` | End-of-session summary |
818
+ | `Stop` | Assistant's final reply of each turn (privacy-filtered) |
1048
819
  | `SessionEnd` | Session complete marker |
1049
820
 
1050
821
  ### Key Capabilities
1051
822
 
1052
823
  | Capability | Description |
1053
824
  |---|---|
1054
- | **Automatic capture** | Every tool use recorded via hooks, no manual effort |
825
+ | **Automatic capture** | Supported session and tool events recorded by native integrations |
1055
826
  | **Semantic search** | BM25 + vector + knowledge graph with RRF fusion |
1056
827
  | **Memory evolution** | Versioning, supersession, relationship graphs |
1057
828
  | **Recall hygiene** | Superseded memory versions leave the search indexes; the version chain in KV keeps full history |
@@ -1061,12 +832,16 @@ Memories decay over time (Ebbinghaus curve). Frequently accessed memories streng
1061
832
  | **Auto-forgetting** | TTL expiry, contradiction detection, importance eviction |
1062
833
  | **Privacy first** | API keys, secrets, `<private>` tags stripped before storage |
1063
834
  | **Self-healing** | Circuit breaker, provider fallback chain, health monitoring |
1064
- | **Claude bridge** | Bi-directional sync with MEMORY.md |
835
+ | **Claude bridge** | Read MEMORY.md and export project memories without replacing existing files |
1065
836
  | **Knowledge graph** | Entity extraction + BFS traversal |
1066
837
  | **Team memory** | Namespaced shared + private across team members |
1067
838
  | **Citation provenance** | Trace any memory back to source observations |
1068
839
  | **Git snapshots** | Version, rollback, and diff memory state |
1069
840
 
841
+ The Claude bridge is opt-in: set `CLAUDE_MEMORY_BRIDGE=true` and `CLAUDE_PROJECT_PATH` to your project directory, then restart agentmemory. `memory_claude_bridge_sync` exports only the latest memories scoped to that project, excluding unscoped memories. The read direction continues to read existing `MEMORY.md` content.
842
+
843
+ Export creates `MEMORY.md` only when it is absent. Existing files are preserved, including previous generated exports and edits made by you or Claude Code. Identical content returns `changed: false`; different content returns an error. To regenerate deliberately, move the existing file to a backup location (or remove it if no longer needed), then run the tool again. See the bridge settings in [`.env.example`](.env.example).
844
+
1070
845
  ---
1071
846
 
1072
847
  <h2 id="search"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-search.svg"><img src="assets/tags/section-search.svg" alt="Search" height="32" /></picture></h2>
@@ -1083,7 +858,9 @@ Fused with Reciprocal Rank Fusion (RRF, k=60) and session-diversified (max 3 res
1083
858
 
1084
859
  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
860
 
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.
861
+ Filtered `memory_recall` expands its ranked candidate window until it fills the requested result limit, exhausts the candidate source, or reaches 1,000 candidates. This bound limits work for queries with many unrelated matches. Results can contain fewer items when qualifying records rank below that budget.
862
+
863
+ 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. For older documents without vectors, `AGENTMEMORY_VECTOR_BACKFILL=all` opts into a bounded backfill at startup, capped by `AGENTMEMORY_VECTOR_BACKFILL_MAX` (500). Keep the opt-in set across restarts to process more documents. See [source and vector recovery](docs/reliability/source-and-vector-recovery.md). `/agentmemory/status` and the viewer show the pending log size and the backfill state. Keyless installs write nothing.
1087
864
 
1088
865
  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.
1089
866
 
@@ -1095,13 +872,13 @@ Keyless installs disable vector embeddings: `mem::search` uses BM25, while `smar
1095
872
  EMBEDDING_PROVIDER=local
1096
873
  ```
1097
874
 
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.
875
+ 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 embedding providers run only when `EMBEDDING_PROVIDER` names one of them (`gemini`, `openai`, `voyage`, `cohere`, `openrouter`) and its key is set. A key on its own never turns on remote embeddings.
1099
876
 
1100
877
  | Provider | Model | Cost | Notes |
1101
878
  |---|---|---|---|
1102
- | **Local (recommended opt-in)** | `all-MiniLM-L6-v2` | Free | On-device after the first model download, +8pp recall over BM25-only |
879
+ | **Local (recommended opt-in)** | `all-MiniLM-L6-v2` | Free | On-device after the first model download |
1103
880
  | 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)) |
1104
- | OpenAI | `text-embedding-3-small` | $0.02/1M | Highest quality |
881
+ | OpenAI | `text-embedding-3-small` | [Provider pricing](https://openai.com/api/pricing/) | Remote embeddings |
1105
882
  | Voyage AI | `voyage-code-3` | Paid | Optimized for code |
1106
883
  | Cohere | `embed-english-v3.0` | Free trial | General purpose |
1107
884
  | OpenRouter | Any model | Varies | Multi-model proxy |
@@ -1112,11 +889,11 @@ The normal npm install includes the optional `@huggingface/transformers` runtime
1112
889
 
1113
890
  54 tools, 6 resources, 3 prompts, and 17 skills.
1114
891
 
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`.
892
+ > **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 connect to a self-hosted server) and set `AGENTMEMORY_URL=http://localhost:3111`.
1116
893
 
1117
894
  ### 54 Tools
1118
895
 
1119
- Three tool surfaces, smallest to largest: `AGENTMEMORY_TOOLS=core` trims visibility to 8 essentials (`memory_save`, `memory_recall`, `memory_consolidate`, `memory_smart_search`, `memory_sessions`, `memory_diagnose`, `memory_lesson_save`, `memory_reflect`); the base set below is the registry's 14 foundational tools; the default (`AGENTMEMORY_TOOLS=all`) exposes all 54.
896
+ Three tool surfaces, smallest to largest: `AGENTMEMORY_TOOLS=core` trims visibility to 8 essentials (`memory_save`, `memory_recall`, `memory_consolidate`, `memory_smart_search`, `memory_sessions`, `memory_diagnose`, `memory_lesson_save`, `memory_reflect`); the base set below is the registry's 14 foundational tools; the default (`AGENTMEMORY_TOOLS=all`) exposes all 54, minus the 6 `memory_slot_*` tools until `AGENTMEMORY_SLOTS=true`.
1120
897
 
1121
898
  <details>
1122
899
  <summary>Base tools (14)</summary>
@@ -1133,7 +910,7 @@ Three tool surfaces, smallest to largest: `AGENTMEMORY_TOOLS=core` trims visibil
1133
910
  | `memory_vision_search` | Search image observations |
1134
911
  | `memory_timeline` | Chronological observations |
1135
912
  | `memory_profile` | Project profile (concepts, files, patterns) |
1136
- | `memory_export` | Export all memory data |
913
+ | `memory_export` | Export memory data, in pages or selected collections on a large store |
1137
914
  | `memory_relations` | Query relationship graph |
1138
915
  | `memory_commit_lookup` | Sessions behind a git commit |
1139
916
  | `memory_commits` | Commits recorded for a session |
@@ -1150,7 +927,7 @@ Three tool surfaces, smallest to largest: `AGENTMEMORY_TOOLS=core` trims visibil
1150
927
  | `memory_relations` | Query relationship graph |
1151
928
  | `memory_graph_query` | Knowledge graph traversal |
1152
929
  | `memory_consolidate` | Run 4-tier consolidation |
1153
- | `memory_claude_bridge_sync` | Sync with MEMORY.md |
930
+ | `memory_claude_bridge_sync` | Read MEMORY.md or create a project export, preserving existing files |
1154
931
  | `memory_team_share` | Share with team members |
1155
932
  | `memory_team_feed` | Recent shared items |
1156
933
  | `memory_audit` | Audit trail of operations |
@@ -1252,7 +1029,7 @@ cp plugin/opencode/commands/*.md ~/.config/opencode/commands/
1252
1029
 
1253
1030
  <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>
1254
1031
 
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.
1032
+ Auto-starts on port `3113`. The viewer loads one snapshot when it connects (`GET /agentmemory/viewer/snapshot`) and then applies live events over SSE at `/agentmemory/viewer/events` on the REST worker: 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
1033
 
1257
1034
  - **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
1035
  - **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.
@@ -1265,188 +1042,7 @@ Auto-starts on port `3113`. The viewer loads one snapshot when it connects (`GET
1265
1042
  open http://localhost:3113
1266
1043
  ```
1267
1044
 
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'`).
1269
-
1270
- ---
1271
-
1272
- <h2 id="iii-console"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-viewer.svg"><img src="assets/tags/section-viewer.svg" alt="iii Console" height="32" /></picture></h2>
1273
-
1274
- The viewer at `:3113` shows what your agent **remembered**. The [iii console](https://iii.dev/docs/console) shows what your agent **did**: every memory op as an OpenTelemetry trace, every KV entry editable, every function invocable, every stream tappable. Two windows on the same memory: one product-shaped, one engine-shaped.
1275
-
1276
- Watch a `memory_smart_search` fire and see the BM25 scan → embedding lookup → RRF fusion → reranker as a waterfall. Edit a stuck consolidation timer in the KV browser. Replay a `PostToolUse` hook with a tweaked payload. Pin the WebSocket stream and watch observations land live.
1277
-
1278
- agentmemory ships this for free because every function call and trigger fires through iii; nothing custom, nothing to instrument.
1279
-
1280
- <p align="center">
1281
- <img src="assets/iii-console/workers.png" alt="iii console Workers page: connected workers including agentmemory instances with live function counts and runtime metadata" width="720" />
1282
- <br/>
1283
- <em>Workers page: every connected worker, including agentmemory itself, with PID, function count, runtime, and last-seen.</em>
1284
- </p>
1285
-
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.
1287
-
1288
- **Launch alongside agentmemory:**
1289
-
1290
- ```bash
1291
- agentmemory console
1292
- ```
1293
-
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.
1295
-
1296
- The same thing by hand, useful when `agentmemory` is not on PATH:
1297
-
1298
- ```bash
1299
- ~/.agentmemory/bin/iii console --port 3114 \
1300
- --engine-port 3111 \
1301
- --ws-port 3112 \
1302
- --bridge-port 49134
1303
- ```
1304
-
1305
- **What you can do from the console:**
1306
-
1307
- | Page | Use it to |
1308
- |------|-----------|
1309
- | **Workers** | See every connected worker and its live metrics, including the agentmemory worker itself. |
1310
- | **Functions** | Invoke any of agentmemory's functions directly with a JSON payload; handy for testing `memory.recall`, `memory.consolidate`, `graph.query` without wiring a client. |
1311
- | **Triggers** | Replay HTTP, cron, event, and state triggers: fire the consolidation cron manually, retry an HTTP route, emit a state change. |
1312
- | **States** | KV browser with full CRUD over sessions, memory slots, lifecycle timers, and the embeddings index; edit values in place. |
1313
- | **Streams** | Live WebSocket monitor for memory writes, hook events, and observation updates as they flow through iii streams. |
1314
- | **Queues** | Durable queue topics + dead-letter management. Replay or drop failed embedding / compression jobs. |
1315
- | **Traces** | OpenTelemetry waterfall / flame / service-breakdown views. Filter by `trace_id` to see exactly which functions, DB calls, and embedding requests a single `memory.search` produced. |
1316
- | **Logs** | Structured OTEL logs filtered and correlated to trace/span IDs. |
1317
- | **Config** | Runtime configuration: see exactly which workers, providers, and ports your engine is running with. |
1318
- | **Flow** | (Optional, `--enable-flow`) Interactive architecture graph of every worker, trigger, and stream. |
1319
-
1320
- <p align="center">
1321
- <img src="assets/iii-console/traces-waterfall.png" alt="iii console trace waterfall view showing per-span duration" width="720" />
1322
- <br/>
1323
- <em>Traces: waterfall / flame / service breakdown for every memory operation.</em>
1324
- </p>
1325
-
1326
- **Traces are already on:**
1327
-
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.
1329
-
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.
1331
-
1332
- > **Heads-up:** no auth is enforced on the console itself; keep it bound to `127.0.0.1` (the default) and never expose it publicly.
1333
-
1334
- ---
1335
-
1336
- <h2 id="powered-by-iii"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-architecture.svg"><img src="assets/tags/section-architecture.svg" alt="Powered by iii" height="32" /></picture></h2>
1337
-
1338
- agentmemory is **already a running [iii](https://iii.dev) instance**. Three primitives (worker, function, trigger) compose the runtime; KV state, streams, and OTEL traces come from iii-state, iii-stream, and iii-observability workers that ship with iii. You didn't install Postgres, Redis, Express, pm2, or Prometheus, because iii replaces them.
1339
-
1340
- That means one more command extends agentmemory with an entire new capability.
1341
-
1342
- ### Extend agentmemory with more workers
1343
-
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.
1345
-
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
- ```
1353
-
1354
- | Worker | What you get on top of agentmemory |
1355
- |---|---|
1356
- | [`database`](https://workers.iii.dev/workers/database) | SQL-backed state adapter when you outgrow the in-memory KV defaults |
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 |
1358
- | [`mcp`](https://workers.iii.dev/workers/mcp) | Stand up extra MCP servers next to agentmemory's, share the same engine |
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
-
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.
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
-
1438
- ### What iii replaces
1439
-
1440
- | Traditional stack | agentmemory uses |
1441
- |---|---|
1442
- | Express.js / Fastify | iii HTTP Triggers |
1443
- | SQLite / Postgres + pgvector | iii KV State + in-memory vector index |
1444
- | SSE / Socket.io | iii Streams (WebSocket) |
1445
- | pm2 / systemd | iii engine worker supervision |
1446
- | Prometheus / Grafana | iii OTEL + health monitor |
1447
- | Custom plugin systems | `iii worker add <name>` |
1448
-
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.
1045
+ The viewer server binds to `127.0.0.1` by default and attaches the server secret when it forwards requests to the REST API. On a non-loopback bind, the HTML shell remains public but every proxy request requires the bearer; the viewer prompts for it and stores it in session storage. Configure explicit host/origin allowlists and TLS before exposing a viewer. 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'`).
1450
1046
 
1451
1047
  ---
1452
1048
 
@@ -1454,17 +1050,17 @@ fi
1454
1050
 
1455
1051
  ### LLM Providers
1456
1052
 
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`.
1053
+ agentmemory sends session content to an LLM only after you select a provider with `AGENTMEMORY_LLM_PROVIDER`, or turn on the Claude Agent SDK fallback with `AGENTMEMORY_ALLOW_AGENT_SDK=true`. A key that exists in your environment for another tool is never enough. A selected provider makes LLM-backed operations available (session summaries, consolidation, reflection), but it does not enable LLM-written observation compression on its own. That path also requires `AGENTMEMORY_AUTO_COMPRESS=true`.
1458
1054
 
1459
1055
  | Provider | Config | Notes |
1460
1056
  |----------|--------|-------|
1461
1057
  | **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. |
1462
- | Anthropic API | `ANTHROPIC_API_KEY` | Per-token billing |
1463
- | MiniMax | `MINIMAX_API_KEY` | Anthropic-compatible |
1464
- | Gemini | `GEMINI_API_KEY` | Also enables embeddings |
1465
- | OpenRouter | `OPENROUTER_API_KEY` | Any model |
1466
- | OpenAI API | `OPENAI_API_KEY` | Default `gpt-5.6-luna`, override with `OPENAI_MODEL` |
1467
- | **Local (Ollama / LM Studio / vLLM / llama.cpp)** | `OPENAI_API_KEY=local` + `OPENAI_BASE_URL=http://localhost:11434/v1` (Ollama) or `http://localhost:1234/v1` (LM Studio) + `OPENAI_MODEL=<your model>` | Anything OpenAI-API-compatible. Zero cost, runs on your hardware. See [Local models](#local-models-ollama--lm-studio--vllm) below. |
1058
+ | Anthropic API | `AGENTMEMORY_LLM_PROVIDER=anthropic` + `ANTHROPIC_API_KEY` | Per-token billing |
1059
+ | MiniMax | `AGENTMEMORY_LLM_PROVIDER=minimax` + `MINIMAX_API_KEY` | Anthropic-compatible |
1060
+ | Gemini | `AGENTMEMORY_LLM_PROVIDER=gemini` + `GEMINI_API_KEY` | Gemini embeddings need `EMBEDDING_PROVIDER=gemini` as well |
1061
+ | OpenRouter | `AGENTMEMORY_LLM_PROVIDER=openrouter` + `OPENROUTER_API_KEY` | Any model |
1062
+ | OpenAI API | `AGENTMEMORY_LLM_PROVIDER=openai` + `OPENAI_API_KEY` | Default `gpt-5.6-luna`, override with `OPENAI_MODEL` |
1063
+ | **Local (Ollama / LM Studio / vLLM / llama.cpp)** | `AGENTMEMORY_LLM_PROVIDER=openai` + `OPENAI_API_KEY=local` + `OPENAI_BASE_URL=http://localhost:11434/v1` (Ollama) or `http://localhost:1234/v1` (LM Studio) + `OPENAI_MODEL=<your model>` | Anything OpenAI-API-compatible. Zero cost, runs on your hardware. See [Local models](#local-models-ollama--lm-studio--vllm) below. |
1468
1064
  | Claude subscription fallback | `AGENTMEMORY_ALLOW_AGENT_SDK=true` | Opt-in only. Spawns `@anthropic-ai/claude-agent-sdk` sessions; it used to cause unbounded Stop-hook recursion, so it is no longer the default. |
1469
1065
 
1470
1066
  ### Local models (Ollama / LM Studio / vLLM)
@@ -1480,6 +1076,7 @@ ollama serve
1480
1076
 
1481
1077
  ```env
1482
1078
  # ~/.agentmemory/.env
1079
+ AGENTMEMORY_LLM_PROVIDER=openai
1483
1080
  OPENAI_API_KEY=ollama # any non-empty string; Ollama ignores it
1484
1081
  OPENAI_BASE_URL=http://localhost:11434/v1
1485
1082
  OPENAI_MODEL=qwen3:8b
@@ -1491,6 +1088,7 @@ Open LM Studio → Local Server tab → Start Server. Pick any chat model from t
1491
1088
 
1492
1089
  ```env
1493
1090
  # ~/.agentmemory/.env
1091
+ AGENTMEMORY_LLM_PROVIDER=openai
1494
1092
  OPENAI_API_KEY=lmstudio # any non-empty string; LM Studio ignores it
1495
1093
  OPENAI_BASE_URL=http://localhost:1234/v1
1496
1094
  OPENAI_MODEL=qwen3-8b # match the model name from LM Studio
@@ -1516,24 +1114,9 @@ Local embeddings ship as an optional dependency but are not enabled by default.
1516
1114
 
1517
1115
  ### Cost-aware model selection
1518
1116
 
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.
1520
-
1521
- | Tier | Model | Input / 1M | Output / 1M | Cost for the captured 35h | Notes |
1522
- |------|-------|------------|-------------|---------------------------|-------|
1523
- | Recommended | `deepseek/deepseek-v4-flash-0731` | $0.07 | $0.14 | ~$0.07 (est.) | Latest DeepSeek; cheapest recommended pick for compression workloads. |
1524
- | Recommended | `deepseek/deepseek-v4-pro` | $0.435 | $0.87 | ~$0.46 | Solid compression + summarization quality at ~10× lower cost than Sonnet. |
1525
- | Recommended | `qwen/qwen3-coder` | $0.45 | $1.80 | ~$0.55 | Strong code reasoning if your sessions are heavily code-shaped. |
1526
- | Premium | `anthropic/claude-sonnet-5` | $3.00 | $15.00 | ~$5.02 (est.) | Same list price as the measured Sonnet 4.6 run; $2/$10 intro pricing through 2026-08-31. |
1527
- | Premium | `openai/gpt-5.6-sol` | $5.00 | $30.00 | ~$9 (est.) | Flagship tier; expensive for always-on background work. |
1528
- | Avoid | `anthropic/claude-opus-5` | $5.00 | $25.00 | ~$8.40 (est.) | Flagship-class model; overspend for compression. |
1529
-
1530
- Measured rows come from the captured run; (est.) rows scale the same token mix by each model's list price.
1531
-
1532
- agentmemory prints a runtime warning when `OPENROUTER_MODEL` matches a premium-tier pattern. Set `AGENTMEMORY_SUPPRESS_COST_WARNING=1` to silence once you've made an informed choice.
1533
-
1534
- Quality vs cost tradeoff for memory work: compression is a summarization task with relatively loose quality bars (the agent re-reads the summary, not the user). DeepSeek V4 Flash / V4 Pro / Qwen3-Coder land within rounding error of Sonnet on this task while costing 10-70× less. Save the premium-tier models for queries you read directly.
1117
+ Start keyless for capture and keyword recall. Enable `EMBEDDING_PROVIDER=local` for on-device semantic search after the initial model download. LLM-written compression requires a provider and `AGENTMEMORY_AUTO_COMPRESS=true`; it can make a request for each captured observation, so check your provider's current pricing before enabling it.
1535
1118
 
1536
- Sources: [OpenRouter pricing for Claude Sonnet 5](https://openrouter.ai/anthropic/claude-sonnet-5), [DeepSeek V4 Flash](https://openrouter.ai/deepseek/deepseek-v4-flash-0731), [DeepSeek pricing notes](https://api-docs.deepseek.com/quick_start/pricing/).
1119
+ The viewer and `agentmemory status` show the active providers. Local OpenAI-compatible servers work with the same configuration shape as hosted providers.
1537
1120
 
1538
1121
  ### Multi-agent memory (`AGENT_ID` + `AGENTMEMORY_AGENT_SCOPE`)
1539
1122
 
@@ -1563,39 +1146,24 @@ When `AGENT_ID` is unset, memory remains unscoped (legacy behavior, no tags, no
1563
1146
 
1564
1147
  ### Ports
1565
1148
 
1566
- agentmemory + iii-engine bind four ports by default. If a restart fails with `port in use`, this table tells you which process to look for.
1149
+ The API and viewer bind to loopback by default.
1567
1150
 
1568
- | Port | Process | Purpose | Env override |
1569
- |------|---------|---------|--------------|
1570
- | `3111` | agentmemory | REST API + MCP HTTP + `/agentmemory/health` + `/agentmemory/livez` | `III_REST_PORT` |
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.
1151
+ | Port | Purpose | Env override |
1152
+ |---|---|---|
1153
+ | `3111` | REST API, MCP HTTP and live viewer events | `III_REST_PORT` |
1154
+ | `3113` | Viewer UI | `III_VIEWER_PORT` |
1576
1155
 
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.
1156
+ `--port <N>` sets the REST port and defaults the viewer to `N+2`. Use `--instance N` for a separate runtime. Internal runtime listeners must remain private; see the [deployment guide](deploy/README.md) before exposing the service remotely.
1578
1157
 
1579
- Stale-process cleanup when ports stay bound after a crashed run:
1158
+ ### Storage backend: file (default) vs Redis
1580
1159
 
1581
- ```bash
1582
- # macOS / Linux — find whatever is on each port and kill it
1583
- lsof -i :3111,3112,3113,49134
1584
- pkill -f agentmemory || true
1585
- pkill -f 'iii ' || true
1586
-
1587
- # Windows
1588
- netstat -ano | findstr ":3111 :3112 :3113 :49134"
1589
- taskkill /F /PID <pid>
1590
- ```
1591
-
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.
1160
+ The default file store needs no separate database service. Redis is optional with `AGENTMEMORY_STATE_BACKEND=redis` and `AGENTMEMORY_REDIS_URL`. Changing backends does not copy existing memories. Follow the [storage and backup guide](docs/reliability/state-storage.md) for persistence settings, Redis limitations and authenticated export/import.
1593
1161
 
1594
1162
  ### Config File
1595
1163
 
1596
- Put agentmemory runtime configuration in `~/.agentmemory/.env` instead of exporting variables in every shell. If the viewer shows a setup hint like `export ANTHROPIC_API_KEY=...`, copy it into this file as `ANTHROPIC_API_KEY=...` without the `export` prefix, then restart agentmemory.
1164
+ Put agentmemory runtime configuration in `~/.agentmemory/.env` instead of exporting variables in every shell. If the viewer shows a setup hint like `export ANTHROPIC_API_KEY=...`, copy it into this file as `ANTHROPIC_API_KEY=...` without the `export` prefix, add `AGENTMEMORY_LLM_PROVIDER=anthropic` to select it, then restart agentmemory. Set `AGENTMEMORY_ENV_FILE` to use another env-file path.
1597
1165
 
1598
- Process environment variables still work and take precedence over values in the file.
1166
+ Process environment variables take precedence over values in the file. Restart the server after changing its configuration.
1599
1167
 
1600
1168
  On Windows, the same file lives at `%USERPROFILE%\.agentmemory\.env`:
1601
1169
 
@@ -1613,7 +1181,7 @@ AGENTMEMORY_AUTO_COMPRESS=true
1613
1181
 
1614
1182
  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
1183
 
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:
1184
+ Consolidation (graph nodes, lessons, crystals) is on by default whenever an LLM provider is selected with `AGENTMEMORY_LLM_PROVIDER`, or the Agent SDK fallback is on with `AGENTMEMORY_ALLOW_AGENT_SDK=true`. Explicitly opt out with `CONSOLIDATION_ENABLED=false` if you want LLM-free operation. Graph extraction is a separate flag:
1617
1185
 
1618
1186
  ```env
1619
1187
  GRAPH_EXTRACTION_ENABLED=true
@@ -1622,179 +1190,43 @@ GRAPH_EXTRACTION_ENABLED=true
1622
1190
 
1623
1191
  ### Environment Variables
1624
1192
 
1625
- Create `~/.agentmemory/.env`:
1193
+ Common options for `~/.agentmemory/.env`:
1626
1194
 
1627
1195
  ```env
1628
- # LLM provider (pick one — default is the no-op provider: no LLM calls)
1629
- # ANTHROPIC_API_KEY=sk-ant-...
1630
- # ANTHROPIC_BASE_URL=... # Optional: Anthropic-compatible proxy / Azure
1631
- # GEMINI_API_KEY=...
1632
- # OPENROUTER_API_KEY=...
1633
- # MINIMAX_API_KEY=...
1634
- # OPENAI_API_KEY=*** # NOTE: this same key auto-activates BOTH the
1635
- # # OpenAI LLM provider (here) AND the OpenAI
1636
- # # embedding provider (further below). Set
1637
- # # OPENAI_API_KEY_FOR_LLM=false to scope it
1638
- # # to embeddings only.
1639
- # OPENAI_BASE_URL=https://api.openai.com # Optional: override for Azure / vLLM / LM Studio / proxies
1640
- # # Azure: https://<resource>.openai.azure.com/openai/deployments/<deployment>
1641
- # # Auto-detected from `.openai.azure.com` hostname; uses
1642
- # # api-key header + api-version query param.
1643
- # OPENAI_API_VERSION=2024-08-01-preview # Optional: Azure api-version query param
1644
- # OPENAI_MODEL=gpt-5.6-luna # Optional: default model
1645
- # OPENAI_TIMEOUT_MS=60000 # Optional: OpenAI-scoped alias for the outbound fetch
1646
- # # timeout. Takes precedence over AGENTMEMORY_LLM_TIMEOUT_MS
1647
- # # for back-compat with v0.9.17. New configs should
1648
- # # prefer the global AGENTMEMORY_LLM_TIMEOUT_MS below.
1649
- # OPENAI_REASONING_EFFORT=none # Optional: "low" | "medium" | "high" | "none"
1650
- # # Honored only by OpenAI's reasoning models (o1, o3,
1651
- # # gpt-*-reasoning) and providers that mirror that
1652
- # # schema (Ollama Cloud thinking models). Standard
1653
- # # chat models reject this field with 400. Set to
1654
- # # "none" for thinking models that return reasoning
1655
- # # but no content.
1656
- # OPENAI_API_KEY_FOR_LLM=false # Optional: set to false to skip OpenAI auto-detection
1657
- # # for LLM (useful if you only want OpenAI for embeddings)
1658
- # Opt-in Claude-subscription fallback (spawns @anthropic-ai/claude-agent-sdk);
1659
- # leave OFF unless you understand the Stop-hook recursion risk:
1660
- # AGENTMEMORY_ALLOW_AGENT_SDK=true
1661
-
1662
- # Embedding provider (BM25-only when unset; local is an explicit opt-in)
1663
- # EMBEDDING_PROVIDER=local
1664
- # VOYAGE_API_KEY=...
1665
- # OPENAI_API_KEY=sk-...
1666
- # OPENAI_BASE_URL=https://api.openai.com # Override for Azure / vLLM / LM Studio / proxies
1667
- # OPENAI_EMBEDDING_MODEL=text-embedding-3-small
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
1671
-
1672
- # Outbound LLM / embedding timeout
1673
- # AGENTMEMORY_LLM_TIMEOUT_MS=60000 # Default: 60 000 ms (60 s). Applies to every
1674
- # raw-fetch provider (Gemini, OpenRouter, MiniMax,
1675
- # OpenAI LLM, OpenAI/Cohere/Voyage/OpenRouter
1676
- # embedding). For the OpenAI LLM path, the
1677
- # OpenAI-scoped OPENAI_TIMEOUT_MS alias (above)
1678
- # takes precedence when set, for back-compat
1679
- # with v0.9.17.
1680
- # Increase for slow networks or large batch calls;
1681
- # decrease to fail-fast on rate-limit holds.
1682
-
1683
- # Search tuning
1684
- # BM25_WEIGHT=0.4
1685
- # VECTOR_WEIGHT=0.6
1686
- # TOKEN_BUDGET=2000
1687
-
1688
- # Auth (generated into ~/.agentmemory/secret on first start when unset)
1689
- # AGENTMEMORY_SECRET=your-secret
1690
- # VIEWER_ALLOWED_ORIGINS=https://memory.example.com
1691
- # AGENTMEMORY_IMPORT_ROOT=~/projects
1692
-
1693
- # Ports (defaults: 3111 API, 3113 viewer)
1694
- # III_REST_PORT=3111
1695
-
1696
- # Engine usage telemetry (iii). Off unless you set it; true opts in.
1697
- # III_TELEMETRY_ENABLED=false
1698
-
1699
- # Features
1700
- # AGENTMEMORY_AUTO_COMPRESS=false # OFF by default. Requires an LLM
1701
- # provider as well. When both are on,
1702
- # every PostToolUse hook calls your
1703
- # LLM provider to compress the
1704
- # observation — expect significant
1705
- # token spend on active sessions.
1706
- # AGENTMEMORY_SLOTS=false # OFF by default. Editable pinned
1707
- # memory slots — persona,
1708
- # user_preferences, tool_guidelines,
1709
- # project_context, guidance,
1710
- # pending_items, session_patterns,
1711
- # self_notes. Size-limited; agent
1712
- # edits via memory_slot_* tools.
1713
- # Pinned slots addressable for
1714
- # SessionStart injection.
1715
- # AGENTMEMORY_REFLECT=false # OFF by default. Requires SLOTS=on.
1716
- # Stop hook fires mem::slot-reflect:
1717
- # scans recent observations, auto-
1718
- # appends TODOs to pending_items,
1719
- # counts patterns in
1720
- # session_patterns, records touched
1721
- # files in project_context. Fire-
1722
- # and-forget; does not block.
1723
- # AGENTMEMORY_INJECT_CONTEXT=false # OFF by default. When on:
1724
- # - SessionStart may inject ~1-2K
1725
- # chars of project context into
1726
- # the first turn of each session
1727
- # (this is what actually reaches
1728
- # the model — Claude Code treats
1729
- # SessionStart stdout as context)
1730
- # - PreToolUse fires /agentmemory/enrich
1731
- # on every file-touching tool call
1732
- # (resource cleanup, not a token
1733
- # fix — PreToolUse stdout is debug
1734
- # log only per Claude Code docs)
1735
- # Observations are still captured via
1736
- # PostToolUse regardless of this flag.
1737
- # GRAPH_EXTRACTION_ENABLED=false
1738
- # AGENTMEMORY_LLM_NOTHINK=1 # Local reasoning models only: ask the
1739
- # model to skip its hidden thinking pass
1740
- # during graph extraction. Faster runs;
1741
- # relation quality can drop slightly.
1742
- # CONSOLIDATION_ENABLED=false # on by default when an LLM provider is configured
1743
- # LESSON_DECAY_ENABLED=true
1744
- # OBSIDIAN_AUTO_EXPORT=false
1745
- # AGENTMEMORY_EXPORT_ROOT=~/.agentmemory
1746
- # CLAUDE_MEMORY_BRIDGE=false
1747
- # SNAPSHOT_ENABLED=false
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
-
1779
- # Team
1780
- # TEAM_ID=
1781
- # USER_ID=
1782
- # TEAM_MODE=private
1783
-
1784
- # Tool visibility: "all" (54 tools, default) or "core" (8 tools, lean)
1196
+ # Semantic recall on your machine, after the first model download
1197
+ EMBEDDING_PROVIDER=local
1198
+
1199
+ # Optional automatic context injection through the shared hooks
1200
+ # AGENTMEMORY_INJECT_CONTEXT=true
1201
+
1202
+ # Optional outside LLM for summaries and consolidation. A key alone does nothing;
1203
+ # this line selects the provider whose key agentmemory may use.
1204
+ # AGENTMEMORY_LLM_PROVIDER=anthropic
1205
+
1206
+ # Optional LLM-written compression; also requires AGENTMEMORY_LLM_PROVIDER
1207
+ # AGENTMEMORY_AUTO_COMPRESS=true
1208
+
1209
+ # Show 8 essential MCP tools instead of the default 54
1785
1210
  # AGENTMEMORY_TOOLS=core
1211
+
1212
+ # Disable scheduled auto-forget and lesson/insight decay
1213
+ # AUTO_FORGET_ENABLED=false
1214
+ # LESSON_DECAY_ENABLED=false
1215
+ # INSIGHT_DECAY_ENABLED=false
1786
1216
  ```
1787
1217
 
1218
+ The complete reference is [`.env.example`](.env.example), including provider credentials, capture filters, retention, storage, team scope and optional features. `AGENTMEMORY_ENV_FILE` selects another file. Never commit a populated `.env` or bearer secret.
1219
+
1788
1220
  ---
1789
1221
 
1790
1222
  <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>
1791
1223
 
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.
1224
+ 147 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
1225
 
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:
1226
+ **Authentication is on by default.** When `AGENTMEMORY_SECRET` is not set (in the shell or in `~/.agentmemory/.env`), the CLI generates a random secret on first start and stores it at `~/.agentmemory/secret`, mirrored to the selected data directory as `secret`, with mode `0600` (the platform-specific default data directory is described above). Bundled clients read the canonical secret first when they talk 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 need the secret set in their environment. Repository-based Docker self-host deployments and the `deploy/` entrypoints generate and export their own secret. To call the API by hand:
1795
1227
 
1796
1228
  ```bash
1797
- curl -H "Authorization: Bearer $(cat ~/.agentmemory/secret)" http://localhost:3111/agentmemory/health
1229
+ curl -H "Authorization: Bearer <secret-from-data-dir>" http://localhost:3111/agentmemory/health
1798
1230
  ```
1799
1231
 
1800
1232
  **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.
@@ -1812,7 +1244,7 @@ curl -H "Authorization: Bearer $(cat ~/.agentmemory/secret)" http://localhost:31
1812
1244
  | `GET` | `/agentmemory/status` | What is wrong and how to fix it (HTML for browsers, JSON otherwise) |
1813
1245
  | `GET` | `/agentmemory/viewer/snapshot` | Everything the viewer shows, in one response |
1814
1246
  | `POST` | `/agentmemory/session/start` | Start session + get context |
1815
- | `POST` | `/agentmemory/session/end` | End session |
1247
+ | `POST` | `/agentmemory/session/end` | End session; `final: false` (per-turn hooks) defers completion until the session is idle |
1816
1248
  | `POST` | `/agentmemory/observe` | Capture observation (see capture delivery below) |
1817
1249
  | `GET` | `/agentmemory/capture` | Capture inbox, dead letters and offline spool |
1818
1250
  | `POST` | `/agentmemory/capture/retry` | Retry dead-letter captures |
@@ -1826,11 +1258,12 @@ curl -H "Authorization: Bearer $(cat ~/.agentmemory/secret)" http://localhost:31
1826
1258
  | `GET` | `/agentmemory/export` | Export all data |
1827
1259
  | `POST` | `/agentmemory/import` | Import from JSON |
1828
1260
  | `POST` | `/agentmemory/graph/query` | Knowledge graph query |
1261
+ | `POST` | `/agentmemory/graph/reset` | Start an empty graph generation; retain observations and memories |
1829
1262
  | `POST` | `/agentmemory/graph/compact` | Trim oversized graph provenance |
1830
1263
  | `POST` | `/agentmemory/team/share` | Share with team |
1831
1264
  | `GET` | `/agentmemory/audit` | Audit trail |
1832
1265
 
1833
- Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
1266
+ Full endpoint list: [generated REST reference](plugin/skills/agentmemory-rest-api/REFERENCE.md)
1834
1267
 
1835
1268
  </details>
1836
1269
 
@@ -1848,19 +1281,23 @@ Failed events are retried every `AGENTMEMORY_CAPTURE_RETRY_INTERVAL_MS` (10 s) w
1848
1281
 
1849
1282
  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
1283
 
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.
1284
+ **Resetting the graph.** Call `POST /agentmemory/graph/reset` to start a new graph generation. The previous graph becomes inaccessible to graph queries, node lookups, statistics, and MCP reads; new imports and extraction populate the new generation. Existing observations and memories remain available. Old graph storage is retained.
1285
+
1286
+ **Upgrading from v0.9.30:** if you already reset the graph before upgrading, run `POST /agentmemory/graph/reset` again after the upgrade. Earlier reset timestamps are not used to infer a completed generation reset.
1287
+
1288
+ **Compacting graph provenance.** Legacy provenance compaction is deferred at startup because it reads complete legacy scopes. `/agentmemory/status` reports `deferred`, or `off` with `AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=false`. Run the manual compaction below during maintenance. Retrieval index migration is separate: use `agentmemory graph-index migrate --allow-legacy-scan` as described in the [maintenance guide](docs/reliability/graph-index-migration.md).
1852
1289
 
1853
1290
  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
1291
 
1855
1292
  ```bash
1856
- curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: application/json" -d '{}'
1293
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization: Bearer <secret>" -H "Content-Type: application/json" -d '{}'
1857
1294
  ```
1858
1295
 
1859
1296
  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
1297
 
1861
1298
  ```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"}'
1299
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization: Bearer <secret>" -H "Content-Type: application/json" -d '{"scope":"nodes","offset":0,"limit":200}'
1300
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization: Bearer <secret>" -H "Content-Type: application/json" -d '{"scope":"snapshot"}'
1864
1301
  ```
1865
1302
 
1866
1303
  ---
@@ -1870,11 +1307,11 @@ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: a
1870
1307
  ```bash
1871
1308
  npm run dev # Hot reload
1872
1309
  npm run build # Production build
1873
- npm test # 2,500+ tests
1310
+ npm test # 4,400+ tests
1874
1311
  npm run test:integration # API tests (requires running services)
1875
1312
  ```
1876
1313
 
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.
1314
+ **Prerequisites:** see [Install](#install). Contribution rules and release checks are in [CONTRIBUTING.md](CONTRIBUTING.md).
1878
1315
 
1879
1316
  <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>
1880
1317