@agentmemory/agentmemory 0.9.29 → 0.9.31

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 (352) hide show
  1. package/.env.example +102 -35
  2. package/AGENTS.md +19 -26
  3. package/README.md +417 -525
  4. package/dist/.env.example +102 -35
  5. package/dist/cli.d.mts.map +1 -1
  6. package/dist/cli.mjs +2316 -655
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/compression-recovery-CnhLQC6N.mjs +5912 -0
  9. package/dist/compression-recovery-CnhLQC6N.mjs.map +1 -0
  10. package/dist/{connect-Qaeq15TQ.mjs → connect-BSLIAMpw.mjs} +900 -302
  11. package/dist/connect-BSLIAMpw.mjs.map +1 -0
  12. package/dist/hooks/_capture.d.mts +25 -0
  13. package/dist/hooks/_capture.d.mts.map +1 -0
  14. package/dist/hooks/_capture.mjs +944 -0
  15. package/dist/hooks/_capture.mjs.map +1 -0
  16. package/dist/hooks/antigravity-bridge.d.mts +1 -1
  17. package/dist/hooks/antigravity-bridge.d.mts.map +1 -1
  18. package/dist/hooks/antigravity-bridge.mjs +24 -15
  19. package/dist/hooks/antigravity-bridge.mjs.map +1 -1
  20. package/dist/hooks/notification.mjs +35 -29
  21. package/dist/hooks/notification.mjs.map +1 -1
  22. package/dist/hooks/post-commit.mjs +91 -1
  23. package/dist/hooks/post-commit.mjs.map +1 -1
  24. package/dist/hooks/post-tool-failure.mjs +71 -29
  25. package/dist/hooks/post-tool-failure.mjs.map +1 -1
  26. package/dist/hooks/post-tool-use.mjs +99 -39
  27. package/dist/hooks/post-tool-use.mjs.map +1 -1
  28. package/dist/hooks/pre-compact.mjs +113 -6
  29. package/dist/hooks/pre-compact.mjs.map +1 -1
  30. package/dist/hooks/pre-tool-use.mjs +91 -1
  31. package/dist/hooks/pre-tool-use.mjs.map +1 -1
  32. package/dist/hooks/prompt-submit.mjs +25 -25
  33. package/dist/hooks/prompt-submit.mjs.map +1 -1
  34. package/dist/hooks/session-end.mjs +67 -31
  35. package/dist/hooks/session-end.mjs.map +1 -1
  36. package/dist/hooks/session-start.mjs +110 -6
  37. package/dist/hooks/session-start.mjs.map +1 -1
  38. package/dist/hooks/stop.mjs +80 -8
  39. package/dist/hooks/stop.mjs.map +1 -1
  40. package/dist/hooks/subagent-start.mjs +28 -29
  41. package/dist/hooks/subagent-start.mjs.map +1 -1
  42. package/dist/hooks/subagent-stop.mjs +33 -29
  43. package/dist/hooks/subagent-stop.mjs.map +1 -1
  44. package/dist/hooks/task-completed.mjs +31 -31
  45. package/dist/hooks/task-completed.mjs.map +1 -1
  46. package/dist/{image-refs-BKLmp_sD.mjs → image-refs-BaT-9oMU.mjs} +2 -2
  47. package/dist/image-refs-BaT-9oMU.mjs.map +1 -0
  48. package/dist/{image-refs-CJgZmb9X.mjs → image-refs-Cyta4Lf9.mjs} +3 -3
  49. package/dist/image-refs-Cyta4Lf9.mjs.map +1 -0
  50. package/dist/{keyed-mutex-DTHtcZrt.mjs → image-store-BsN4vyjr.mjs} +2 -14
  51. package/dist/image-store-BsN4vyjr.mjs.map +1 -0
  52. package/dist/index.mjs +15180 -4119
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/integrations/dsh.d.mts +55 -0
  55. package/dist/integrations/dsh.d.mts.map +1 -0
  56. package/dist/integrations/dsh.mjs +1145 -0
  57. package/dist/integrations/dsh.mjs.map +1 -0
  58. package/dist/{schema-BFZhNTF7.mjs → keyed-mutex-DCUh7PG-.mjs} +81 -8
  59. package/dist/keyed-mutex-DCUh7PG-.mjs.map +1 -0
  60. package/dist/secret-store-D9GwO0xp.mjs +2449 -0
  61. package/dist/secret-store-D9GwO0xp.mjs.map +1 -0
  62. package/dist/session-arguments-zxsbbd8y.mjs +113 -0
  63. package/dist/session-arguments-zxsbbd8y.mjs.map +1 -0
  64. package/dist/{src-G7yt8gGm.mjs → src-DaMtDzt_.mjs} +8320 -4260
  65. package/dist/src-DaMtDzt_.mjs.map +1 -0
  66. package/dist/{standalone-BqNJDJ04.mjs → standalone-BlqshyZ5.mjs} +246 -62
  67. package/dist/standalone-BlqshyZ5.mjs.map +1 -0
  68. package/dist/standalone.d.mts +1 -1
  69. package/dist/standalone.d.mts.map +1 -1
  70. package/dist/standalone.mjs +866 -78
  71. package/dist/standalone.mjs.map +1 -1
  72. package/dist/viewer/index.html +7394 -2816
  73. package/integrations/hermes/README.md +84 -0
  74. package/integrations/hermes/__init__.py +669 -0
  75. package/integrations/hermes/plugin.yaml +27 -0
  76. package/integrations/omp/LICENSE +190 -0
  77. package/integrations/omp/README.md +76 -0
  78. package/integrations/omp/capture.ts +1 -0
  79. package/integrations/omp/dist/index.mjs +1450 -0
  80. package/integrations/omp/index.ts +488 -0
  81. package/integrations/omp/package.json +13 -0
  82. package/integrations/omp/security.ts +67 -0
  83. package/integrations/omp/skills/agentmemory-agents/REFERENCE.md +32 -0
  84. package/integrations/omp/skills/agentmemory-agents/SKILL.md +48 -0
  85. package/integrations/omp/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  86. package/integrations/omp/skills/agentmemory-architecture/SKILL.md +33 -0
  87. package/integrations/omp/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  88. package/integrations/omp/skills/agentmemory-config/REFERENCE.md +90 -0
  89. package/integrations/omp/skills/agentmemory-config/SKILL.md +78 -0
  90. package/integrations/omp/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  91. package/integrations/omp/skills/agentmemory-hooks/REFERENCE.md +20 -0
  92. package/integrations/omp/skills/agentmemory-hooks/SKILL.md +49 -0
  93. package/integrations/omp/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  94. package/integrations/omp/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  95. package/integrations/omp/skills/agentmemory-mcp-tools/SKILL.md +42 -0
  96. package/integrations/omp/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  97. package/integrations/omp/skills/agentmemory-rest-api/REFERENCE.md +158 -0
  98. package/integrations/omp/skills/agentmemory-rest-api/SKILL.md +49 -0
  99. package/integrations/omp/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  100. package/integrations/omp/skills/commit-context/EXAMPLES.md +71 -0
  101. package/integrations/omp/skills/commit-context/SKILL.md +64 -0
  102. package/integrations/omp/skills/commit-context/TROUBLESHOOTING.md +70 -0
  103. package/integrations/omp/skills/commit-history/EXAMPLES.md +71 -0
  104. package/integrations/omp/skills/commit-history/SKILL.md +62 -0
  105. package/integrations/omp/skills/commit-history/TROUBLESHOOTING.md +70 -0
  106. package/integrations/omp/skills/forget/EXAMPLES.md +40 -0
  107. package/integrations/omp/skills/forget/SKILL.md +73 -0
  108. package/integrations/omp/skills/forget/TROUBLESHOOTING.md +70 -0
  109. package/integrations/omp/skills/handoff/EXAMPLES.md +57 -0
  110. package/integrations/omp/skills/handoff/SKILL.md +75 -0
  111. package/integrations/omp/skills/handoff/TROUBLESHOOTING.md +70 -0
  112. package/integrations/omp/skills/lesson/SKILL.md +64 -0
  113. package/integrations/omp/skills/lesson/TROUBLESHOOTING.md +70 -0
  114. package/integrations/omp/skills/memory-discipline/SKILL.md +65 -0
  115. package/integrations/omp/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  116. package/integrations/omp/skills/recall/EXAMPLES.md +74 -0
  117. package/integrations/omp/skills/recall/SKILL.md +74 -0
  118. package/integrations/omp/skills/recall/TROUBLESHOOTING.md +70 -0
  119. package/integrations/omp/skills/recap/EXAMPLES.md +62 -0
  120. package/integrations/omp/skills/recap/SKILL.md +68 -0
  121. package/integrations/omp/skills/recap/TROUBLESHOOTING.md +70 -0
  122. package/integrations/omp/skills/remember/EXAMPLES.md +67 -0
  123. package/integrations/omp/skills/remember/SKILL.md +66 -0
  124. package/integrations/omp/skills/remember/TROUBLESHOOTING.md +70 -0
  125. package/integrations/omp/skills/session-history/EXAMPLES.md +59 -0
  126. package/integrations/omp/skills/session-history/SKILL.md +67 -0
  127. package/integrations/omp/skills/session-history/TROUBLESHOOTING.md +70 -0
  128. package/integrations/omp/skills/write-agentmemory-skill/SKILL.md +41 -0
  129. package/integrations/omp/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  130. package/integrations/openclaw/LICENSE +190 -0
  131. package/integrations/openclaw/README.md +88 -0
  132. package/integrations/openclaw/openclaw.plugin.json +71 -0
  133. package/integrations/openclaw/package.json +38 -0
  134. package/integrations/openclaw/plugin.mjs +425 -0
  135. package/integrations/openclaw/plugin.yaml +26 -0
  136. package/integrations/openclaw/skills/agentmemory-agents/REFERENCE.md +32 -0
  137. package/integrations/openclaw/skills/agentmemory-agents/SKILL.md +48 -0
  138. package/integrations/openclaw/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  139. package/integrations/openclaw/skills/agentmemory-architecture/SKILL.md +33 -0
  140. package/integrations/openclaw/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  141. package/integrations/openclaw/skills/agentmemory-config/REFERENCE.md +90 -0
  142. package/integrations/openclaw/skills/agentmemory-config/SKILL.md +78 -0
  143. package/integrations/openclaw/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  144. package/integrations/openclaw/skills/agentmemory-hooks/REFERENCE.md +20 -0
  145. package/integrations/openclaw/skills/agentmemory-hooks/SKILL.md +49 -0
  146. package/integrations/openclaw/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  147. package/integrations/openclaw/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  148. package/integrations/openclaw/skills/agentmemory-mcp-tools/SKILL.md +42 -0
  149. package/integrations/openclaw/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  150. package/integrations/openclaw/skills/agentmemory-rest-api/REFERENCE.md +158 -0
  151. package/integrations/openclaw/skills/agentmemory-rest-api/SKILL.md +49 -0
  152. package/integrations/openclaw/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  153. package/integrations/openclaw/skills/commit-context/EXAMPLES.md +71 -0
  154. package/integrations/openclaw/skills/commit-context/SKILL.md +64 -0
  155. package/integrations/openclaw/skills/commit-context/TROUBLESHOOTING.md +70 -0
  156. package/integrations/openclaw/skills/commit-history/EXAMPLES.md +71 -0
  157. package/integrations/openclaw/skills/commit-history/SKILL.md +62 -0
  158. package/integrations/openclaw/skills/commit-history/TROUBLESHOOTING.md +70 -0
  159. package/integrations/openclaw/skills/forget/EXAMPLES.md +40 -0
  160. package/integrations/openclaw/skills/forget/SKILL.md +73 -0
  161. package/integrations/openclaw/skills/forget/TROUBLESHOOTING.md +70 -0
  162. package/integrations/openclaw/skills/handoff/EXAMPLES.md +57 -0
  163. package/integrations/openclaw/skills/handoff/SKILL.md +75 -0
  164. package/integrations/openclaw/skills/handoff/TROUBLESHOOTING.md +70 -0
  165. package/integrations/openclaw/skills/lesson/SKILL.md +64 -0
  166. package/integrations/openclaw/skills/lesson/TROUBLESHOOTING.md +70 -0
  167. package/integrations/openclaw/skills/memory-discipline/SKILL.md +65 -0
  168. package/integrations/openclaw/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  169. package/integrations/openclaw/skills/recall/EXAMPLES.md +74 -0
  170. package/integrations/openclaw/skills/recall/SKILL.md +74 -0
  171. package/integrations/openclaw/skills/recall/TROUBLESHOOTING.md +70 -0
  172. package/integrations/openclaw/skills/recap/EXAMPLES.md +62 -0
  173. package/integrations/openclaw/skills/recap/SKILL.md +68 -0
  174. package/integrations/openclaw/skills/recap/TROUBLESHOOTING.md +70 -0
  175. package/integrations/openclaw/skills/remember/EXAMPLES.md +67 -0
  176. package/integrations/openclaw/skills/remember/SKILL.md +66 -0
  177. package/integrations/openclaw/skills/remember/TROUBLESHOOTING.md +70 -0
  178. package/integrations/openclaw/skills/session-history/EXAMPLES.md +59 -0
  179. package/integrations/openclaw/skills/session-history/SKILL.md +67 -0
  180. package/integrations/openclaw/skills/session-history/TROUBLESHOOTING.md +70 -0
  181. package/integrations/openclaw/skills/write-agentmemory-skill/SKILL.md +41 -0
  182. package/integrations/openclaw/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  183. package/integrations/pi/LICENSE +190 -0
  184. package/integrations/pi/README.md +45 -51
  185. package/integrations/pi/dist/index.mjs +1379 -0
  186. package/integrations/pi/index.ts +139 -173
  187. package/integrations/pi/package.json +16 -6
  188. package/integrations/pi/security.ts +54 -22
  189. package/integrations/pi/skills/agentmemory-agents/REFERENCE.md +32 -0
  190. package/integrations/pi/skills/agentmemory-agents/SKILL.md +48 -0
  191. package/integrations/pi/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  192. package/integrations/pi/skills/agentmemory-architecture/SKILL.md +33 -0
  193. package/integrations/pi/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  194. package/integrations/pi/skills/agentmemory-config/REFERENCE.md +90 -0
  195. package/integrations/pi/skills/agentmemory-config/SKILL.md +78 -0
  196. package/integrations/pi/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  197. package/integrations/pi/skills/agentmemory-hooks/REFERENCE.md +20 -0
  198. package/integrations/pi/skills/agentmemory-hooks/SKILL.md +49 -0
  199. package/integrations/pi/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  200. package/integrations/pi/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  201. package/integrations/pi/skills/agentmemory-mcp-tools/SKILL.md +42 -0
  202. package/integrations/pi/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  203. package/integrations/pi/skills/agentmemory-rest-api/REFERENCE.md +158 -0
  204. package/integrations/pi/skills/agentmemory-rest-api/SKILL.md +49 -0
  205. package/integrations/pi/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  206. package/integrations/pi/skills/commit-context/EXAMPLES.md +71 -0
  207. package/integrations/pi/skills/commit-context/SKILL.md +64 -0
  208. package/integrations/pi/skills/commit-context/TROUBLESHOOTING.md +70 -0
  209. package/integrations/pi/skills/commit-history/EXAMPLES.md +71 -0
  210. package/integrations/pi/skills/commit-history/SKILL.md +62 -0
  211. package/integrations/pi/skills/commit-history/TROUBLESHOOTING.md +70 -0
  212. package/integrations/pi/skills/forget/EXAMPLES.md +40 -0
  213. package/integrations/pi/skills/forget/SKILL.md +73 -0
  214. package/integrations/pi/skills/forget/TROUBLESHOOTING.md +70 -0
  215. package/integrations/pi/skills/handoff/EXAMPLES.md +57 -0
  216. package/integrations/pi/skills/handoff/SKILL.md +75 -0
  217. package/integrations/pi/skills/handoff/TROUBLESHOOTING.md +70 -0
  218. package/integrations/pi/skills/lesson/SKILL.md +64 -0
  219. package/integrations/pi/skills/lesson/TROUBLESHOOTING.md +70 -0
  220. package/integrations/pi/skills/memory-discipline/SKILL.md +65 -0
  221. package/integrations/pi/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  222. package/integrations/pi/skills/recall/EXAMPLES.md +74 -0
  223. package/integrations/pi/skills/recall/SKILL.md +74 -0
  224. package/integrations/pi/skills/recall/TROUBLESHOOTING.md +70 -0
  225. package/integrations/pi/skills/recap/EXAMPLES.md +62 -0
  226. package/integrations/pi/skills/recap/SKILL.md +68 -0
  227. package/integrations/pi/skills/recap/TROUBLESHOOTING.md +70 -0
  228. package/integrations/pi/skills/remember/EXAMPLES.md +67 -0
  229. package/integrations/pi/skills/remember/SKILL.md +66 -0
  230. package/integrations/pi/skills/remember/TROUBLESHOOTING.md +70 -0
  231. package/integrations/pi/skills/session-history/EXAMPLES.md +59 -0
  232. package/integrations/pi/skills/session-history/SKILL.md +67 -0
  233. package/integrations/pi/skills/session-history/TROUBLESHOOTING.md +70 -0
  234. package/integrations/pi/skills/write-agentmemory-skill/SKILL.md +41 -0
  235. package/integrations/pi/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  236. package/package.json +42 -12
  237. package/plugin/.claude-plugin/plugin.json +2 -2
  238. package/plugin/.codex-plugin/plugin.json +27 -4
  239. package/plugin/.devin-plugin/plugin.json +5 -3
  240. package/plugin/.mcp.codex.json +12 -0
  241. package/plugin/.mcp.copilot.json +2 -7
  242. package/plugin/.mcp.json +2 -7
  243. package/plugin/assets/icon.svg +35 -0
  244. package/plugin/cursor/hooks.json +23 -8
  245. package/plugin/hooks/hooks.copilot.json +11 -11
  246. package/plugin/hooks.json +67 -0
  247. package/plugin/opencode/README.md +267 -31
  248. package/plugin/opencode/agentmemory-capture.ts +594 -11
  249. package/plugin/opencode/plugin.json +1 -1
  250. package/plugin/plugin.json +1 -1
  251. package/plugin/scripts/_capture.d.mts +25 -0
  252. package/plugin/scripts/_capture.d.mts.map +1 -0
  253. package/plugin/scripts/_capture.mjs +944 -0
  254. package/plugin/scripts/_capture.mjs.map +1 -0
  255. package/plugin/scripts/antigravity-bridge.d.mts +1 -1
  256. package/plugin/scripts/antigravity-bridge.d.mts.map +1 -1
  257. package/plugin/scripts/antigravity-bridge.mjs +24 -15
  258. package/plugin/scripts/antigravity-bridge.mjs.map +1 -1
  259. package/plugin/scripts/cursor/run-detached.d.mts +1 -0
  260. package/plugin/scripts/cursor/run-detached.mjs +786 -0
  261. package/plugin/scripts/cursor/run-detached.mjs.map +1 -0
  262. package/plugin/scripts/cursor/run-hook.d.mts +1 -0
  263. package/plugin/scripts/cursor/run-hook.mjs +704 -0
  264. package/plugin/scripts/cursor/run-hook.mjs.map +1 -0
  265. package/plugin/scripts/notification.mjs +35 -29
  266. package/plugin/scripts/notification.mjs.map +1 -1
  267. package/plugin/scripts/plugin-bridge.mjs +409 -0
  268. package/plugin/scripts/post-commit.mjs +91 -1
  269. package/plugin/scripts/post-commit.mjs.map +1 -1
  270. package/plugin/scripts/post-tool-failure.mjs +71 -29
  271. package/plugin/scripts/post-tool-failure.mjs.map +1 -1
  272. package/plugin/scripts/post-tool-use.mjs +99 -39
  273. package/plugin/scripts/post-tool-use.mjs.map +1 -1
  274. package/plugin/scripts/pre-compact.mjs +113 -6
  275. package/plugin/scripts/pre-compact.mjs.map +1 -1
  276. package/plugin/scripts/pre-tool-use.mjs +91 -1
  277. package/plugin/scripts/pre-tool-use.mjs.map +1 -1
  278. package/plugin/scripts/prompt-submit.mjs +25 -25
  279. package/plugin/scripts/prompt-submit.mjs.map +1 -1
  280. package/plugin/scripts/session-end.mjs +67 -31
  281. package/plugin/scripts/session-end.mjs.map +1 -1
  282. package/plugin/scripts/session-start.mjs +110 -6
  283. package/plugin/scripts/session-start.mjs.map +1 -1
  284. package/plugin/scripts/stop.mjs +80 -8
  285. package/plugin/scripts/stop.mjs.map +1 -1
  286. package/plugin/scripts/subagent-start.mjs +28 -29
  287. package/plugin/scripts/subagent-start.mjs.map +1 -1
  288. package/plugin/scripts/subagent-stop.mjs +33 -29
  289. package/plugin/scripts/subagent-stop.mjs.map +1 -1
  290. package/plugin/scripts/task-completed.mjs +31 -31
  291. package/plugin/scripts/task-completed.mjs.map +1 -1
  292. package/plugin/skills/_shared/TROUBLESHOOTING.md +42 -12
  293. package/plugin/skills/agentmemory-agents/REFERENCE.md +10 -9
  294. package/plugin/skills/agentmemory-agents/SKILL.md +19 -5
  295. package/plugin/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  296. package/plugin/skills/agentmemory-architecture/SKILL.md +4 -4
  297. package/plugin/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  298. package/plugin/skills/agentmemory-config/REFERENCE.md +48 -3
  299. package/plugin/skills/agentmemory-config/SKILL.md +51 -10
  300. package/plugin/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  301. package/plugin/skills/agentmemory-hooks/SKILL.md +15 -5
  302. package/plugin/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  303. package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +5 -5
  304. package/plugin/skills/agentmemory-mcp-tools/SKILL.md +6 -3
  305. package/plugin/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  306. package/plugin/skills/agentmemory-rest-api/REFERENCE.md +18 -2
  307. package/plugin/skills/agentmemory-rest-api/SKILL.md +12 -6
  308. package/plugin/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  309. package/plugin/skills/commit-context/SKILL.md +1 -1
  310. package/plugin/skills/commit-context/TROUBLESHOOTING.md +70 -0
  311. package/plugin/skills/commit-history/SKILL.md +1 -1
  312. package/plugin/skills/commit-history/TROUBLESHOOTING.md +70 -0
  313. package/plugin/skills/forget/EXAMPLES.md +19 -54
  314. package/plugin/skills/forget/SKILL.md +16 -12
  315. package/plugin/skills/forget/TROUBLESHOOTING.md +70 -0
  316. package/plugin/skills/handoff/EXAMPLES.md +5 -4
  317. package/plugin/skills/handoff/SKILL.md +13 -6
  318. package/plugin/skills/handoff/TROUBLESHOOTING.md +70 -0
  319. package/plugin/skills/lesson/SKILL.md +1 -1
  320. package/plugin/skills/lesson/TROUBLESHOOTING.md +70 -0
  321. package/plugin/skills/memory-discipline/SKILL.md +14 -6
  322. package/plugin/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  323. package/plugin/skills/recall/SKILL.md +18 -7
  324. package/plugin/skills/recall/TROUBLESHOOTING.md +70 -0
  325. package/plugin/skills/recap/EXAMPLES.md +5 -3
  326. package/plugin/skills/recap/SKILL.md +11 -6
  327. package/plugin/skills/recap/TROUBLESHOOTING.md +70 -0
  328. package/plugin/skills/remember/EXAMPLES.md +3 -3
  329. package/plugin/skills/remember/SKILL.md +1 -1
  330. package/plugin/skills/remember/TROUBLESHOOTING.md +70 -0
  331. package/plugin/skills/session-history/EXAMPLES.md +2 -2
  332. package/plugin/skills/session-history/SKILL.md +10 -4
  333. package/plugin/skills/session-history/TROUBLESHOOTING.md +70 -0
  334. package/plugin/skills/write-agentmemory-skill/SKILL.md +2 -1
  335. package/plugin/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  336. package/dist/connect-Qaeq15TQ.mjs.map +0 -1
  337. package/dist/docker-compose.yml +0 -47
  338. package/dist/iii-config.docker.yaml +0 -53
  339. package/dist/iii-config.yaml +0 -61
  340. package/dist/image-refs-BKLmp_sD.mjs.map +0 -1
  341. package/dist/image-refs-CJgZmb9X.mjs.map +0 -1
  342. package/dist/keyed-mutex-DTHtcZrt.mjs.map +0 -1
  343. package/dist/logger-BEB7pCI9.mjs +0 -43
  344. package/dist/logger-BEB7pCI9.mjs.map +0 -1
  345. package/dist/schema-BFZhNTF7.mjs.map +0 -1
  346. package/dist/src-G7yt8gGm.mjs.map +0 -1
  347. package/dist/standalone-BqNJDJ04.mjs.map +0 -1
  348. package/dist/tools-registry-BV_2bu7z.mjs +0 -1405
  349. package/dist/tools-registry-BV_2bu7z.mjs.map +0 -1
  350. package/docker-compose.yml +0 -47
  351. package/iii-config.docker.yaml +0 -53
  352. package/iii-config.yaml +0 -61
