@agentmemory/agentmemory 0.9.22 → 0.9.24

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 (84) hide show
  1. package/AGENTS.md +7 -2
  2. package/README.md +144 -32
  3. package/dist/cli.d.mts.map +1 -1
  4. package/dist/cli.mjs +42 -25
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/{connect-BQQXpyDS.mjs → connect-Cf9bmBqO.mjs} +290 -33
  7. package/dist/connect-Cf9bmBqO.mjs.map +1 -0
  8. package/dist/hooks/notification.mjs +46 -21
  9. package/dist/hooks/notification.mjs.map +1 -1
  10. package/dist/hooks/post-tool-failure.mjs +47 -21
  11. package/dist/hooks/post-tool-failure.mjs.map +1 -1
  12. package/dist/hooks/post-tool-use.mjs +57 -22
  13. package/dist/hooks/post-tool-use.mjs.map +1 -1
  14. package/dist/hooks/pre-compact.mjs +26 -2
  15. package/dist/hooks/pre-compact.mjs.map +1 -1
  16. package/dist/hooks/pre-tool-use.mjs +19 -12
  17. package/dist/hooks/pre-tool-use.mjs.map +1 -1
  18. package/dist/hooks/prompt-submit.mjs +39 -16
  19. package/dist/hooks/prompt-submit.mjs.map +1 -1
  20. package/dist/hooks/session-end.mjs +26 -33
  21. package/dist/hooks/session-end.mjs.map +1 -1
  22. package/dist/hooks/session-start.mjs +28 -3
  23. package/dist/hooks/session-start.mjs.map +1 -1
  24. package/dist/hooks/stop.mjs +14 -17
  25. package/dist/hooks/stop.mjs.map +1 -1
  26. package/dist/hooks/subagent-start.mjs +31 -4
  27. package/dist/hooks/subagent-start.mjs.map +1 -1
  28. package/dist/hooks/subagent-stop.mjs +45 -20
  29. package/dist/hooks/subagent-stop.mjs.map +1 -1
  30. package/dist/hooks/task-completed.mjs +44 -21
  31. package/dist/hooks/task-completed.mjs.map +1 -1
  32. package/dist/iii-config.docker.yaml +3 -2
  33. package/dist/iii-config.yaml +11 -2
  34. package/dist/index.mjs +336 -57
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/{src-gpTAJuBy.mjs → src-B8J9Exum.mjs} +323 -58
  37. package/dist/src-B8J9Exum.mjs.map +1 -0
  38. package/dist/{standalone-C4i7ktpn.mjs → standalone-CPfsVTBA.mjs} +92 -11
  39. package/dist/standalone-CPfsVTBA.mjs.map +1 -0
  40. package/dist/standalone.mjs +94 -9
  41. package/dist/standalone.mjs.map +1 -1
  42. package/dist/{tools-registry-B7Y6nJsr.mjs → tools-registry-DJizX9Az.mjs} +16 -2
  43. package/dist/tools-registry-DJizX9Az.mjs.map +1 -0
  44. package/dist/version-BWEBnKAp.mjs +6 -0
  45. package/dist/version-BWEBnKAp.mjs.map +1 -0
  46. package/dist/viewer/index.html +9 -2
  47. package/iii-config.docker.yaml +3 -2
  48. package/iii-config.yaml +11 -2
  49. package/package.json +1 -1
  50. package/plugin/.claude-plugin/plugin.json +2 -2
  51. package/plugin/.codex-plugin/plugin.json +2 -2
  52. package/plugin/.mcp.copilot.json +15 -0
  53. package/plugin/hooks/hooks.copilot.json +72 -0
  54. package/plugin/plugin.json +15 -0
  55. package/plugin/scripts/notification.mjs +46 -21
  56. package/plugin/scripts/notification.mjs.map +1 -1
  57. package/plugin/scripts/post-tool-failure.mjs +47 -21
  58. package/plugin/scripts/post-tool-failure.mjs.map +1 -1
  59. package/plugin/scripts/post-tool-use.mjs +57 -22
  60. package/plugin/scripts/post-tool-use.mjs.map +1 -1
  61. package/plugin/scripts/pre-compact.mjs +26 -2
  62. package/plugin/scripts/pre-compact.mjs.map +1 -1
  63. package/plugin/scripts/pre-tool-use.mjs +19 -12
  64. package/plugin/scripts/pre-tool-use.mjs.map +1 -1
  65. package/plugin/scripts/prompt-submit.mjs +39 -16
  66. package/plugin/scripts/prompt-submit.mjs.map +1 -1
  67. package/plugin/scripts/session-end.mjs +26 -33
  68. package/plugin/scripts/session-end.mjs.map +1 -1
  69. package/plugin/scripts/session-start.mjs +28 -3
  70. package/plugin/scripts/session-start.mjs.map +1 -1
  71. package/plugin/scripts/stop.mjs +14 -17
  72. package/plugin/scripts/stop.mjs.map +1 -1
  73. package/plugin/scripts/subagent-start.mjs +31 -4
  74. package/plugin/scripts/subagent-start.mjs.map +1 -1
  75. package/plugin/scripts/subagent-stop.mjs +45 -20
  76. package/plugin/scripts/subagent-stop.mjs.map +1 -1
  77. package/plugin/scripts/task-completed.mjs +44 -21
  78. package/plugin/scripts/task-completed.mjs.map +1 -1
  79. package/dist/connect-BQQXpyDS.mjs.map +0 -1
  80. package/dist/src-gpTAJuBy.mjs.map +0 -1
  81. package/dist/standalone-C4i7ktpn.mjs.map +0 -1
  82. package/dist/tools-registry-B7Y6nJsr.mjs.map +0 -1
  83. package/dist/version-DvQMNbEH.mjs +0 -6
  84. package/dist/version-DvQMNbEH.mjs.map +0 -1
package/AGENTS.md CHANGED
@@ -19,6 +19,7 @@ agentmemory is a persistent memory system for AI coding agents, built on iii-eng
19
19
  5. `test/mcp-standalone.test.ts` — tool count assertion