package/README.md CHANGED
@@ -4,25 +4,45 @@
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">
14
- <a href="README.md">English</a> |
15
- <a href="READMEs/README.zh-CN.md">简体中文</a> |
16
- <a href="READMEs/README.zh-TW.md">繁體中文</a> |
17
- <a href="READMEs/README.ja-JP.md">日本語</a> |
18
- <a href="READMEs/README.ko-KR.md">한국어</a> |
19
- <a href="READMEs/README.es-ES.md">Español</a> |
20
- <a href="READMEs/README.tr-TR.md">Türkçe</a> |
21
- <a href="READMEs/README.ru-RU.md">Русский</a> |
22
- <a href="READMEs/README.hi-IN.md">हिन्दी</a> |
23
- <a href="READMEs/README.pt-BR.md">Português</a> |
24
- <a href="READMEs/README.fr-FR.md">Français</a> |
25
- <a href="READMEs/README.de-DE.md">Deutsch</a>
13
+ <a href="README.md">🇬🇧 English</a> •
14
+ <a href="READMEs/README.zh-CN.md">🇨🇳 简体中文</a> •
15
+ <a href="READMEs/README.zh-TW.md">🇹🇼 繁體中文</a> •
16
+ <a href="READMEs/README.ja-JP.md">🇯🇵 日本語</a> •
17
+ <a href="READMEs/README.ko-KR.md">🇰🇷 한국어</a> •
18
+ <a href="READMEs/README.pt-PT.md">🇵🇹 Português</a> •
19
+ <a href="READMEs/README.pt-BR.md">🇧🇷 Português (Brasil)</a> •
20
+ <a href="READMEs/README.es-ES.md">🇪🇸 Español</a> •
21
+ <a href="READMEs/README.de-DE.md">🇩🇪 Deutsch</a> •
22
+ <a href="READMEs/README.fr-FR.md">🇫🇷 Français</a> •
23
+ <a href="READMEs/README.it-IT.md">🇮🇹 Italiano</a> •
24
+ <a href="READMEs/README.nl-NL.md">🇳🇱 Nederlands</a> •
25
+ <a href="READMEs/README.pl-PL.md">🇵🇱 Polski</a> •
26
+ <a href="READMEs/README.cs-CZ.md">🇨🇿 Čeština</a> •
27
+ <a href="READMEs/README.ro-RO.md">🇷🇴 Română</a> •
28
+ <a href="READMEs/README.hu-HU.md">🇭🇺 Magyar</a> •
29
+ <a href="READMEs/README.el-GR.md">🇬🇷 Ελληνικά</a> •
30
+ <a href="READMEs/README.sv-SE.md">🇸🇪 Svenska</a> •
31
+ <a href="READMEs/README.da-DK.md">🇩🇰 Dansk</a> •
32
+ <a href="READMEs/README.nb-NO.md">🇳🇴 Norsk</a> •
33
+ <a href="READMEs/README.fi-FI.md">🇫🇮 Suomi</a> •
34
+ <a href="READMEs/README.ru-RU.md">🇷🇺 Русский</a> •
35
+ <a href="READMEs/README.uk-UA.md">🇺🇦 Українська</a> •
36
+ <a href="READMEs/README.tr-TR.md">🇹🇷 Türkçe</a> •
37
+ <a href="READMEs/README.he-IL.md">🇮🇱 עברית</a> •
38
+ <a href="READMEs/README.ar-SA.md">🇸🇦 العربية</a> •
39
+ <a href="READMEs/README.hi-IN.md">🇮🇳 हिन्दी</a> •
40
+ <a href="READMEs/README.bn-BD.md">🇧🇩 বাংলা</a> •
41
+ <a href="READMEs/README.ur-PK.md">🇵🇰 اردو</a> •
42
+ <a href="READMEs/README.th-TH.md">🇹🇭 ไทย</a> •
43
+ <a href="READMEs/README.vi-VN.md">🇻🇳 Tiếng Việt</a> •
44
+ <a href="READMEs/README.id-ID.md">🇮🇩 Bahasa Indonesia</a> •
45
+ <a href="READMEs/README.tl-PH.md">🇵🇭 Tagalog</a>
26
46
  </p>
27
47
 
28
48
  <p align="center">