20
20
  6. `README.md` — tool counts (search for "MCP tools")
21
21
  7. `plugin/.claude-plugin/plugin.json` — tool count in description
22
+ 8. `plugin/plugin.json` and `plugin/.mcp.copilot.json` (when present) — tool count or MCP exposure
22
23
 
23
24
  **When adding REST endpoints, you MUST update:**
24
25
  1. `src/triggers/api.ts` — endpoint registration
@@ -32,6 +33,7 @@ agentmemory is a persistent memory system for AI coding agents, built on iii-eng
32
33
  4. `src/functions/export-import.ts` — supportedVersions set
33
34
  5. `test/export-import.test.ts` — version assertion
34
35
  6. `plugin/.claude-plugin/plugin.json` — version field
36
+ 7. `plugin/plugin.json` (when present) — version field
35
37
 
36
38
  **When adding new KV scopes:**
37
39
  1. `src/state/schema.ts` — add to the KV object
@@ -89,7 +91,10 @@ case "memory_your_tool": {
89
91
  ```
90
92
 
91
93
  ### Hook Scripts
92
- Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import). They read JSON from stdin, make HTTP calls to the REST API, and exit. Always use `try/catch` with `AbortSignal.timeout()` for best-effort calls.
94
+ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import). They read JSON from stdin, make HTTP calls to the REST API, and exit. There are two patterns depending on whether Claude Code consumes the script's stdout:
95
+
96
+ - **Context-injecting hooks** (`pre-tool-use`, `pre-compact`, `session-start`) write recalled context to stdout for Claude Code to inject. These MUST use `try/catch` with `await fetch(..., { signal: AbortSignal.timeout(N) })` — the script has to wait for the response before exiting, and the timeout is the only bound on hang time.
97
+ - **Telemetry-only hooks** (`notification`, `post-tool-failure`, `post-tool-use`, `prompt-submit`, `stop`, `session-end`, `subagent-start`, `subagent-stop`, `task-completed`) write nothing to stdout. These MUST use fire-and-forget `fetch(..., { signal: AbortSignal.timeout(N) }).catch(() => {})` paired with `setTimeout(() => process.exit(0), 500).unref()`. The unawaited fetch dispatches the request; the unref'd `setTimeout` force-exits the process after the request has been flushed to the local daemon's socket buffer (~500ms is enough for single-request hooks; use 1500ms for multi-request hooks like `stop` and `session-end` so all fetches have time to start, especially when `AGENTMEMORY_URL` points to a remote daemon). Without the `setTimeout` Node keeps the event loop alive waiting for any in-flight fetch to settle, which means the hook still blocks Claude Code's next-prompt boundary for up to the AbortSignal duration — exactly the bug fire-and-forget is meant to fix.
93
98
 
94
99
  ## Coding Standards
95
100
 
@@ -112,7 +117,7 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
112
117
  ## Current Stats (v0.9.16)
113
118
 
114
119
  - 53 MCP tools (8 visible by default, `AGENTMEMORY_TOOLS=all` for all)
115
- - 124 REST endpoints
120
+ - 125 REST endpoints
116
121
  - 6 MCP resources, 3 MCP prompts
117
122
  - 12 hooks, 4 skills
118
123
  - 50+ iii functions
package/README.md CHANGED
@@ -7,7 +7,22 @@
7
7
  Your coding agent remembers everything. No more re-explaining.
8
8
  Built on <a href="https://github.com/iii-hq/iii">iii engine</a>
9
9
  </strong><br/>
10
- Persistent memory for Claude Code, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, pi, OpenCode, and any MCP client.
10
+ Persistent memory for Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, pi, OpenCode, and any MCP client.
11
+ </p>
12
+
13
+ <p align="center">
14
+ <a href="README.md">English</a> |
15
+ <a href="READMEs/README.zh-CN.md">简体中文</a> |
16
+ <a href="READMEs/README.zh-TW.md">繁體中文</a> |
17
+ <a href="READMEs/README.ja-JP.md">日本語</a> |
18
+ <a href="READMEs/README.ko-KR.md">한국어</a> |
19
+ <a href="READMEs/README.es-ES.md">Español</a> |
20
+ <a href="READMEs/README.tr-TR.md">Türkçe</a> |
21
+ <a href="READMEs/README.ru-RU.md">Русский</a> |
22
+ <a href="READMEs/README.hi-IN.md">हिन्दी</a> |
23
+ <a href="READMEs/README.pt-BR.md">Português</a> |
24
+ <a href="READMEs/README.fr-FR.md">Français</a> |
25
+ <a href="READMEs/README.de-DE.md">Deutsch</a>
11
26
  </p>
12
27
 
13
28
  <p align="center">
@@ -25,7 +40,7 @@
25
40
  </p>
26
41
 
27
42
  <p align="center">
28
- <a href="https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1200%20stars%20%2F%20172%20forks-FF6B35?style=for-the-badge&logo=github&logoColor=white&labelColor=1a1a1a" alt="Design doc: 1200 stars / 172 forks on the gist" /></a>
43
+ <a href="https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1.3k%20stars%20%2F%20182%20forks-FF6B35?style=for-the-badge&logo=github&logoColor=white&labelColor=1a1a1a" alt="Design doc: 1.3k stars / 182 forks on the gist" /></a>
29
44
  </p>
30
45
 
31
46
  <p align="center">
@@ -78,7 +93,8 @@ npm install -g @agentmemory/agentmemory # once — bare `agentmemory` o
78
93
  # sudo npm install -g @agentmemory/agentmemory
79
94
  agentmemory # start the memory server on :3111
80
95
  agentmemory demo # seed sample sessions + prove recall
81
- agentmemory connect claude-code # wire your agent (also: codex, cursor, gemini-cli, ...)
96
+ agentmemory connect claude-code # wire MCP into your agent (also: copilot-cli, codex, cursor, gemini-cli, ...)
97
+ npx skills add rohitg00/agentmemory -y # install 8 native skills so your agent knows when to use the tools
82
98
  ```
83
99
 
84
100
  Or via `npx` (no install):
@@ -100,7 +116,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
100
116
  <table>
101
117
  <tr>
102
118
  <td align="center" width="12.5%">
103
- <a href="https://claude.com/product/claude-code"><img src="https://matthiasroder.com/content/images/2026/01/Claude.png?size=120" alt="Claude Code" width="48" height="48" /></a><br/>
119
+ <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/>
104
120
  <strong>Claude Code</strong><br/>
105
121
  <sub>native plugin + 12 hooks + MCP</sub>
106
122
  </td>
@@ -110,6 +126,11 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
110
126
  <sub>native plugin + 6 hooks + MCP</sub>
111
127
  </td>
112
128
  <td align="center" width="12.5%">
129
+ <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/>
130
+ <strong>GitHub Copilot CLI</strong><br/>
131
+ <sub>MCP + plugin hooks/skills</sub>
132
+ </td>
133
+ <td align="center" width="12.5%">
113
134
  <a href="integrations/openclaw/"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /></a><br/>
114
135
  <strong>OpenClaw</strong><br/>
115
136
  <sub>native plugin + MCP</sub>
@@ -130,7 +151,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
130
151
  <sub>native Memory trait backend</sub>
131
152
  </td>
132
153
  <td align="center" width="12.5%">
133
- <a href="https://cursor.com"><img src="https://www.freelogovectors.net/wp-content/uploads/2025/06/cursor-logo-freelogovectors.net_.png" alt="Cursor" width="48" height="48" /></a><br/>
154
+ <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/>
134
155
  <strong>Cursor</strong><br/>
135
156
  <sub>MCP server</sub>
136
157
  </td>
@@ -142,7 +163,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
142
163
  </tr>
143
164
  <tr>
144
165
  <td align="center" width="12.5%">
145
- <a href="https://github.com/opencode-ai/opencode"><img src="https://github.com/opencode-ai.png?size=120" alt="OpenCode" width="48" height="48" /></a><br/>
166
+ <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/>
146
167
  <strong>OpenCode</strong><br/>
147
168
  <sub>22 hooks + MCP + plugin</sub>
148
169
  </td>
@@ -172,7 +193,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
172
193
  <sub>MCP server</sub>
173
194
  </td>
174
195
  <td align="center" width="12.5%">
175
- <a href="https://windsurf.com"><img src="https://exafunction.github.io/public/brand/windsurf-black-symbol.svg?size=120" alt="Windsurf" width="48" height="48" /></a><br/>
196
+ <a href="https://windsurf.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/windsurf-dark.svg"><img src="https://svgl.app/library/windsurf-light.svg" alt="Windsurf" width="48" height="48" /></picture></a><br/>
176
197
  <strong>Windsurf</strong><br/>
177
198
  <sub>MCP server</sub>
178
199
  </td>
@@ -182,6 +203,13 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
182
203
  <sub>MCP server</sub>
183
204
  </td>
184
205
  </tr>
206
+ <tr>
207
+ <td align="center" width="12.5%">
208
+ <a href="https://www.warp.dev"><img src="https://github.com/warpdotdev.png?size=120" alt="Warp" width="48" height="48" /></a><br/>
209
+ <strong>Warp</strong><br/>
210
+ <sub>connect + MCP + skills</sub>
211
+ </td>
212
+ </tr>
185
213
  </table>
186
214
 
187
215
  <p align="center">
@@ -198,7 +226,7 @@ You explain the same architecture every session. You re-discover the same bugs.
198
226
  npx @agentmemory/agentmemory
199
227
  ```
200
228
 
201
- > **New in v0.9.0** — Landing site at [agent-memory.dev](https://agent-memory.dev), filesystem connector (`@agentmemory/fs-watcher`), standalone MCP now proxies to the running server so hooks and the viewer agree, audit policy codified across every delete path, health stops flagging `memory_critical` on tiny Node processes. Full notes in [CHANGELOG.md](CHANGELOG.md#090--2026-04-18).
229
+ > **New in v0.9.22** — Three new connect adapters (Qwen Code, Antigravity, Kiro), `AGENT_ID` multi-agent isolation with opt-in `AGENTMEMORY_AGENT_SCOPE=isolated` filtering, install ERESOLVE fixed, OpenAI thinking-model output handled, OpenCode auto-context + session creation, viewer graph settles on 1000+ nodes, 22 fixes total. Full notes in [CHANGELOG.md](CHANGELOG.md).
202
230
 
203
231
  ---
204
232
 
@@ -413,13 +441,13 @@ Implementation details live in `src/cli.ts` (see `runUpgrade` around the `src/cl
413
441
 
414
442
  ### Claude Code (one block, paste it)
415
443
 
416
- ```
417
- 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, 4 skills, AND auto-wires the `@agentmemory/mcp` stdio server via its `.mcp.json`, so you get 53 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.
444
+ ```text
445
+ 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, 8 skills, AND auto-wires the `@agentmemory/mcp` stdio server via its `.mcp.json`, so you get 53 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.
418
446
  ```
419
447
 
420
448
  #### Claude Code without the plugin install (MCP-standalone path)
421
449
 
422
- If you wire agentmemory's MCP server through `~/.claude.json` directly instead of using `/plugin install`, Claude Code never resolves `${CLAUDE_PLUGIN_ROOT}` and you have to point hook scripts at absolute paths in `~/.claude/settings.json`. Those paths typically embed the agentmemory version (e.g. `~/.codex/plugins/cache/agentmemory/agentmemory/0.9.21/scripts/…`), so the next upgrade silently breaks every hook ([#508](https://github.com/rohitg00/agentmemory/issues/508)).
450
+ If you wire agentmemory's MCP server through `~/.claude.json` directly instead of using `/plugin install`, Claude Code never resolves `${CLAUDE_PLUGIN_ROOT}` and you have to point hook scripts at absolute paths in `~/.claude/settings.json`. Those paths typically embed the agentmemory version (e.g. `~/.codex/plugins/cache/agentmemory/agentmemory/0.9.22/scripts/…`), so the next upgrade silently breaks every hook ([#508](https://github.com/rohitg00/agentmemory/issues/508)).
423
451
 
424
452
  Workaround:
425
453
 
@@ -443,9 +471,9 @@ codex plugin add agentmemory@agentmemory
443
471
 
444
472
  The Codex plugin ships from the same `plugin/` directory as the Claude Code plugin. It registers:
445
473
 
446
- - `@agentmemory/mcp` as an MCP server (proxies all 51 tools when `AGENTMEMORY_URL` points at a running agentmemory server; falls back to 7 tools locally when no server is reachable)
474
+ - `@agentmemory/mcp` as an MCP server (proxies all 53 tools when `AGENTMEMORY_URL` points at a running agentmemory server; falls back to 7 tools locally when no server is reachable)
447
475
  - 6 lifecycle hooks: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PreCompact`, `Stop`
448
- - 4 skills: `/recall`, `/remember`, `/session-history`, `/forget`
476
+ - 8 skills: `/recall`, `/remember`, `/session-history`, `/forget`, `/recap`, `/handoff`, `/commit-context`, `/commit-history`
449
477
 
450
478
  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.
451
479
 
@@ -461,11 +489,23 @@ agentmemory connect codex --with-hooks
461
489
 
462
490
  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.
463
491
 
492
+ ### GitHub Copilot CLI
493
+
494
+ ```bash
495
+ # MCP-only wiring
496
+ agentmemory connect copilot-cli
497
+
498
+ # Full hooks/skills plugin from the GitHub subdir
499
+ copilot plugin install rohitg00/agentmemory:plugin
500
+ ```
501
+
502
+ `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.
503
+
464
504
  <details>
465
505
  <summary><b>OpenClaw (paste this prompt)</b></summary>
466
506
 
467
- ```
468
- 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 51 memory tools:
507
+ ```text
508
+ 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 53 memory tools:
469
509
 
470
510
  {
471
511
  "mcpServers": {
@@ -489,8 +529,8 @@ Full guide: [`integrations/openclaw/`](integrations/openclaw/)
489
529
  <details>
490
530
  <summary><b>Hermes Agent (paste this prompt)</b></summary>
491
531
 
492
- ```
493
- 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 51 memory tools:
532
+ ```text
533
+ 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 53 memory tools:
494
534
 
495
535
  mcp_servers:
496
536
  agentmemory:
@@ -511,6 +551,25 @@ Full guide: [`integrations/hermes/`](integrations/hermes/)
511
551
 
512
552
  Start the memory server: `npx @agentmemory/agentmemory`
513
553
 
554
+ #### Native skills via `npx skills add` (50+ agents)
555
+
556
+ agentmemory ships 8 skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) in the Claude-Code-style `<dir>/SKILL.md` format. The [`skills`](https://npmjs.com/package/skills) CLI by vercel-labs auto-installs them into the calling agent's native skill directory across 50+ agents (Claude Code, Cursor, Cline, Continue, Droid, Warp, Codex, Antigravity, Kiro, OpenCode, Goose, Roo, Trae, Windsurf, and more):
557
+
558
+ ```bash
559
+ npx skills add rohitg00/agentmemory -y # auto-detects the calling agent
560
+ npx skills add rohitg00/agentmemory -y -a warp # explicit agent
561
+ npx skills add rohitg00/agentmemory -y -a '*' # install to every installed agent
562
+ ```
563
+
564
+ This is **complementary** to `agentmemory connect <agent>`:
565
+
566
+ - `agentmemory connect <agent>` writes the MCP server config so the tools are available.
567
+ - `npx skills add rohitg00/agentmemory` installs the skills so the agent knows when to call them.
568
+
569
+ For the few agents the skills CLI doesn't cover yet (Zed v1.3.x and below), drop the 8 SKILL.md files under the agent's native skill directory yourself — same format works everywhere.
570
+
571
+ #### Standard MCP block
572
+
514
573
  The agentmemory entry is the **same MCP server block** across every host that uses the `mcpServers` shape (Cursor, Claude Desktop, Cline, Roo Code, Windsurf, Gemini CLI, OpenClaw):
515
574
 
516
575
  ```json
@@ -533,9 +592,11 @@ The agentmemory entry is the **same MCP server block** across every host that us
533
592
  | **Cline / Roo Code / Kilo Code** | Cline MCP settings (Settings UI → MCP Servers → Edit) | Same `mcpServers` block. |
534
593
  | **Windsurf** | `~/.codeium/windsurf/mcp_config.json` | Same `mcpServers` block. |
535
594
  | **Gemini CLI** | `~/.gemini/settings.json` | `gemini mcp add agentmemory npx -y @agentmemory/mcp --scope user` (auto-merges). |
595
+ | **GitHub Copilot CLI (MCP only)** | `~/.copilot/mcp-config.json` | `agentmemory connect copilot-cli` merges `mcpServers.agentmemory`; Copilot picks it up on next launch or `/mcp`. |
596
+ | **GitHub Copilot CLI (full plugin)** | Copilot plugin install | `copilot plugin install rohitg00/agentmemory:plugin` for the plugin from the GitHub subdir. |
536
597
  | **OpenClaw** | OpenClaw MCP config | Same `mcpServers` block, or use the deeper [memory plugin](integrations/openclaw/). |
537
598
  | **Codex CLI (MCP only)** | `.codex/config.toml` | TOML shape: `codex mcp add agentmemory -- npx -y @agentmemory/mcp`, or add `[mcp_servers.agentmemory]` manually. |
538
- | **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) + 4 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. |
599
+ | **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) + 8 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. |
539
600
  | **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}}}`. |
540
601
  | **OpenCode (full plugin)** | `plugin/opencode/` | 22 auto-capture hooks covering session lifecycle, messages, tools, errors. 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. |
541
602
  | **pi** | `~/.pi/agent/extensions/agentmemory` | Copy [`integrations/pi`](integrations/pi/) and restart pi. |
@@ -543,7 +604,12 @@ The agentmemory entry is the **same MCP server block** across every host that us
543
604
  | **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`. |
544
605
  | **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. |
545
606
  | **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. |
546
- | **Goose** | Goose MCP settings UI | Same `mcpServers` block. |
607
+ | **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. |
608
+ | **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. |
609
+ | **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`. |
610
+ | **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. |
611
+ | **Droid (Factory.ai)** | `~/.factory/mcp.json` | `agentmemory connect droid` writes the standard `mcpServers` block. Project-scoped overrides go in `<repo>/.factory/mcp.json`. The `/mcp` slash command inside droid lists configured servers. |
612
+ | **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`). |
547
613
  | **Aider** | n/a | Talk to the REST API directly: `curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}'`. |
548
614
  | **Any agent (32+)** | n/a | `npx skillkit install agentmemory` auto-detects the host and merges. |
549
615
 
@@ -687,7 +753,7 @@ SSH-tunnel pattern for reaching it.
687
753
 
688
754
  Every coding agent forgets everything when the session ends. You waste the first 5 minutes of every session re-explaining your stack. agentmemory runs in the background and eliminates that entirely.
689
755
 
690
- ```
756
+ ```text
691
757
  Session 1: "Add auth to the API"
692
758
  Agent writes code, runs tests, fixes bugs
693
759
  agentmemory silently captures every tool use
@@ -720,7 +786,7 @@ Every AI coding agent ships with built-in memory — Claude Code has `MEMORY.md`
720
786
 