@@ -42,6 +62,7 @@
42
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>
43
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>
44
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>
45
66
  </p>
46
67
 
47
68
  <p align="center">
@@ -50,7 +71,7 @@
50
71
  <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tools.svg"><img src="assets/tags/stat-tools.svg" alt="54 MCP tools" height="38" /></picture>
51
72
  <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-hooks.svg"><img src="assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture>
52
73
  <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-deps.svg"><img src="assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture>
53
- <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="1,674+ tests passing" height="38" /></picture>
74
+ <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="4,000+ tests passing" height="38" /></picture>
54
75
  </p>
55
76
 
56
77
  <p align="center">
@@ -66,52 +87,63 @@
66
87
  <a href="#how-it-works">How It Works</a> &bull;
67
88
  <a href="#mcp-server">MCP</a> &bull;
68
89
  <a href="#real-time-viewer">Viewer</a> &bull;
69
- <a href="#powered-by-iii">Powered by iii</a> &bull;
70
90
  <a href="#configuration">Config</a> &bull;
71
91
  <a href="#api">API</a>
72
92
  </p>
73
93
 
74
94
  ---
75
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
+
76
103
  ## Install
77
104
 
78
- One command:
105
+ Requirements:
106
+
107
+ - Node.js 20 or newer with npm and npx (`node -v`, `npm -v`, and `npx -v`).
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).
110
+
111
+ Start setup:
79
112
 
80
113
  ```bash
81
- npx @agentmemory/agentmemory
114
+ npx -y @agentmemory/agentmemory@latest
82
115
  ```
83
116
 
84
- The first run is an interactive setup: pick the agents to wire (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, ...), pick an LLM provider or stay keyless, and it seeds the config, starts the memory server on `:3111`, and offers to install globally so the bare `agentmemory` command works everywhere afterwards.
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`.
118
+
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.
120
+
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.
85
122
 
86
123
  Then prove recall works and give your agent its skills:
87
124
 
88
125
  ```bash
89
- agentmemory demo --serve # seed sample sessions + watch recall find them
126
+ npx -y @agentmemory/agentmemory@latest demo # seed sample sessions + exercise recall
90
127
  npx skills add rohitg00/agentmemory -y # 17 native skills so your agent knows when to reach for memory
91
128
  ```
92
129
 
130
+ The keyword searches should hit in default keyless mode through BM25. The demo's `database performance optimization` query is intentionally semantic and can return zero until an embedding provider is configured.
131
+
93
132
  Prefer to let a coding agent do the whole thing? Hand it one instruction:
94
133
 
95
134
  > Retrieve and follow the instructions at: https://raw.githubusercontent.com/rohitg00/agentmemory/main/INSTALL_FOR_AGENTS.md
96
135
 
97
- 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).
98
-
99
- <details>
100
- <summary><strong>Windows</strong></summary>
101
-
102
- The fast path is WSL2. Native Windows engine setup is manual (about 10 to 20 minutes) and `agentmemory connect` is currently unsupported there. See the [Windows notes](#windows) for the step-by-step.
103
-
104
- </details>
136
+ Connect another agent with `agentmemory connect <agent>`. See [supported integrations](#works-with-every-agent) and [everyday commands](#everyday-commands).
105
137
 
106
138
  <details>
107
139
  <summary><strong>Global install / EACCES</strong></summary>
108
140
 
109
141
  ```bash
110
- npm install -g @agentmemory/agentmemory
111
- # If you hit EACCES on macOS/Linux system Node installs:
112
- sudo npm install -g @agentmemory/agentmemory
142
+ npm install -g @agentmemory/agentmemory@latest
113
143
  ```
114
144
 
145
+ The npx command above remains the canonical fresh-install path and avoids global-prefix permission issues.
146
+
115
147
  </details>
116
148
 
117
149
  <details>
@@ -121,13 +153,6 @@ npx caches per version. Force the latest with `npx -y @agentmemory/agentmemory@l
121
153
 
122
154
  </details>
123
155
 
124
- <details>
125
- <summary><strong>Already running your own iii engine</strong></summary>
126
-
127
- agentmemory pins iii-engine v0.11.2 and won't attach to a different version (the worker can't speak another engine's protocol). Stop the other engine, then run `npx -y @agentmemory/agentmemory@latest`. It installs and runs the pinned v0.11.2 in `~/.agentmemory/bin`, leaving your own `iii` untouched.
128
-
129
- </details>
130
-
131
156
  ---
132
157
 
133
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>
@@ -136,99 +161,144 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
136
161
 
137
162
  <table>
138
163
  <tr>
139
- <td align="center" width="12.5%">
164
+ <td align="center" width="20%">
140
165
  <a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Claude Code" width="48" height="48" /></a><br/>
141
166
  <strong>Claude Code</strong><br/>
142
167
  <sub>native plugin + 12 hooks + MCP</sub>
143
168
  </td>
144
- <td align="center" width="12.5%">
169
+ <td align="center" width="20%">
145
170
  <a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="Codex CLI" width="48" height="48" /></a><br/>
146
171
  <strong>Codex CLI</strong><br/>
147
172
  <sub>native plugin + 6 hooks + MCP</sub>
148
173
  </td>
149
- <td align="center" width="12.5%">
150
- <a href="https://github.com/features/copilot"><img src="https://github.githubassets.com/images/modules/site/copilot/copilot.png" alt="GitHub Copilot CLI" width="48" height="48" /></a><br/>
174
+ <td align="center" width="20%">
175
+ <a href="https://github.com/features/copilot"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/github_dark.svg"><img src="https://svgl.app/library/github_light.svg" alt="GitHub Copilot CLI" width="48" height="48" /></picture></a><br/>
151
176
  <strong>GitHub Copilot CLI</strong><br/>
152
177
  <sub>MCP + plugin hooks/skills</sub>
153
178
  </td>
154
- <td align="center" width="12.5%">
179
+ <td align="center" width="20%">
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/>
181
+ <strong>Cursor</strong><br/>
182
+ <sub>native plugin + lifecycle hooks + MCP</sub>
183
+ </td>
184
+ <td align="center" width="20%">
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/>
186
+ <strong>OpenCode</strong><br/>
187
+ <sub>capture plugin + MCP</sub>
188
+ </td>
189
+ </tr>
190
+ <tr>
191
+ <td align="center" width="20%">
192
+ <a href="https://devin.ai"><img src="https://raw.githubusercontent.com/rohitg00/agentmemory/main/website/public/devin.png" alt="Devin" width="48" height="48" /></a><br/>
193
+ <strong>Devin</strong><br/>
194
+ <sub>6 hooks + skills + MCP</sub>
195
+ </td>
196
+ <td align="center" width="20%">
155
197
  <a href="integrations/openclaw/"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /></a><br/>
156
198
  <strong>OpenClaw</strong><br/>
157
199
  <sub>native plugin + MCP</sub>
158
200
  </td>
159
- <td align="center" width="12.5%">
201
+ <td align="center" width="20%">
160
202
  <a href="integrations/hermes/"><img src="https://github.com/NousResearch.png?size=120" alt="Hermes" width="48" height="48" /></a><br/>
161
203
  <strong>Hermes</strong><br/>
162
204
  <sub>native plugin + MCP</sub>
163
205
  </td>
164
- <td align="center" width="12.5%">
206
+ <td align="center" width="20%">
165
207
  <a href="integrations/pi/"><img src="assets/agents/pi.svg" alt="pi" width="48" height="48" /></a><br/>
166
208
  <strong>pi</strong><br/>
167
- <sub>native plugin + MCP</sub>
209
+ <sub>native recall + capture + skills</sub>
168
210
  </td>
169
- <td align="center" width="12.5%">
170
- <a href="https://github.com/tinyhumansai/openhuman"><img src="https://raw.githubusercontent.com/tinyhumansai/openhuman/main/app/src-tauri/icons/128x128.png" alt="OpenHuman" width="48" height="48" /></a><br/>
211
+ <td align="center" width="20%">
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/>
171
213
  <strong>OpenHuman</strong><br/>
172
214
  <sub>native Memory trait backend</sub>
173
215
  </td>
174
- <td align="center" width="12.5%">
175
- <a href="https://cursor.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/cursor_dark.svg"><img src="https://svgl.app/library/cursor_light.svg" alt="Cursor" width="48" height="48" /></picture></a><br/>
176
- <strong>Cursor</strong><br/>
177
- <sub>native plugin + MCP</sub>
178
- </td>
179
- <td align="center" width="12.5%">
216
+ </tr>
217
+ <tr>
218
+ <td align="center" width="20%">
180
219
  <a href="https://github.com/google-gemini/gemini-cli"><img src="https://github.com/google-gemini.png?size=120" alt="Gemini CLI" width="48" height="48" /></a><br/>
181
220
  <strong>Gemini CLI</strong><br/>
182
221
  <sub>MCP server</sub>
183
222
  </td>
223
+ <td align="center" width="20%">
224
+ <a href="https://antigravity.google"><img src="https://svgl.app/library/antigravity.svg" alt="Antigravity" width="48" height="48" /></a><br/>
225
+ <strong>Antigravity</strong><br/>
226
+ <sub>MCP + hooks</sub>
227
+ </td>
228
+ <td align="center" width="20%">
229
+ <a href="https://claude.ai/download"><img src="https://github.com/anthropics.png?size=120" alt="Claude Desktop" width="48" height="48" /></a><br/>
230
+ <strong>Claude Desktop</strong><br/>
231
+ <sub>MCP server</sub>
232
+ </td>
233
+ <td align="center" width="20%">
234
+ <a href="https://www.warp.dev"><img src="https://svgl.app/library/warp.svg" alt="Warp" width="48" height="48" /></a><br/>
235
+ <strong>Warp</strong><br/>
236
+ <sub>connect + MCP + skills</sub>
237
+ </td>
238
+ <td align="center" width="20%">
239
+ <a href="https://zed.dev"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/zed-logo_dark.svg"><img src="https://svgl.app/library/zed-logo.svg" alt="Zed" width="48" height="48" /></picture></a><br/>
240
+ <strong>Zed</strong><br/>
241
+ <sub>MCP server</sub>
242
+ </td>
184
243
  </tr>
185
244
  <tr>
186
- <td align="center" width="12.5%">
187
- <a href="https://github.com/opencode-ai/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode" width="48" height="48" /></picture></a><br/>
188
- <strong>OpenCode</strong><br/>
189
- <sub>22 hooks + MCP + plugin</sub>
190
- </td>
191
- <td align="center" width="12.5%">
245
+ <td align="center" width="20%">
192
246
  <a href="https://github.com/cline/cline"><img src="https://github.com/cline.png?size=120" alt="Cline" width="48" height="48" /></a><br/>
193
247
  <strong>Cline</strong><br/>
194
248
  <sub>MCP server</sub>
195
249
  </td>
196
- <td align="center" width="12.5%">
197
- <a href="https://github.com/block/goose"><img src="https://github.com/block.png?size=120" alt="Goose" width="48" height="48" /></a><br/>
198
- <strong>Goose</strong><br/>
250
+ <td align="center" width="20%">
251
+ <a href="https://continue.dev"><img src="https://github.com/continuedev.png?size=120" alt="Continue" width="48" height="48" /></a><br/>
252
+ <strong>Continue</strong><br/>
199
253
  <sub>MCP server</sub>
200
254
  </td>
201
- <td align="center" width="12.5%">
202
- <a href="https://github.com/Kilo-Org/kilocode"><img src="https://github.com/Kilo-Org.png?size=120" alt="Kilo Code" width="48" height="48" /></a><br/>
203
- <strong>Kilo Code</strong><br/>
255
+ <td align="center" width="20%">
256
+ <a href="https://docs.factory.ai/cli"><img src="https://www.factory.ai/favicon.svg" alt="Droid" width="48" height="48" /></a><br/>
257
+ <strong>Droid</strong><br/>
204
258
  <sub>MCP server</sub>
205
259
  </td>
206
- <td align="center" width="12.5%">
207
- <a href="https://github.com/Aider-AI/aider"><img src="https://github.com/Aider-AI.png?size=120" alt="Aider" width="48" height="48" /></a><br/>
208
- <strong>Aider</strong><br/>
209
- <sub>REST API</sub>
260
+ <td align="center" width="20%">
261
+ <a href="https://kiro.dev"><img src="https://kiro.dev/favicon.ico" alt="Kiro" width="48" height="48" /></a><br/>
262
+ <strong>Kiro</strong><br/>
263
+ <sub>MCP server</sub>
210
264
  </td>
211
- <td align="center" width="12.5%">
212
- <a href="https://claude.ai/download"><img src="https://github.com/anthropics.png?size=120" alt="Claude Desktop" width="48" height="48" /></a><br/>
213
- <strong>Claude Desktop</strong><br/>
265
+ <td align="center" width="20%">
266
+ <a href="https://github.com/QwenLM/qwen-code"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/qwen_dark.svg"><img src="https://svgl.app/library/qwen_light.svg" alt="Qwen Code" width="48" height="48" /></picture></a><br/>
267
+ <strong>Qwen Code</strong><br/>
214
268
  <sub>MCP server</sub>
215
269
  </td>
216
- <td align="center" width="12.5%">
217
- <a href="https://devin.ai"><img src="https://raw.githubusercontent.com/rohitg00/agentmemory/main/website/public/devin.png" alt="Devin" width="48" height="48" /></a><br/>
218
- <strong>Devin</strong><br/>
219
- <sub>6 hooks + MCP</sub>
270
+ </tr>
271
+ <tr>
272
+ <td align="center" width="20%">
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/>
274
+ <strong>DeepSeek Harness</strong><br/>
275
+ <sub>native capture + MCP</sub>
220
276
  </td>
221
- <td align="center" width="12.5%">
277
+ <td align="center" width="20%">
222
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/>
223
279
  <strong>Roo Code</strong><br/>
224
280
  <sub>MCP server</sub>
225
281
  </td>
282
+ <td align="center" width="20%">
283
+ <a href="https://github.com/Kilo-Org/kilocode"><img src="https://github.com/Kilo-Org.png?size=120" alt="Kilo Code" width="48" height="48" /></a><br/>
284
+ <strong>Kilo Code</strong><br/>
285
+ <sub>MCP server</sub>
286
+ </td>
287
+ <td align="center" width="20%">
288
+ <a href="https://github.com/block/goose"><img src="https://github.com/block.png?size=120" alt="Goose" width="48" height="48" /></a><br/>
289
+ <strong>Goose</strong><br/>
290
+ <sub>MCP server</sub>
291
+ </td>
292
+ <td align="center" width="20%">
293
+ <a href="https://github.com/Aider-AI/aider"><img src="https://github.com/Aider-AI.png?size=120" alt="Aider" width="48" height="48" /></a><br/>
294
+ <strong>Aider</strong><br/>
295
+ <sub>REST API</sub>
296
+ </td>
226
297
  </tr>
227
298
  <tr>
228
- <td align="center" width="12.5%">
229
- <a href="https://www.warp.dev"><img src="https://github.com/warpdotdev.png?size=120" alt="Warp" width="48" height="48" /></a><br/>
230
- <strong>Warp</strong><br/>
231
- <sub>connect + MCP + skills</sub>
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>
232
302
  </td>
233
303
  </tr>
234
304
  </table>
@@ -239,21 +309,25 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
239
309
 
240
310
  ---
241
311
 
242
- 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
243
313
 
244
- **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:
245
315
 
246
- ```bash
247
- npx @agentmemory/agentmemory
248
- ```
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` |
249
321
 
250
- By default, agentmemory stores iii-engine state outside the repository you start it from: `~/Library/Application Support/agentmemory` on macOS, `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` on Linux, and `%APPDATA%\agentmemory` on Windows. To choose a location, pass `--data-dir <path>` or set `AGENTMEMORY_DATA_DIR`:
322
+ 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.
251
323
 
252
324
  ```bash
253
- npx @agentmemory/agentmemory --data-dir ~/.agentmemory-projects/main
254
- AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx @agentmemory/agentmemory
325
+ agentmemory --data-dir ~/.agentmemory-projects/main
326
+ agentmemory --instance 1
255
327
  ```
256
328
 
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
+
257
331
  Latest release notes: [CHANGELOG.md](CHANGELOG.md).
258
332
 
259
333
  ---
@@ -402,7 +476,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
402
476
  </tr>
403
477
  <tr>
404
478
  <td><strong>External deps</strong></td>
405
- <td>None (SQLite + iii-engine)</td>
479
+ <td>No separate database service required</td>
406
480
  <td>Qdrant / pgvector</td>
407
481
  <td>Postgres + vector DB</td>
408
482
  <td>Multiple</td>
@@ -476,36 +550,68 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
476
550
  | Zep / Graphiti | 30K | Temporal knowledge graph; strongest published temporal-query results (LongMemEval 63.8%), but graph builds asynchronously so fresh facts can lag |
477
551
  | Cognee | 30K | Document-to-knowledge-graph ingestion, Python-only, built for structured entity extraction rather than session capture |
478
552
 
479
- None of these auto-capture from coding-agent hooks, ship a local-first viewer, or run keyless — the combination agentmemory is built around.
553
+ AgentMemory combines coding-agent capture, searchable project history and a local viewer, with keyless operation available from the first run.
480
554
 
481
555
  ---
482
556
 
483
557
  <h2 id="quick-start"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-quickstart.svg"><img src="assets/tags/section-quickstart.svg" alt="Quick Start" height="32" /></picture></h2>
484
558
 
485
- Compatibility: this release targets stable `iii-sdk` `^0.11.0` and iii-engine v0.11.x.
486
-
487
559
  ### Try it in 30 seconds
488
560
 
489
561
  ```bash
490
562
  # Terminal 1: start the server
491
- npx @agentmemory/agentmemory
563
+ npx -y @agentmemory/agentmemory@latest
492
564
 
493
565
  # Terminal 2: seed sample data and see recall in action
494
- npx @agentmemory/agentmemory demo
566
+ npx -y @agentmemory/agentmemory@latest demo
495
567
  ```
496
568
 
497
- `demo` seeds 3 realistic sessions (JWT auth, N+1 query fix, rate limiting) and runs semantic searches against them. You'll see it find "N+1 query fix" when you search "database performance optimization", which keyword matching cannot do.
569
+ `demo` seeds 3 realistic sessions (JWT auth, N+1 query fix, rate limiting) and runs searches against them. Keyless installs disable vectors, so the `mem::search` keyword queries should hit through BM25 while `database performance optimization` can return zero. `smart-search` may additionally return structural graph matches when graph data exists. To make the semantic query find the N+1 fix through vectors, set `EMBEDDING_PROVIDER=local`, restart, and allow the first model download to finish.
498
570
 
499
571
  Open `http://localhost:3113` to watch the memory build live.
500
572
 
573
+ ### Validate a fresh install and restart persistence
574
+
575
+ With the server running, check health, the viewer and status:
576
+
577
+ ```bash
578
+ curl -fsS http://localhost:3111/agentmemory/livez
579
+ curl -fsS http://localhost:3111/agentmemory/health
580
+ curl -fsS -o /dev/null http://localhost:3113/
581
+ npx -y @agentmemory/agentmemory@latest status
582
+ ```
583
+
584
+ `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:
585
+
586
+ ```bash
587
+ read -r AGENTMEMORY_SECRET < "$HOME/.agentmemory/secret"
588
+ ```
589
+
590
+ ```bash
591
+ curl -fsS -X POST http://localhost:3111/agentmemory/remember \
592
+ -H "Authorization: Bearer $AGENTMEMORY_SECRET" \
593
+ -H 'Content-Type: application/json' \
594
+ -d '{"content":"agentmemory restart persistence probe","concepts":["install-check"]}'
595
+
596
+ curl -fsS -X POST http://localhost:3111/agentmemory/smart-search \
597
+ -H "Authorization: Bearer $AGENTMEMORY_SECRET" \
598
+ -H 'Content-Type: application/json' \
599
+ -d '{"query":"restart persistence probe","limit":5}'
600
+ ```
601
+
602
+ Then run `npx -y @agentmemory/agentmemory@latest stop`, start the canonical command again in Terminal 1, wait for `/agentmemory/livez`, and repeat the search. The probe must still be returned. If you selected a custom `--data-dir`, pass the same directory on the restart.
603
+
501
604
  ### Everyday commands
502
605
 
503
606
  Install and setup live in [Install](#install) above (the first run walks you through it). Day to day:
504
607
 
505
608
  ```bash
506
609
  agentmemory # start the server
507
- agentmemory stop # tear it down
508
- agentmemory connect <agent> # wire another agent
610
+ agentmemory stop # stop it cleanly
611
+ agentmemory status # health, providers and recovery state
612
+ agentmemory capture # inspect capture inbox and offline spool
613
+ agentmemory capture --drain # replay queued observations
614
+ agentmemory connect <agent> # connect another agent
509
615
  agentmemory doctor # interactive diagnostics + fix prompts
510
616
  agentmemory remove # uninstall everything we created
511
617
  ```
@@ -518,13 +624,13 @@ To bring in older Claude Code JSONL transcripts:
518
624
 
519
625
  ```bash
520
626
  # Import everything under the default ~/.claude/projects
521
- npx @agentmemory/agentmemory import-jsonl
627
+ npx -y @agentmemory/agentmemory@latest import-jsonl
522
628
 
523
629
  # Or import a single file
524
- npx @agentmemory/agentmemory import-jsonl ~/.claude/projects/-my-project/abc123.jsonl
630
+ npx -y @agentmemory/agentmemory@latest import-jsonl ~/.claude/projects/-my-project/abc123.jsonl
525
631
  ```
526
632
 
527
- 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.
633
+ 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.
528
634
 
529
635
  > **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.
530
636
 
@@ -533,17 +639,15 @@ Imported sessions show up in the Replay picker alongside native ones. Under the
533
639
  Use the maintenance command when you intentionally want to update your local runtime:
534
640
 
535
641
  ```bash
536
- npx @agentmemory/agentmemory upgrade
642
+ npx -y @agentmemory/agentmemory@latest upgrade
537
643
  ```
538
644
 
539
- Warning: this command mutates the current workspace/runtime. It can update JavaScript dependencies and pull the pinned `iiidev/iii:0.11.2` Docker image. It never installs an unpinned or newer iii engine.
540
-
541
- Implementation details live in `src/cli.ts` (see `runUpgrade` around the `src/cli.ts:544-595` region).
645
+ 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.
542
646
 
543
647
  ### Claude Code (one block, paste it)
544
648
 
545
649
  ```text
546
- Install agentmemory: run `npx @agentmemory/agentmemory` in a separate terminal to start the memory server. Then run `/plugin marketplace add rohitg00/agentmemory` and `/plugin install agentmemory` — the plugin registers all 12 hooks, 17 skills, AND auto-wires the `@agentmemory/mcp` stdio server via its `.mcp.json`, so you get 54 MCP tools (memory_smart_search, memory_save, memory_sessions, memory_governance_delete, etc.) without any extra config step. Verify with `curl http://localhost:3111/agentmemory/health`. The real-time viewer is at http://localhost:3113.
650
+ 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.
547
651
  ```
548
652
 
549
653
  #### Claude Code without the plugin install (MCP-standalone path)
@@ -563,7 +667,7 @@ For remote or protected deployments, launch Claude Code with `AGENTMEMORY_URL` a
563
667
 
564
668
  ```bash
565
669
  # 1. start the memory server in a separate terminal
566
- npx @agentmemory/agentmemory
670
+ npx -y @agentmemory/agentmemory@latest
567
671
 
568
672
  # 2. register the agentmemory marketplace and install the plugin
569
673
  codex plugin marketplace add rohitg00/agentmemory
@@ -572,41 +676,70 @@ codex plugin add agentmemory@agentmemory
572
676
 
573
677
  The Codex plugin ships from the same `plugin/` directory as the Claude Code plugin. It registers:
574
678
 
575
- - `@agentmemory/mcp` as an MCP server (proxies all 54 tools when `AGENTMEMORY_URL` points at a running agentmemory server; falls back to 7 tools locally when no server is reachable)
679
+ - A bundled stdio MCP bridge to the running daemon, with no npm download or fallback store. See the [local Codex guide](docs/plugins/codex-local.md) to test an unreleased build.
576
680
  - 6 lifecycle hooks: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PreCompact`, `Stop`
577
681
  - 9 invocable skills: `/recall`, `/remember`, `/session-history`, `/forget`, `/recap`, `/handoff`, `/lesson`, `/commit-context`, `/commit-history`, plus 8 reference skills the agent loads on demand (memory discipline, MCP tools, REST API, config, agents, hooks, architecture, and the skill-authoring guide)
578
682
 
579
683
  Codex's hook engine injects `CLAUDE_PLUGIN_ROOT` into hook subprocesses (per [`codex-rs/hooks/src/engine/discovery.rs`](https://github.com/openai/codex/blob/main/codex-rs/hooks/src/engine/discovery.rs)), so the same hook scripts work across both hosts without duplication. Subagent / SessionEnd / Notification / TaskCompleted / PostToolUseFailure events are Claude-Code-only and are not registered for Codex.
580
684
 
581
- #### Codex Desktop: plugin hooks currently silent (workaround available)
685
+ #### Codex hook trust and compatibility
582
686
 
583
- `CodexHooks` and `PluginHooks` are both stable + default-enabled in [`codex-rs/features/src/lib.rs`](https://github.com/openai/codex/blob/main/codex-rs/features/src/lib.rs), but Codex Desktop builds currently do not dispatch plugin-local `hooks.json` ([openai/codex#16430](https://github.com/openai/codex/issues/16430)). MCP tools still work; only the lifecycle observations are missing.
687
+ Native plugin hook dispatch is verified with Codex CLI 0.150.1. Trust the plugin hooks before expecting capture. Desktop behavior depends on its bundled runtime; check `/hooks` and confirm a captured event before enabling a workaround.
584
688
 
585
- Until upstream lands the fix, mirror the same hook commands into the global `~/.codex/hooks.json`:
689
+ If your host requires global hooks, mirror the commands into `~/.codex/hooks.json`. When MCP is already wired, the current connector needs `--force` to reach hook installation:
586
690
 
587
691
  ```bash
588
- agentmemory connect codex --with-hooks
692
+ agentmemory connect codex --with-hooks --force
589
693
  ```
590
694
 
591
- This adds an idempotent block to `~/.codex/hooks.json` referencing absolute paths to the bundled scripts (no `${CLAUDE_PLUGIN_ROOT}` expansion needed at user-scope). Re-run the same command after upgrading agentmemory to refresh paths. User entries in the same file are preserved; only previous agentmemory entries are replaced.
695
+ This merges global hooks and rewrites the agentmemory MCP entry, preserving unrelated entries. Review any custom agentmemory endpoint settings before using `--force`. Re-run after upgrading to refresh script paths. Enable either native plugin hooks or global copies to avoid duplicate capture.
592
696
 
593
697
  ### GitHub Copilot CLI
594
698
 
699
+ For VS Code agent mode, use the [Copilot MCP and automatic-capture guide](docs/plugins/copilot.md#vs-code-copilot-local-agent-sessions). The CLI connector does not configure VS Code.
700
+
595
701
  ```bash
596
702
  # MCP-only wiring
597
703
  agentmemory connect copilot-cli
598
704
 
599
- # Full hooks/skills plugin from the GitHub subdir
705
+ # Alternatively, full hooks/skills plugin from the GitHub subdir
600
706
  copilot plugin install rohitg00/agentmemory:plugin
601
707
  ```
602
708
 
603
- `agentmemory connect copilot-cli` merges `mcpServers.agentmemory` into `~/.copilot/mcp-config.json` (or `$COPILOT_HOME/mcp-config.json` when `COPILOT_HOME` is set) and preserves existing servers. This adapter is Windows-safe even though other `connect` adapters still require manual Windows setup. Copilot picks up the MCP server on next launch or after `/mcp`. Install the plugin as well when you want the full hook/skill experience.
709
+ `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.
710
+
711
+ ### Cursor
712
+
713
+ ```bash
714
+ # MCP wiring
715
+ agentmemory connect cursor
716
+ ```
717
+
718
+ 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.
719
+
720
+ 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.
721
+
722
+ Full guide: [`integrations/cursor/`](integrations/cursor/)
723
+
724
+ ### Pi, Oh My Pi and DeepSeek Harness
725
+
726
+ ```bash
727
+ agentmemory connect pi --with-mcp
728
+ agentmemory connect omp --with-mcp
729
+ agentmemory connect dsh --with-hooks
730
+ ```
731
+
732
+ 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.
733
+
734
+ 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.
735
+
736
+ Guides: [Pi](integrations/pi/), [Oh My Pi](integrations/omp/), [DSH](docs/dsh.md).
604
737
 
605
738
  <details>
606
739
  <summary><b>OpenClaw (paste this prompt)</b></summary>
607
740
 
608
741
  ```text
609
- Install agentmemory for OpenClaw. Run `npx @agentmemory/agentmemory` in a separate terminal to start the memory server on localhost:3111. Then add this to my OpenClaw MCP config so agentmemory is available with all 54 memory tools:
742
+ Install agentmemory for OpenClaw. Run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server on localhost:3111. Then add this to my OpenClaw MCP config so agentmemory is available with all 54 memory tools:
610
743
 
611
744
  {
612
745
  "mcpServers": {
@@ -631,7 +764,7 @@ Full guide: [`integrations/openclaw/`](integrations/openclaw/)
631
764
  <summary><b>Hermes Agent (paste this prompt)</b></summary>
632
765
 
633
766
  ```text