721
787
  ### Memory Pipeline
722
788
 
723
- ```
789
+ ```text
724
790
  PostToolUse hook fires
725
791
  -> SHA-256 dedup (5min window)
726
792
  -> Privacy filter (strip secrets, API keys)
@@ -821,11 +887,11 @@ npm install @xenova/transformers
821
887
 
822
888
  <h2 id="mcp-server"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-mcp.svg"><img src="assets/tags/section-mcp.svg" alt="MCP Server" height="32" /></picture></h2>
823
889
 
824
- 53 tools, 6 resources, 3 prompts, and 4 skills — the most comprehensive MCP memory toolkit for any agent.
890
+ 53 tools, 6 resources, 3 prompts, and 8 skills — the most comprehensive MCP memory toolkit for any agent.
825
891
 
826
- > **MCP shim vs full server:** the published `@agentmemory/mcp` package is a thin shim. It exposes the full 51-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`.
892
+ > **MCP shim vs full server:** the published `@agentmemory/mcp` package is a thin shim. It exposes the full 53-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`.
827
893
 
828
- ### 51 Tools
894
+ ### 53 Tools
829
895
 
830
896
  <details>
831
897
  <summary>Core tools (always available)</summary>
@@ -847,7 +913,7 @@ npm install @xenova/transformers
847
913
  </details>
848
914
 
849
915
  <details>
850
- <summary>Extended tools (51 total — set AGENTMEMORY_TOOLS=all)</summary>
916
+ <summary>Extended tools (53 total — set AGENTMEMORY_TOOLS=all)</summary>
851
917
 
852
918
  | Tool | Description |
853
919
  |------|-------------|
@@ -970,7 +1036,7 @@ The viewer at `:3113` shows what your agent **remembered**. The [iii console](ht
970
1036
 
971
1037
  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.
972
1038
 
973
- agentmemory ships this for free because every function, trigger, state scope, and stream is an iii primitive — nothing custom, nothing to instrument.
1039
+ agentmemory ships this for free because every function call and trigger fires through iii — nothing custom, nothing to instrument.
974
1040
 
975
1041
  <p align="center">
976
1042
  <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" />
@@ -1032,7 +1098,7 @@ If you want to export to Jaeger/Honeycomb/Grafana Tempo instead, change `exporte
1032
1098
 
1033
1099
  <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>
1034
1100
 
1035
- agentmemory is **already a running [iii](https://iii.dev) instance**. Functions, triggers, KV state, streams, OTEL traces all of it is iii primitives. You didn't install Postgres, Redis, Express, pm2, or Prometheus, because iii replaces them.
1101
+ 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.
1036
1102
 
1037
1103
  That means one more command extends agentmemory with an entire new capability.
1038
1104
 
@@ -1090,8 +1156,54 @@ agentmemory auto-detects from your environment. By default, no LLM calls are mad
1090
1156
  | MiniMax | `MINIMAX_API_KEY` | Anthropic-compatible |
1091
1157
  | Gemini | `GEMINI_API_KEY` | Also enables embeddings |
1092
1158
  | OpenRouter | `OPENROUTER_API_KEY` | Any model |
1159
+ | OpenAI API | `OPENAI_API_KEY` | Default `gpt-4o-mini`, override with `OPENAI_MODEL` |
1160
+ | **Local (Ollama / LM Studio / vLLM / llama.cpp)** | `OPENAI_API_KEY=local` + `OPENAI_BASE_URL=http://localhost:11434/v1` (Ollama) or `http://localhost:1234/v1` (LM Studio) + `OPENAI_MODEL=<your model>` | Anything OpenAI-API-compatible. Zero cost, runs on your hardware. See [Local models](#local-models-ollama-lm-studio-vllm) below. |
1093
1161
  | Claude subscription fallback | `AGENTMEMORY_ALLOW_AGENT_SDK=true` | Opt-in only. Spawns `@anthropic-ai/claude-agent-sdk` sessions — used to cause unbounded Stop-hook recursion (#149 follow-up) so it is no longer the default. |
1094
1162
 
1163
+ ### Local models (Ollama / LM Studio / vLLM)
1164
+
1165
+ agentmemory talks to any OpenAI-API-compatible server, so anything that exposes `/v1/chat/completions` works without code changes. No paid keys, no cloud, no rate limits — runs entirely on your hardware.
1166
+
1167
+ **Ollama** (default port `11434`):
1168
+
1169
+ ```bash
1170
+ ollama pull qwen2.5-coder:7b # or llama3.2:3b, mistral:7b, etc.
1171
+ ollama serve
1172
+ ```
1173
+
1174
+ ```env
1175
+ # ~/.agentmemory/.env
1176
+ OPENAI_API_KEY=ollama # any non-empty string; Ollama ignores it
1177
+ OPENAI_BASE_URL=http://localhost:11434/v1
1178
+ OPENAI_MODEL=qwen2.5-coder:7b
1179
+ ```
1180
+
1181
+ **LM Studio** (default port `1234`):
1182
+
1183
+ Open LM Studio → Local Server tab → Start Server. Pick any chat model from the picker (Qwen 2.5 Coder, Llama 3.2, DeepSeek, etc.).
1184
+
1185
+ ```env
1186
+ # ~/.agentmemory/.env
1187
+ OPENAI_API_KEY=lmstudio # any non-empty string; LM Studio ignores it
1188
+ OPENAI_BASE_URL=http://localhost:1234/v1
1189
+ OPENAI_MODEL=qwen2.5-coder-7b-instruct # match the model name from LM Studio
1190
+ ```
1191
+
1192
+ **vLLM / llama.cpp / Text Generation Inference**: same shape — point `OPENAI_BASE_URL` at whatever URL your server exposes, set `OPENAI_MODEL` to a name your server will accept.
1193
+
1194
+ **Model picks for memory work**: compression and summarization are short tasks (<2K tokens in, <500 tokens out) where a 7B instruct model is plenty. Recommendations:
1195
+
1196
+ | Model | Size | Why |
1197
+ |-------|------|-----|
1198
+ | `qwen2.5-coder:7b` | ~4.7 GB | Best at code-shaped sessions; trained on programming + tool-use traces |
1199
+ | `llama3.2:3b` | ~2 GB | Smallest sane option — fine for compression, weaker for graph extraction |
1200
+ | `mistral:7b-instruct` | ~4.4 GB | Good general-purpose baseline if you don't want code-specific |
1201
+ | `deepseek-r1:7b` | ~4.7 GB | Reasoning-tier quality at 7B; slower but cleaner extractions |
1202
+
1203
+ 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.
1204
+
1205
+ Local embeddings ship out of the box via `@xenova/transformers` — `EMBEDDING_PROVIDER=local` (default) gives you BGE-small entirely on-device. No extra config needed.
1206
+
1095
1207
  ### Cost-aware model selection
1096
1208
 
1097
1209
  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.
@@ -1183,11 +1295,11 @@ AGENTMEMORY_ALLOW_AGENT_SDK=true
1183
1295
  AGENTMEMORY_AUTO_COMPRESS=true
1184
1296
  ```
1185
1297
 
1186
- Turn on graph or consolidation features in the same file if you want them:
1298
+ 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:
1187
1299
 
1188
1300
  ```env
1189
1301
  GRAPH_EXTRACTION_ENABLED=true
1190
- CONSOLIDATION_ENABLED=true
1302
+ # CONSOLIDATION_ENABLED=false # opt out of auto-consolidation
1191
1303
  ```
1192
1304
 
1193
1305
  ### Environment Variables
@@ -1297,7 +1409,7 @@ Create `~/.agentmemory/.env`:
1297
1409
  # Observations are still captured via
1298
1410
  # PostToolUse regardless of this flag.
1299
1411
  # GRAPH_EXTRACTION_ENABLED=false
1300
- # CONSOLIDATION_ENABLED=true
1412
+ # CONSOLIDATION_ENABLED=false # on by default when an LLM provider is configured
1301
1413
  # LESSON_DECAY_ENABLED=true
1302
1414
  # OBSIDIAN_AUTO_EXPORT=false
1303
1415
  # AGENTMEMORY_EXPORT_ROOT=~/.agentmemory
@@ -1309,7 +1421,7 @@ Create `~/.agentmemory/.env`:
1309
1421
  # USER_ID=
1310
1422
  # TEAM_MODE=private
1311
1423
 
1312
- # Tool visibility: "core" (8 tools) or "all" (51 tools)
1424
+ # Tool visibility: "core" (8 tools, lean fallback) or "all" (53 tools)
1313
1425
  # AGENTMEMORY_TOOLS=core
1314
1426
  ```
1315
1427
 
@@ -1317,7 +1429,7 @@ Create `~/.agentmemory/.env`:
1317
1429
 
1318
1430
  <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>
1319
1431
 
1320
- 124 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.
1432
+ 125 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.
1321
1433
 
1322
1434
  <details>
1323
1435
  <summary>Key endpoints</summary>
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";iBAuMsB,kBAAA,CAAA,GAAsB,OAAA"}
1
+ {"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";iBAgNsB,kBAAA,CAAA,GAAsB,OAAA"}
package/dist/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { n as resolveAdapter, r as runAdapter } from "./connect-BQQXpyDS.mjs";
2
+ import { n as resolveAdapter, r as runAdapter } from "./connect-Cf9bmBqO.mjs";
3
3
  import { i as generateId } from "./schema-BkALl7Z_.mjs";
4
4
  import { r as setBootVerbose } from "./logger-xlVlvCWX.mjs";
5
- import { t as VERSION } from "./version-DvQMNbEH.mjs";
5
+ import { t as VERSION } from "./version-BWEBnKAp.mjs";
6
6
  import { execFileSync, spawn, spawnSync } from "node:child_process";
7
7
  import { closeSync, constants, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
8
8
  import { delimiter, dirname, join } from "node:path";
@@ -488,6 +488,11 @@ const NATIVE_AGENTS = [
488
488
  label: "Claude Code",
489
489
  glyph: "⟁"
490
490
  },
491
+ {
492
+ value: "copilot-cli",
493
+ label: "GitHub Copilot CLI",
494
+ glyph: "◈"
495
+ },
491
496
  {
492
497
  value: "codex",
493
498
  label: "Codex",
@@ -609,6 +614,10 @@ function buildAgentOptions() {
609
614
  hint: "MCP server"
610
615
  }))];
611
616
  }