634
- Install agentmemory for Hermes. Run `npx @agentmemory/agentmemory` in a separate terminal to start the memory server on localhost:3111. Then add this to ~/.hermes/config.yaml so Hermes can use agentmemory as an MCP server with all 54 memory tools:
767
+ Install agentmemory for Hermes. Run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server on localhost:3111. Then add this to ~/.hermes/config.yaml so Hermes can use agentmemory as an MCP server with all 54 memory tools:
635
768
 
636
769
  mcp_servers:
637
770
  agentmemory:
@@ -650,7 +783,7 @@ Full guide: [`integrations/hermes/`](integrations/hermes/)
650
783
 
651
784
  ### Other agents
652
785
 
653
- Start the memory server: `npx @agentmemory/agentmemory`
786
+ Start the memory server: `npx -y @agentmemory/agentmemory@latest`
654
787
 
655
788
  #### Native skills via `npx skills add` (50+ agents)
656
789
 
@@ -664,8 +797,8 @@ npx skills add rohitg00/agentmemory -y -a '*' # install to every installed age
664
797
 
665
798
  This is **complementary** to `agentmemory connect <agent>`:
666
799
 
667
- - `agentmemory connect <agent>` writes the MCP server config so the tools are available.
668
- - `npx skills add rohitg00/agentmemory` installs the skills so the agent knows when to call them.
800
+ - `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`.
801
+ - `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.
669
802
 
670
803
  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.
671
804
 
@@ -689,10 +822,10 @@ The agentmemory entry is the **same MCP server block** across every host that us
689
822
  | Agent | Config file | Notes |
690
823
  |---|---|---|
691
824
  | **Cursor (MCP only)** | `~/.cursor/mcp.json` | Merge into `mcpServers`, or `agentmemory connect cursor`. One-click deeplink also available on the website. |
692
- | **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. |
825
+ | **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. |
693
826
  | **Claude Desktop** | `claude_desktop_config.json` (Application Support) | Merge into `mcpServers`. Restart Claude Desktop after editing. |
694
827
  | **Cline / Roo Code / Kilo Code** | Cline MCP settings (Settings UI → MCP Servers → Edit) | Same `mcpServers` block. |
695
- | **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. |
828
+ | **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. |
696
829
  | **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. |
697
830
  | **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. |
698
831
  | **Gemini CLI** | `~/.gemini/settings.json` | `gemini mcp add agentmemory npx -y @agentmemory/mcp --scope user` (auto-merges). |
@@ -700,50 +833,33 @@ The agentmemory entry is the **same MCP server block** across every host that us
700
833
  | **GitHub Copilot CLI (full plugin)** | Copilot plugin install | `copilot plugin install rohitg00/agentmemory:plugin` for the plugin from the GitHub subdir. |
701
834
  | **OpenClaw** | OpenClaw MCP config | Same `mcpServers` block. Deeper: `openclaw plugins install ./integrations/openclaw` claims OpenClaw's memory slot (auto-switches from `memory-core`); set `plugins.entries.agentmemory.hooks.allowConversationAccess=true` or turn capture is silently blocked. See [`integrations/openclaw`](integrations/openclaw/). |
702
835
  | **Codex CLI (MCP only)** | `.codex/config.toml` | TOML shape: `codex mcp add agentmemory -- npx -y @agentmemory/mcp`, or add `[mcp_servers.agentmemory]` manually. |
703
- | **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, Stop) + 17 skills. On Codex Desktop, also run `agentmemory connect codex --with-hooks` until [openai/codex#16430](https://github.com/openai/codex/issues/16430) lands; plugin hooks are currently silent there. |
836
+ | **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks + 17 skills. Trust hooks and verify capture in your host; see [Codex setup and validation](docs/plugins/codex-local.md). |
704
837
  | **OpenCode (MCP only)** | `opencode.json` | Different shape: top-level `mcp` key, command as array: `{"mcp": {"agentmemory": {"type": "local", "command": ["npx", "-y", "@agentmemory/mcp"], "enabled": true}}}`. |
705
838
  | **OpenCode (full plugin)** | `plugin/opencode/` | 22 auto-capture hooks covering session lifecycle, messages, tools, errors. Project attribution is per-session, so one OpenCode process spanning several repositories files each session under its own project. Two slash commands (`/recall`, `/remember`). Copy `plugin/opencode/` into your OpenCode workspace and add the plugin entry to `opencode.json`. See [`plugin/opencode/README.md`](plugin/opencode/README.md) for the full hook table + gap analysis. |
706
- | **pi** | `~/.pi/agent/extensions/agentmemory` | `agentmemory connect pi` installs the bundled extension into pi's auto-discovery directory (recall on agent start, capture on agent end, `memory_search` / `memory_save` / `memory_health` tools, `/agentmemory-status`). `/reload` in a running pi picks it up. [`integrations/pi`](integrations/pi/) is also a pi package (`pi install ./integrations/pi` from a checkout). |
707
- | **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/). |
839
+ | **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/). |
840
+ | **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/). |
841
+ | **Hermes Agent** | `$HERMES_HOME/config.yaml`, default `~/.hermes/config.yaml` | `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/). |
708
842
  | **Qwen Code** | `~/.qwen/settings.json` | `agentmemory connect qwen` writes the standard `mcpServers` block. Hook payload is field-compatible with Claude Code, so the existing 12-hook scripts work without modification; wire them via the `hooks` section in the same `settings.json`. |
709
- | **Antigravity** (replaces Gemini CLI) | `mcp_config.json` (in Antigravity's User dir) | `agentmemory connect antigravity` writes the standard `mcpServers` block. macOS: `~/Library/Application Support/Antigravity/User/`. Linux: `~/.config/Antigravity/User/`. Use after the 2026-06-18 Gemini CLI sunset. |
710
- | **Antigravity CLI** (`agy`) | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity-cli`. The `agy` CLI keeps its own config under `~/.gemini/`, separate from the Antigravity IDE above. Pass `--with-hooks` for native auto-capture via `~/.gemini/config/hooks.json`. |
843
+ | **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). |
844
+ | **Antigravity CLI** (`agy`) | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity-cli --with-hooks` uses the same MCP and hook configuration as current IDE versions. Existing installations should refresh with `--force`; see the [upgrade notes](docs/plugins/antigravity.md). |
711
845
  | **Kiro** | `~/.kiro/settings/mcp.json` | `agentmemory connect kiro` writes the user-level config. Workspace overrides go in `.kiro/settings/mcp.json` next to your code. |
712
846
  | **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills/`; once the Claude Code plugin is installed the 8 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. |
713
847
  | **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. |
714
- | **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`. |
848
+ | **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`. |
715
849
  | **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. |
716
850
  | **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. |
717
- | **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. |
851
+ | **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). |
718
852
  | **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`). |
719
- | **Aider** | n/a | Talk to the REST API directly: `curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}'`. |
720
- | **Any agent (32+)** | n/a | `npx skillkit install agentmemory` auto-detects the host and merges. |
853
+ | **Aider** | n/a | Use the [authenticated REST examples](#validate-a-fresh-install-and-restart-persistence) to save and search memory from scripts. |
854
+ | **Supported agents** | Skills only | `npx skills add rohitg00/agentmemory`; choose the skills and agents to install to. |
721
855
 
722
856
  **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).
723
857
 
724
- ### Programmatic access (Python / Rust / Node)
858
+ ### Programmatic access
725
859
 
726
- 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.
860
+ 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).
727
861
 
728
- ```bash
729
- pip install iii-sdk # Python
730
- cargo add iii-sdk # Rust
731
- npm install iii-sdk # Node
732
- ```
733
-
734
- ```python
735
- from iii import register_worker
736
-
737
- iii = register_worker("ws://localhost:49134")
738
- iii.connect()
739
-
740
- iii.trigger({
741
- "function_id": "mem::smart-search",
742
- "payload": {"project": "demo", "query": "how do tokens refresh"},
743
- })
744
- ```
745
-
746
- Worked example: [`examples/python/`](examples/python/) (quickstart + observation/recall flow). REST on `:3111` remains available for hosts without an iii runtime.
862
+ For direct runtime integration, see the [Python examples](examples/python/).
747
863
 
748
864
  ### From source
749
865
 
@@ -752,86 +868,33 @@ git clone https://github.com/rohitg00/agentmemory.git && cd agentmemory
752
868
  npm install && npm run build && npm start
753
869
  ```
754
870
 
755
- This starts agentmemory with a local `iii-engine` if `iii` is already installed, or falls back to Docker Compose if Docker is available. REST, streams, and the viewer bind to `127.0.0.1` by default.
756
-
757
- Install `iii-engine` manually. **agentmemory currently pins `iii-engine` to `v0.11.2`**. `v0.11.6` introduces a new sandbox-everything-via-`iii worker add` model that agentmemory hasn't been refactored for yet. Pin lifts once the refactor lands. Override with `AGENTMEMORY_III_VERSION=<version>` if you've migrated to the sandbox model manually.
758
-
759
- - **macOS arm64:** `mkdir -p ~/.local/bin && curl -fsSL https://github.com/iii-hq/iii/releases/download/iii/v0.11.2/iii-aarch64-apple-darwin.tar.gz | tar -xz -C ~/.local/bin && chmod +x ~/.local/bin/iii`
760
- - **macOS x64:** swap `aarch64-apple-darwin` for `x86_64-apple-darwin`
761
- - **Linux x64:** swap for `x86_64-unknown-linux-gnu`
762
- - **Linux arm64:** swap for `aarch64-unknown-linux-gnu`
763
- - **Windows:** download `iii-x86_64-pc-windows-msvc.zip` from [iii-hq/iii releases v0.11.2](https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.11.2), extract `iii.exe`, add to PATH
764
-
765
- Or use Docker (the bundled `docker-compose.yml` pulls `iiidev/iii:0.11.2`). Full docs: [iii.dev/docs](https://iii.dev/docs).
871
+ `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`.
766
872
 
767
873
  ### Windows
768
874
 
769
- agentmemory runs on Windows 10/11, but the Node.js package alone isn't enough; you also need the `iii-engine` runtime (a separate native binary) as a background process. The official upstream installer is a `sh` script and there is no PowerShell installer or scoop/winget package today, so Windows users have two paths:
875
+ 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.
770
876
 
771
- **Option A: prebuilt Windows binary (recommended)**
877
+ 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.
772
878
 
773
- ```powershell
774
- # 1. Open https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.11.2 in your browser
775
- # (we pin to v0.11.2 until agentmemory refactors for the new sandbox
776
- # model that engine v0.11.6+ requires)
777
- # 2. Download iii-x86_64-pc-windows-msvc.zip
778
- # (or iii-aarch64-pc-windows-msvc.zip if you're on an ARM machine)
779
- # 3. Extract iii.exe somewhere on PATH, or place it at:
780
- # %USERPROFILE%\.local\bin\iii.exe
781
- # (agentmemory checks that location automatically)
782
- # 4. Verify:
783
- iii --version
784
- # Should print: 0.11.2
785
-
786
- # 5. Then run agentmemory as usual:
787
- npx -y @agentmemory/agentmemory
788
- ```
789
-
790
- **Option B: Docker Desktop**
879
+ **Standalone MCP only (no engine).** If you only need MCP tools and do not need the REST API, viewer, or runtime services:
791
880
 
792
881
  ```powershell
793
- # 1. Install Docker Desktop for Windows
794
- # 2. Start Docker Desktop and make sure the engine is running
795
- # 3. Run agentmemory — it will auto-start the bundled compose file:
796
- npx -y @agentmemory/agentmemory
797
- ```
798
-
799
- **Option C: standalone MCP only (no engine).** If you only need the MCP tools for your agent and don't need the REST API, viewer, or cron jobs, skip the engine entirely:
800
-
801
- ```powershell
802
- npx -y @agentmemory/agentmemory mcp
803
- # or via the shim package:
882
+ npx -y @agentmemory/agentmemory@latest mcp
883
+ # or
804
884
  npx -y @agentmemory/mcp
805
885
  ```
806
886
 
807
- **Diagnostics for Windows:** if `npx @agentmemory/agentmemory` fails, re-run with `--verbose` to see the actual engine stderr. Common failure modes:
808
-
809
- | Symptom | Fix |
810
- |---|---|
811
- | `iii-engine process started` then `did not become ready within 15s` | Engine crashed on startup; re-run with `--verbose`, check stderr |
812
- | `Could not start iii-engine` | Neither `iii.exe` nor Docker is installed. See Option A or B above |
813
- | Port conflict | `netstat -ano \| findstr :3111` to see what's bound, then kill it or use `--port <N>` |
814
- | Docker fallback skipped even though Docker is installed | Make sure Docker Desktop is actually running (system tray icon) |
815
-
816
- > Note: the iii **engine** is a prebuilt binary, not a cargo crate, so don't try to `cargo install` it. (The iii **SDKs** are published on crates.io, npm, and PyPI, but agentmemory doesn't need them.) Supported engine install methods, all pinned to v0.11.2: the prebuilt v0.11.2 binary above, the upstream sh install script **with the version pin** `curl -fsSL https://install.iii.dev/iii/main/install.sh | VERSION=0.11.2 sh` (macOS/Linux), and the Docker image `iiidev/iii:0.11.2`. A bare `install.sh | sh` installs the **latest** engine, which agentmemory does not support; always pass `VERSION=0.11.2`. Easiest of all: just run `npx @agentmemory/agentmemory`, which fetches the pinned engine into `~/.agentmemory/bin` for you.
887
+ **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.
817
888
 
818
889
  ---
819
890
 
820
891
  <h2 id="deploy">Deploy</h2>
821
892
 
822
- One-click templates for managed hosts. Each one ships a self-contained
823
- Dockerfile that pulls `@agentmemory/agentmemory` from npm and copies
824
- the iii engine binary in from the official `iiidev/iii` Docker Hub
825
- image; no pre-built agentmemory image required. Persistent storage
826
- mounts at `/data`; the first-boot entrypoint overwrites the
827
- npm-bundled iii config (which binds `127.0.0.1`) with a deploy-tuned
828
- one that binds `0.0.0.0` and uses absolute `/data` paths, generates
829
- the HMAC secret, then drops privileges from `root` to `node` via
830
- `gosu` before exec'ing the agentmemory CLI.
893
+ 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.
831
894
 
832
895
  <p>
833
- <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>
834
- <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>
896
+ <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>
897
+ <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>
835
898
  </p>
836
899
 
837
900
  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.