617
+ function getInitialAgentValues(env = process.env) {
618
+ if (env["COPILOT_CLI"] === "1" || env["COPILOT_AGENT_SESSION_ID"]) return ["copilot-cli"];
619
+ return ["claude-code"];
620
+ }
612
621
  function findEnvExample$1() {
613
622
  const candidates = [
614
623
  join(__dirname$1, "..", "..", ".env.example"),
@@ -670,7 +679,7 @@ async function runOnboarding() {
670
679
  message: "Which agents will use agentmemory? (space to toggle, enter to confirm)",
671
680
  options: buildAgentOptions(),
672
681
  required: false,
673
- initialValues: ["claude-code"]
682
+ initialValues: getInitialAgentValues()
674
683
  });
675
684
  if (p.isCancel(agentsPicked)) {
676
685
  p.cancel("Setup cancelled. Re-run any time with: agentmemory --reset");
@@ -679,7 +688,7 @@ async function runOnboarding() {
679
688
  if ((agentsPicked ?? []).length > 0) p.note([
680
689
  "━ how this works ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
681
690
  "All selected agents share the same memory at :3111.",
682
- "A memory saved by Claude Code is visible to Codex + Cursor instantly.",
691
+ "A memory saved by Claude Code is visible to Copilot + Codex + Cursor instantly.",
683
692
  "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
684
693
  ].join("\n"));
685
694
  const providerPicked = await p.select({
@@ -797,6 +806,10 @@ const IS_WINDOWS = platform() === "win32";
797
806
  const IS_VERBOSE = args.includes("--verbose") || args.includes("-v") || process.env["AGENTMEMORY_VERBOSE"] === "1" || process.env["AGENTMEMORY_VERBOSE"] === "true";
798
807
  setBootVerbose(IS_VERBOSE);
799
808
  const IS_RESET = args.includes("--reset");
809
+ if (args.includes("--version") || args.includes("-V")) {
810
+ process.stdout.write(`${VERSION}\n`);
811
+ process.exit(0);
812
+ }
800
813
  const IIPINNED_VERSION = process.env["AGENTMEMORY_III_VERSION"] || "0.11.2";
801
814
  function iiiReleaseAsset() {
802
815
  const p = platform();
@@ -827,8 +840,9 @@ Usage: agentmemory [command] [options]
827
840
  Commands:
828
841
  (default) Start agentmemory worker
829
842
  init Copy bundled .env.example to ~/.agentmemory/.env if absent
830
- connect [agent] Wire agentmemory into an installed agent (claude-code, codex,
831
- cursor, gemini-cli, openclaw, hermes, pi, openhuman).
843
+ connect [agent] Wire agentmemory into an installed agent (claude-code,
844
+ copilot-cli, codex, cursor, gemini-cli, openclaw,
845
+ hermes, pi, openhuman).
832
846
  No arg = interactive picker. --all wires every detected agent.
833
847
  --dry-run shows what would change. --force re-installs.
834
848
  status Show connection status, memory count, flags, and health
@@ -962,10 +976,13 @@ async function isAgentmemoryReady() {
962
976
  }
963
977
  }
964
978
  function findIiiConfig() {
979
+ const envPath = process.env["AGENTMEMORY_III_CONFIG"];
965
980
  const candidates = [
981
+ ...envPath ? [envPath] : [],
982
+ join(process.cwd(), "iii-config.yaml"),
983
+ join(homedir(), ".agentmemory", "iii-config.yaml"),
966
984
  join(__dirname, "iii-config.yaml"),
967
- join(__dirname, "..", "iii-config.yaml"),
968
- join(process.cwd(), "iii-config.yaml")
985
+ join(__dirname, "..", "iii-config.yaml")
969
986
  ];
970
987
  for (const c of candidates) if (existsSync(c)) return c;
971
988
  return "";
@@ -1011,15 +1028,14 @@ function iiiBinVersion(binPath) {
1011
1028
  return null;
1012
1029
  }
1013
1030
  }
1014
- let warnedVersionMismatch = false;
1015
- function warnIfEngineVersionMismatch(iiiBinPath) {
1016
- if (!iiiBinPath || warnedVersionMismatch) return;
1031
+ function enforceEngineVersionPin(iiiBinPath) {
1032
+ if (!iiiBinPath) return;
1017
1033
  const detected = iiiBinVersion(iiiBinPath);
1018
1034
  if (!detected || detected === IIPINNED_VERSION) return;
1019
- warnedVersionMismatch = true;
1020
1035
  const asset = iiiReleaseAsset();
1021
1036
  const downloadHint = asset ? `curl -fsSL https://github.com/iii-hq/iii/releases/download/iii/v${IIPINNED_VERSION}/${asset} | tar -xz -C ~/.local/bin` : `download v${IIPINNED_VERSION} from https://github.com/iii-hq/iii/releases/tag/iii%2Fv${IIPINNED_VERSION}`;
1022
- p.log.warn(`iii-engine on PATH is v${detected} but agentmemory v${VERSION} pins v${IIPINNED_VERSION}. Set AGENTMEMORY_III_VERSION=${detected} to silence, or downgrade with: \`${downloadHint}\``);
1037
+ p.log.error(`iii-engine on PATH is v${detected} but agentmemory v${VERSION} hard-pins v${IIPINNED_VERSION}. Engine API drift causes runtime failures (e.g. state::list-not-found on v0.13.0). Downgrade with: \`${downloadHint}\`. Or set AGENTMEMORY_III_VERSION=${detected} to override at your own risk.`);
1038
+ process.exit(1);
1023
1039
  }
1024
1040
  function enginePidfilePath() {
1025
1041
  return join(homedir(), ".agentmemory", "iii.pid");
@@ -1148,7 +1164,7 @@ function detectIiiConsole() {
1148
1164
  };
1149
1165
  return { kind: "missing" };
1150
1166
  }
1151
- const III_CONSOLE_INSTALL_CMD = "curl -fsSL https://install.iii.dev/console/main/install.sh | sh";
1167
+ const III_CONSOLE_INSTALL_CMD = "curl -fsSL https://install.iii.dev/iii/main/install.sh | sh";
1152
1168
  async function ensureIiiConsole() {
1153
1169
  const state = detectIiiConsole();
1154
1170
  if (state.kind === "installed") return state;
@@ -1281,7 +1297,7 @@ function spawnEngineBackground(bin, spawnArgs, label) {
1281
1297
  return child;
1282
1298
  }
1283
1299
  function startIiiBin(iiiBin, configPath) {
1284
- warnIfEngineVersionMismatch(iiiBin);
1300
+ enforceEngineVersionPin(iiiBin);
1285
1301
  const s = p.spinner();
1286
1302
  s.start(`Starting iii-engine: ${iiiBin}`);
1287
1303
  writeEngineState({
@@ -1488,7 +1504,7 @@ async function main() {
1488
1504
  if (firstRun || IS_RESET) await runOnboarding();
1489
1505
  if (skipEngine) {
1490
1506
  if (IS_VERBOSE) p.log.info("Skipping engine check (--no-engine)");
1491
- await import("./src-gpTAJuBy.mjs");
1507
+ await import("./src-B8J9Exum.mjs");
1492
1508
  if (await waitForAgentmemoryReady(15e3)) {
1493
1509
  const consoleState = await ensureIiiConsole();
1494
1510
  await maybeOfferGlobalInstall();
@@ -1498,9 +1514,9 @@ async function main() {
1498
1514
  }
1499
1515
  if (await isEngineRunning()) {
1500
1516
  if (IS_VERBOSE) p.log.success("iii-engine is running");
1501
- warnIfEngineVersionMismatch(whichBinary("iii") ?? fallbackIiiPaths().find((p) => existsSync(p)) ?? null);
1517
+ enforceEngineVersionPin(whichBinary("iii") ?? fallbackIiiPaths().find((p) => existsSync(p)) ?? null);
1502
1518
  adoptRunningEngine();
1503
- await import("./src-gpTAJuBy.mjs");
1519
+ await import("./src-B8J9Exum.mjs");
1504
1520
  if (await waitForAgentmemoryReady(15e3)) {
1505
1521
  const consoleState = await ensureIiiConsole();
1506
1522
  await maybeOfferGlobalInstall();
@@ -1549,7 +1565,7 @@ async function main() {
1549
1565
  process.exit(1);
1550
1566
  }
1551
1567
  s.stop("iii-engine is ready");
1552
- await import("./src-gpTAJuBy.mjs");
1568
+ await import("./src-B8J9Exum.mjs");
1553
1569
  if (await waitForAgentmemoryReady(15e3)) {
1554
1570
  const consoleState = await ensureIiiConsole();
1555
1571
  await maybeOfferGlobalInstall();
@@ -1584,21 +1600,22 @@ async function runStatus() {
1584
1600
  apiFetch(base, "health"),
1585
1601
  apiFetch(base, "sessions"),
1586
1602
  apiFetch(base, "graph/stats"),
1587
- apiFetch(base, "export"),
1603
+ apiFetch(base, "memories?count=true"),
1588
1604
  apiFetch(base, "config/flags")
1589
1605
  ]);
1590
1606
  if (typeof healthRes?.viewerPort === "number") discoveredViewerPort = healthRes.viewerPort;
1591
1607
  const h = healthRes?.health;
1592
1608
  const status = healthRes?.status || "unknown";
1593
1609
  const version = healthRes?.version || "?";
1594
- const sessions = Array.isArray(sessionsRes?.sessions) ? sessionsRes.sessions.length : 0;
1610
+ const sessionList = Array.isArray(sessionsRes?.sessions) ? sessionsRes.sessions : [];
1611
+ const sessions = sessionList.length;
1595
1612
  const nodes = Number(graphRes?.totalNodes ?? graphRes?.nodes ?? graphRes?.nodeCount ?? 0);
1596
1613
  const edges = Number(graphRes?.totalEdges ?? graphRes?.edges ?? graphRes?.edgeCount ?? 0);
1597
1614
  const cb = healthRes?.circuitBreaker?.state || "closed";
1598
1615
  const heapMB = h?.memory ? Math.round(h.memory.heapUsed / 1048576) : 0;
1599
1616
  const uptime = h?.uptimeSeconds ? Math.round(h.uptimeSeconds) : 0;
1600
- const obsCount = memoriesRes?.observations?.length || 0;
1601
- const memCount = memoriesRes?.memories?.length || 0;
1617
+ const obsCount = sessionList.reduce((sum, s) => sum + (Number(s?.observationCount) || 0), 0);
1618
+ const memCount = Number(memoriesRes?.latestCount ?? memoriesRes?.total ?? 0) || 0;
1602
1619
  const estFullTokens = obsCount * 80;
1603
1620
  const estInjectedTokens = Math.min(obsCount, 50) * 38;
1604
1621
  const tokensSaved = estFullTokens - estInjectedTokens;
@@ -2473,10 +2490,10 @@ async function runStop() {
2473
2490
  p.outro("Stopped. Memories persisted to disk; restart anytime with: npx @agentmemory/agentmemory");
2474
2491
  }
2475
2492
  async function runMcp() {
2476
- await import("./standalone-C4i7ktpn.mjs");
2493
+ await import("./standalone-CPfsVTBA.mjs");
2477
2494
  }
2478
2495
  async function runConnectCmd() {
2479
- const { runConnect } = await import("./connect-BQQXpyDS.mjs").then((n) => n.t);
2496
+ const { runConnect } = await import("./connect-Cf9bmBqO.mjs").then((n) => n.t);
2480
2497
  await runConnect(args.slice(1));
2481
2498
  }
2482
2499
  async function runImportJsonl() {