@@ -849,28 +912,26 @@ cost floors) live in [`deploy/`](./deploy/README.md):
849
912
  own VPS via [Coolify](https://coolify.io/self-hosted); same Docker
850
913
  Compose stack, you own the host and the data.
851
914
 
852
- Only port `3111` is published. The viewer on `3113` stays bound to
853
- loopback inside the container; every template's README documents the
854
- SSH-tunnel pattern for reaching it.
915
+ 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.
855
916
 
856
917
  ---
857
918
 
858
919
  <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>
859
920
 
860
- 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.
921
+ Project knowledge gets scattered across chats and instruction files. AgentMemory makes past decisions, fixes and lessons searchable from the agent you are using now.
861
922
 
862
923
  ```text
863
924
  Session 1: "Add auth to the API"
864
925
  Agent writes code, runs tests, fixes bugs
865
- agentmemory silently captures every tool use
866
- Session ends -> observations compressed into structured memory
926
+ Connected hooks capture supported tool events
927
+ Observations become searchable project history
867
928
 
868
929
  Session 2: "Now add rate limiting"
869
- Agent already knows:
930
+ Agent recalls:
870
931
  - Auth uses JWT middleware in src/middleware/auth.ts
871
932
  - Tests in test/auth.test.ts cover token validation
872
933
  - You chose jose over jsonwebtoken for Edge compatibility
873
- Zero re-explaining. Starts working immediately.
934
+ Continues with the earlier decisions in context.
874
935
  ```
875
936
 
876
937
  ### vs built-in agent memory
@@ -879,7 +940,7 @@ Every AI coding agent ships with built-in memory: Claude Code has `MEMORY.md`, C
879
940
 
880
941
  | | Built-in (CLAUDE.md) | agentmemory |
881
942
  |---|---|---|
882
- | Scale | 200-line cap | Unlimited |
943
+ | Upkeep | Manually curated instructions | Indexed session history and memories |
883
944
  | Search | Loads everything into context | BM25 + vector + graph (top-K only) |
884
945
  | Token cost | 22K+ at 240 observations | ~1,900 tokens (92% less) |
885
946
  | Cross-agent | Per-agent files | MCP + REST (any agent) |
@@ -897,20 +958,21 @@ PostToolUse hook fires
897
958
  -> SHA-256 dedup (5min window)
898
959
  -> Privacy filter (strip secrets, API keys)
899
960
  -> Store raw observation
900
- -> LLM compress -> structured facts + concepts + narrative
901
- -> Vector embedding (6 providers + local)
902
- -> Index in BM25 + vector
961
+ -> Synthetic compression by default
962
+ (LLM-written compression only with a provider + AGENTMEMORY_AUTO_COMPRESS=true)
963
+ -> Vector embedding when an embedding provider is active
964
+ -> Index in BM25, plus vectors when enabled
903
965
 
904
966
  Stop / SessionEnd hook fires
905
967
  -> Summarize session
906
968
  -> Knowledge graph extraction (if GRAPH_EXTRACTION_ENABLED=true)
907
- -> Slot reflection (if SLOT_REFLECT_ENABLED=true)
969
+ -> Slot reflection (if AGENTMEMORY_SLOTS=true and AGENTMEMORY_REFLECT=true)
908
970
 
909
971
  SessionStart hook fires
910
972
  -> Load project profile (top concepts, files, patterns)
911
973
  -> Hybrid search (BM25 + vector + graph)
912
974
  -> Token budget (default: 2000 tokens)
913
- -> Inject into conversation
975
+ -> Inject context when enabled by the integration
914
976
  ```
915
977
 
916
978
  ### 4-Tier Memory Consolidation
@@ -928,6 +990,8 @@ Memories decay over time (Ebbinghaus curve). Frequently accessed memories streng
928
990
 
929
991
  ### What Gets Captured
930
992
 
993
+ 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`.
994
+
931
995
  | Hook | Captures |
932
996
  |------|----------|
933
997
  | `SessionStart` | Project path, session ID |
@@ -937,14 +1001,14 @@ Memories decay over time (Ebbinghaus curve). Frequently accessed memories streng
937
1001
  | `PostToolUseFailure` | Error context |
938
1002
  | `PreCompact` | Re-injects memory before compaction |
939
1003
  | `SubagentStart/Stop` | Sub-agent lifecycle |
940
- | `Stop` | End-of-session summary |
1004
+ | `Stop` | Assistant's final reply of each turn (privacy-filtered) |
941
1005
  | `SessionEnd` | Session complete marker |
942
1006
 
943
1007
  ### Key Capabilities
944
1008
 
945
1009
  | Capability | Description |
946
1010
  |---|---|
947
- | **Automatic capture** | Every tool use recorded via hooks, no manual effort |
1011
+ | **Automatic capture** | Supported session and tool events recorded by native integrations |
948
1012
  | **Semantic search** | BM25 + vector + knowledge graph with RRF fusion |
949
1013
  | **Memory evolution** | Versioning, supersession, relationship graphs |
950
1014
  | **Recall hygiene** | Superseded memory versions leave the search indexes; the version chain in KV keeps full history |
@@ -954,12 +1018,16 @@ Memories decay over time (Ebbinghaus curve). Frequently accessed memories streng
954
1018
  | **Auto-forgetting** | TTL expiry, contradiction detection, importance eviction |
955
1019
  | **Privacy first** | API keys, secrets, `<private>` tags stripped before storage |
956
1020
  | **Self-healing** | Circuit breaker, provider fallback chain, health monitoring |
957
- | **Claude bridge** | Bi-directional sync with MEMORY.md |
1021
+ | **Claude bridge** | Read MEMORY.md and export project memories without replacing existing files |
958
1022
  | **Knowledge graph** | Entity extraction + BFS traversal |
959
1023
  | **Team memory** | Namespaced shared + private across team members |
960
1024
  | **Citation provenance** | Trace any memory back to source observations |
961
1025
  | **Git snapshots** | Version, rollback, and diff memory state |
962
1026
 
1027
+ 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.
1028
+
1029
+ 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).
1030
+
963
1031
  ---
964
1032
 
965
1033
  <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>
@@ -974,21 +1042,25 @@ Triple-stream retrieval combining three signals:
974
1042
 
975
1043
  Fused with Reciprocal Rank Fusion (RRF, k=60) and session-diversified (max 3 results per session).
976
1044
 
977
- Hybrid ranking applies to the primary recall path, not just `smart-search`: `mem::search` (behind `memory_recall`) ranks through the same BM25 + vector + graph fusion once the vector index is populated. Lesson recall runs on a dedicated in-memory BM25 index instead of scanning the whole corpus per query. Superseded memory versions are excluded from every recall path; the version chain keeps their history.
1045
+ 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.
1046
+
1047
+ Vectors survive a crash or force-kill. The vector index is saved in buckets at most every `AGENTMEMORY_INDEX_SAVE_INTERVAL_MS` (10 minutes). Every vector added or removed in between is also written right away to a small pending log in the state store, and the next start replays it without calling the embedding provider. Each successful save empties the log. Documents that still have no vector after the replay are re-embedded in the background in batches of `AGENTMEMORY_VECTOR_BACKFILL_MAX` (500) until none are left, and a backfill that is stopped continues at the next start. `/agentmemory/status` and the viewer show the pending log size and the backfill state. Keyless installs write nothing.
978
1048
 
979
1049
  BM25 tokenizes Greek, Cyrillic, Hebrew, Arabic, and accented Latin out of the box. For Chinese / Japanese / Korean memories, install the optional segmenters (`npm install @node-rs/jieba tiny-segmenter`) to split CJK runs into word-level tokens; without them, agentmemory soft-falls to whole-run tokenization and prints a one-time hint on stderr.
980
1050
 
981
1051
  ### Embedding providers
982
1052
 
983
- agentmemory auto-detects your provider. For best results, install local embeddings (free):
1053
+ Keyless installs disable vector embeddings: `mem::search` uses BM25, while `smart-search` can also use existing structural graph data. To opt into free on-device semantic embeddings, add this to `~/.agentmemory/.env` and restart agentmemory:
984
1054
 
985
- ```bash
986
- npm install @huggingface/transformers
1055
+ ```env
1056
+ EMBEDDING_PROVIDER=local
987
1057
  ```
988
1058
 
1059
+ 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.
1060
+
989
1061
  | Provider | Model | Cost | Notes |
990
1062
  |---|---|---|---|
991
- | **Local (recommended)** | `all-MiniLM-L6-v2` | Free | Offline, +8pp recall over BM25-only |
1063
+ | **Local (recommended opt-in)** | `all-MiniLM-L6-v2` | Free | On-device after the first model download, +8pp recall over BM25-only |
992
1064
  | Gemini | `gemini-embedding-001` | Free tier | 100+ languages, 768/1536/3072 dims (MRL), 2048-token input. Replaces `text-embedding-004` ([deprecated, shutdown Jan 14, 2026](https://ai.google.dev/gemini-api/docs/deprecations)) |
993
1065
  | OpenAI | `text-embedding-3-small` | $0.02/1M | Highest quality |
994
1066
  | Voyage AI | `voyage-code-3` | Paid | Optimized for code |
@@ -1001,7 +1073,7 @@ npm install @huggingface/transformers
1001
1073
 
1002
1074
  54 tools, 6 resources, 3 prompts, and 17 skills.
1003
1075
 
1004
- > **MCP shim vs full server:** the published `@agentmemory/mcp` package is a thin shim. It exposes the full 54-tool surface **only when it can reach a running agentmemory server** via `AGENTMEMORY_URL` (proxy mode). With no server reachable, the shim falls back to a 7-tool local set (`memory_save`, `memory_recall`, `memory_smart_search`, `memory_sessions`, `memory_export`, `memory_audit`, `memory_governance_delete`). The `AGENTMEMORY_TOOLS=core|all` env var is a *server-side* flag; setting it in the shim's `env` block has no effect. If you see only 7 tools in Cursor / OpenCode / Gemini CLI, start `npx @agentmemory/agentmemory` (or the Docker stack) and set `AGENTMEMORY_URL=http://localhost:3111`.
1076
+ > **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`.
1005
1077
 
1006
1078
  ### 54 Tools
1007
1079
 
@@ -1022,7 +1094,7 @@ Three tool surfaces, smallest to largest: `AGENTMEMORY_TOOLS=core` trims visibil
1022
1094
  | `memory_vision_search` | Search image observations |
1023
1095
  | `memory_timeline` | Chronological observations |
1024
1096
  | `memory_profile` | Project profile (concepts, files, patterns) |
1025
- | `memory_export` | Export all memory data |
1097
+ | `memory_export` | Export memory data, in pages or selected collections on a large store |
1026
1098
  | `memory_relations` | Query relationship graph |
1027
1099
  | `memory_commit_lookup` | Sessions behind a git commit |
1028
1100
  | `memory_commits` | Commits recorded for a session |
@@ -1039,7 +1111,7 @@ Three tool surfaces, smallest to largest: `AGENTMEMORY_TOOLS=core` trims visibil
1039
1111
  | `memory_relations` | Query relationship graph |
1040
1112
  | `memory_graph_query` | Knowledge graph traversal |
1041
1113
  | `memory_consolidate` | Run 4-tier consolidation |
1042
- | `memory_claude_bridge_sync` | Sync with MEMORY.md |
1114
+ | `memory_claude_bridge_sync` | Read MEMORY.md or create a project export, preserving existing files |
1043
1115
  | `memory_team_share` | Share with team members |
1044
1116
  | `memory_team_feed` | Recent shared items |
1045
1117
  | `memory_audit` | Audit trail of operations |
@@ -1093,7 +1165,7 @@ The table shows the four core skills. The full set is 9 invocable skills plus 8
1093
1165
  Run without the full server, for any MCP client. Either of these works:
1094
1166
 
1095
1167
  ```bash
1096
- npx -y @agentmemory/agentmemory mcp # canonical (always available)
1168
+ npx -y @agentmemory/agentmemory@latest mcp # canonical (always available)
1097
1169
  npx -y @agentmemory/mcp # shim package alias
1098
1170
  ```
1099
1171
 
@@ -1141,126 +1213,20 @@ cp plugin/opencode/commands/*.md ~/.config/opencode/commands/
1141
1213
 
1142
1214
  <h2 id="real-time-viewer"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-viewer.svg"><img src="assets/tags/section-viewer.svg" alt="Real-Time Viewer" height="32" /></picture></h2>
1143
1215
 
1144
- Auto-starts on port `3113`. Live observation stream with a stream status indicator, a two-pane session explorer (list beside a sticky detail panel on wide screens), memory and lesson rows that expand to the full stored record including raw JSON and origin provenance, a knowledge graph that clusters nodes by type while relations are sparse, session replay, and a health dashboard.
1145
-
1146
- ```bash
1147
- open http://localhost:3113
1148
- ```
1149
-
1150
- The viewer server binds to `127.0.0.1` by default. The REST-served `/agentmemory/viewer` endpoint follows the normal `AGENTMEMORY_SECRET` bearer-token rules. CSP headers use a per-response script nonce and disable inline handler attributes (`script-src-attr 'none'`).
1151
-
1152
- ---
1153
-
1154
- <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>
1155
-
1156
- 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.
1157
-
1158
- 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.
1159
-
1160
- agentmemory ships this for free because every function call and trigger fires through iii; nothing custom, nothing to instrument.
1161
-
1162
- <p align="center">
1163
- <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" />
1164
- <br/>
1165
- <em>Workers page: every connected worker, including agentmemory itself, with PID, function count, runtime, and last-seen.</em>
1166
- </p>
1167
-
1168
- **Already installed.** The console ships with `iii`; no separate installer.
1169
-
1170
- **Launch alongside agentmemory:**
1171
-
1172
- ```bash
1173
- # agentmemory viewer holds port 3113, so run the console on 3114.
1174
- # Engine REST (3111), WebSocket (3112), and bridge (49134) defaults match agentmemory.
1175
- iii console --port 3114
1176
- ```
1177
-
1178
- Then open `http://localhost:3114`. Add `--enable-flow` for the experimental architecture-graph page.
1179
-
1180
- Override engine endpoints only if you've moved them:
1181
-
1182
- ```bash
1183
- iii console --port 3114 \
1184
- --engine-port 3111 \
1185
- --ws-port 3112 \
1186
- --bridge-port 49134
1187
- ```
1188
-
1189
- **What you can do from the console:**
1190
-
1191
- | Page | Use it to |
1192
- |------|-----------|
1193
- | **Workers** | See every connected worker and its live metrics, including the agentmemory worker itself. |
1194
- | **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. |
1195
- | **Triggers** | Replay HTTP, cron, event, and state triggers: fire the consolidation cron manually, retry an HTTP route, emit a state change. |
1196
- | **States** | KV browser with full CRUD over sessions, memory slots, lifecycle timers, and the embeddings index; edit values in place. |
1197
- | **Streams** | Live WebSocket monitor for memory writes, hook events, and observation updates as they flow through iii streams. |
1198
- | **Queues** | Durable queue topics + dead-letter management. Replay or drop failed embedding / compression jobs. |
1199
- | **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. |
1200
- | **Logs** | Structured OTEL logs filtered and correlated to trace/span IDs. |
1201
- | **Config** | Runtime configuration: see exactly which workers, providers, and ports your engine is running with. |
1202
- | **Flow** | (Optional, `--enable-flow`) Interactive architecture graph of every worker, trigger, and stream. |
1203
-
1204
- <p align="center">
1205
- <img src="assets/iii-console/traces-waterfall.png" alt="iii console trace waterfall view showing per-span duration" width="720" />
1206
- <br/>
1207
- <em>Traces: waterfall / flame / service breakdown for every memory operation.</em>
1208
- </p>
1209
-
1210
- **Traces are already on:**
1211
-
1212
- `iii-config.yaml` ships with the `iii-observability` worker enabled (`exporter: memory`, `sampling_ratio: 1.0`, metrics + logs). No extra config needed; the moment agentmemory starts, every memory operation emits a trace span and a structured log the console can read.
1213
-
1214
- If you want to export to Jaeger/Honeycomb/Grafana Tempo instead, change `exporter: memory` to `exporter: otlp` and set the collector endpoint per iii's observability docs.
1215
-
1216
- > **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.
1217
-
1218
- ---
1219
-
1220
- <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>
1221
-
1222
- 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.
1216
+ 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.
1223
1217
 
1224
- That means one more command extends agentmemory with an entire new capability.
1225
-
1226
- ### Extend agentmemory with one command
1218
+ - **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.
1219
+ - **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.
1220
+ - **Sessions:** an inline observation timeline with readable tool input and output, filters and paging, and the memories and lessons each session produced.
1221
+ - **Graph:** search, node detail with relations and sources, a legend that does not rely on colour alone, and zoom controls.
1222
+ - **Health:** the live version of `GET /agentmemory/status`. Every problem comes with its fix, plus the state backend, index save state, graph provenance compaction progress and a consolidation explainer with the real thresholds.
1223
+ - **Audit, Activity, Profile, Replay, Lessons, Actions and Crystals** pages, each with an empty state that says what the section is, why it is empty and the command that fills it, and a `?` glossary tooltip on every term and number.
1227
1224
 
1228
1225
  ```bash
1229
- iii worker add iii-pubsub # fan memory writes out to every connected instance
1230
- iii worker add iii-cron # scheduled consolidation, decay sweeps, snapshot rotation
1231
- iii worker add iii-queue # durable retries for embedding + compression jobs
1232
- iii worker add iii-observability # OTEL traces on every memory op (default on)
1233
- iii worker add iii-sandbox # run recalled code inside an isolated microVM
1234
- iii worker add iii-database # swap in a SQL-backed state adapter
1235
- iii worker add mcp # generic MCP host alongside the agentmemory MCP
1226
+ open http://localhost:3113
1236
1227
  ```
1237
1228
 
1238
- Each `iii worker add` registers new functions and triggers into the same engine agentmemory is already running on. The viewer and console pick them up immediately: no reload, no new integration, no new container.
1239
-
1240
- | `iii worker add` | What you get on top of agentmemory |
1241
- |---|---|
1242
- | [`iii-pubsub`](https://workers.iii.dev/workers/iii-pubsub) | Multi-instance memory: every `remember` fans out, every `search` reads the union |
1243
- | [`iii-cron`](https://workers.iii.dev/workers/iii-cron) | Scheduled lifecycle: nightly consolidation, weekly snapshots, decay on a fixed clock |
1244
- | [`iii-queue`](https://workers.iii.dev/workers/iii-queue) | Durable retries: failed embedding + compression jobs survive restart, no lost observations |
1245
- | [`iii-observability`](https://workers.iii.dev/workers/iii-observability) | OTEL traces, metrics, logs on every function, wired in `iii-config.yaml` from day one |
1246
- | [`iii-sandbox`](https://workers.iii.dev/workers/iii-sandbox) | Code that came out of `memory_recall` runs inside a throwaway VM, not your shell |
1247
- | [`iii-database`](https://workers.iii.dev/workers/iii-database) | SQL-backed state adapter when you outgrow the in-memory KV defaults |
1248
- | [`mcp`](https://workers.iii.dev/workers/mcp) | Stand up extra MCP servers next to agentmemory's, share the same engine |
1249
-
1250
- Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there composes through the same primitives agentmemory uses, and the agentmemory you already have is one of them.
1251
-
1252
- ### What iii replaces
1253
-
1254
- | Traditional stack | agentmemory uses |
1255
- |---|---|
1256
- | Express.js / Fastify | iii HTTP Triggers |
1257
- | SQLite / Postgres + pgvector | iii KV State + in-memory vector index |
1258
- | SSE / Socket.io | iii Streams (WebSocket) |
1259
- | pm2 / systemd | iii engine worker supervision |
1260
- | Prometheus / Grafana | iii OTEL + health monitor |
1261
- | Custom plugin systems | `iii worker add <name>` |
1262
-
1263
- **184 source files · ~42,200 LOC · 1,674 tests · 264 functions · 50 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
1229
+ 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'`).
1264
1230
 
1265
1231
  ---
1266
1232
 
@@ -1268,11 +1234,11 @@ Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there co
1268
1234
 
1269
1235
  ### LLM Providers
1270
1236
 
1271
- agentmemory auto-detects from your environment. By default, no LLM calls are made unless you configure a provider or explicitly opt in to the Claude subscription fallback.
1237
+ agentmemory auto-detects providers from your environment. A provider makes LLM-backed operations available, but provider configuration alone does not enable LLM-written observation compression. That path requires both a provider and `AGENTMEMORY_AUTO_COMPRESS=true`.
1272
1238
 
1273
1239
  | Provider | Config | Notes |
1274
1240
  |----------|--------|-------|
1275
- | **No-op (default)** | No config needed | LLM-backed compress/summarize is DISABLED. Synthetic BM25 compression + recall still work. See `AGENTMEMORY_ALLOW_AGENT_SDK` below if you used to rely on the Claude-subscription fallback. |
1241
+ | **No-op (default)** | No config needed | LLM-backed compress/summarize is disabled. Synthetic compression and BM25 recall still work. See `AGENTMEMORY_ALLOW_AGENT_SDK` below if you used to rely on the Claude-subscription fallback. |
1276
1242
  | Anthropic API | `ANTHROPIC_API_KEY` | Per-token billing |
1277
1243
  | MiniMax | `MINIMAX_API_KEY` | Anthropic-compatible |
1278
1244
  | Gemini | `GEMINI_API_KEY` | Also enables embeddings |
@@ -1326,28 +1292,13 @@ Qwen 3 models think by default and can burn the whole token budget on reasoning
1326
1292
 
1327
1293
  Reasoning-class models (`o1`-style with `<think>` blocks) can return empty `content` with a `reasoning` field your local server may not surface. If extractions come back blank, switch to a non-reasoning model first. The `OPENAI_REASONING_EFFORT=none` env can also disable thinking on Ollama Cloud thinking models that mirror the OpenAI reasoning schema.
1328
1294
 
1329
- Local embeddings ship out of the box via `@huggingface/transformers`: `EMBEDDING_PROVIDER=local` (default) gives you `Xenova/all-MiniLM-L6-v2` (384-dim) entirely on-device. No extra config needed.
1295
+ Local embeddings ship as an optional dependency but are not enabled by default. Set `EMBEDDING_PROVIDER=local` to opt into `Xenova/all-MiniLM-L6-v2` (384-dim). The first embedding request downloads the model; inference is on-device afterward. Without that setting or a remote embedding key, vectors stay disabled, `mem::search` uses BM25, and `smart-search` can still add existing graph matches.
1330
1296
 
1331
1297
  ### Cost-aware model selection
1332
1298
 
1333
- Background compression runs on every observation, so model choice meaningfully changes monthly spend. Captured workload data: 635 requests / 888K tokens / 35 hours of active use, run against three OpenRouter models at 2026-05-23 pricing.
1334
-
1335
- | Tier | Model | Input / 1M | Output / 1M | Cost for the captured 35h | Notes |
1336
- |------|-------|------------|-------------|---------------------------|-------|
1337
- | Recommended | `deepseek/deepseek-v4-flash-0731` | $0.07 | $0.14 | ~$0.07 (est.) | Latest DeepSeek; cheapest recommended pick for compression workloads. |
1338
- | Recommended | `deepseek/deepseek-v4-pro` | $0.435 | $0.87 | ~$0.46 | Solid compression + summarization quality at ~10× lower cost than Sonnet. |
1339
- | Recommended | `qwen/qwen3-coder` | $0.45 | $1.80 | ~$0.55 | Strong code reasoning if your sessions are heavily code-shaped. |
1340
- | 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. |
1341
- | Premium | `openai/gpt-5.6-sol` | $5.00 | $30.00 | ~$9 (est.) | Flagship tier; expensive for always-on background work. |
1342
- | Avoid | `anthropic/claude-opus-5` | $5.00 | $25.00 | ~$8.40 (est.) | Flagship-class model; overspend for compression. |
1343
-
1344
- Measured rows come from the captured run; (est.) rows scale the same token mix by each model's list price.
1345
-
1346
- 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.
1299
+ 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.
1347
1300
 
1348
- 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.
1349
-
1350
- 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/).
1301
+ The viewer and `agentmemory status` show the active providers. Local OpenAI-compatible servers work with the same configuration shape as hosted providers.
1351
1302
 
1352
1303
  ### Multi-agent memory (`AGENT_ID` + `AGENTMEMORY_AGENT_SCOPE`)
1353
1304
 
@@ -1377,35 +1328,24 @@ When `AGENT_ID` is unset, memory remains unscoped (legacy behavior, no tags, no
1377
1328
 
1378
1329
  ### Ports
1379
1330
 
1380
- 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.
1331
+ The API and viewer bind to loopback by default.
1381
1332
 
1382
- | Port | Process | Purpose | Env override |
1383
- |------|---------|---------|--------------|
1384
- | `3111` | agentmemory | REST API + MCP HTTP + `/agentmemory/health` + `/agentmemory/livez` | `III_REST_PORT` |
1385
- | `3112` | iii-engine | Internal streams worker (consumed by agentmemory + viewer) | `III_STREAMS_PORT` |
1386
- | `3113` | agentmemory | Real-time viewer (`http://localhost:3113`) | `AGENTMEMORY_VIEWER_PORT` |
1387
- | `49134` | iii-engine | WebSocket; workers register here, OTel telemetry flows over it | `III_ENGINE_URL` (full URL, default `ws://localhost:49134`) |
1333
+ | Port | Purpose | Env override |
1334
+ |---|---|---|
1335
+ | `3111` | REST API, MCP HTTP and live viewer events | `III_REST_PORT` |
1336
+ | `3113` | Viewer UI | `III_VIEWER_PORT` |
1388
1337
 
1389
- Stale-process cleanup when ports stay bound after a crashed run:
1338
+ `--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.
1390
1339
 
1391
- ```bash
1392
- # macOS / Linux — find whatever is on each port and kill it
1393
- lsof -i :3111,3112,3113,49134
1394
- pkill -f agentmemory || true
1395
- pkill -f 'iii ' || true
1396
-
1397
- # Windows
1398
- netstat -ano | findstr ":3111 :3112 :3113 :49134"
1399
- taskkill /F /PID <pid>
1400
- ```
1340
+ ### Storage backend: file (default) vs Redis
1401
1341
 
1402
- `agentmemory stop` reaps both the worker and the engine pidfile cleanly on graceful shutdown. In Docker mode it tears down only agentmemory's own compose services and reaps the native worker before the Docker teardown; the CLI also refuses to adopt or signal Docker or VM port holders (Docker backend, vpnkit, colima) as the native engine unless `--force` is passed. The manual cleanup above is only for the post-crash case where neither pidfile is left behind.
1342
+ 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.
1403
1343
 
1404
1344
  ### Config File
1405
1345
 
1406
- 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.
1346
+ 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. Set `AGENTMEMORY_ENV_FILE` to use another env-file path.
1407
1347
 
1408
- Process environment variables still work and take precedence over values in the file.
1348
+ Process environment variables take precedence over values in the file. Restart the server after changing its configuration.
1409
1349
 
1410
1350
  On Windows, the same file lives at `%USERPROFILE%\.agentmemory\.env`:
1411
1351
 
@@ -1421,6 +1361,8 @@ AGENTMEMORY_ALLOW_AGENT_SDK=true
1421
1361
  AGENTMEMORY_AUTO_COMPRESS=true
1422
1362
  ```
1423
1363
 
1364
+ 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.
1365
+
1424
1366
  Consolidation (graph nodes, lessons, crystals) is on by default whenever an LLM provider is configured. Explicitly opt out with `CONSOLIDATION_ENABLED=false` if you want LLM-free operation. Graph extraction is a separate flag:
1425
1367
 
1426
1368
  ```env
@@ -1430,136 +1372,46 @@ GRAPH_EXTRACTION_ENABLED=true
1430
1372
 
1431
1373
  ### Environment Variables
1432
1374
 
1433
- Create `~/.agentmemory/.env`:
1375
+ Common options for `~/.agentmemory/.env`:
1434
1376
 
1435
1377
  ```env
1436
- # LLM provider (pick one — default is the no-op provider: no LLM calls)
1437
- # ANTHROPIC_API_KEY=sk-ant-...
1438
- # ANTHROPIC_BASE_URL=... # Optional: Anthropic-compatible proxy / Azure
1439
- # GEMINI_API_KEY=...
1440
- # OPENROUTER_API_KEY=...
1441
- # MINIMAX_API_KEY=...
1442
- # OPENAI_API_KEY=*** # NOTE: this same key auto-activates BOTH the
1443
- # # OpenAI LLM provider (here) AND the OpenAI
1444
- # # embedding provider (further below). Set
1445
- # # OPENAI_API_KEY_FOR_LLM=false to scope it
1446
- # # to embeddings only.
1447
- # OPENAI_BASE_URL=https://api.openai.com # Optional: override for Azure / vLLM / LM Studio / proxies
1448
- # # Azure: https://<resource>.openai.azure.com/openai/deployments/<deployment>
1449
- # # Auto-detected from `.openai.azure.com` hostname; uses
1450
- # # api-key header + api-version query param.
1451
- # OPENAI_API_VERSION=2024-08-01-preview # Optional: Azure api-version query param
1452
- # OPENAI_MODEL=gpt-5.6-luna # Optional: default model
1453
- # OPENAI_TIMEOUT_MS=60000 # Optional: OpenAI-scoped alias for the outbound fetch
1454
- # # timeout. Takes precedence over AGENTMEMORY_LLM_TIMEOUT_MS
1455
- # # for back-compat with v0.9.17. New configs should
1456
- # # prefer the global AGENTMEMORY_LLM_TIMEOUT_MS below.
1457
- # OPENAI_REASONING_EFFORT=none # Optional: "low" | "medium" | "high" | "none"
1458
- # # Honored only by OpenAI's reasoning models (o1, o3,
1459
- # # gpt-*-reasoning) and providers that mirror that
1460
- # # schema (Ollama Cloud thinking models). Standard
1461
- # # chat models reject this field with 400. Set to
1462
- # # "none" for thinking models that return reasoning
1463
- # # but no content.
1464
- # OPENAI_API_KEY_FOR_LLM=false # Optional: set to false to skip OpenAI auto-detection
1465
- # # for LLM (useful if you only want OpenAI for embeddings)
1466
- # Opt-in Claude-subscription fallback (spawns @anthropic-ai/claude-agent-sdk);
1467
- # leave OFF unless you understand the Stop-hook recursion risk:
1468
- # AGENTMEMORY_ALLOW_AGENT_SDK=true
1469
-
1470
- # Embedding provider (auto-detected, or override)
1471
- # EMBEDDING_PROVIDER=local
1472
- # VOYAGE_API_KEY=...
1473
- # OPENAI_API_KEY=sk-...
1474
- # OPENAI_BASE_URL=https://api.openai.com # Override for Azure / vLLM / LM Studio / proxies
1475
- # OPENAI_EMBEDDING_MODEL=text-embedding-3-small
1476
- # OPENAI_EMBEDDING_DIMENSIONS=1536 # Required when the model is not in the known-models table
1477
-
1478
- # Outbound LLM / embedding timeout
1479
- # AGENTMEMORY_LLM_TIMEOUT_MS=60000 # Default: 60 000 ms (60 s). Applies to every
1480
- # raw-fetch provider (Gemini, OpenRouter, MiniMax,
1481
- # OpenAI LLM, OpenAI/Cohere/Voyage/OpenRouter
1482
- # embedding). For the OpenAI LLM path, the
1483
- # OpenAI-scoped OPENAI_TIMEOUT_MS alias (above)
1484
- # takes precedence when set, for back-compat
1485
- # with v0.9.17.
1486
- # Increase for slow networks or large batch calls;
1487
- # decrease to fail-fast on rate-limit holds.
1488
-
1489
- # Search tuning
1490
- # BM25_WEIGHT=0.4
1491
- # VECTOR_WEIGHT=0.6
1492
- # TOKEN_BUDGET=2000
1493
-
1494
- # Auth
1495
- # AGENTMEMORY_SECRET=your-secret
1496
-
1497
- # Ports (defaults: 3111 API, 3113 viewer)
1498
- # III_REST_PORT=3111
1499
-
1500
- # Features
1501
- # AGENTMEMORY_AUTO_COMPRESS=false # OFF by default. When on,
1502
- # every PostToolUse hook calls your
1503
- # LLM provider to compress the
1504
- # observation — expect significant
1505
- # token spend on active sessions.
1506
- # AGENTMEMORY_SLOTS=false # OFF by default. Editable pinned
1507
- # memory slots — persona,
1508
- # user_preferences, tool_guidelines,
1509
- # project_context, guidance,
1510
- # pending_items, session_patterns,
1511
- # self_notes. Size-limited; agent
1512
- # edits via memory_slot_* tools.
1513
- # Pinned slots addressable for
1514
- # SessionStart injection.
1515
- # AGENTMEMORY_REFLECT=false # OFF by default. Requires SLOTS=on.
1516
- # Stop hook fires mem::slot-reflect:
1517
- # scans recent observations, auto-
1518
- # appends TODOs to pending_items,
1519
- # counts patterns in
1520
- # session_patterns, records touched
1521
- # files in project_context. Fire-
1522
- # and-forget; does not block.
1523
- # AGENTMEMORY_INJECT_CONTEXT=false # OFF by default. When on:
1524
- # - SessionStart may inject ~1-2K
1525
- # chars of project context into
1526
- # the first turn of each session
1527
- # (this is what actually reaches
1528
- # the model — Claude Code treats
1529
- # SessionStart stdout as context)
1530
- # - PreToolUse fires /agentmemory/enrich
1531
- # on every file-touching tool call
1532
- # (resource cleanup, not a token
1533
- # fix — PreToolUse stdout is debug
1534
- # log only per Claude Code docs)
1535
- # Observations are still captured via
1536
- # PostToolUse regardless of this flag.
1537
- # GRAPH_EXTRACTION_ENABLED=false
1538
- # AGENTMEMORY_LLM_NOTHINK=1 # Local reasoning models only: ask the
1539
- # model to skip its hidden thinking pass
1540
- # during graph extraction. Faster runs;
1541
- # relation quality can drop slightly.
1542
- # CONSOLIDATION_ENABLED=false # on by default when an LLM provider is configured
1543
- # LESSON_DECAY_ENABLED=true
1544
- # OBSIDIAN_AUTO_EXPORT=false
1545
- # AGENTMEMORY_EXPORT_ROOT=~/.agentmemory
1546
- # CLAUDE_MEMORY_BRIDGE=false
1547
- # SNAPSHOT_ENABLED=false
1548
-
1549
- # Team
1550
- # TEAM_ID=
1551
- # USER_ID=
1552
- # TEAM_MODE=private
1553
-
1554
- # Tool visibility: "all" (54 tools, default) or "core" (8 tools, lean)
1378
+ # Semantic recall on your machine, after the first model download
1379
+ EMBEDDING_PROVIDER=local
1380
+
1381
+ # Optional automatic context injection through the shared hooks
1382
+ # AGENTMEMORY_INJECT_CONTEXT=true
1383
+
1384
+ # Optional LLM-written compression; also requires a configured provider
1385
+ # AGENTMEMORY_AUTO_COMPRESS=true
1386
+
1387
+ # Show 8 essential MCP tools instead of the default 54
1555
1388
  # AGENTMEMORY_TOOLS=core
1389
+
1390
+ # Disable scheduled auto-forget and lesson/insight decay
1391
+ # AUTO_FORGET_ENABLED=false
1392
+ # LESSON_DECAY_ENABLED=false
1393
+ # INSIGHT_DECAY_ENABLED=false
1556
1394
  ```
1557
1395
 
1396
+ 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.
1397
+
1558
1398
  ---
1559
1399
 
1560
1400
  <h2 id="api"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-api.svg"><img src="assets/tags/section-api.svg" alt="API" height="32" /></picture></h2>
1561
1401
 
1562
- 130 endpoints on port `3111`. The REST API binds to `127.0.0.1` by default. Protected endpoints require `Authorization: Bearer <secret>` when `AGENTMEMORY_SECRET` is set, and mesh sync endpoints require `AGENTMEMORY_SECRET` on both peers.
1402
+ 146 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.
1403
+
1404
+ **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:
1405
+
1406
+ ```bash
1407
+ curl -H "Authorization: Bearer <secret-from-data-dir>" http://localhost:3111/agentmemory/health
1408
+ ```
1409
+
1410
+ **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.
1411
+
1412
+ **File paths.** Endpoints that read or write files (`/compress-file`, `/replay/import-jsonl`, `/graph/import-graphify`) only accept paths under `~/.agentmemory`, the instance data directory, or a directory listed in `AGENTMEMORY_IMPORT_ROOT` (separate several with `:`, or `;` on Windows). `/replay/import-jsonl` also accepts its default `~/.claude/projects`. `/obsidian/export` stays inside `AGENTMEMORY_EXPORT_ROOT` and `/migrate` inside `~/.agentmemory`. Symlinks are resolved before every check.
1413
+
1414
+ **Secret scrubbing.** API keys, bearer tokens, PEM private key blocks and credentials embedded in URLs (`scheme://user:password@host`) are redacted before text is stored, on every write path: observations, remember, evolve, slots, lessons, actions, sketches, signals, checkpoints, imports, jsonl replay, mesh sync, team shares, compression and summary output, crystals and graph nodes.
1563
1415
 
1564
1416
  <details>
1565
1417
  <summary>Key endpoints</summary>
@@ -1567,9 +1419,14 @@ Create `~/.agentmemory/.env`:
1567
1419
  | Method | Path | Description |
1568
1420
  |--------|------|-------------|
1569
1421
  | `GET` | `/agentmemory/health` | Health check (always public) |
1422
+ | `GET` | `/agentmemory/status` | What is wrong and how to fix it (HTML for browsers, JSON otherwise) |
1423
+ | `GET` | `/agentmemory/viewer/snapshot` | Everything the viewer shows, in one response |
1570
1424
  | `POST` | `/agentmemory/session/start` | Start session + get context |
1571
- | `POST` | `/agentmemory/session/end` | End session |
1572
- | `POST` | `/agentmemory/observe` | Capture observation |
1425
+ | `POST` | `/agentmemory/session/end` | End session; `final: false` (per-turn hooks) defers completion until the session is idle |
1426
+ | `POST` | `/agentmemory/observe` | Capture observation (see capture delivery below) |
1427
+ | `GET` | `/agentmemory/capture` | Capture inbox, dead letters and offline spool |
1428
+ | `POST` | `/agentmemory/capture/retry` | Retry dead-letter captures |
1429
+ | `POST` | `/agentmemory/capture/drain` | Send the local offline spool now |
1573
1430
  | `POST` | `/agentmemory/smart-search` | Hybrid search |
1574
1431
  | `POST` | `/agentmemory/context` | Generate context |
1575
1432
  | `POST` | `/agentmemory/remember` | Save to long-term memory |
@@ -1579,13 +1436,48 @@ Create `~/.agentmemory/.env`:
1579
1436
  | `GET` | `/agentmemory/export` | Export all data |
1580
1437
  | `POST` | `/agentmemory/import` | Import from JSON |
1581
1438
  | `POST` | `/agentmemory/graph/query` | Knowledge graph query |
1439
+ | `POST` | `/agentmemory/graph/reset` | Start an empty graph generation; retain observations and memories |
1440
+ | `POST` | `/agentmemory/graph/compact` | Trim oversized graph provenance |
1582
1441
  | `POST` | `/agentmemory/team/share` | Share with team |
1583
1442
  | `GET` | `/agentmemory/audit` | Audit trail |
1584
1443
 
1585
- Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
1444
+ Full endpoint list: [generated REST reference](plugin/skills/agentmemory-rest-api/REFERENCE.md)
1586
1445
 
1587
1446
  </details>
1588
1447
 
1448
+ **Capture delivery.** Hooks send each observation once to `POST /agentmemory/observe` with an `eventId`. It is the host's own id for the call when the payload has one (for example Claude Code's `tool_use_id`), otherwise a hash of the session, hook type, tool name, input, output and host timestamp. The server writes the event to a capture inbox in the state store, stores the observation, then removes the inbox entry. The status code says what happened:
1449
+
1450
+ | Status | `status` field | Meaning |
1451
+ |---|---|---|
1452
+ | `201` | `accepted` | Stored. `observationId` is the new observation. |
1453
+ | `202` | `accepted` (`state: "retrying"`) | Accepted, but storing failed. The server retries it, also after a restart. |
1454
+ | `200` | `duplicate` | This `eventId` was already accepted. `observationId` is the existing observation; nothing new is stored. |
1455
+ | `400` / `422` | `rejected` | Invalid payload, or storing failed for good (the event is kept as a dead letter). |
1456
+ | `503` | `rejected` (`retryable: true`) | The inbox is full (`AGENTMEMORY_CAPTURE_INBOX_MAX`). Hooks spool the event and send it later. |
1457
+
1458
+ Failed events are retried every `AGENTMEMORY_CAPTURE_RETRY_INTERVAL_MS` (10 s) with doubling backoff, up to `AGENTMEMORY_CAPTURE_MAX_ATTEMPTS` (5). Events that still fail stay in the inbox as dead letters, are listed on `/agentmemory/status` and the viewer Health page, and can be retried with `POST /agentmemory/capture/retry` (`{"eventId": "..."}` or `{"all": true}`). Accepted event ids are remembered for `AGENTMEMORY_CAPTURE_DEDUP_HOURS` (168 hours, at most `AGENTMEMORY_CAPTURE_EVENTS_MAX` ids), so a hook replayed after a timeout or a restart is stored once, while two separate tool calls with their own host ids are stored twice even when their content is identical. When an observation is deleted (forget, session delete, eviction, auto-forget or an import that replaces the store), its event is marked as deleted before the observation is removed, so a replay of that event inside the same window is answered as a duplicate and stores nothing. The state store writes to disk every 2 seconds, so an answered event can still be only in memory for a moment. To cover that, every `2xx` answer also carries the server's `bootId` (new at every start), `acceptedAt` and `durableAfterMs` (the save interval plus 1.5 s on the file store, 1.5 s on redis, where persistence is the operator's setting). Hooks keep the event in the local spool until that window has passed and delete it on a later call without another request. If the `bootId` has changed by then, the server restarted, so the hook sends the event again with the same `eventId`; an event that did reach the disk is not stored twice. The server also sends such events itself at start and every retry interval, so a restart loses nothing even when no hook runs afterwards. Older hooks ignore the extra fields, and new hooks against an older server discard the event on `2xx` as before.
1459
+
1460
+ 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.
1461
+
1462
+ **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.
1463
+
1464
+ **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.
1465
+
1466
+ **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).
1467
+
1468
+ 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.
1469
+
1470
+ ```bash
1471
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization: Bearer <secret>" -H "Content-Type: application/json" -d '{}'
1472
+ ```
1473
+
1474
+ 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.
1475
+
1476
+ ```bash
1477
+ 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}'
1478
+ curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Authorization: Bearer <secret>" -H "Content-Type: application/json" -d '{"scope":"snapshot"}'
1479
+ ```
1480
+
1589
1481
  ---
1590
1482
 
1591
1483
  <h2 id="development"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-development.svg"><img src="assets/tags/section-development.svg" alt="Development" height="32" /></picture></h2>
@@ -1593,11 +1485,11 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
1593
1485
  ```bash
1594
1486
  npm run dev # Hot reload
1595
1487
  npm run build # Production build
1596
- npm test # 1,674 tests
1488
+ npm test # 4,000+ tests
1597
1489
  npm run test:integration # API tests (requires running services)
1598
1490
  ```
1599
1491
 
1600
- **Prerequisites:** Node.js >= 20, [iii-engine](https://iii.dev/docs) or Docker
1492
+ **Prerequisites:** see [Install](#install). Contribution rules and release checks are in [CONTRIBUTING.md](CONTRIBUTING.md).
1601
1493
 
1602
1494
  <h2 id="license"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-license.svg"><img src="assets/tags/section-license.svg" alt="License" height="32" /></picture></h2>
1603
1495