@agentmemory/agentmemory 0.9.28 → 0.9.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +98 -28
- package/AGENTS.md +19 -26
- package/README.md +619 -274
- package/dist/.env.example +98 -28
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +1328 -244
- package/dist/cli.mjs.map +1 -1
- package/dist/{connect-JnsJXc68.mjs → connect-B4_ca6BD.mjs} +619 -70
- package/dist/connect-B4_ca6BD.mjs.map +1 -0
- package/dist/docker-compose.yml +42 -16
- package/dist/hooks/_capture.d.mts +22 -0
- package/dist/hooks/_capture.d.mts.map +1 -0
- package/dist/hooks/_capture.mjs +908 -0
- package/dist/hooks/_capture.mjs.map +1 -0
- package/dist/hooks/antigravity-bridge.d.mts +8 -0
- package/dist/hooks/antigravity-bridge.d.mts.map +1 -0
- package/dist/hooks/antigravity-bridge.mjs +123 -0
- package/dist/hooks/antigravity-bridge.mjs.map +1 -0
- package/dist/hooks/notification.mjs +34 -27
- package/dist/hooks/notification.mjs.map +1 -1
- package/dist/hooks/post-commit.mjs +84 -2
- package/dist/hooks/post-commit.mjs.map +1 -1
- package/dist/hooks/post-tool-failure.mjs +71 -26
- package/dist/hooks/post-tool-failure.mjs.map +1 -1
- package/dist/hooks/post-tool-use.mjs +99 -36
- package/dist/hooks/post-tool-use.mjs.map +1 -1
- package/dist/hooks/pre-compact.mjs +95 -5
- package/dist/hooks/pre-compact.mjs.map +1 -1
- package/dist/hooks/pre-tool-use.mjs +72 -2
- package/dist/hooks/pre-tool-use.mjs.map +1 -1
- package/dist/hooks/prompt-submit.mjs +25 -22
- package/dist/hooks/prompt-submit.mjs.map +1 -1
- package/dist/hooks/session-end.mjs +93 -24
- package/dist/hooks/session-end.mjs.map +1 -1
- package/dist/hooks/session-start.mjs +101 -6
- package/dist/hooks/session-start.mjs.map +1 -1
- package/dist/hooks/stop.mjs +72 -8
- package/dist/hooks/stop.mjs.map +1 -1
- package/dist/hooks/subagent-start.mjs +28 -26
- package/dist/hooks/subagent-start.mjs.map +1 -1
- package/dist/hooks/subagent-stop.mjs +29 -26
- package/dist/hooks/subagent-stop.mjs.map +1 -1
- package/dist/hooks/task-completed.mjs +31 -28
- package/dist/hooks/task-completed.mjs.map +1 -1
- package/dist/iii-config.docker.yaml +10 -10
- package/dist/iii-config.yaml +3 -1
- package/dist/{image-refs-BKLmp_sD.mjs → image-refs-BaT-9oMU.mjs} +2 -2
- package/dist/image-refs-BaT-9oMU.mjs.map +1 -0
- package/dist/{image-refs-C2YU7BIm.mjs → image-refs-T_urbwHM.mjs} +3 -3
- package/dist/image-refs-T_urbwHM.mjs.map +1 -0
- package/dist/{keyed-mutex-DTHtcZrt.mjs → image-store-BsN4vyjr.mjs} +2 -14
- package/dist/image-store-BsN4vyjr.mjs.map +1 -0
- package/dist/index.mjs +14021 -6494
- package/dist/index.mjs.map +1 -1
- package/dist/keyed-mutex-DchXsyfP.mjs +221 -0
- package/dist/keyed-mutex-DchXsyfP.mjs.map +1 -0
- package/dist/secret-store-BnY3A50C.mjs +2348 -0
- package/dist/secret-store-BnY3A50C.mjs.map +1 -0
- package/dist/{src-CzgoepGU.mjs → src-Jsq9LCeH.mjs} +7349 -2940
- package/dist/src-Jsq9LCeH.mjs.map +1 -0
- package/dist/{standalone-YsZFFQBM.mjs → standalone-DKCdrf1d.mjs} +62 -24
- package/dist/standalone-DKCdrf1d.mjs.map +1 -0
- package/dist/standalone.d.mts.map +1 -1
- package/dist/standalone.mjs +298 -27
- package/dist/standalone.mjs.map +1 -1
- package/dist/status-IRz7ta8-.mjs +2344 -0
- package/dist/status-IRz7ta8-.mjs.map +1 -0
- package/dist/viewer/favicon.svg +35 -1
- package/dist/viewer/index.html +7428 -2608
- package/docker-compose.yml +42 -16
- package/iii-config.docker.yaml +10 -10
- package/iii-config.yaml +3 -1
- package/integrations/pi/README.md +77 -0
- package/integrations/pi/index.ts +402 -0
- package/integrations/pi/package.json +32 -0
- package/integrations/pi/security.ts +87 -0
- package/package.json +15 -7
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/.codex-plugin/plugin.json +26 -4
- package/plugin/.devin-plugin/plugin.json +32 -0
- package/plugin/.mcp.codex.json +12 -0
- package/plugin/.mcp.copilot.json +2 -7
- package/plugin/.mcp.json +2 -7
- package/plugin/assets/icon.svg +35 -0
- package/plugin/cursor/hooks.json +41 -0
- package/plugin/cursor/mcp.json +12 -0
- package/plugin/hooks/hooks.antigravity.json +43 -0
- package/plugin/hooks/hooks.copilot.json +11 -11
- package/plugin/hooks/hooks.devin.json +67 -0
- package/plugin/hooks/hooks.droid.json +55 -0
- package/plugin/opencode/README.md +267 -31
- package/plugin/opencode/agentmemory-capture.ts +644 -15
- package/plugin/opencode/plugin.json +1 -1
- package/plugin/plugin.json +2 -2
- package/plugin/scripts/_capture.d.mts +22 -0
- package/plugin/scripts/_capture.d.mts.map +1 -0
- package/plugin/scripts/_capture.mjs +908 -0
- package/plugin/scripts/_capture.mjs.map +1 -0
- package/plugin/scripts/antigravity-bridge.d.mts +8 -0
- package/plugin/scripts/antigravity-bridge.d.mts.map +1 -0
- package/plugin/scripts/antigravity-bridge.mjs +123 -0
- package/plugin/scripts/antigravity-bridge.mjs.map +1 -0
- package/plugin/scripts/notification.mjs +34 -27
- package/plugin/scripts/notification.mjs.map +1 -1
- package/plugin/scripts/plugin-bridge.mjs +378 -0
- package/plugin/scripts/post-commit.mjs +84 -2
- package/plugin/scripts/post-commit.mjs.map +1 -1
- package/plugin/scripts/post-tool-failure.mjs +71 -26
- package/plugin/scripts/post-tool-failure.mjs.map +1 -1
- package/plugin/scripts/post-tool-use.mjs +99 -36
- package/plugin/scripts/post-tool-use.mjs.map +1 -1
- package/plugin/scripts/pre-compact.mjs +95 -5
- package/plugin/scripts/pre-compact.mjs.map +1 -1
- package/plugin/scripts/pre-tool-use.mjs +72 -2
- package/plugin/scripts/pre-tool-use.mjs.map +1 -1
- package/plugin/scripts/prompt-submit.mjs +25 -22
- package/plugin/scripts/prompt-submit.mjs.map +1 -1
- package/plugin/scripts/session-end.mjs +93 -24
- package/plugin/scripts/session-end.mjs.map +1 -1
- package/plugin/scripts/session-start.mjs +101 -6
- package/plugin/scripts/session-start.mjs.map +1 -1
- package/plugin/scripts/stop.mjs +72 -8
- package/plugin/scripts/stop.mjs.map +1 -1
- package/plugin/scripts/subagent-start.mjs +28 -26
- package/plugin/scripts/subagent-start.mjs.map +1 -1
- package/plugin/scripts/subagent-stop.mjs +29 -26
- package/plugin/scripts/subagent-stop.mjs.map +1 -1
- package/plugin/scripts/task-completed.mjs +31 -28
- package/plugin/scripts/task-completed.mjs.map +1 -1
- package/plugin/skills/_shared/TROUBLESHOOTING.md +22 -6
- package/plugin/skills/agentmemory-agents/REFERENCE.md +8 -5
- package/plugin/skills/agentmemory-config/REFERENCE.md +52 -1
- package/plugin/skills/agentmemory-config/SKILL.md +44 -7
- package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +4 -3
- package/plugin/skills/agentmemory-rest-api/REFERENCE.md +23 -2
- package/plugin/skills/forget/SKILL.md +4 -1
- package/plugin/skills/handoff/SKILL.md +4 -2
- package/plugin/skills/lesson/SKILL.md +64 -0
- package/plugin/skills/memory-discipline/SKILL.md +65 -0
- package/plugin/skills/recall/SKILL.md +4 -1
- package/plugin/skills/remember/SKILL.md +6 -1
- package/dist/config-ChC9EtgV.mjs +0 -259
- package/dist/config-ChC9EtgV.mjs.map +0 -1
- package/dist/connect-JnsJXc68.mjs.map +0 -1
- package/dist/image-refs-BKLmp_sD.mjs.map +0 -1
- package/dist/image-refs-C2YU7BIm.mjs.map +0 -1
- package/dist/keyed-mutex-DTHtcZrt.mjs.map +0 -1
- package/dist/logger-BEB7pCI9.mjs +0 -43
- package/dist/logger-BEB7pCI9.mjs.map +0 -1
- package/dist/schema-CNiCWzV9.mjs +0 -78
- package/dist/schema-CNiCWzV9.mjs.map +0 -1
- package/dist/src-CzgoepGU.mjs.map +0 -1
- package/dist/standalone-YsZFFQBM.mjs.map +0 -1
- package/dist/tools-registry-D3NEoe5m.mjs +0 -1115
- package/dist/tools-registry-D3NEoe5m.mjs.map +0 -1
- package/plugin/scripts/diagnostics.d.mts +0 -17
- package/plugin/scripts/diagnostics.d.mts.map +0 -1
- package/plugin/scripts/diagnostics.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/banner.png" alt="agentmemory
|
|
2
|
+
<img src="assets/banner.png" alt="agentmemory: persistent memory for AI coding agents" width="720" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -11,18 +11,39 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<a href="README.md"
|
|
15
|
-
<a href="READMEs/README.zh-CN.md"
|
|
16
|
-
<a href="READMEs/README.zh-TW.md"
|
|
17
|
-
<a href="READMEs/README.ja-JP.md"
|
|
18
|
-
<a href="READMEs/README.ko-KR.md"
|
|
19
|
-
<a href="READMEs/README.
|
|
20
|
-
<a href="READMEs/README.
|
|
21
|
-
<a href="READMEs/README.
|
|
22
|
-
<a href="READMEs/README.
|
|
23
|
-
<a href="READMEs/README.
|
|
24
|
-
<a href="READMEs/README.
|
|
25
|
-
<a href="READMEs/README.
|
|
14
|
+
<a href="README.md">🇬🇧 English</a> •
|
|
15
|
+
<a href="READMEs/README.zh-CN.md">🇨🇳 简体中文</a> •
|
|
16
|
+
<a href="READMEs/README.zh-TW.md">🇹🇼 繁體中文</a> •
|
|
17
|
+
<a href="READMEs/README.ja-JP.md">🇯🇵 日本語</a> •
|
|
18
|
+
<a href="READMEs/README.ko-KR.md">🇰🇷 한국어</a> •
|
|
19
|
+
<a href="READMEs/README.pt-PT.md">🇵🇹 Português</a> •
|
|
20
|
+
<a href="READMEs/README.pt-BR.md">🇧🇷 Português (Brasil)</a> •
|
|
21
|
+
<a href="READMEs/README.es-ES.md">🇪🇸 Español</a> •
|
|
22
|
+
<a href="READMEs/README.de-DE.md">🇩🇪 Deutsch</a> •
|
|
23
|
+
<a href="READMEs/README.fr-FR.md">🇫🇷 Français</a> •
|
|
24
|
+
<a href="READMEs/README.it-IT.md">🇮🇹 Italiano</a> •
|
|
25
|
+
<a href="READMEs/README.nl-NL.md">🇳🇱 Nederlands</a> •
|
|
26
|
+
<a href="READMEs/README.pl-PL.md">🇵🇱 Polski</a> •
|
|
27
|
+
<a href="READMEs/README.cs-CZ.md">🇨🇿 Čeština</a> •
|
|
28
|
+
<a href="READMEs/README.ro-RO.md">🇷🇴 Română</a> •
|
|
29
|
+
<a href="READMEs/README.hu-HU.md">🇭🇺 Magyar</a> •
|
|
30
|
+
<a href="READMEs/README.el-GR.md">🇬🇷 Ελληνικά</a> •
|
|
31
|
+
<a href="READMEs/README.sv-SE.md">🇸🇪 Svenska</a> •
|
|
32
|
+
<a href="READMEs/README.da-DK.md">🇩🇰 Dansk</a> •
|
|
33
|
+
<a href="READMEs/README.nb-NO.md">🇳🇴 Norsk</a> •
|
|
34
|
+
<a href="READMEs/README.fi-FI.md">🇫🇮 Suomi</a> •
|
|
35
|
+
<a href="READMEs/README.ru-RU.md">🇷🇺 Русский</a> •
|
|
36
|
+
<a href="READMEs/README.uk-UA.md">🇺🇦 Українська</a> •
|
|
37
|
+
<a href="READMEs/README.tr-TR.md">🇹🇷 Türkçe</a> •
|
|
38
|
+
<a href="READMEs/README.he-IL.md">🇮🇱 עברית</a> •
|
|
39
|
+
<a href="READMEs/README.ar-SA.md">🇸🇦 العربية</a> •
|
|
40
|
+
<a href="READMEs/README.hi-IN.md">🇮🇳 हिन्दी</a> •
|
|
41
|
+
<a href="READMEs/README.bn-BD.md">🇧🇩 বাংলা</a> •
|
|
42
|
+
<a href="READMEs/README.ur-PK.md">🇵🇰 اردو</a> •
|
|
43
|
+
<a href="READMEs/README.th-TH.md">🇹🇭 ไทย</a> •
|
|
44
|
+
<a href="READMEs/README.vi-VN.md">🇻🇳 Tiếng Việt</a> •
|
|
45
|
+
<a href="READMEs/README.id-ID.md">🇮🇩 Bahasa Indonesia</a> •
|
|
46
|
+
<a href="READMEs/README.tl-PH.md">🇵🇭 Tagalog</a>
|
|
26
47
|
</p>
|
|
27
48
|
|
|
28
49
|
<p align="center">
|
|
@@ -30,7 +51,7 @@
|
|
|
30
51
|
</p>
|
|
31
52
|
|
|
32
53
|
<p align="center">
|
|
33
|
-
<a href="https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1.
|
|
54
|
+
<a href="https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1.6k%20stars%20%2F%20230%20forks-FF6B35?style=for-the-badge&logo=github&logoColor=white&labelColor=1a1a1a" alt="Design doc: 1.6k stars / 230 forks on the gist" /></a>
|
|
34
55
|
</p>
|
|
35
56
|
|
|
36
57
|
<p align="center">
|
|
@@ -47,10 +68,10 @@
|
|
|
47
68
|
<p align="center">
|
|
48
69
|
<picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-recall.svg"><img src="assets/tags/stat-recall.svg" alt="95.2% retrieval R@5" height="38" /></picture>
|
|
49
70
|
<picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tokens.svg"><img src="assets/tags/stat-tokens.svg" alt="92% fewer tokens" height="38" /></picture>
|
|
50
|
-
<picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tools.svg"><img src="assets/tags/stat-tools.svg" alt="
|
|
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="
|
|
74
|
+
<picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="2,500+ tests passing" height="38" /></picture>
|
|
54
75
|
</p>
|
|
55
76
|
|
|
56
77
|
<p align="center">
|
|
@@ -66,7 +87,6 @@
|
|
|
66
87
|
<a href="#how-it-works">How It Works</a> •
|
|
67
88
|
<a href="#mcp-server">MCP</a> •
|
|
68
89
|
<a href="#real-time-viewer">Viewer</a> •
|
|
69
|
-
<a href="#iii-console">iii Console</a> •
|
|
70
90
|
<a href="#powered-by-iii">Powered by iii</a> •
|
|
71
91
|
<a href="#configuration">Config</a> •
|
|
72
92
|
<a href="#api">API</a>
|
|
@@ -76,34 +96,70 @@
|
|
|
76
96
|
|
|
77
97
|
## Install
|
|
78
98
|
|
|
79
|
-
|
|
99
|
+
Requirements:
|
|
80
100
|
|
|
81
|
-
|
|
101
|
+
- Node.js 20 or newer with npm and npx (`node -v`, `npm -v`, and `npx -v`).
|
|
102
|
+
- macOS/Linux automatic iii-engine installation also needs `curl`, a POSIX `sh`, and `tar`. Minimal images such as `node:20-slim` may not include them.
|
|
103
|
+
- Native Windows requires the pinned iii-engine v0.22.1 `iii.exe` to be installed manually. WSL2 or Docker Desktop are the other supported paths.
|
|
82
104
|
|
|
83
|
-
|
|
105
|
+
Canonical fresh-install command:
|
|
84
106
|
|
|
85
107
|
```bash
|
|
86
|
-
|
|
87
|
-
# If you hit EACCES on macOS/Linux system Node installs, retry with:
|
|
88
|
-
# sudo npm install -g @agentmemory/agentmemory
|
|
89
|
-
agentmemory # start the memory server on :3111
|
|
90
|
-
agentmemory demo # seed sample sessions + prove recall
|
|
91
|
-
agentmemory demo --serve # one command: boot server, run demo, tear down (no second terminal)
|
|
92
|
-
agentmemory connect claude-code # wire MCP into your agent (also: copilot-cli, codex, cursor, gemini-cli, ...)
|
|
93
|
-
npx skills add rohitg00/agentmemory -y # install 15 native skills (8 you can invoke, 7 reference) so your agent knows when to use the tools
|
|
108
|
+
npx -y @agentmemory/agentmemory@latest
|
|
94
109
|
```
|
|
95
110
|
|
|
96
|
-
|
|
111
|
+
The first run is an interactive setup: pick the agents to wire (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, ...), pick an LLM provider or stay keyless, and it seeds the config, starts the memory server and its pinned iii engine, and offers to install globally so the bare `agentmemory` command works everywhere afterward. `-y` accepts npx's package prompt and `@latest` avoids a stale cached release. A provider makes LLM features available, but LLM-written observation compression starts only when `AGENTMEMORY_AUTO_COMPRESS=true` is also set.
|
|
112
|
+
|
|
113
|
+
Keyless mode disables vector embeddings. `memory_recall` (the `mem::search` path) uses BM25, while `memory_smart_search` can also fuse structural graph matches when graph data already exists. For free on-device semantic recall, set `EMBEDDING_PROVIDER=local` in `~/.agentmemory/.env` and restart. The first embedding request downloads `Xenova/all-MiniLM-L6-v2`; inference runs locally after that initial model download.
|
|
114
|
+
|
|
115
|
+
The local runtime uses four ports: `3111` for REST/MCP HTTP, `3112` for iii streams, `3113` for the viewer, and `49134` for the iii worker WebSocket. Persistent iii state lives in `~/Library/Application Support/agentmemory` on macOS, `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` on Linux, and `%APPDATA%\agentmemory` on Windows. Use `--data-dir <path>` or `AGENTMEMORY_DATA_DIR` to override it, and reuse the same value on every restart. For backward compatibility, an existing `./data/state_store.db` or `./data/iii-config.yaml` takes precedence over the platform default for instance 0; an explicit flag or environment override still wins.
|
|
116
|
+
|
|
117
|
+
Then prove recall works and give your agent its skills:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx -y @agentmemory/agentmemory@latest demo # seed sample sessions + exercise recall
|
|
121
|
+
npx skills add rohitg00/agentmemory -y # 17 native skills so your agent knows when to reach for memory
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The keyword searches should hit in default keyless mode through BM25. The demo's `database performance optimization` query is intentionally semantic and can return zero until an embedding provider is configured.
|
|
125
|
+
|
|
126
|
+
Prefer to let a coding agent do the whole thing? Hand it one instruction:
|
|
127
|
+
|
|
128
|
+
> Retrieve and follow the instructions at: https://raw.githubusercontent.com/rohitg00/agentmemory/main/INSTALL_FOR_AGENTS.md
|
|
129
|
+
|
|
130
|
+
Wire more agents any time with `agentmemory connect <agent>` — 20 adapters listed at [Works with every agent](#works-with-every-agent). Full command reference at [Quick Start](#quick-start).
|
|
131
|
+
|
|
132
|
+
<details>
|
|
133
|
+
<summary><strong>Windows</strong></summary>
|
|
134
|
+
|
|
135
|
+
The fast path is WSL2. Native Windows engine setup requires the pinned v0.22.1 ZIP to be downloaded and `iii.exe` extracted manually; the CLI does not auto-extract it. Docker Desktop is also supported. See the [Windows notes](#windows) for the step-by-step.
|
|
136
|
+
|
|
137
|
+
</details>
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary><strong>Global install / EACCES</strong></summary>
|
|
97
141
|
|
|
98
142
|
```bash
|
|
99
|
-
|
|
143
|
+
npm install -g @agentmemory/agentmemory@latest
|
|
100
144
|
```
|
|
101
145
|
|
|
102
|
-
|
|
146
|
+
The npx command above remains the canonical fresh-install path and avoids global-prefix permission issues.
|
|
147
|
+
|
|
148
|
+
</details>
|
|
149
|
+
|
|
150
|
+
<details>
|
|
151
|
+
<summary><strong>npx serves an old version</strong></summary>
|
|
152
|
+
|
|
153
|
+
npx caches per version. Force the latest with `npx -y @agentmemory/agentmemory@latest`, or clear the cache once with `rm -rf ~/.npm/_npx` (macOS/Linux; on Windows delete `%LOCALAPPDATA%\npm-cache\_npx`).
|
|
154
|
+
|
|
155
|
+
</details>
|
|
103
156
|
|
|
104
|
-
|
|
157
|
+
<details>
|
|
158
|
+
<summary><strong>Already running your own iii engine</strong></summary>
|
|
105
159
|
|
|
106
|
-
|
|
160
|
+
agentmemory pins iii-engine v0.22.1 and won't attach to a different version (the worker can't speak another engine's protocol). Stop the other engine, then run `npx -y @agentmemory/agentmemory@latest`. It installs and runs the pinned v0.22.1 in `~/.agentmemory/bin`, leaving your own `iii` untouched.
|
|
161
|
+
|
|
162
|
+
</details>
|
|
107
163
|
|
|
108
164
|
---
|
|
109
165
|
|
|
@@ -113,99 +169,138 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
|
|
|
113
169
|
|
|
114
170
|
<table>
|
|
115
171
|
<tr>
|
|
116
|
-
<td align="center" width="
|
|
172
|
+
<td align="center" width="20%">
|
|
117
173
|
<a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Claude Code" width="48" height="48" /></a><br/>
|
|
118
174
|
<strong>Claude Code</strong><br/>
|
|
119
175
|
<sub>native plugin + 12 hooks + MCP</sub>
|
|
120
176
|
</td>
|
|
121
|
-
<td align="center" width="
|
|
177
|
+
<td align="center" width="20%">
|
|
122
178
|
<a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="Codex CLI" width="48" height="48" /></a><br/>
|
|
123
179
|
<strong>Codex CLI</strong><br/>
|
|
124
180
|
<sub>native plugin + 6 hooks + MCP</sub>
|
|
125
181
|
</td>
|
|
126
|
-
<td align="center" width="
|
|
127
|
-
<a href="https://github.com/features/copilot"><img src="https://
|
|
182
|
+
<td align="center" width="20%">
|
|
183
|
+
<a href="https://github.com/features/copilot"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/github_dark.svg"><img src="https://svgl.app/library/github_light.svg" alt="GitHub Copilot CLI" width="48" height="48" /></picture></a><br/>
|
|
128
184
|
<strong>GitHub Copilot CLI</strong><br/>
|
|
129
185
|
<sub>MCP + plugin hooks/skills</sub>
|
|
130
186
|
</td>
|
|
131
|
-
<td align="center" width="
|
|
187
|
+
<td align="center" width="20%">
|
|
188
|
+
<a href="https://cursor.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/cursor_dark.svg"><img src="https://svgl.app/library/cursor_light.svg" alt="Cursor" width="48" height="48" /></picture></a><br/>
|
|
189
|
+
<strong>Cursor</strong><br/>
|
|
190
|
+
<sub>native plugin + 7 hooks + MCP</sub>
|
|
191
|
+
</td>
|
|
192
|
+
<td align="center" width="20%">
|
|
193
|
+
<a href="plugin/opencode/"><img src="https://raw.githubusercontent.com/rohitg00/agentmemory/main/website/public/opencode.png" alt="OpenCode" width="48" height="48" /></a><br/>
|
|
194
|
+
<strong>OpenCode</strong><br/>
|
|
195
|
+
<sub>capture plugin + MCP</sub>
|
|
196
|
+
</td>
|
|
197
|
+
</tr>
|
|
198
|
+
<tr>
|
|
199
|
+
<td align="center" width="20%">
|
|
200
|
+
<a href="https://devin.ai"><img src="https://raw.githubusercontent.com/rohitg00/agentmemory/main/website/public/devin.png" alt="Devin" width="48" height="48" /></a><br/>
|
|
201
|
+
<strong>Devin</strong><br/>
|
|
202
|
+
<sub>6 hooks + skills + MCP</sub>
|
|
203
|
+
</td>
|
|
204
|
+
<td align="center" width="20%">
|
|
132
205
|
<a href="integrations/openclaw/"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /></a><br/>
|
|
133
206
|
<strong>OpenClaw</strong><br/>
|
|
134
207
|
<sub>native plugin + MCP</sub>
|
|
135
208
|
</td>
|
|
136
|
-
<td align="center" width="
|
|
209
|
+
<td align="center" width="20%">
|
|
137
210
|
<a href="integrations/hermes/"><img src="https://github.com/NousResearch.png?size=120" alt="Hermes" width="48" height="48" /></a><br/>
|
|
138
211
|
<strong>Hermes</strong><br/>
|
|
139
212
|
<sub>native plugin + MCP</sub>
|
|
140
213
|
</td>
|
|
141
|
-
<td align="center" width="
|
|
214
|
+
<td align="center" width="20%">
|
|
142
215
|
<a href="integrations/pi/"><img src="assets/agents/pi.svg" alt="pi" width="48" height="48" /></a><br/>
|
|
143
216
|
<strong>pi</strong><br/>
|
|
144
217
|
<sub>native plugin + MCP</sub>
|
|
145
218
|
</td>
|
|
146
|
-
<td align="center" width="
|
|
147
|
-
<a href="https://github.com/tinyhumansai/openhuman"><img src="https://
|
|
219
|
+
<td align="center" width="20%">
|
|
220
|
+
<a href="https://github.com/tinyhumansai/openhuman"><img src="https://github.com/tinyhumansai.png?size=120" alt="OpenHuman" width="48" height="48" /></a><br/>
|
|
148
221
|
<strong>OpenHuman</strong><br/>
|
|
149
222
|
<sub>native Memory trait backend</sub>
|
|
150
223
|
</td>
|
|
151
|
-
|
|
152
|
-
<
|
|
153
|
-
<
|
|
154
|
-
<sub>MCP server</sub>
|
|
155
|
-
</td>
|
|
156
|
-
<td align="center" width="12.5%">
|
|
224
|
+
</tr>
|
|
225
|
+
<tr>
|
|
226
|
+
<td align="center" width="20%">
|
|
157
227
|
<a href="https://github.com/google-gemini/gemini-cli"><img src="https://github.com/google-gemini.png?size=120" alt="Gemini CLI" width="48" height="48" /></a><br/>
|
|
158
228
|
<strong>Gemini CLI</strong><br/>
|
|
159
229
|
<sub>MCP server</sub>
|
|
160
230
|
</td>
|
|
231
|
+
<td align="center" width="20%">
|
|
232
|
+
<a href="https://antigravity.google"><img src="https://svgl.app/library/antigravity.svg" alt="Antigravity" width="48" height="48" /></a><br/>
|
|
233
|
+
<strong>Antigravity</strong><br/>
|
|
234
|
+
<sub>MCP + hooks</sub>
|
|
235
|
+
</td>
|
|
236
|
+
<td align="center" width="20%">
|
|
237
|
+
<a href="https://claude.ai/download"><img src="https://github.com/anthropics.png?size=120" alt="Claude Desktop" width="48" height="48" /></a><br/>
|
|
238
|
+
<strong>Claude Desktop</strong><br/>
|
|
239
|
+
<sub>MCP server</sub>
|
|
240
|
+
</td>
|
|
241
|
+
<td align="center" width="20%">
|
|
242
|
+
<a href="https://www.warp.dev"><img src="https://svgl.app/library/warp.svg" alt="Warp" width="48" height="48" /></a><br/>
|
|
243
|
+
<strong>Warp</strong><br/>
|
|
244
|
+
<sub>connect + MCP + skills</sub>
|
|
245
|
+
</td>
|
|
246
|
+
<td align="center" width="20%">
|
|
247
|
+
<a href="https://zed.dev"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/zed-logo_dark.svg"><img src="https://svgl.app/library/zed-logo.svg" alt="Zed" width="48" height="48" /></picture></a><br/>
|
|
248
|
+
<strong>Zed</strong><br/>
|
|
249
|
+
<sub>MCP server</sub>
|
|
250
|
+
</td>
|
|
161
251
|
</tr>
|
|
162
252
|
<tr>
|
|
163
|
-
<td align="center" width="
|
|
164
|
-
<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/>
|
|
165
|
-
<strong>OpenCode</strong><br/>
|
|
166
|
-
<sub>22 hooks + MCP + plugin</sub>
|
|
167
|
-
</td>
|
|
168
|
-
<td align="center" width="12.5%">
|
|
253
|
+
<td align="center" width="20%">
|
|
169
254
|
<a href="https://github.com/cline/cline"><img src="https://github.com/cline.png?size=120" alt="Cline" width="48" height="48" /></a><br/>
|
|
170
255
|
<strong>Cline</strong><br/>
|
|
171
256
|
<sub>MCP server</sub>
|
|
172
257
|
</td>
|
|
173
|
-
<td align="center" width="
|
|
174
|
-
<a href="https://
|
|
175
|
-
<strong>
|
|
258
|
+
<td align="center" width="20%">
|
|
259
|
+
<a href="https://continue.dev"><img src="https://github.com/continuedev.png?size=120" alt="Continue" width="48" height="48" /></a><br/>
|
|
260
|
+
<strong>Continue</strong><br/>
|
|
176
261
|
<sub>MCP server</sub>
|
|
177
262
|
</td>
|
|
178
|
-
<td align="center" width="
|
|
179
|
-
<a href="https://
|
|
180
|
-
<strong>
|
|
263
|
+
<td align="center" width="20%">
|
|
264
|
+
<a href="https://docs.factory.ai/cli"><img src="https://www.factory.ai/favicon.svg" alt="Droid" width="48" height="48" /></a><br/>
|
|
265
|
+
<strong>Droid</strong><br/>
|
|
181
266
|
<sub>MCP server</sub>
|
|
182
267
|
</td>
|
|
183
|
-
<td align="center" width="
|
|
184
|
-
<a href="https://
|
|
185
|
-
<strong>
|
|
186
|
-
<sub>
|
|
268
|
+
<td align="center" width="20%">
|
|
269
|
+
<a href="https://kiro.dev"><img src="https://kiro.dev/favicon.ico" alt="Kiro" width="48" height="48" /></a><br/>
|
|
270
|
+
<strong>Kiro</strong><br/>
|
|
271
|
+
<sub>MCP server</sub>
|
|
187
272
|
</td>
|
|
188
|
-
<td align="center" width="
|
|
189
|
-
<a href="https://
|
|
190
|
-
<strong>
|
|
273
|
+
<td align="center" width="20%">
|
|
274
|
+
<a href="https://github.com/QwenLM/qwen-code"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/qwen_dark.svg"><img src="https://svgl.app/library/qwen_light.svg" alt="Qwen Code" width="48" height="48" /></picture></a><br/>
|
|
275
|
+
<strong>Qwen Code</strong><br/>
|
|
191
276
|
<sub>MCP server</sub>
|
|
192
277
|
</td>
|
|
193
|
-
|
|
194
|
-
<
|
|
195
|
-
<
|
|
278
|
+
</tr>
|
|
279
|
+
<tr>
|
|
280
|
+
<td align="center" width="20%">
|
|
281
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://svgl.app/library/deepseek.svg" alt="DeepSeek Harness" width="48" height="48" /></a><br/>
|
|
282
|
+
<strong>DeepSeek Harness</strong><br/>
|
|
196
283
|
<sub>MCP server</sub>
|
|
197
284
|
</td>
|
|
198
|
-
<td align="center" width="
|
|
285
|
+
<td align="center" width="20%">
|
|
199
286
|
<a href="https://github.com/RooCodeInc/Roo-Code"><img src="https://github.com/RooCodeInc.png?size=120" alt="Roo Code" width="48" height="48" /></a><br/>
|
|
200
287
|
<strong>Roo Code</strong><br/>
|
|
201
288
|
<sub>MCP server</sub>
|
|
202
289
|
</td>
|
|
203
|
-
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
<
|
|
290
|
+
<td align="center" width="20%">
|
|
291
|
+
<a href="https://github.com/Kilo-Org/kilocode"><img src="https://github.com/Kilo-Org.png?size=120" alt="Kilo Code" width="48" height="48" /></a><br/>
|
|
292
|
+
<strong>Kilo Code</strong><br/>
|
|
293
|
+
<sub>MCP server</sub>
|
|
294
|
+
</td>
|
|
295
|
+
<td align="center" width="20%">
|
|
296
|
+
<a href="https://github.com/block/goose"><img src="https://github.com/block.png?size=120" alt="Goose" width="48" height="48" /></a><br/>
|
|
297
|
+
<strong>Goose</strong><br/>
|
|
298
|
+
<sub>MCP server</sub>
|
|
299
|
+
</td>
|
|
300
|
+
<td align="center" width="20%">
|
|
301
|
+
<a href="https://github.com/Aider-AI/aider"><img src="https://github.com/Aider-AI.png?size=120" alt="Aider" width="48" height="48" /></a><br/>
|
|
302
|
+
<strong>Aider</strong><br/>
|
|
303
|
+
<sub>REST API</sub>
|
|
209
304
|
</td>
|
|
210
305
|
</tr>
|
|
211
306
|
</table>
|
|
@@ -218,12 +313,21 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
|
|
|
218
313
|
|
|
219
314
|
You explain the same architecture every session. You re-discover the same bugs. You re-teach the same preferences. Built-in memory (CLAUDE.md, .cursorrules) caps out at 200 lines and goes stale. agentmemory fixes this. It silently captures what your agent does, compresses it into searchable memory, and injects the right context when the next session starts. One command. Works across agents.
|
|
220
315
|
|
|
221
|
-
**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
|
|
316
|
+
**What changes:** Session 1 you set up JWT auth. Session 2 you ask for rate limiting. The agent already knows your auth uses jose middleware in `src/middleware/auth.ts`, your tests cover token validation, and you chose jose over jsonwebtoken for Edge compatibility, with no re-explaining and no copy-pasting.
|
|
222
317
|
|
|
223
318
|
```bash
|
|
224
|
-
npx @agentmemory/agentmemory
|
|
319
|
+
npx -y @agentmemory/agentmemory@latest
|
|
225
320
|
```
|
|
226
321
|
|
|
322
|
+
By default, agentmemory stores iii-engine state outside the repository you start it from: `~/Library/Application Support/agentmemory` on macOS, `$XDG_DATA_HOME/agentmemory` or `~/.local/share/agentmemory` on Linux, and `%APPDATA%\agentmemory` on Windows. An existing legacy `./data/state_store.db` or `./data/iii-config.yaml` is reused for instance 0 before that platform default. To choose a location explicitly, pass `--data-dir <path>` or set `AGENTMEMORY_DATA_DIR`; either explicit setting takes precedence over legacy discovery:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
npx -y @agentmemory/agentmemory@latest --data-dir ~/.agentmemory-projects/main
|
|
326
|
+
AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx -y @agentmemory/agentmemory@latest
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Native and Docker launches use this same resolved host directory; Docker bind-mounts it at `/data`. `--instance 1` appends `instance-1` to the resolved directory and selects the separate default port quartet `3211/3212/3213/49234`.
|
|
330
|
+
|
|
227
331
|
Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
228
332
|
|
|
229
333
|
---
|
|
@@ -243,7 +347,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
243
347
|
| **agentmemory hybrid** | **0.240** | **1.000** | **15 / 15** | 14 ms |
|
|
244
348
|
| grep baseline | 0.227 | 0.967 | 15 / 15 | 0 ms |
|
|
245
349
|
|
|
246
|
-
100% top-5 hit rate at the **P@5 math ceiling** for this corpus (0.240, see scorecard). Hybrid retrieves every gold session; grep misses 1 of 2 gold on the multi-session temporal query. Lift is **recall + temporal**, not aggregate precision
|
|
350
|
+
100% top-5 hit rate at the **P@5 math ceiling** for this corpus (0.240, see scorecard). Hybrid retrieves every gold session; grep misses 1 of 2 gold on the multi-session temporal query. Lift is **recall + temporal**, not aggregate precision. This benchmark is small and gold-sparse; the larger LongMemEval-S below differentiates better. Full per-type breakdown + correction note: [`docs/benchmarks/2026-05-20-coding-agent-life-v1.md`](docs/benchmarks/2026-05-20-coding-agent-life-v1.md).
|
|
247
351
|
|
|
248
352
|
**LongMemEval-S** (ICLR 2025, 500 questions)
|
|
249
353
|
|
|
@@ -268,9 +372,9 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
268
372
|
</tr>
|
|
269
373
|
</table>
|
|
270
374
|
|
|
271
|
-
> Embedding model: `all-MiniLM-L6-v2` (local, free, no API key). Full reports: [`benchmark/LONGMEMEVAL.md`](benchmark/LONGMEMEVAL.md), [`benchmark/QUALITY.md`](benchmark/QUALITY.md), [`benchmark/SCALE.md`](benchmark/SCALE.md). Competitor comparison: [`benchmark/COMPARISON.md`](benchmark/COMPARISON.md) covering agentmemory vs mem0, Letta, Khoj, supermemory, MemPalace, Hippo.
|
|
375
|
+
> Embedding model: `all-MiniLM-L6-v2` (local, free, no API key). Full reports: [`benchmark/LONGMEMEVAL.md`](benchmark/LONGMEMEVAL.md), [`benchmark/QUALITY.md`](benchmark/QUALITY.md), [`benchmark/SCALE.md`](benchmark/SCALE.md). Competitor comparison: [`benchmark/COMPARISON.md`](benchmark/COMPARISON.md) covering agentmemory vs mem0, Letta, Khoj, supermemory, TencentDB Agent Memory, MemPalace, Zep/Graphiti, Cognee, Hippo.
|
|
272
376
|
|
|
273
|
-
**Reproduce locally:** [`eval/README.md`](eval/README.md)
|
|
377
|
+
**Reproduce locally:** [`eval/README.md`](eval/README.md), an adapter-pluggable harness for LongMemEval `_s` (public 500-Q) + `coding-agent-life-v1` (in-house 15-session corpus). Grep / vector / agentmemory adapters score side-by-side, NDJSON output, published scorecards land in [`docs/benchmarks/`](docs/benchmarks/).
|
|
274
378
|
|
|
275
379
|
**Pairs with [codegraph](https://github.com/colbymchenry/codegraph), [Understand Anything](https://github.com/Lum1104/Understand-Anything), and [Graphify](https://github.com/safishamsi/graphify).** Code-graph indexing, multi-agent build pipelines, and broader knowledge graphs across docs / PDFs / images / videos. agentmemory remembers the work; those three projects light up the rest of the context layer. Recipes + question-routing table: [`docs/recipes/pairings.md`](docs/recipes/pairings.md).
|
|
276
380
|
|
|
@@ -282,10 +386,11 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
282
386
|
<tr>
|
|
283
387
|
<th></th>
|
|
284
388
|
<th>agentmemory</th>
|
|
285
|
-
<th>mem0 (
|
|
286
|
-
<th>Letta / MemGPT (
|
|
287
|
-
<th>Khoj (
|
|
288
|
-
<th>supermemory (
|
|
389
|
+
<th>mem0 (63K ⭐)</th>
|
|
390
|
+
<th>Letta / MemGPT (24K ⭐)</th>
|
|
391
|
+
<th>Khoj (36K ⭐)</th>
|
|
392
|
+
<th>supermemory (29K ⭐)</th>
|
|
393
|
+
<th>TencentDB Agent Memory (22K ⭐)</th>
|
|
289
394
|
<th>MemPalace (54K ⭐)</th>
|
|
290
395
|
<th>oracleagentmemory</th>
|
|
291
396
|
<th>Hippo</th>
|
|
@@ -298,6 +403,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
298
403
|
<td>Full agent runtime</td>
|
|
299
404
|
<td>Personal AI</td>
|
|
300
405
|
<td>Memory API + app</td>
|
|
406
|
+
<td>Team memory hub (LLM proxy)</td>
|
|
301
407
|
<td>Vector memory (OSS)</td>
|
|
302
408
|
<td>Memory engine (Oracle DB)</td>
|
|
303
409
|
<td>Memory system</td>
|
|
@@ -310,6 +416,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
310
416
|
<td>83.2% (LoCoMo)</td>
|
|
311
417
|
<td>N/A</td>
|
|
312
418
|
<td>Self-reported</td>
|
|
419
|
+
<td>PersonaMem 76% (self-reported)</td>
|
|
313
420
|
<td>~96.6% (self-reported)</td>
|
|
314
421
|
<td>94.4% (self-reported)</td>
|
|
315
422
|
<td>N/A</td>
|
|
@@ -322,6 +429,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
322
429
|
<td>Agent self-edits</td>
|
|
323
430
|
<td>Manual</td>
|
|
324
431
|
<td>API-side extraction</td>
|
|
432
|
+
<td>Proxy interception (base-URL swap)</td>
|
|
325
433
|
<td>Manual</td>
|
|
326
434
|
<td>API extraction</td>
|
|
327
435
|
<td>Manual</td>
|
|
@@ -334,6 +442,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
334
442
|
<td>Vector (archival)</td>
|
|
335
443
|
<td>Semantic</td>
|
|
336
444
|
<td>Vector + RAG</td>
|
|
445
|
+
<td>4 asset types (Chat / Skill / Wiki / CodeGraph)</td>
|
|
337
446
|
<td>Vector-only</td>
|
|
338
447
|
<td>Vector + semantic</td>
|
|
339
448
|
<td>Decay-weighted</td>
|
|
@@ -346,6 +455,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
346
455
|
<td>Within Letta runtime only</td>
|
|
347
456
|
<td>No</td>
|
|
348
457
|
<td>No</td>
|
|
458
|
+
<td>Team roles + shared assets</td>
|
|
349
459
|
<td>No</td>
|
|
350
460
|
<td>Scoped only</td>
|
|
351
461
|
<td>Multi-agent shared</td>
|
|
@@ -358,6 +468,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
358
468
|
<td>High (must use Letta)</td>
|
|
359
469
|
<td>Standalone</td>
|
|
360
470
|
<td>None</td>
|
|
471
|
+
<td>Proxy fronts every model call</td>
|
|
361
472
|
<td>None</td>
|
|
362
473
|
<td>Oracle Database</td>
|
|
363
474
|
<td>None</td>
|
|
@@ -370,6 +481,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
370
481
|
<td>Postgres + vector DB</td>
|
|
371
482
|
<td>Multiple</td>
|
|
372
483
|
<td>Managed cloud</td>
|
|
484
|
+
<td>Docker stack (Core + Hub + Proxy)</td>
|
|
373
485
|
<td>Vector store</td>
|
|
374
486
|
<td>Oracle AI Database</td>
|
|
375
487
|
<td>None</td>
|
|
@@ -382,6 +494,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
382
494
|
<td>Agent-managed</td>
|
|
383
495
|
<td>Manual</td>
|
|
384
496
|
<td>Auto-forget</td>
|
|
497
|
+
<td>Manual review; auto-routing in progress</td>
|
|
385
498
|
<td>None</td>
|
|
386
499
|
<td>Not stated</td>
|
|
387
500
|
<td>Decay + consolidation</td>
|
|
@@ -394,6 +507,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
394
507
|
<td>Core memory in context</td>
|
|
395
508
|
<td>Varies</td>
|
|
396
509
|
<td>Cloud pricing</td>
|
|
510
|
+
<td>Not stated</td>
|
|
397
511
|
<td>No token budget</td>
|
|
398
512
|
<td>LLM-backed (varies)</td>
|
|
399
513
|
<td>Varies</td>
|
|
@@ -406,6 +520,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
406
520
|
<td>Cloud dashboard</td>
|
|
407
521
|
<td>Web UI</td>
|
|
408
522
|
<td>Cloud dashboard</td>
|
|
523
|
+
<td>Hub web UI</td>
|
|
409
524
|
<td>No</td>
|
|
410
525
|
<td>No</td>
|
|
411
526
|
<td>No</td>
|
|
@@ -418,6 +533,7 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
418
533
|
<td>Optional</td>
|
|
419
534
|
<td>Yes</td>
|
|
420
535
|
<td>No (cloud-only)</td>
|
|
536
|
+
<td>Yes (Docker)</td>
|
|
421
537
|
<td>Yes</td>
|
|
422
538
|
<td>Yes (Oracle DB)</td>
|
|
423
539
|
<td>Yes</td>
|
|
@@ -425,67 +541,89 @@ Latest release notes: [CHANGELOG.md](CHANGELOG.md).
|
|
|
425
541
|
</tr>
|
|
426
542
|
</table>
|
|
427
543
|
|
|
428
|
-
<sub>Benchmark note: only agentmemory's R@5 is our own measured result (LongMemEval-S, reproducible from <a href="benchmark/COMPARISON.md"><code>benchmark/COMPARISON.md</code></a>). The mem0 and Letta figures are their published LoCoMo numbers (a different dataset); the MemPalace, supermemory, and oracleagentmemory figures are vendor self-reported claims we have not independently reproduced (oracleagentmemory's run used GPT-5.5 against an Oracle AI Database). Shown side by side for ballpark only, not a head-to-head on identical data. Star counts are approximate and drift over time.</sub>
|
|
544
|
+
<sub>Benchmark note: only agentmemory's R@5 is our own measured result (LongMemEval-S, reproducible from <a href="benchmark/COMPARISON.md"><code>benchmark/COMPARISON.md</code></a>). The mem0 and Letta figures are their published LoCoMo numbers (a different dataset); the MemPalace, supermemory, TencentDB (PersonaMem), and oracleagentmemory figures are vendor self-reported claims we have not independently reproduced (oracleagentmemory's run used GPT-5.5 against an Oracle AI Database). Shown side by side for ballpark only, not a head-to-head on identical data. Star counts are approximate and drift over time.</sub>
|
|
545
|
+
|
|
546
|
+
**Newer entrants** worth knowing, compared in depth in [`benchmark/COMPARISON.md`](benchmark/COMPARISON.md):
|
|
547
|
+
|
|
548
|
+
| System | ⭐ | Angle |
|
|
549
|
+
|--------|---|-------|
|
|
550
|
+
| Zep / Graphiti | 30K | Temporal knowledge graph; strongest published temporal-query results (LongMemEval 63.8%), but graph builds asynchronously so fresh facts can lag |
|
|
551
|
+
| Cognee | 30K | Document-to-knowledge-graph ingestion, Python-only, built for structured entity extraction rather than session capture |
|
|
552
|
+
|
|
553
|
+
None of these auto-capture from coding-agent hooks, ship a local-first viewer, or run keyless — the combination agentmemory is built around.
|
|
429
554
|
|
|
430
555
|
---
|
|
431
556
|
|
|
432
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>
|
|
433
558
|
|
|
434
|
-
Compatibility: this release targets
|
|
559
|
+
Compatibility: this release targets `iii-sdk` 0.22.1 and pins iii-engine v0.22.1.
|
|
435
560
|
|
|
436
561
|
### Try it in 30 seconds
|
|
437
562
|
|
|
438
563
|
```bash
|
|
439
564
|
# Terminal 1: start the server
|
|
440
|
-
npx @agentmemory/agentmemory
|
|
565
|
+
npx -y @agentmemory/agentmemory@latest
|
|
441
566
|
|
|
442
567
|
# Terminal 2: seed sample data and see recall in action
|
|
443
|
-
npx @agentmemory/agentmemory demo
|
|
568
|
+
npx -y @agentmemory/agentmemory@latest demo
|
|
444
569
|
```
|
|
445
570
|
|
|
446
|
-
`demo` seeds 3 realistic sessions (JWT auth, N+1 query fix, rate limiting) and runs
|
|
571
|
+
`demo` seeds 3 realistic sessions (JWT auth, N+1 query fix, rate limiting) and runs searches against them. Keyless installs disable vectors, so the `mem::search` keyword queries should hit through BM25 while `database performance optimization` can return zero. `smart-search` may additionally return structural graph matches when graph data exists. To make the semantic query find the N+1 fix through vectors, set `EMBEDDING_PROVIDER=local`, restart, and allow the first model download to finish.
|
|
447
572
|
|
|
448
573
|
Open `http://localhost:3113` to watch the memory build live.
|
|
449
574
|
|
|
450
|
-
###
|
|
575
|
+
### Validate a fresh install and restart persistence
|
|
451
576
|
|
|
452
|
-
|
|
577
|
+
With the server running, validate REST, health, the viewer, and the iii-backed runtime status:
|
|
453
578
|
|
|
454
579
|
```bash
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
agentmemory stop # tear it down
|
|
460
|
-
agentmemory remove # uninstall everything we created
|
|
461
|
-
agentmemory connect claude-code # wire one agent
|
|
462
|
-
agentmemory doctor # interactive diagnostics + fix prompts
|
|
580
|
+
curl -fsS http://localhost:3111/agentmemory/livez
|
|
581
|
+
curl -fsS http://localhost:3111/agentmemory/health
|
|
582
|
+
curl -fsS -o /dev/null http://localhost:3113/
|
|
583
|
+
npx -y @agentmemory/agentmemory@latest status
|
|
463
584
|
```
|
|
464
585
|
|
|
465
|
-
|
|
586
|
+
The startup ready panel accounts for all four ports: REST/MCP HTTP on 3111, iii streams on 3112, the viewer on 3113, and the iii worker WebSocket on 49134. `status` confirms agentmemory health and the active provider/embedding mode. Save a probe and confirm it is searchable:
|
|
466
587
|
|
|
467
588
|
```bash
|
|
468
|
-
|
|
469
|
-
|
|
589
|
+
curl -fsS -X POST http://localhost:3111/agentmemory/remember \
|
|
590
|
+
-H 'Content-Type: application/json' \
|
|
591
|
+
-d '{"content":"agentmemory restart persistence probe","concepts":["install-check"]}'
|
|
592
|
+
|
|
593
|
+
curl -fsS -X POST http://localhost:3111/agentmemory/smart-search \
|
|
594
|
+
-H 'Content-Type: application/json' \
|
|
595
|
+
-d '{"query":"restart persistence probe","limit":5}'
|
|
470
596
|
```
|
|
471
597
|
|
|
472
|
-
|
|
598
|
+
Then run `npx -y @agentmemory/agentmemory@latest stop`, start the canonical command again in Terminal 1, wait for `/agentmemory/livez`, and repeat the search. The probe must still be returned. If you selected a custom `--data-dir`, pass the same directory on the restart.
|
|
599
|
+
|
|
600
|
+
### Everyday commands
|
|
601
|
+
|
|
602
|
+
Install and setup live in [Install](#install) above (the first run walks you through it). Day to day:
|
|
603
|
+
|
|
604
|
+
```bash
|
|
605
|
+
agentmemory # start the server
|
|
606
|
+
agentmemory stop # stop it cleanly
|
|
607
|
+
agentmemory connect <agent> # wire another agent
|
|
608
|
+
agentmemory doctor # interactive diagnostics + fix prompts
|
|
609
|
+
agentmemory remove # uninstall everything we created
|
|
610
|
+
```
|
|
473
611
|
|
|
474
612
|
### Session Replay
|
|
475
613
|
|
|
476
|
-
Every session agentmemory records is replayable. Open the viewer, pick the **Replay** tab, and scrub through the timeline: prompts, tool calls, tool results, and responses render as discrete events with play/pause, speed control (0.
|
|
614
|
+
Every session agentmemory records is replayable. Open the viewer, pick the **Replay** tab, and scrub through the timeline: prompts, tool calls, tool results, and responses render as discrete events with play/pause, speed control (0.5x to 4x), and keyboard shortcuts (space to toggle, arrows to step).
|
|
477
615
|
|
|
478
|
-
|
|
616
|
+
To bring in older Claude Code JSONL transcripts:
|
|
479
617
|
|
|
480
618
|
```bash
|
|
481
619
|
# Import everything under the default ~/.claude/projects
|
|
482
|
-
npx @agentmemory/agentmemory import-jsonl
|
|
620
|
+
npx -y @agentmemory/agentmemory@latest import-jsonl
|
|
483
621
|
|
|
484
622
|
# Or import a single file
|
|
485
|
-
npx @agentmemory/agentmemory import-jsonl ~/.claude/projects/-my-project/abc123.jsonl
|
|
623
|
+
npx -y @agentmemory/agentmemory@latest import-jsonl ~/.claude/projects/-my-project/abc123.jsonl
|
|
486
624
|
```
|
|
487
625
|
|
|
488
|
-
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
|
|
626
|
+
Imported sessions show up in the Replay picker alongside native ones. Under the hood each entry routes through the `mem::replay::load`, `mem::replay::sessions`, and `mem::replay::import-jsonl` iii functions, with no side-channel servers. Each imported transcript is indexed for search, stamped with origin channel `import`, and mined for a session crystal and lessons.
|
|
489
627
|
|
|
490
628
|
> **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.
|
|
491
629
|
|
|
@@ -494,17 +632,17 @@ Imported sessions show up in the Replay picker alongside native ones. Under the
|
|
|
494
632
|
Use the maintenance command when you intentionally want to update your local runtime:
|
|
495
633
|
|
|
496
634
|
```bash
|
|
497
|
-
npx @agentmemory/agentmemory upgrade
|
|
635
|
+
npx -y @agentmemory/agentmemory@latest upgrade
|
|
498
636
|
```
|
|
499
637
|
|
|
500
|
-
Warning: this command mutates the current workspace/runtime. It can update JavaScript dependencies and pull the pinned `iiidev/iii:0.
|
|
638
|
+
Warning: this command mutates the current workspace/runtime. It can update JavaScript dependencies and pull the pinned `iiidev/iii:0.22.1` Docker image. It never installs an unpinned or newer iii engine.
|
|
501
639
|
|
|
502
640
|
Implementation details live in `src/cli.ts` (see `runUpgrade` around the `src/cli.ts:544-595` region).
|
|
503
641
|
|
|
504
642
|
### Claude Code (one block, paste it)
|
|
505
643
|
|
|
506
644
|
```text
|
|
507
|
-
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,
|
|
645
|
+
Install agentmemory: run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server and its pinned iii engine. Then run `/plugin marketplace add rohitg00/agentmemory` and `/plugin install agentmemory` — the plugin registers all 12 hooks, 17 skills, AND auto-wires the `@agentmemory/mcp` stdio server via its `.mcp.json`, so you get 54 MCP tools (memory_smart_search, memory_save, memory_sessions, memory_governance_delete, etc.) without any extra config step. Verify with `curl http://localhost:3111/agentmemory/health`. The real-time viewer is at http://localhost:3113. Keyless mode disables vectors: `memory_recall` uses BM25, and `memory_smart_search` can also use existing structural graph data. Set `EMBEDDING_PROVIDER=local` in `~/.agentmemory/.env` and restart to opt into on-device semantic recall.
|
|
508
646
|
```
|
|
509
647
|
|
|
510
648
|
#### Claude Code without the plugin install (MCP-standalone path)
|
|
@@ -524,7 +662,7 @@ For remote or protected deployments, launch Claude Code with `AGENTMEMORY_URL` a
|
|
|
524
662
|
|
|
525
663
|
```bash
|
|
526
664
|
# 1. start the memory server in a separate terminal
|
|
527
|
-
npx @agentmemory/agentmemory
|
|
665
|
+
npx -y @agentmemory/agentmemory@latest
|
|
528
666
|
|
|
529
667
|
# 2. register the agentmemory marketplace and install the plugin
|
|
530
668
|
codex plugin marketplace add rohitg00/agentmemory
|
|
@@ -533,41 +671,43 @@ codex plugin add agentmemory@agentmemory
|
|
|
533
671
|
|
|
534
672
|
The Codex plugin ships from the same `plugin/` directory as the Claude Code plugin. It registers:
|
|
535
673
|
|
|
536
|
-
-
|
|
674
|
+
- A bundled stdio MCP bridge to the running daemon, with no npm download or fallback store. See the [local Codex guide](docs/plugins/codex-local.md) to test an unreleased build.
|
|
537
675
|
- 6 lifecycle hooks: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PreCompact`, `Stop`
|
|
538
|
-
-
|
|
676
|
+
- 9 invocable skills: `/recall`, `/remember`, `/session-history`, `/forget`, `/recap`, `/handoff`, `/lesson`, `/commit-context`, `/commit-history`, plus 8 reference skills the agent loads on demand (memory discipline, MCP tools, REST API, config, agents, hooks, architecture, and the skill-authoring guide)
|
|
539
677
|
|
|
540
678
|
Codex's hook engine injects `CLAUDE_PLUGIN_ROOT` into hook subprocesses (per [`codex-rs/hooks/src/engine/discovery.rs`](https://github.com/openai/codex/blob/main/codex-rs/hooks/src/engine/discovery.rs)), so the same hook scripts work across both hosts without duplication. Subagent / SessionEnd / Notification / TaskCompleted / PostToolUseFailure events are Claude-Code-only and are not registered for Codex.
|
|
541
679
|
|
|
542
|
-
#### Codex
|
|
680
|
+
#### Codex hook trust and compatibility
|
|
543
681
|
|
|
544
|
-
|
|
682
|
+
Native plugin hook dispatch is verified with Codex CLI 0.150.1. Trust the plugin hooks before expecting capture. Desktop behavior depends on its bundled runtime; check `/hooks` and confirm a captured event before enabling a workaround.
|
|
545
683
|
|
|
546
|
-
|
|
684
|
+
If your host requires global hooks, mirror the commands into `~/.codex/hooks.json`. When MCP is already wired, the current connector needs `--force` to reach hook installation:
|
|
547
685
|
|
|
548
686
|
```bash
|
|
549
|
-
agentmemory connect codex --with-hooks
|
|
687
|
+
agentmemory connect codex --with-hooks --force
|
|
550
688
|
```
|
|
551
689
|
|
|
552
|
-
This
|
|
690
|
+
This merges global hooks and rewrites the agentmemory MCP entry, preserving unrelated entries. Review any custom agentmemory endpoint settings before using `--force`. Re-run after upgrading to refresh script paths. Enable either native plugin hooks or global copies to avoid duplicate capture.
|
|
553
691
|
|
|
554
692
|
### GitHub Copilot CLI
|
|
555
693
|
|
|
694
|
+
For VS Code agent mode, use the [Copilot MCP and automatic-capture guide](docs/plugins/copilot.md#vs-code-copilot-local-agent-sessions). The CLI connector does not configure VS Code.
|
|
695
|
+
|
|
556
696
|
```bash
|
|
557
697
|
# MCP-only wiring
|
|
558
698
|
agentmemory connect copilot-cli
|
|
559
699
|
|
|
560
|
-
#
|
|
700
|
+
# Alternatively, full hooks/skills plugin from the GitHub subdir
|
|
561
701
|
copilot plugin install rohitg00/agentmemory:plugin
|
|
562
702
|
```
|
|
563
703
|
|
|
564
|
-
`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.
|
|
704
|
+
`agentmemory connect copilot-cli` merges `mcpServers.agentmemory` into `~/.copilot/mcp-config.json` (or `$COPILOT_HOME/mcp-config.json` when `COPILOT_HOME` is set) and preserves existing servers. On native Windows this is the only automated `connect` adapter; configure every other native Windows agent manually. WSL `connect` is supported only when the target agent is installed in that same WSL environment. Copilot picks up the MCP server on next launch or after `/mcp`. Install the plugin as well when you want the full hook/skill experience.
|
|
565
705
|
|
|
566
706
|
<details>
|
|
567
707
|
<summary><b>OpenClaw (paste this prompt)</b></summary>
|
|
568
708
|
|
|
569
709
|
```text
|
|
570
|
-
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
|
|
710
|
+
Install agentmemory for OpenClaw. Run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server on localhost:3111. Then add this to my OpenClaw MCP config so agentmemory is available with all 54 memory tools:
|
|
571
711
|
|
|
572
712
|
{
|
|
573
713
|
"mcpServers": {
|
|
@@ -592,7 +732,7 @@ Full guide: [`integrations/openclaw/`](integrations/openclaw/)
|
|
|
592
732
|
<summary><b>Hermes Agent (paste this prompt)</b></summary>
|
|
593
733
|
|
|
594
734
|
```text
|
|
595
|
-
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
|
|
735
|
+
Install agentmemory for Hermes. Run `npx -y @agentmemory/agentmemory@latest` in a separate terminal to start the memory server on localhost:3111. Then add this to ~/.hermes/config.yaml so Hermes can use agentmemory as an MCP server with all 54 memory tools:
|
|
596
736
|
|
|
597
737
|
mcp_servers:
|
|
598
738
|
agentmemory:
|
|
@@ -611,11 +751,11 @@ Full guide: [`integrations/hermes/`](integrations/hermes/)
|
|
|
611
751
|
|
|
612
752
|
### Other agents
|
|
613
753
|
|
|
614
|
-
Start the memory server: `npx @agentmemory/agentmemory`
|
|
754
|
+
Start the memory server: `npx -y @agentmemory/agentmemory@latest`
|
|
615
755
|
|
|
616
756
|
#### Native skills via `npx skills add` (50+ agents)
|
|
617
757
|
|
|
618
|
-
agentmemory ships
|
|
758
|
+
agentmemory ships 17 skills in the Claude-Code-style `<dir>/SKILL.md` format: 9 invocable action skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `lesson`, `commit-context`, `commit-history`, `session-history`) and 8 reference skills the agent loads on demand (`memory-discipline`, `agentmemory-mcp-tools`, `agentmemory-rest-api`, `agentmemory-config`, `agentmemory-agents`, `agentmemory-hooks`, `agentmemory-architecture`, `write-agentmemory-skill`). The reference skills carry data tables generated from source, so they never drift. The [`skills`](https://npmjs.com/package/skills) CLI by vercel-labs auto-installs them into the calling agent's native skill directory across 50+ agents (Claude Code, Cursor, Cline, Continue, Droid, Warp, Codex, Antigravity, Kiro, OpenCode, Goose, Roo, Trae, Windsurf, and more):
|
|
619
759
|
|
|
620
760
|
```bash
|
|
621
761
|
npx skills add rohitg00/agentmemory -y # auto-detects the calling agent
|
|
@@ -628,11 +768,11 @@ This is **complementary** to `agentmemory connect <agent>`:
|
|
|
628
768
|
- `agentmemory connect <agent>` writes the MCP server config so the tools are available.
|
|
629
769
|
- `npx skills add rohitg00/agentmemory` installs the skills so the agent knows when to call them.
|
|
630
770
|
|
|
631
|
-
For the few agents the skills CLI doesn't cover yet (Zed v1.3.x and below), drop the
|
|
771
|
+
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.
|
|
632
772
|
|
|
633
773
|
#### Standard MCP block
|
|
634
774
|
|
|
635
|
-
The agentmemory entry is the **same MCP server block** across every host that uses the `mcpServers` shape (Cursor, Claude Desktop, Cline, Roo Code,
|
|
775
|
+
The agentmemory entry is the **same MCP server block** across every host that uses the `mcpServers` shape (Cursor, Claude Desktop, Cline, Roo Code, Gemini CLI, OpenClaw):
|
|
636
776
|
|
|
637
777
|
```json
|
|
638
778
|
"agentmemory": {
|
|
@@ -645,33 +785,38 @@ The agentmemory entry is the **same MCP server block** across every host that us
|
|
|
645
785
|
}
|
|
646
786
|
```
|
|
647
787
|
|
|
648
|
-
**Merge this entry into the existing `mcpServers` object** in the host's config file
|
|
788
|
+
**Merge this entry into the existing `mcpServers` object** in the host's config file; don't replace the file. If the file already has other servers, add `agentmemory` next to them as another key inside `mcpServers`. If `mcpServers` is missing entirely, paste the block inside `{ "mcpServers": { ... } }`. The `${VAR}` placeholders inherit `AGENTMEMORY_URL` / `AGENTMEMORY_SECRET` from the shell at MCP-server launch; unset vars pass empty strings and the shim falls back to `http://localhost:3111`. One wired entry covers both local and remote (k8s / reverse-proxied) deployments.
|
|
649
789
|
|
|
650
790
|
| Agent | Config file | Notes |
|
|
651
791
|
|---|---|---|
|
|
652
|
-
| **Cursor** | `~/.cursor/mcp.json` | Merge into `mcpServers`. One-click deeplink also available on the website. |
|
|
792
|
+
| **Cursor (MCP only)** | `~/.cursor/mcp.json` | Merge into `mcpServers`, or `agentmemory connect cursor`. One-click deeplink also available on the website. |
|
|
793
|
+
| **Cursor (full plugin)** | `.cursor-plugin/` | Cursor Marketplace listing (submission in review) or Cursor Settings → Plugins → local checkout. Registers 7 auto-capture hooks (sessionStart, beforeSubmitPrompt, preToolUse, postToolUse, postToolUseFailure, stop, sessionEnd) + 17 skills + the MCP server, with `AGENTMEMORY_URL` / `AGENTMEMORY_SECRET` managed in Cursor's plugin dashboard. Works in the Cursor IDE and `cursor-agent` CLI; CLI print-mode prompts are backfilled from the session transcript at session end. |
|
|
653
794
|
| **Claude Desktop** | `claude_desktop_config.json` (Application Support) | Merge into `mcpServers`. Restart Claude Desktop after editing. |
|
|
654
795
|
| **Cline / Roo Code / Kilo Code** | Cline MCP settings (Settings UI → MCP Servers → Edit) | Same `mcpServers` block. |
|
|
655
|
-
| **
|
|
796
|
+
| **Devin CLI (MCP + hooks)** | `~/.config/devin/config.json` | `agentmemory connect devin` merges the MCP entry; `--with-hooks` adds six native auto-capture hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd) with Devin'"'"'s lowercase tool matchers. Verify with `devin mcp list` and `/hooks` inside devin. |
|
|
797
|
+
| **Devin CLI (full plugin)** | `plugin/.devin-plugin/` | `devin plugins install ./plugin` from a checkout registers all 17 skills as `/agentmemory:<skill>` slash commands plus the MCP server. Devin plugin hooks cannot fire `SessionStart`/`SessionEnd`, so pair it with `connect devin --with-hooks` for full session capture. |
|
|
798
|
+
| **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. |
|
|
656
799
|
| **Gemini CLI** | `~/.gemini/settings.json` | `gemini mcp add agentmemory npx -y @agentmemory/mcp --scope user` (auto-merges). |
|
|
657
800
|
| **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`. |
|
|
658
801
|
| **GitHub Copilot CLI (full plugin)** | Copilot plugin install | `copilot plugin install rohitg00/agentmemory:plugin` for the plugin from the GitHub subdir. |
|
|
659
|
-
| **OpenClaw** | OpenClaw MCP config | Same `mcpServers` block
|
|
802
|
+
| **OpenClaw** | OpenClaw MCP config | Same `mcpServers` block. Deeper: `openclaw plugins install ./integrations/openclaw` claims OpenClaw's memory slot (auto-switches from `memory-core`); set `plugins.entries.agentmemory.hooks.allowConversationAccess=true` or turn capture is silently blocked. See [`integrations/openclaw`](integrations/openclaw/). |
|
|
660
803
|
| **Codex CLI (MCP only)** | `.codex/config.toml` | TOML shape: `codex mcp add agentmemory -- npx -y @agentmemory/mcp`, or add `[mcp_servers.agentmemory]` manually. |
|
|
661
|
-
| **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks
|
|
662
|
-
| **OpenCode (MCP only)** | `opencode.json` | Different shape
|
|
663
|
-
| **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. |
|
|
664
|
-
| **pi** | `~/.pi/agent/extensions/agentmemory` |
|
|
665
|
-
| **Hermes Agent** | `~/.hermes/config.yaml` |
|
|
666
|
-
| **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
|
|
667
|
-
| **Antigravity
|
|
804
|
+
| **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin add agentmemory@agentmemory`. Registers MCP + 6 lifecycle hooks + 17 skills. Trust hooks and verify capture in your host; see [Codex setup and validation](docs/plugins/codex-local.md). |
|
|
805
|
+
| **OpenCode (MCP only)** | `opencode.json` | Different shape: top-level `mcp` key, command as array: `{"mcp": {"agentmemory": {"type": "local", "command": ["npx", "-y", "@agentmemory/mcp"], "enabled": true}}}`. |
|
|
806
|
+
| **OpenCode (full plugin)** | `plugin/opencode/` | 22 auto-capture hooks covering session lifecycle, messages, tools, errors. Project attribution is per-session, so one OpenCode process spanning several repositories files each session under its own project. Two slash commands (`/recall`, `/remember`). Copy `plugin/opencode/` into your OpenCode workspace and add the plugin entry to `opencode.json`. See [`plugin/opencode/README.md`](plugin/opencode/README.md) for the full hook table + gap analysis. |
|
|
807
|
+
| **pi** | `~/.pi/agent/extensions/agentmemory` | `agentmemory connect pi` installs the bundled extension into pi's auto-discovery directory (recall on agent start, capture on agent end, `memory_search` / `memory_save` / `memory_health` tools, `/agentmemory-status`). `/reload` in a running pi picks it up. [`integrations/pi`](integrations/pi/) is also a pi package (`pi install ./integrations/pi` from a checkout). |
|
|
808
|
+
| **Hermes Agent** | `~/.hermes/config.yaml` | `cp -r integrations/hermes ~/.hermes/plugins/agentmemory` + `memory.provider: agentmemory` gives the 6-hook memory provider (prefetch, turn capture, session end, pre-compress, MEMORY.md mirroring, system prompt block). Validate with `hermes plugins doctor` and `hermes memory status`. See [`integrations/hermes`](integrations/hermes/). |
|
|
809
|
+
| **Qwen Code** | `~/.qwen/settings.json` | `agentmemory connect qwen` writes the standard `mcpServers` block. Hook payload is field-compatible with Claude Code, so the existing 12-hook scripts work without modification; wire them via the `hooks` section in the same `settings.json`. |
|
|
810
|
+
| **Antigravity IDE / 2.0** | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity --with-hooks` installs MCP and capture hooks in the shared customization directory. See [Antigravity setup and limits](docs/plugins/antigravity.md). |
|
|
811
|
+
| **Antigravity CLI** (`agy`) | `~/.gemini/config/mcp_config.json` | `agentmemory connect antigravity-cli --with-hooks` uses the same MCP and hook configuration as current IDE versions. Existing installations should refresh with `--force`; see the [upgrade notes](docs/plugins/antigravity.md). |
|
|
668
812
|
| **Kiro** | `~/.kiro/settings/mcp.json` | `agentmemory connect kiro` writes the user-level config. Workspace overrides go in `.kiro/settings/mcp.json` next to your code. |
|
|
669
|
-
| **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills
|
|
813
|
+
| **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills/`; once the Claude Code plugin is installed the 8 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. |
|
|
670
814
|
| **Cline (CLI)** | `~/.cline/mcp.json` | `agentmemory connect cline` writes the standard `mcpServers` block. VS Code extension users: paste the same block via Cline Settings → MCP Servers → Edit JSON. |
|
|
671
|
-
| **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
|
|
815
|
+
| **Continue.dev** | `~/.continue/config.yaml` (preferred) or `config.json` (legacy) | `agentmemory connect continue` creates `config.yaml` from scratch when neither exists, or modifies existing `config.json`. **If you already have `config.yaml`** the adapter prints the exact block to paste under `mcpServers:`; it won't silently rewrite your yaml because preserving comments and anchors safely needs a YAML parser the package doesn't ship. Continue uses array form (not object) for `mcpServers`. |
|
|
672
816
|
| **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. |
|
|
673
|
-
| **Droid (Factory.ai)** | `~/.factory/mcp.json` | `agentmemory connect droid` writes the standard `mcpServers` block. Project-scoped overrides go in `<repo>/.factory/mcp.json`.
|
|
674
|
-
| **
|
|
817
|
+
| **Droid (Factory.ai)** | `~/.factory/mcp.json` | `agentmemory connect droid` writes the standard `mcpServers` block. Project-scoped overrides go in `<repo>/.factory/mcp.json`. Pass `--with-hooks` for native auto-capture. |
|
|
818
|
+
| **DeepSeek Harness** | `$DSH_HOME/cordis.patch.yml` | `agentmemory connect dsh` appends an `@deepseek-ai/dsh-mcp-client` row to the home-level patch layer every Harness profile loads; tools register as `mcp__agentmemory__*`. Pass `--with-hooks` to also wire auto-capture: the bundled Claude Code hook scripts run through Harness's first-party `@deepseek-ai/dsh-hooks-claude-code` bridge (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop) via a manifest written to `$DSH_HOME/agentmemory.hooks.json`. Defaults to `~/.dsh` when `DSH_HOME` is unset. |
|
|
819
|
+
| **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`). |
|
|
675
820
|
| **Aider** | n/a | Talk to the REST API directly: `curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}'`. |
|
|
676
821
|
| **Any agent (32+)** | n/a | `npx skillkit install agentmemory` auto-detects the host and merges. |
|
|
677
822
|
|
|
@@ -679,7 +824,7 @@ The agentmemory entry is the **same MCP server block** across every host that us
|
|
|
679
824
|
|
|
680
825
|
### Programmatic access (Python / Rust / Node)
|
|
681
826
|
|
|
682
|
-
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
|
|
827
|
+
agentmemory registers its core operations as iii functions (`mem::remember`, `mem::observe`, `mem::context`, `mem::smart-search`, `mem::forget`). Any language with an iii SDK can call them directly over `ws://localhost:49134`, with no separate REST client per language.
|
|
683
828
|
|
|
684
829
|
```bash
|
|
685
830
|
pip install iii-sdk # Python
|
|
@@ -708,68 +853,73 @@ git clone https://github.com/rohitg00/agentmemory.git && cd agentmemory
|
|
|
708
853
|
npm install && npm run build && npm start
|
|
709
854
|
```
|
|
710
855
|
|
|
711
|
-
This starts agentmemory with a local `iii-engine` if
|
|
856
|
+
This starts agentmemory with a local `iii-engine` if the pinned binary is already installed, or uses Docker Compose when selected. REST, streams, and the viewer bind to `127.0.0.1` by default. The automatic macOS/Linux binary path requires `curl`, a POSIX `sh`, and `tar`.
|
|
712
857
|
|
|
713
|
-
Install `iii-engine` manually. **agentmemory currently pins `iii-engine` to `v0.
|
|
858
|
+
Install `iii-engine` manually. **agentmemory currently pins `iii-engine` to `v0.22.1`**, the same release as its `iii-sdk` dependency; the worker speaks that engine's wire protocol, and 0.20.0 reorganized the SDK surface, so the two move together in agentmemory releases. Override with `AGENTMEMORY_III_VERSION=<version>` if you run your own engine and know it matches.
|
|
714
859
|
|
|
715
|
-
- **macOS arm64:** `mkdir -p ~/.local/bin && curl -
|
|
860
|
+
- **macOS arm64:** `mkdir -p ~/.local/bin && curl -fsSLo iii.tar.gz https://github.com/iii-hq/iii/releases/download/iii/v0.22.1/iii-aarch64-apple-darwin.tar.gz && echo "2b309019b909a896cae874dc947e2cdf877b4f3c51dd026b79850af858517fa4 iii.tar.gz" | shasum -a 256 -c - && tar -xzf iii.tar.gz -C ~/.local/bin && chmod +x ~/.local/bin/iii`
|
|
716
861
|
- **macOS x64:** swap `aarch64-apple-darwin` for `x86_64-apple-darwin`
|
|
717
862
|
- **Linux x64:** swap for `x86_64-unknown-linux-gnu`
|
|
718
863
|
- **Linux arm64:** swap for `aarch64-unknown-linux-gnu`
|
|
719
|
-
- **Windows:** download `iii-x86_64-pc-windows-msvc.zip` from [iii-hq/iii releases v0.
|
|
864
|
+
- **Windows:** download `iii-x86_64-pc-windows-msvc.zip` from [iii-hq/iii releases v0.22.1](https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.22.1) and extract `iii.exe` to `%USERPROFILE%\.agentmemory\bin\iii.exe`
|
|
720
865
|
|
|
721
|
-
|
|
866
|
+
Every archive has a matching `.sha256` file on the release page; when you swap the platform, use that file's hash in the check above (on Windows: `Get-FileHash`). The automatic installer in `npx @agentmemory/agentmemory` pins these hashes and refuses an archive that does not match.
|
|
867
|
+
|
|
868
|
+
Or use Docker (the bundled `docker-compose.yml` pulls `iiidev/iii:0.22.1`). Full docs: [iii.dev/docs](https://iii.dev/docs).
|
|
722
869
|
|
|
723
870
|
### Windows
|
|
724
871
|
|
|
725
|
-
agentmemory runs on Windows 10/11, but the Node.js package alone isn't enough
|
|
872
|
+
agentmemory runs on Windows 10/11, but the Node.js package alone isn't enough; you also need the pinned iii-engine v0.22.1 runtime as a background process. The CLI does not auto-extract the Windows ZIP, so native Windows users must install `iii.exe` manually, use WSL2, or choose Docker Desktop.
|
|
873
|
+
|
|
874
|
+
Native Windows automated MCP wiring supports only `agentmemory connect copilot-cli`. For Claude Code, Codex, Cursor, and every other native Windows agent, copy the manual MCP block from [Other agents](#other-agents) into that agent's Windows config. Running `connect` in WSL is appropriate only when the target agent is also installed in the same WSL environment; it does not edit a Windows-host agent's configuration.
|
|
726
875
|
|
|
727
|
-
**Option A
|
|
876
|
+
**Option A: prebuilt Windows binary (recommended)**
|
|
728
877
|
|
|
729
878
|
```powershell
|
|
730
|
-
# 1. Open https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.
|
|
731
|
-
# (
|
|
732
|
-
#
|
|
879
|
+
# 1. Open https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.22.1 in your browser
|
|
880
|
+
# (agentmemory pins the engine to the same release as its iii-sdk;
|
|
881
|
+
# v0.22.1 is the current pair)
|
|
733
882
|
# 2. Download iii-x86_64-pc-windows-msvc.zip
|
|
734
883
|
# (or iii-aarch64-pc-windows-msvc.zip if you're on an ARM machine)
|
|
735
|
-
# 3. Extract iii.exe
|
|
736
|
-
|
|
737
|
-
#
|
|
884
|
+
# 3. Extract iii.exe to agentmemory's private engine directory:
|
|
885
|
+
New-Item -ItemType Directory -Force "$HOME\.agentmemory\bin"
|
|
886
|
+
# Copy iii.exe to $HOME\.agentmemory\bin\iii.exe
|
|
738
887
|
# 4. Verify:
|
|
739
|
-
iii --version
|
|
740
|
-
# Should print: 0.
|
|
888
|
+
& "$HOME\.agentmemory\bin\iii.exe" --version
|
|
889
|
+
# Should print: 0.22.1
|
|
741
890
|
|
|
742
891
|
# 5. Then run agentmemory as usual:
|
|
743
|
-
npx -y @agentmemory/agentmemory
|
|
892
|
+
npx -y @agentmemory/agentmemory@latest
|
|
744
893
|
```
|
|
745
894
|
|
|
746
|
-
**Option B
|
|
895
|
+
**Option B: Docker Desktop**
|
|
747
896
|
|
|
748
897
|
```powershell
|
|
749
898
|
# 1. Install Docker Desktop for Windows
|
|
750
899
|
# 2. Start Docker Desktop and make sure the engine is running
|
|
751
|
-
# 3.
|
|
752
|
-
|
|
900
|
+
# 3. Select Docker explicitly and run agentmemory:
|
|
901
|
+
$env:AGENTMEMORY_USE_DOCKER = "1"
|
|
902
|
+
npx -y @agentmemory/agentmemory@latest
|
|
753
903
|
```
|
|
754
904
|
|
|
755
|
-
**Option C
|
|
905
|
+
**Option C: standalone MCP only (no engine).** If you only need the MCP tools for your agent and don't need the REST API, viewer, or cron jobs, skip the engine entirely:
|
|
756
906
|
|
|
757
907
|
```powershell
|
|
758
|
-
npx -y @agentmemory/agentmemory mcp
|
|
908
|
+
npx -y @agentmemory/agentmemory@latest mcp
|
|
759
909
|
# or via the shim package:
|
|
760
910
|
npx -y @agentmemory/mcp
|
|
761
911
|
```
|
|
762
912
|
|
|
763
|
-
**Diagnostics for Windows:** if `npx @agentmemory/agentmemory` fails, re-run with `--verbose` to see the actual engine stderr. Common failure modes:
|
|
913
|
+
**Diagnostics for Windows:** if `npx -y @agentmemory/agentmemory@latest` fails, re-run it with `--verbose` to see the actual engine stderr. Common failure modes:
|
|
764
914
|
|
|
765
915
|
| Symptom | Fix |
|
|
766
916
|
|---|---|
|
|
767
|
-
| `
|
|
917
|
+
| `The engine process started but the REST API never responded.` | Confirm all four derived ports are free, verify the pinned `iii.exe` stayed alive, then re-run with `--verbose` and inspect the captured engine stderr |
|
|
768
918
|
| `Could not start iii-engine` | Neither `iii.exe` nor Docker is installed. See Option A or B above |
|
|
769
919
|
| Port conflict | `netstat -ano \| findstr :3111` to see what's bound, then kill it or use `--port <N>` |
|
|
770
920
|
| Docker fallback skipped even though Docker is installed | Make sure Docker Desktop is actually running (system tray icon) |
|
|
771
921
|
|
|
772
|
-
> Note: the iii **engine** is a prebuilt binary, not a cargo crate
|
|
922
|
+
> Note: the iii **engine** is a prebuilt binary, not a cargo crate, so don't try to `cargo install` it. (The iii **SDKs** are published on crates.io, npm, and PyPI, but agentmemory doesn't need them.) Supported engine install methods are all pinned to v0.22.1: the prebuilt binary above, agentmemory's macOS/Linux auto-install path (`curl`, POSIX `sh`, and `tar` required), and the Docker image `iiidev/iii:0.22.1`. A bare upstream `install.sh | sh` installs the latest engine, which agentmemory does not support. Use `npx -y @agentmemory/agentmemory@latest`; on macOS/Linux it fetches the pinned engine into `~/.agentmemory/bin`.
|
|
773
923
|
|
|
774
924
|
---
|
|
775
925
|
|
|
@@ -778,7 +928,7 @@ npx -y @agentmemory/mcp
|
|
|
778
928
|
One-click templates for managed hosts. Each one ships a self-contained
|
|
779
929
|
Dockerfile that pulls `@agentmemory/agentmemory` from npm and copies
|
|
780
930
|
the iii engine binary in from the official `iiidev/iii` Docker Hub
|
|
781
|
-
image
|
|
931
|
+
image; no pre-built agentmemory image required. Persistent storage
|
|
782
932
|
mounts at `/data`; the first-boot entrypoint overwrites the
|
|
783
933
|
npm-bundled iii config (which binds `127.0.0.1`) with a deploy-tuned
|
|
784
934
|
one that binds `0.0.0.0` and uses absolute `/data` paths, generates
|
|
@@ -795,25 +945,25 @@ Render's one-click deploy button requires `render.yaml` at the repository root,
|
|
|
795
945
|
Full setup details (HMAC capture, viewer SSH tunnel, rotation, backup,
|
|
796
946
|
cost floors) live in [`deploy/`](./deploy/README.md):
|
|
797
947
|
|
|
798
|
-
- [`deploy/fly`](./deploy/fly/README.md)
|
|
948
|
+
- [`deploy/fly`](./deploy/fly/README.md): single machine with
|
|
799
949
|
`auto_stop_machines = "stop"`; cheapest idle.
|
|
800
|
-
- [`deploy/railway`](./deploy/railway/README.md)
|
|
950
|
+
- [`deploy/railway`](./deploy/railway/README.md): Hobby plan flat fee,
|
|
801
951
|
volume in the dashboard.
|
|
802
|
-
- [`deploy/render`](./deploy/render/README.md)
|
|
952
|
+
- [`deploy/render`](./deploy/render/README.md): Blueprint flow,
|
|
803
953
|
automatic disk snapshots on paid plans.
|
|
804
|
-
- [`deploy/coolify`](./deploy/coolify/README.md)
|
|
954
|
+
- [`deploy/coolify`](./deploy/coolify/README.md): self-hosted on your
|
|
805
955
|
own VPS via [Coolify](https://coolify.io/self-hosted); same Docker
|
|
806
956
|
Compose stack, you own the host and the data.
|
|
807
957
|
|
|
808
958
|
Only port `3111` is published. The viewer on `3113` stays bound to
|
|
809
|
-
loopback inside the container
|
|
959
|
+
loopback inside the container; every template's README documents the
|
|
810
960
|
SSH-tunnel pattern for reaching it.
|
|
811
961
|
|
|
812
962
|
---
|
|
813
963
|
|
|
814
964
|
<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>
|
|
815
965
|
|
|
816
|
-
Every coding agent forgets everything when the session ends
|
|
966
|
+
Every coding agent forgets everything when the session ends, and each new session starts with you re-explaining your stack. agentmemory runs in the background and removes that step.
|
|
817
967
|
|
|
818
968
|
```text
|
|
819
969
|
Session 1: "Add auth to the API"
|
|
@@ -831,7 +981,7 @@ Session 2: "Now add rate limiting"
|
|
|
831
981
|
|
|
832
982
|
### vs built-in agent memory
|
|
833
983
|
|
|
834
|
-
Every AI coding agent ships with built-in memory
|
|
984
|
+
Every AI coding agent ships with built-in memory: Claude Code has `MEMORY.md`, Cursor has notepads, Cline has memory bank. These work like sticky notes. agentmemory is the searchable database behind the sticky notes.
|
|
835
985
|
|
|
836
986
|
| | Built-in (CLAUDE.md) | agentmemory |
|
|
837
987
|
|---|---|---|
|
|
@@ -853,9 +1003,10 @@ PostToolUse hook fires
|
|
|
853
1003
|
-> SHA-256 dedup (5min window)
|
|
854
1004
|
-> Privacy filter (strip secrets, API keys)
|
|
855
1005
|
-> Store raw observation
|
|
856
|
-
->
|
|
857
|
-
|
|
858
|
-
->
|
|
1006
|
+
-> Synthetic compression by default
|
|
1007
|
+
(LLM-written compression only with a provider + AGENTMEMORY_AUTO_COMPRESS=true)
|
|
1008
|
+
-> Vector embedding when an embedding provider is active
|
|
1009
|
+
-> Index in BM25, plus vectors when enabled
|
|
859
1010
|
|
|
860
1011
|
Stop / SessionEnd hook fires
|
|
861
1012
|
-> Summarize session
|
|
@@ -871,7 +1022,7 @@ SessionStart hook fires
|
|
|
871
1022
|
|
|
872
1023
|
### 4-Tier Memory Consolidation
|
|
873
1024
|
|
|
874
|
-
|
|
1025
|
+
Modeled on how human brains process memory, including sleep consolidation.
|
|
875
1026
|
|
|
876
1027
|
| Tier | What | Analogy |
|
|
877
1028
|
|------|------|---------|
|
|
@@ -900,9 +1051,13 @@ Memories decay over time (Ebbinghaus curve). Frequently accessed memories streng
|
|
|
900
1051
|
|
|
901
1052
|
| Capability | Description |
|
|
902
1053
|
|---|---|
|
|
903
|
-
| **Automatic capture** | Every tool use recorded via hooks
|
|
1054
|
+
| **Automatic capture** | Every tool use recorded via hooks, no manual effort |
|
|
904
1055
|
| **Semantic search** | BM25 + vector + knowledge graph with RRF fusion |
|
|
905
1056
|
| **Memory evolution** | Versioning, supersession, relationship graphs |
|
|
1057
|
+
| **Recall hygiene** | Superseded memory versions leave the search indexes; the version chain in KV keeps full history |
|
|
1058
|
+
| **Near-duplicate hints** | Saves report an advisory `similarTo` match when new content closely resembles an existing memory |
|
|
1059
|
+
| **Per-agent scoping** | `agentId` threads through save and recall across REST, MCP, and the search index, in shared or isolated mode |
|
|
1060
|
+
| **Write-time provenance** | Every observation and memory carries an immutable origin channel (user, agent, tool, import, or shared) stamped at capture, save, and import |
|
|
906
1061
|
| **Auto-forgetting** | TTL expiry, contradiction detection, importance eviction |
|
|
907
1062
|
| **Privacy first** | API keys, secrets, `<private>` tags stripped before storage |
|
|
908
1063
|
| **Self-healing** | Circuit breaker, provider fallback chain, health monitoring |
|
|
@@ -926,19 +1081,25 @@ Triple-stream retrieval combining three signals:
|
|
|
926
1081
|
|
|
927
1082
|
Fused with Reciprocal Rank Fusion (RRF, k=60) and session-diversified (max 3 results per session).
|
|
928
1083
|
|
|
1084
|
+
When a vector index is populated, `mem::search` (behind `memory_recall`) uses the hybrid BM25 + vector ranker. Without embeddings it uses BM25. `smart-search` can additionally fuse structural graph matches when graph data exists, including in keyless mode. Lesson recall runs on a dedicated in-memory BM25 index instead of scanning the whole corpus per query. Superseded memory versions are excluded from every recall path; the version chain keeps their history.
|
|
1085
|
+
|
|
1086
|
+
Vectors survive a crash or force-kill. The vector index is saved in buckets at most every `AGENTMEMORY_INDEX_SAVE_INTERVAL_MS` (10 minutes). Every vector added or removed in between is also written right away to a small pending log in the state store, and the next start replays it without calling the embedding provider. Each successful save empties the log. Documents that still have no vector after the replay are re-embedded in the background in batches of `AGENTMEMORY_VECTOR_BACKFILL_MAX` (500) until none are left, and a backfill that is stopped continues at the next start. `/agentmemory/status` and the viewer show the pending log size and the backfill state. Keyless installs write nothing.
|
|
1087
|
+
|
|
929
1088
|
BM25 tokenizes Greek, Cyrillic, Hebrew, Arabic, and accented Latin out of the box. For Chinese / Japanese / Korean memories, install the optional segmenters (`npm install @node-rs/jieba tiny-segmenter`) to split CJK runs into word-level tokens; without them, agentmemory soft-falls to whole-run tokenization and prints a one-time hint on stderr.
|
|
930
1089
|
|
|
931
1090
|
### Embedding providers
|
|
932
1091
|
|
|
933
|
-
|
|
1092
|
+
Keyless installs disable vector embeddings: `mem::search` uses BM25, while `smart-search` can also use existing structural graph data. To opt into free on-device semantic embeddings, add this to `~/.agentmemory/.env` and restart agentmemory:
|
|
934
1093
|
|
|
935
|
-
```
|
|
936
|
-
|
|
1094
|
+
```env
|
|
1095
|
+
EMBEDDING_PROVIDER=local
|
|
937
1096
|
```
|
|
938
1097
|
|
|
1098
|
+
The normal npm install includes the optional `@huggingface/transformers` runtime. The first embedding request downloads `Xenova/all-MiniLM-L6-v2`, so it needs network access and can take longer; subsequent inference runs on-device. Remote providers are auto-detected from their keys unless `EMBEDDING_PROVIDER` overrides them.
|
|
1099
|
+
|
|
939
1100
|
| Provider | Model | Cost | Notes |
|
|
940
1101
|
|---|---|---|---|
|
|
941
|
-
| **Local (recommended)** | `all-MiniLM-L6-v2` | Free |
|
|
1102
|
+
| **Local (recommended opt-in)** | `all-MiniLM-L6-v2` | Free | On-device after the first model download, +8pp recall over BM25-only |
|
|
942
1103
|
| Gemini | `gemini-embedding-001` | Free tier | 100+ languages, 768/1536/3072 dims (MRL), 2048-token input. Replaces `text-embedding-004` ([deprecated, shutdown Jan 14, 2026](https://ai.google.dev/gemini-api/docs/deprecations)) |
|
|
943
1104
|
| OpenAI | `text-embedding-3-small` | $0.02/1M | Highest quality |
|
|
944
1105
|
| Voyage AI | `voyage-code-3` | Paid | Optimized for code |
|
|
@@ -949,33 +1110,38 @@ npm install @xenova/transformers
|
|
|
949
1110
|
|
|
950
1111
|
<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>
|
|
951
1112
|
|
|
952
|
-
|
|
1113
|
+
54 tools, 6 resources, 3 prompts, and 17 skills.
|
|
1114
|
+
|
|
1115
|
+
> **MCP shim vs full server:** the published `@agentmemory/mcp` package is a thin shim. It exposes the full 54-tool surface **only when it can reach a running agentmemory server** via `AGENTMEMORY_URL` (proxy mode). With no server reachable, the shim falls back to a 7-tool local set (`memory_save`, `memory_recall`, `memory_smart_search`, `memory_sessions`, `memory_export`, `memory_audit`, `memory_governance_delete`). The `AGENTMEMORY_TOOLS=core|all` env var is a *server-side* flag; setting it in the shim's `env` block has no effect. If you see only 7 tools in Cursor / OpenCode / Gemini CLI, start `npx -y @agentmemory/agentmemory@latest` (or the Docker stack) and set `AGENTMEMORY_URL=http://localhost:3111`.
|
|
953
1116
|
|
|
954
|
-
|
|
1117
|
+
### 54 Tools
|
|
955
1118
|
|
|
956
|
-
|
|
1119
|
+
Three tool surfaces, smallest to largest: `AGENTMEMORY_TOOLS=core` trims visibility to 8 essentials (`memory_save`, `memory_recall`, `memory_consolidate`, `memory_smart_search`, `memory_sessions`, `memory_diagnose`, `memory_lesson_save`, `memory_reflect`); the base set below is the registry's 14 foundational tools; the default (`AGENTMEMORY_TOOLS=all`) exposes all 54.
|
|
957
1120
|
|
|
958
1121
|
<details>
|
|
959
|
-
<summary>
|
|
1122
|
+
<summary>Base tools (14)</summary>
|
|
960
1123
|
|
|
961
1124
|
| Tool | Description |
|
|
962
1125
|
|------|-------------|
|
|
963
1126
|
| `memory_recall` | Search past observations |
|
|
964
1127
|
| `memory_compress_file` | Compress markdown files while preserving structure |
|
|
965
1128
|
| `memory_save` | Save an insight, decision, or pattern |
|
|
966
|
-
| `memory_patterns` | Detect recurring patterns |
|
|
967
|
-
| `memory_smart_search` | Hybrid semantic + keyword search |
|
|
968
1129
|
| `memory_file_history` | Past observations about specific files |
|
|
1130
|
+
| `memory_patterns` | Detect recurring patterns |
|
|
969
1131
|
| `memory_sessions` | List recent sessions |
|
|
1132
|
+
| `memory_smart_search` | Hybrid semantic + keyword search |
|
|
1133
|
+
| `memory_vision_search` | Search image observations |
|
|
970
1134
|
| `memory_timeline` | Chronological observations |
|
|
971
1135
|
| `memory_profile` | Project profile (concepts, files, patterns) |
|
|
972
1136
|
| `memory_export` | Export all memory data |
|
|
973
1137
|
| `memory_relations` | Query relationship graph |
|
|
1138
|
+
| `memory_commit_lookup` | Sessions behind a git commit |
|
|
1139
|
+
| `memory_commits` | Commits recorded for a session |
|
|
974
1140
|
|
|
975
1141
|
</details>
|
|
976
1142
|
|
|
977
1143
|
<details>
|
|
978
|
-
<summary>Extended tools (
|
|
1144
|
+
<summary>Extended tools (54 total, the default surface)</summary>
|
|
979
1145
|
|
|
980
1146
|
| Tool | Description |
|
|
981
1147
|
|------|-------------|
|
|
@@ -1013,14 +1179,16 @@ npm install @xenova/transformers
|
|
|
1013
1179
|
|
|
1014
1180
|
</details>
|
|
1015
1181
|
|
|
1016
|
-
### 6 Resources · 3 Prompts ·
|
|
1182
|
+
### 6 Resources · 3 Prompts · 17 Skills
|
|
1017
1183
|
|
|
1018
1184
|
| Type | Name | Description |
|
|
1019
1185
|
|------|------|-------------|
|
|
1020
1186
|
| Resource | `agentmemory://status` | Health, session count, memory count |
|
|
1021
1187
|
| Resource | `agentmemory://project/{name}/profile` | Per-project intelligence |
|
|
1188
|
+
| Resource | `agentmemory://project/{name}/recent` | Recent observations for a project |
|
|
1022
1189
|
| Resource | `agentmemory://memories/latest` | Latest 10 active memories |
|
|
1023
1190
|
| Resource | `agentmemory://graph/stats` | Knowledge graph statistics |
|
|
1191
|
+
| Resource | `agentmemory://team/{id}/profile` | Shared team profile |
|
|
1024
1192
|
| Prompt | `recall_context` | Search + return context messages |
|
|
1025
1193
|
| Prompt | `session_handoff` | Handoff data between agents |
|
|
1026
1194
|
| Prompt | `detect_patterns` | Analyze recurring patterns |
|
|
@@ -1029,18 +1197,20 @@ npm install @xenova/transformers
|
|
|
1029
1197
|
| Skill | `/session-history` | Recent session summaries |
|
|
1030
1198
|
| Skill | `/forget` | Delete observations/sessions |
|
|
1031
1199
|
|
|
1200
|
+
The table shows the four core skills. The full set is 9 invocable skills plus 8 reference skills; see the Native skills section above.
|
|
1201
|
+
|
|
1032
1202
|
### Standalone MCP
|
|
1033
1203
|
|
|
1034
|
-
Run without the full server
|
|
1204
|
+
Run without the full server, for any MCP client. Either of these works:
|
|
1035
1205
|
|
|
1036
1206
|
```bash
|
|
1037
|
-
npx -y @agentmemory/agentmemory mcp # canonical (always available)
|
|
1207
|
+
npx -y @agentmemory/agentmemory@latest mcp # canonical (always available)
|
|
1038
1208
|
npx -y @agentmemory/mcp # shim package alias
|
|
1039
1209
|
```
|
|
1040
1210
|
|
|
1041
1211
|
Or add to your agent's MCP config:
|
|
1042
1212
|
|
|
1043
|
-
Most agents (Cursor, Claude Desktop, Cline, Roo Code,
|
|
1213
|
+
Most agents (Cursor, Claude Desktop, Cline, Roo Code, Gemini CLI):
|
|
1044
1214
|
```json
|
|
1045
1215
|
{
|
|
1046
1216
|
"mcpServers": {
|
|
@@ -1082,46 +1252,51 @@ cp plugin/opencode/commands/*.md ~/.config/opencode/commands/
|
|
|
1082
1252
|
|
|
1083
1253
|
<h2 id="real-time-viewer"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-viewer.svg"><img src="assets/tags/section-viewer.svg" alt="Real-Time Viewer" height="32" /></picture></h2>
|
|
1084
1254
|
|
|
1085
|
-
Auto-starts on port `3113`.
|
|
1255
|
+
Auto-starts on port `3113`. The viewer loads one snapshot when it connects (`GET /agentmemory/viewer/snapshot`) and then applies live stream events: new memories, lessons, observations, audit entries, graph changes and health updates appear without polling or page reloads. The only other requests are the actions you click, "load more" pages and searches. When the stream drops, the viewer shows how old its numbers are, reconnects with backoff and resyncs from one snapshot.
|
|
1256
|
+
|
|
1257
|
+
- **12 tabs in four groups** with live counts, deep links (`#memories/<id>`, `#sessions/<id>?obs=<id>`, `#graph/<id>`, `#health/consolidation`), keyboard shortcuts and a mobile menu.
|
|
1258
|
+
- **Memories:** server-side search, filters by project, agent and type, a detail panel with the version chain and a word diff, provenance links, copy buttons for the id, the MCP call and a curl command, edit (a new version), forget with confirmation, bulk forget and JSON export.
|
|
1259
|
+
- **Sessions:** an inline observation timeline with readable tool input and output, filters and paging, and the memories and lessons each session produced.
|
|
1260
|
+
- **Graph:** search, node detail with relations and sources, a legend that does not rely on colour alone, and zoom controls.
|
|
1261
|
+
- **Health:** the live version of `GET /agentmemory/status`. Every problem comes with its fix, plus the state backend, index save state, graph provenance compaction progress and a consolidation explainer with the real thresholds.
|
|
1262
|
+
- **Audit, Activity, Profile, Replay, Lessons, Actions and Crystals** pages, each with an empty state that says what the section is, why it is empty and the command that fills it, and a `?` glossary tooltip on every term and number.
|
|
1086
1263
|
|
|
1087
1264
|
```bash
|
|
1088
1265
|
open http://localhost:3113
|
|
1089
1266
|
```
|
|
1090
1267
|
|
|
1091
|
-
The viewer server binds to `127.0.0.1` by default. The REST-served `/agentmemory/viewer` endpoint follows the normal
|
|
1268
|
+
The viewer server binds to `127.0.0.1` by default and attaches the server secret when it forwards requests to the REST API, so it needs no setup. The REST-served `/agentmemory/viewer` endpoint follows the normal bearer-token rules and redirects browsers without a token to the viewer port. CSP headers use a per-response script nonce and disable inline handler attributes (`script-src-attr 'none'`).
|
|
1092
1269
|
|
|
1093
1270
|
---
|
|
1094
1271
|
|
|
1095
1272
|
<h2 id="iii-console"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-viewer.svg"><img src="assets/tags/section-viewer.svg" alt="iii Console" height="32" /></picture></h2>
|
|
1096
1273
|
|
|
1097
|
-
The viewer at `:3113` shows what your agent **remembered**. The [iii console](https://iii.dev/docs/console) shows what your agent **did
|
|
1274
|
+
The viewer at `:3113` shows what your agent **remembered**. The [iii console](https://iii.dev/docs/console) shows what your agent **did**: every memory op as an OpenTelemetry trace, every KV entry editable, every function invocable, every stream tappable. Two windows on the same memory: one product-shaped, one engine-shaped.
|
|
1098
1275
|
|
|
1099
1276
|
Watch a `memory_smart_search` fire and see the BM25 scan → embedding lookup → RRF fusion → reranker as a waterfall. Edit a stuck consolidation timer in the KV browser. Replay a `PostToolUse` hook with a tweaked payload. Pin the WebSocket stream and watch observations land live.
|
|
1100
1277
|
|
|
1101
|
-
agentmemory ships this for free because every function call and trigger fires through iii
|
|
1278
|
+
agentmemory ships this for free because every function call and trigger fires through iii; nothing custom, nothing to instrument.
|
|
1102
1279
|
|
|
1103
1280
|
<p align="center">
|
|
1104
|
-
<img src="assets/iii-console/workers.png" alt="iii console Workers page
|
|
1281
|
+
<img src="assets/iii-console/workers.png" alt="iii console Workers page: connected workers including agentmemory instances with live function counts and runtime metadata" width="720" />
|
|
1105
1282
|
<br/>
|
|
1106
|
-
<em>Workers page: every connected worker
|
|
1283
|
+
<em>Workers page: every connected worker, including agentmemory itself, with PID, function count, runtime, and last-seen.</em>
|
|
1107
1284
|
</p>
|
|
1108
1285
|
|
|
1109
|
-
**Already installed.** The console ships with `iii`
|
|
1286
|
+
**Already installed.** The console ships with the pinned `iii` engine (0.22+); nothing separate to install. The first launch downloads the console binary next to the engine.
|
|
1110
1287
|
|
|
1111
1288
|
**Launch alongside agentmemory:**
|
|
1112
1289
|
|
|
1113
1290
|
```bash
|
|
1114
|
-
|
|
1115
|
-
# Engine REST (3111), WebSocket (3112), and bridge (49134) defaults match agentmemory.
|
|
1116
|
-
iii console --port 3114
|
|
1291
|
+
agentmemory console
|
|
1117
1292
|
```
|
|
1118
1293
|
|
|
1119
|
-
|
|
1294
|
+
This runs the pinned engine's `iii console` against the ports agentmemory resolved (REST, streams, bridge) and serves it one port above the viewer, `http://localhost:3114` by default. `--console-port N` picks another port; `--port` and `--instance` select the agentmemory instance the same way they do for `stop`; any other flag is passed through, for example `--enable-flow` for the experimental architecture-graph page.
|
|
1120
1295
|
|
|
1121
|
-
|
|
1296
|
+
The same thing by hand, useful when `agentmemory` is not on PATH:
|
|
1122
1297
|
|
|
1123
1298
|
```bash
|
|
1124
|
-
iii console --port 3114 \
|
|
1299
|
+
~/.agentmemory/bin/iii console --port 3114 \
|
|
1125
1300
|
--engine-port 3111 \
|
|
1126
1301
|
--ws-port 3112 \
|
|
1127
1302
|
--bridge-port 49134
|
|
@@ -1131,15 +1306,15 @@ iii console --port 3114 \
|
|
|
1131
1306
|
|
|
1132
1307
|
| Page | Use it to |
|
|
1133
1308
|
|------|-----------|
|
|
1134
|
-
| **Workers** | See every connected worker and its live metrics
|
|
1135
|
-
| **Functions** | Invoke any of agentmemory's functions directly with a JSON payload
|
|
1136
|
-
| **Triggers** | Replay HTTP, cron, event, and state triggers
|
|
1137
|
-
| **States** | KV browser with full CRUD
|
|
1309
|
+
| **Workers** | See every connected worker and its live metrics, including the agentmemory worker itself. |
|
|
1310
|
+
| **Functions** | Invoke any of agentmemory's functions directly with a JSON payload; handy for testing `memory.recall`, `memory.consolidate`, `graph.query` without wiring a client. |
|
|
1311
|
+
| **Triggers** | Replay HTTP, cron, event, and state triggers: fire the consolidation cron manually, retry an HTTP route, emit a state change. |
|
|
1312
|
+
| **States** | KV browser with full CRUD over sessions, memory slots, lifecycle timers, and the embeddings index; edit values in place. |
|
|
1138
1313
|
| **Streams** | Live WebSocket monitor for memory writes, hook events, and observation updates as they flow through iii streams. |
|
|
1139
1314
|
| **Queues** | Durable queue topics + dead-letter management. Replay or drop failed embedding / compression jobs. |
|
|
1140
1315
|
| **Traces** | OpenTelemetry waterfall / flame / service-breakdown views. Filter by `trace_id` to see exactly which functions, DB calls, and embedding requests a single `memory.search` produced. |
|
|
1141
1316
|
| **Logs** | Structured OTEL logs filtered and correlated to trace/span IDs. |
|
|
1142
|
-
| **Config** | Runtime configuration
|
|
1317
|
+
| **Config** | Runtime configuration: see exactly which workers, providers, and ports your engine is running with. |
|
|
1143
1318
|
| **Flow** | (Optional, `--enable-flow`) Interactive architecture graph of every worker, trigger, and stream. |
|
|
1144
1319
|
|
|
1145
1320
|
<p align="center">
|
|
@@ -1150,45 +1325,115 @@ iii console --port 3114 \
|
|
|
1150
1325
|
|
|
1151
1326
|
**Traces are already on:**
|
|
1152
1327
|
|
|
1153
|
-
`iii-config.yaml` ships with the `iii-observability` worker enabled (`exporter: memory`, `sampling_ratio: 1
|
|
1328
|
+
`iii-config.yaml` ships with the `iii-observability` worker enabled (`exporter: memory`, `sampling_ratio: 0.1`, metrics + logs). No extra config needed; the moment agentmemory starts, every memory operation emits a structured log the console can read, and one in ten of them (`sampling_ratio: 0.1`) also emits a trace span.
|
|
1154
1329
|
|
|
1155
1330
|
If you want to export to Jaeger/Honeycomb/Grafana Tempo instead, change `exporter: memory` to `exporter: otlp` and set the collector endpoint per iii's observability docs.
|
|
1156
1331
|
|
|
1157
|
-
> **Heads-up:** no auth is enforced on the console itself
|
|
1332
|
+
> **Heads-up:** no auth is enforced on the console itself; keep it bound to `127.0.0.1` (the default) and never expose it publicly.
|
|
1158
1333
|
|
|
1159
1334
|
---
|
|
1160
1335
|
|
|
1161
1336
|
<h2 id="powered-by-iii"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-architecture.svg"><img src="assets/tags/section-architecture.svg" alt="Powered by iii" height="32" /></picture></h2>
|
|
1162
1337
|
|
|
1163
|
-
agentmemory is **already a running [iii](https://iii.dev) instance**. Three primitives
|
|
1338
|
+
agentmemory is **already a running [iii](https://iii.dev) instance**. Three primitives (worker, function, trigger) compose the runtime; KV state, streams, and OTEL traces come from iii-state, iii-stream, and iii-observability workers that ship with iii. You didn't install Postgres, Redis, Express, pm2, or Prometheus, because iii replaces them.
|
|
1164
1339
|
|
|
1165
1340
|
That means one more command extends agentmemory with an entire new capability.
|
|
1166
1341
|
|
|
1167
|
-
### Extend agentmemory with
|
|
1342
|
+
### Extend agentmemory with more workers
|
|
1168
1343
|
|
|
1169
|
-
|
|
1170
|
-
iii worker add iii-pubsub # fan memory writes out to every connected instance
|
|
1171
|
-
iii worker add iii-cron # scheduled consolidation, decay sweeps, snapshot rotation
|
|
1172
|
-
iii worker add iii-queue # durable retries for embedding + compression jobs
|
|
1173
|
-
iii worker add iii-observability # OTEL traces on every memory op (default on)
|
|
1174
|
-
iii worker add iii-sandbox # run recalled code inside an isolated microVM
|
|
1175
|
-
iii worker add iii-database # swap in a SQL-backed state adapter
|
|
1176
|
-
iii worker add mcp # generic MCP host alongside the agentmemory MCP
|
|
1177
|
-
```
|
|
1344
|
+
The builtins agentmemory needs are already in `iii-config.yaml` and boot with it: `iii-state` (KV), `iii-queue` (durable retries for the event subscribers), `iii-pubsub`, `iii-cron`, `iii-stream`, and `iii-observability` (OTEL traces, metrics and logs on every function). Anything else from the [iii worker registry](https://workers.iii.dev) plugs into the same engine: copy `iii-config.yaml` to `~/.agentmemory/iii-config.yaml` (the CLI prefers that file over the bundled one and still renders ports and data paths into it), add the entry, install the worker runtime once with `~/.agentmemory/bin/iii update worker`, and restart agentmemory.
|
|
1178
1345
|
|
|
1179
|
-
|
|
1346
|
+
```yaml
|
|
1347
|
+
workers:
|
|
1348
|
+
# ...the bundled entries...
|
|
1349
|
+
- name: database # SQL-backed state adapter when you outgrow the KV defaults
|
|
1350
|
+
- name: iii-sandbox # run code that came out of memory_recall inside a throwaway VM
|
|
1351
|
+
- name: mcp # extra MCP servers next to agentmemory's, same engine
|
|
1352
|
+
```
|
|
1180
1353
|
|
|
1181
|
-
|
|
|
1354
|
+
| Worker | What you get on top of agentmemory |
|
|
1182
1355
|
|---|---|
|
|
1183
|
-
| [`
|
|
1184
|
-
| [`iii-cron`](https://workers.iii.dev/workers/iii-cron) | Scheduled lifecycle — nightly consolidation, weekly snapshots, decay on a fixed clock |
|
|
1185
|
-
| [`iii-queue`](https://workers.iii.dev/workers/iii-queue) | Durable retries: failed embedding + compression jobs survive restart, no lost observations |
|
|
1186
|
-
| [`iii-observability`](https://workers.iii.dev/workers/iii-observability) | OTEL traces, metrics, logs on every function — wired in `iii-config.yaml` from day one |
|
|
1356
|
+
| [`database`](https://workers.iii.dev/workers/database) | SQL-backed state adapter when you outgrow the in-memory KV defaults |
|
|
1187
1357
|
| [`iii-sandbox`](https://workers.iii.dev/workers/iii-sandbox) | Code that came out of `memory_recall` runs inside a throwaway VM, not your shell |
|
|
1188
|
-
| [`iii-database`](https://workers.iii.dev/workers/iii-database) | SQL-backed state adapter when you outgrow the in-memory KV defaults |
|
|
1189
1358
|
| [`mcp`](https://workers.iii.dev/workers/mcp) | Stand up extra MCP servers next to agentmemory's, share the same engine |
|
|
1190
1359
|
|
|
1191
|
-
|
|
1360
|
+
On engine 0.22.x keep the `iii-` prefixed names for the builtins above; the unprefixed `http`, `state`, `queue`, `pubsub` and `cron` entries are the standalone registry workers agentmemory moves to with the 0.23 migration.
|
|
1361
|
+
|
|
1362
|
+
Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there composes through the same primitives agentmemory uses, and the agentmemory you already have is one of them.
|
|
1363
|
+
|
|
1364
|
+
### Engine config and bind address
|
|
1365
|
+
|
|
1366
|
+
`agentmemory start` reads the engine config from the first file that exists: `AGENTMEMORY_III_CONFIG`, `./iii-config.yaml` in the current directory, `~/.agentmemory/iii-config.yaml`, then the bundled `iii-config.yaml`. On every start it renders that file (data paths, ports, state backend) into `~/.agentmemory/data/iii-config.runtime.yaml` and launches the engine with the rendered copy, so edit the source file, not the rendered one. The `host:` values of the source file are kept as written.
|
|
1367
|
+
|
|
1368
|
+
The bundled `iii-config.yaml` binds `127.0.0.1` on purpose, and that default also applies inside a container. A CLI started in a container listens on the container's loopback, so published ports reach nothing. To serve a containerized CLI through published ports, set `AGENTMEMORY_III_CONFIG` to a config that binds `0.0.0.0`. The packaged `iii-config.docker.yaml` is one: it binds `iii-http`, `iii-stream` and the engine port to `0.0.0.0` and stores state under `/data`, so mount a writable volume there. Keep `AGENTMEMORY_SECRET` set, and publish only the ports you need, on `127.0.0.1` or behind a proxy you trust.
|
|
1369
|
+
|
|
1370
|
+
This repo's `docker-compose.yml` does not go through the CLI's config lookup: it mounts `iii-config.docker.yaml` at `/app/config.yaml`, and the `iii-engine` container starts with `--config /app/config.yaml`. The one-click [deploy templates](deploy/) write their own `0.0.0.0` config in their entrypoints.
|
|
1371
|
+
|
|
1372
|
+
### Storage backend: file (default) vs redis
|
|
1373
|
+
|
|
1374
|
+
`iii-state` and `iii-stream` default to iii-engine's bundled file-based KV store: one JSON file per scope, held in the engine process's memory and rewritten to disk on a timer. That's the right default for a single-user local install; a shared daemon with several concurrent writers gets real per-key writes from Redis instead, at the cost of a network round trip per operation (every `state::*` call still serializes on one Redis connection, so this trades the file store's lock for a socket, not for parallelism).
|
|
1375
|
+
|
|
1376
|
+
Set `AGENTMEMORY_STATE_BACKEND=redis` (plus `AGENTMEMORY_REDIS_URL`) to switch both workers to iii-engine's built-in `redis` adapter, which stores each key as a Redis hash field (`HSET`) instead of rewriting a whole scope on every write:
|
|
1377
|
+
|
|
1378
|
+
```env
|
|
1379
|
+
# ~/.agentmemory/.env
|
|
1380
|
+
AGENTMEMORY_STATE_BACKEND=redis
|
|
1381
|
+
AGENTMEMORY_REDIS_URL=redis://localhost:6379
|
|
1382
|
+
```
|
|
1383
|
+
|
|
1384
|
+
`AGENTMEMORY_STATE_BACKEND` defaults to `file`; leaving it unset keeps today's behavior unchanged, and an unrecognized value (anything other than `file` or `redis`) is a startup error rather than a silent fallback. `/agentmemory/status` and the viewer's Health page (the State store row) report which backend is active and whether it answers, never the URL.
|
|
1385
|
+
|
|
1386
|
+
**Plain `redis://` only.** The pinned engine (0.22.1) builds its Redis client without TLS support, so a `rediss://` URL (most managed Redis offerings, such as Upstash, Redis Cloud, and ElastiCache with in-transit encryption, default to TLS-only) fails to connect. The connection is unencrypted, so the Redis password and every stored memory cross the wire in clear text: point at a local Redis or one on a private network you trust. For any other Redis, run an encrypted tunnel (stunnel, SSH, or a VPN) on the agentmemory host, so the plain `redis://` hop stays on that host and the tunnel's upstream connection is encrypted and authenticated. If a Redis password contains a single quote, percent-encode it (`%27`); the engine expands the URL into its YAML config before parsing it.
|
|
1387
|
+
|
|
1388
|
+
**One Redis server per `--instance`.** The engine's Redis key prefixes (`state:<scope>`, `stream:<name>:<group>`) are fixed, so two agentmemory instances (`--instance 1`, `--instance 2`, ...) pointed at the same database overwrite each other's data. A separate database index (`redis://localhost:6379/1`) keeps the stored data apart, but the engine relays live viewer events over one Redis pub/sub channel (`stream::events`), and Redis pub/sub ignores the database index, so each instance's viewer would still show the other's live events. Give each instance its own Redis server (or port) when you run more than one.
|
|
1389
|
+
|
|
1390
|
+
**What stays the same, and what differs.** Every agentmemory feature works on Redis: sessions, observations, memories (remember, supersede, evolve, forget), search and the index buckets, lessons, the graph, the audit log and its monthly scopes, export and import, governance deletes, consolidation status, the viewer snapshot and its live stream, and the health monitor. The engine stores each scope as one Redis hash (`HSET`/`HGET`/`HGETALL`) and fires the same state triggers as the file store. Three engine differences are handled inside agentmemory:
|
|
1391
|
+
|
|
1392
|
+
- Redis returns a scope's records in no fixed order. agentmemory sorts them oldest first (by the creation time in the record id, then its timestamp) so lists, paging and export chunks come back in the same order as on the file store.
|
|
1393
|
+
- The engine applies partial updates on Redis in a Lua script that turns empty arrays into empty objects. agentmemory applies those updates itself (read, change, write under a per-key lock) on Redis, so fields like `tags: []` stay arrays.
|
|
1394
|
+
- The legacy audit log check reads the old scope from Redis instead of looking for the file store's file on disk.
|
|
1395
|
+
|
|
1396
|
+
One difference needs you: **after Redis restarts, the engine stops relaying live events** to the viewer until agentmemory restarts. Data is still saved and read normally. The health monitor sends a test event through Redis every 30 seconds; when it does not come back, `/agentmemory/status` and the viewer's Health page show "Live updates are not reaching the viewer" with the fix: restart agentmemory. If Redis is down, the status report shows "The state store is not answering" and how to check it (`redis-cli -u "$AGENTMEMORY_REDIS_URL" ping`). Listing a very large scope reads the whole hash in one `HGETALL`, the same cost as the file store holding it in memory.
|
|
1397
|
+
|
|
1398
|
+
**Recommended Redis settings.** The default `save 3600 1 300 100 60 10000` snapshot policy can lose minutes of writes on a crash, worse than the file store's 5s flush window. Set `appendonly yes` for anything you'd mind losing. Set `maxmemory-policy noeviction`; `allkeys-lru` or similar silently drops memories once Redis hits its memory limit.
|
|
1399
|
+
|
|
1400
|
+
A native (non-Docker) start, and every one-click [deploy template](deploy/) (they overwrite the bundled `iii-config.yaml` and start natively), read `AGENTMEMORY_STATE_BACKEND`/`AGENTMEMORY_REDIS_URL` and render them into the launched `iii-config`. The URL itself is never written to that rendered file, only a `${AGENTMEMORY_REDIS_URL}` reference that the engine process expands from its own environment at boot. Only this repo's own Docker Compose path (`AGENTMEMORY_USE_DOCKER=1`, or resuming an engine already started that way) mounts `iii-config.docker.yaml` read-only and never renders; `agentmemory start` warns when it detects that combination. Switch that file by hand, following the same `name: redis` / `config: redis_url: ...` shape shown in the [iii-state](https://workers.iii.dev/workers/iii-state) and [iii-stream](https://workers.iii.dev/workers/iii-stream) worker docs, and point `redis_url` at a Redis reachable from the container. `docker-compose.yml` passes `AGENTMEMORY_REDIS_URL` into the engine container, so `redis_url: '${AGENTMEMORY_REDIS_URL}'` works there and keeps the URL out of the mounted file.
|
|
1401
|
+
|
|
1402
|
+
The rendered config keeps the URL out of `~/.agentmemory/data/iii-config.runtime.yaml`, but the engine's own configuration worker still persists the *expanded* value to `~/.agentmemory/config/iii-state.yaml` and `iii-stream.yaml` once it boots (iii-engine's `${VAR}` expansion happens before that worker stores its seed, and it stores the resolved value, not the reference). Treat that directory as holding a credential: `chmod 700 ~/.agentmemory` on any shared host, and prefer a Redis ACL user scoped to what agentmemory needs over the database's admin credentials.
|
|
1403
|
+
|
|
1404
|
+
**Migration is not automatic.** Switching `AGENTMEMORY_STATE_BACKEND` starts from an empty store on either side; nothing copies existing data from file to Redis or back. Export from the backend you're leaving and import into the one you're moving to. This runs identically under bash and zsh (including `bash -u`). An array like `AUTH=(${AGENTMEMORY_SECRET:+-H "Authorization: Bearer $AGENTMEMORY_SECRET"})` does not: zsh keeps the header as one malformed word where bash splits it into two, so both requests 401 whenever `AGENTMEMORY_SECRET` is set:
|
|
1405
|
+
|
|
1406
|
+
```bash
|
|
1407
|
+
# 0. Use the generated secret when none is exported:
|
|
1408
|
+
AGENTMEMORY_SECRET="${AGENTMEMORY_SECRET:-$(cat ~/.agentmemory/secret 2>/dev/null)}"
|
|
1409
|
+
|
|
1410
|
+
# 1. On the old backend, while agentmemory is still running on it:
|
|
1411
|
+
if [ -n "${AGENTMEMORY_SECRET:-}" ]; then
|
|
1412
|
+
curl -fsS -H "Authorization: Bearer $AGENTMEMORY_SECRET" http://localhost:3111/agentmemory/export > backup.json
|
|
1413
|
+
else
|
|
1414
|
+
curl -fsS http://localhost:3111/agentmemory/export > backup.json
|
|
1415
|
+
fi
|
|
1416
|
+
|
|
1417
|
+
# 2. Confirm backup.json is a usable export before switching backends:
|
|
1418
|
+
jq -e '.version and .exportedAt' backup.json > /dev/null || {
|
|
1419
|
+
echo "backup.json is not a valid export; do not switch backends" >&2
|
|
1420
|
+
exit 1
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
# 3. Switch AGENTMEMORY_STATE_BACKEND (and AGENTMEMORY_REDIS_URL if needed),
|
|
1424
|
+
# restart agentmemory against the new backend, then:
|
|
1425
|
+
if [ -n "${AGENTMEMORY_SECRET:-}" ]; then
|
|
1426
|
+
jq -n --slurpfile d backup.json '{exportData: $d[0], strategy: "merge"}' | \
|
|
1427
|
+
curl -fsS -H "Authorization: Bearer $AGENTMEMORY_SECRET" -X POST http://localhost:3111/agentmemory/import \
|
|
1428
|
+
-H 'Content-Type: application/json' -d @-
|
|
1429
|
+
else
|
|
1430
|
+
jq -n --slurpfile d backup.json '{exportData: $d[0], strategy: "merge"}' | \
|
|
1431
|
+
curl -fsS -X POST http://localhost:3111/agentmemory/import \
|
|
1432
|
+
-H 'Content-Type: application/json' -d @-
|
|
1433
|
+
fi
|
|
1434
|
+
```
|
|
1435
|
+
|
|
1436
|
+
`/agentmemory/export` also accepts `?maxSessions=` and `?offset=` for chunking a large corpus across several calls; `strategy` on import is `merge` (default-safe), `replace`, or `skip`.
|
|
1192
1437
|
|
|
1193
1438
|
### What iii replaces
|
|
1194
1439
|
|
|
@@ -1201,7 +1446,7 @@ Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there co
|
|
|
1201
1446
|
| Prometheus / Grafana | iii OTEL + health monitor |
|
|
1202
1447
|
| Custom plugin systems | `iii worker add <name>` |
|
|
1203
1448
|
|
|
1204
|
-
**
|
|
1449
|
+
**219 source files · ~52,000 LOC · 2,500+ tests · 311 functions · 60 KV scopes**, all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
|
|
1205
1450
|
|
|
1206
1451
|
---
|
|
1207
1452
|
|
|
@@ -1209,27 +1454,27 @@ Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there co
|
|
|
1209
1454
|
|
|
1210
1455
|
### LLM Providers
|
|
1211
1456
|
|
|
1212
|
-
agentmemory auto-detects from your environment.
|
|
1457
|
+
agentmemory auto-detects providers from your environment. A provider makes LLM-backed operations available, but provider configuration alone does not enable LLM-written observation compression. That path requires both a provider and `AGENTMEMORY_AUTO_COMPRESS=true`.
|
|
1213
1458
|
|
|
1214
1459
|
| Provider | Config | Notes |
|
|
1215
1460
|
|----------|--------|-------|
|
|
1216
|
-
| **No-op (default)** | No config needed | LLM-backed compress/summarize is
|
|
1461
|
+
| **No-op (default)** | No config needed | LLM-backed compress/summarize is disabled. Synthetic compression and BM25 recall still work. See `AGENTMEMORY_ALLOW_AGENT_SDK` below if you used to rely on the Claude-subscription fallback. |
|
|
1217
1462
|
| Anthropic API | `ANTHROPIC_API_KEY` | Per-token billing |
|
|
1218
1463
|
| MiniMax | `MINIMAX_API_KEY` | Anthropic-compatible |
|
|
1219
1464
|
| Gemini | `GEMINI_API_KEY` | Also enables embeddings |
|
|
1220
1465
|
| OpenRouter | `OPENROUTER_API_KEY` | Any model |
|
|
1221
|
-
| OpenAI API | `OPENAI_API_KEY` | Default `gpt-
|
|
1222
|
-
| **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
|
|
1223
|
-
| Claude subscription fallback | `AGENTMEMORY_ALLOW_AGENT_SDK=true` | Opt-in only. Spawns `@anthropic-ai/claude-agent-sdk` sessions
|
|
1466
|
+
| OpenAI API | `OPENAI_API_KEY` | Default `gpt-5.6-luna`, override with `OPENAI_MODEL` |
|
|
1467
|
+
| **Local (Ollama / LM Studio / vLLM / llama.cpp)** | `OPENAI_API_KEY=local` + `OPENAI_BASE_URL=http://localhost:11434/v1` (Ollama) or `http://localhost:1234/v1` (LM Studio) + `OPENAI_MODEL=<your model>` | Anything OpenAI-API-compatible. Zero cost, runs on your hardware. See [Local models](#local-models-ollama--lm-studio--vllm) below. |
|
|
1468
|
+
| Claude subscription fallback | `AGENTMEMORY_ALLOW_AGENT_SDK=true` | Opt-in only. Spawns `@anthropic-ai/claude-agent-sdk` sessions; it used to cause unbounded Stop-hook recursion, so it is no longer the default. |
|
|
1224
1469
|
|
|
1225
1470
|
### Local models (Ollama / LM Studio / vLLM)
|
|
1226
1471
|
|
|
1227
|
-
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
|
|
1472
|
+
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.
|
|
1228
1473
|
|
|
1229
1474
|
**Ollama** (default port `11434`):
|
|
1230
1475
|
|
|
1231
1476
|
```bash
|
|
1232
|
-
ollama pull
|
|
1477
|
+
ollama pull qwen3:8b # or qwen3:4b, gpt-oss:20b, qwen3-coder:30b, etc.
|
|
1233
1478
|
ollama serve
|
|
1234
1479
|
```
|
|
1235
1480
|
|
|
@@ -1237,53 +1482,58 @@ ollama serve
|
|
|
1237
1482
|
# ~/.agentmemory/.env
|
|
1238
1483
|
OPENAI_API_KEY=ollama # any non-empty string; Ollama ignores it
|
|
1239
1484
|
OPENAI_BASE_URL=http://localhost:11434/v1
|
|
1240
|
-
OPENAI_MODEL=
|
|
1485
|
+
OPENAI_MODEL=qwen3:8b
|
|
1241
1486
|
```
|
|
1242
1487
|
|
|
1243
1488
|
**LM Studio** (default port `1234`):
|
|
1244
1489
|
|
|
1245
|
-
Open LM Studio → Local Server tab → Start Server. Pick any chat model from the picker (Qwen
|
|
1490
|
+
Open LM Studio → Local Server tab → Start Server. Pick any chat model from the picker (Qwen 3, gpt-oss, DeepSeek R1, etc.).
|
|
1246
1491
|
|
|
1247
1492
|
```env
|
|
1248
1493
|
# ~/.agentmemory/.env
|
|
1249
1494
|
OPENAI_API_KEY=lmstudio # any non-empty string; LM Studio ignores it
|
|
1250
1495
|
OPENAI_BASE_URL=http://localhost:1234/v1
|
|
1251
|
-
OPENAI_MODEL=
|
|
1496
|
+
OPENAI_MODEL=qwen3-8b # match the model name from LM Studio
|
|
1252
1497
|
```
|
|
1253
1498
|
|
|
1254
|
-
**vLLM / llama.cpp / Text Generation Inference**: same shape
|
|
1499
|
+
**vLLM / llama.cpp / Text Generation Inference**: same shape. Point `OPENAI_BASE_URL` at whatever URL your server exposes and set `OPENAI_MODEL` to a name your server will accept.
|
|
1255
1500
|
|
|
1256
1501
|
**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:
|
|
1257
1502
|
|
|
1258
1503
|
| Model | Size | Why |
|
|
1259
1504
|
|-------|------|-----|
|
|
1260
|
-
| `
|
|
1261
|
-
| `
|
|
1262
|
-
| `
|
|
1263
|
-
| `
|
|
1505
|
+
| `qwen3:8b` | ~5.2 GB | Balanced default on a 16 GB machine; strong at extraction and tool-shaped text |
|
|
1506
|
+
| `qwen3:4b` | ~2.6 GB | Smallest sane option; fine for compression, weaker for graph extraction |
|
|
1507
|
+
| `qwen3-coder:30b` | ~19 GB | Best local pick for code-shaped sessions (30B MoE, 3.3B active) on 24-32 GB hardware |
|
|
1508
|
+
| `gpt-oss:20b` | ~14 GB | Strong general model that fits 16 GB RAM |
|
|
1509
|
+
| `deepseek-r1:8b` | ~5.2 GB | Reasoning distill; slower but cleaner extractions |
|
|
1510
|
+
|
|
1511
|
+
Qwen 3 models think by default and can burn the whole token budget on reasoning before any output. Set `AGENTMEMORY_LLM_NOTHINK=1` to append `/no_think` to graph-extraction prompts, and raise `MAX_TOKENS` (16384 works) if extractions come back empty.
|
|
1264
1512
|
|
|
1265
1513
|
Reasoning-class models (`o1`-style with `<think>` blocks) can return empty `content` with a `reasoning` field your local server may not surface. If extractions come back blank, switch to a non-reasoning model first. The `OPENAI_REASONING_EFFORT=none` env can also disable thinking on Ollama Cloud thinking models that mirror the OpenAI reasoning schema.
|
|
1266
1514
|
|
|
1267
|
-
Local embeddings ship
|
|
1515
|
+
Local embeddings ship as an optional dependency but are not enabled by default. Set `EMBEDDING_PROVIDER=local` to opt into `Xenova/all-MiniLM-L6-v2` (384-dim). The first embedding request downloads the model; inference is on-device afterward. Without that setting or a remote embedding key, vectors stay disabled, `mem::search` uses BM25, and `smart-search` can still add existing graph matches.
|
|
1268
1516
|
|
|
1269
1517
|
### Cost-aware model selection
|
|
1270
1518
|
|
|
1271
|
-
|
|
1519
|
+
When LLM-written background compression is enabled with both a provider and `AGENTMEMORY_AUTO_COMPRESS=true`, it runs on every observation, so model choice meaningfully changes monthly spend. Captured workload data: 635 requests / 888K tokens / 35 hours of active use, run against three OpenRouter models at 2026-05-23 pricing.
|
|
1272
1520
|
|
|
1273
1521
|
| Tier | Model | Input / 1M | Output / 1M | Cost for the captured 35h | Notes |
|
|
1274
1522
|
|------|-------|------------|-------------|---------------------------|-------|
|
|
1523
|
+
| Recommended | `deepseek/deepseek-v4-flash-0731` | $0.07 | $0.14 | ~$0.07 (est.) | Latest DeepSeek; cheapest recommended pick for compression workloads. |
|
|
1275
1524
|
| Recommended | `deepseek/deepseek-v4-pro` | $0.435 | $0.87 | ~$0.46 | Solid compression + summarization quality at ~10× lower cost than Sonnet. |
|
|
1276
|
-
| Recommended | `deepseek/deepseek-chat` | $0.27 | $1.10 | ~$0.40 | Older but still fine for compression-only workloads. |
|
|
1277
1525
|
| Recommended | `qwen/qwen3-coder` | $0.45 | $1.80 | ~$0.55 | Strong code reasoning if your sessions are heavily code-shaped. |
|
|
1278
|
-
| Premium | `anthropic/claude-sonnet-
|
|
1279
|
-
| Premium | `openai/gpt-
|
|
1280
|
-
| Avoid | `anthropic/claude-opus-
|
|
1526
|
+
| Premium | `anthropic/claude-sonnet-5` | $3.00 | $15.00 | ~$5.02 (est.) | Same list price as the measured Sonnet 4.6 run; $2/$10 intro pricing through 2026-08-31. |
|
|
1527
|
+
| Premium | `openai/gpt-5.6-sol` | $5.00 | $30.00 | ~$9 (est.) | Flagship tier; expensive for always-on background work. |
|
|
1528
|
+
| Avoid | `anthropic/claude-opus-5` | $5.00 | $25.00 | ~$8.40 (est.) | Flagship-class model; overspend for compression. |
|
|
1529
|
+
|
|
1530
|
+
Measured rows come from the captured run; (est.) rows scale the same token mix by each model's list price.
|
|
1281
1531
|
|
|
1282
1532
|
agentmemory prints a runtime warning when `OPENROUTER_MODEL` matches a premium-tier pattern. Set `AGENTMEMORY_SUPPRESS_COST_WARNING=1` to silence once you've made an informed choice.
|
|
1283
1533
|
|
|
1284
|
-
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
|
|
1534
|
+
Quality vs cost tradeoff for memory work: compression is a summarization task with relatively loose quality bars (the agent re-reads the summary, not the user). DeepSeek V4 Flash / V4 Pro / Qwen3-Coder land within rounding error of Sonnet on this task while costing 10-70× less. Save the premium-tier models for queries you read directly.
|
|
1285
1535
|
|
|
1286
|
-
Sources: [OpenRouter pricing for Sonnet
|
|
1536
|
+
Sources: [OpenRouter pricing for Claude Sonnet 5](https://openrouter.ai/anthropic/claude-sonnet-5), [DeepSeek V4 Flash](https://openrouter.ai/deepseek/deepseek-v4-flash-0731), [DeepSeek pricing notes](https://api-docs.deepseek.com/quick_start/pricing/).
|
|
1287
1537
|
|
|
1288
1538
|
### Multi-agent memory (`AGENT_ID` + `AGENTMEMORY_AGENT_SCOPE`)
|
|
1289
1539
|
|
|
@@ -1307,7 +1557,7 @@ What gets tagged when `AGENT_ID` is set: `Session.agentId`, `RawObservation.agen
|
|
|
1307
1557
|
|
|
1308
1558
|
What gets filtered in isolated mode: `mem::smart-search`, `/agentmemory/memories`, `/agentmemory/observations`, `/agentmemory/sessions`. Each endpoint accepts `?agentId=<role>` to override per-request, and `?agentId=*` to opt out of the env scope entirely. `/memories` also accepts `?includeOrphans=true` to surface pre-AGENT_ID memories whose `agentId` is undefined.
|
|
1309
1559
|
|
|
1310
|
-
Per-call override at the SDK / REST layer: every mutating endpoint (`/session/start`, `/remember`) accepts an `agentId` field in the request body that wins over the env. Useful for runtimes routing many roles through one server process.
|
|
1560
|
+
Per-call override at the SDK / REST layer: every mutating endpoint (`/session/start`, `/remember`) accepts an `agentId` field in the request body that wins over the env. Useful for runtimes routing many roles through one server process. The MCP `memory_save` tool exposes the same `agentId` field, the standalone stdio server forwards both `agentId` and `project`, and saved memories carry `agentId` into the search index, so agent-scoped search covers memories as well as observations.
|
|
1311
1561
|
|
|
1312
1562
|
When `AGENT_ID` is unset, memory remains unscoped (legacy behavior, no tags, no filters).
|
|
1313
1563
|
|
|
@@ -1318,9 +1568,13 @@ agentmemory + iii-engine bind four ports by default. If a restart fails with `po
|
|
|
1318
1568
|
| Port | Process | Purpose | Env override |
|
|
1319
1569
|
|------|---------|---------|--------------|
|
|
1320
1570
|
| `3111` | agentmemory | REST API + MCP HTTP + `/agentmemory/health` + `/agentmemory/livez` | `III_REST_PORT` |
|
|
1321
|
-
| `3112` | iii-engine | Internal streams worker (consumed by agentmemory + viewer) | `III_STREAMS_PORT` |
|
|
1322
|
-
| `3113` | agentmemory | Real-time viewer (`http://localhost:3113`) | `
|
|
1323
|
-
| `49134` | iii-engine | WebSocket
|
|
1571
|
+
| `3112` | iii-engine | Internal streams worker (consumed by agentmemory + viewer) | `III_STREAM_PORT` (preferred) or legacy `III_STREAMS_PORT` |
|
|
1572
|
+
| `3113` | agentmemory | Real-time viewer (`http://localhost:3113`) | `III_VIEWER_PORT` or `AGENTMEMORY_VIEWER_URL` for the reported URL |
|
|
1573
|
+
| `49134` | iii-engine | WebSocket; workers register here, OTel telemetry flows over it | `III_ENGINE_PORT` or `III_ENGINE_URL` |
|
|
1574
|
+
|
|
1575
|
+
`--port <N>` changes the REST anchor and derives streams `N+1`, viewer `N+2`, and engine WebSocket `N+46023` only where the corresponding explicit port or URL above is unset. It does not create an isolated lifecycle namespace. Use `--instance 1` for a second daemon; it uses anchor 3211, defaults to `3211/3212/3213/49234`, and receives a separate `instance-1` data and lifecycle directory. Instances 1 through 50 follow the same pattern.
|
|
1576
|
+
|
|
1577
|
+
The pinned engine starts with `--no-update-check` (no update or security-advisory lookups against GitHub at boot) and with iii's anonymous usage telemetry off: agentmemory sets `III_TELEMETRY_ENABLED=false` for the engine it spawns unless you export the variable yourself, and the bundled compose file does the same.
|
|
1324
1578
|
|
|
1325
1579
|
Stale-process cleanup when ports stay bound after a crashed run:
|
|
1326
1580
|
|
|
@@ -1335,7 +1589,7 @@ netstat -ano | findstr ":3111 :3112 :3113 :49134"
|
|
|
1335
1589
|
taskkill /F /PID <pid>
|
|
1336
1590
|
```
|
|
1337
1591
|
|
|
1338
|
-
`agentmemory stop` reaps both the worker and the engine pidfile cleanly on graceful shutdown. The manual cleanup above is only for the post-crash case where neither pidfile is left behind.
|
|
1592
|
+
`agentmemory stop` reaps both the worker and the engine pidfile cleanly on graceful native shutdown. In Docker mode it flushes the native worker, stops the exact validated engine container, and preserves both the container and its `/data` mount for a lossless restart; the next start validates and resumes that same container. Docker-backed uninstall requires `agentmemory remove --keep-data`: it removes shared agentmemory-managed files while preserving the validated container, its data mount, and the lifecycle record needed to recover them. Destructive Docker data deletion is intentionally left to the operator after a backup. The CLI also refuses to adopt or signal Docker or VM port holders (Docker backend, vpnkit, colima) as the native engine unless `--force` is passed. The manual cleanup above is only for the post-crash case where neither pidfile is left behind.
|
|
1339
1593
|
|
|
1340
1594
|
### Config File
|
|
1341
1595
|
|
|
@@ -1357,6 +1611,8 @@ AGENTMEMORY_ALLOW_AGENT_SDK=true
|
|
|
1357
1611
|
AGENTMEMORY_AUTO_COMPRESS=true
|
|
1358
1612
|
```
|
|
1359
1613
|
|
|
1614
|
+
LLM-written observation compression requires both lines: access to an LLM provider (including this explicit subscription fallback) and `AGENTMEMORY_AUTO_COMPRESS=true`. A provider by itself leaves the default synthetic compression path in place.
|
|
1615
|
+
|
|
1360
1616
|
Consolidation (graph nodes, lessons, crystals) is on by default whenever an LLM provider is configured. Explicitly opt out with `CONSOLIDATION_ENABLED=false` if you want LLM-free operation. Graph extraction is a separate flag:
|
|
1361
1617
|
|
|
1362
1618
|
```env
|
|
@@ -1385,7 +1641,7 @@ Create `~/.agentmemory/.env`:
|
|
|
1385
1641
|
# # Auto-detected from `.openai.azure.com` hostname; uses
|
|
1386
1642
|
# # api-key header + api-version query param.
|
|
1387
1643
|
# OPENAI_API_VERSION=2024-08-01-preview # Optional: Azure api-version query param
|
|
1388
|
-
# OPENAI_MODEL=gpt-
|
|
1644
|
+
# OPENAI_MODEL=gpt-5.6-luna # Optional: default model
|
|
1389
1645
|
# OPENAI_TIMEOUT_MS=60000 # Optional: OpenAI-scoped alias for the outbound fetch
|
|
1390
1646
|
# # timeout. Takes precedence over AGENTMEMORY_LLM_TIMEOUT_MS
|
|
1391
1647
|
# # for back-compat with v0.9.17. New configs should
|
|
@@ -1403,13 +1659,15 @@ Create `~/.agentmemory/.env`:
|
|
|
1403
1659
|
# leave OFF unless you understand the Stop-hook recursion risk:
|
|
1404
1660
|
# AGENTMEMORY_ALLOW_AGENT_SDK=true
|
|
1405
1661
|
|
|
1406
|
-
# Embedding provider (
|
|
1662
|
+
# Embedding provider (BM25-only when unset; local is an explicit opt-in)
|
|
1407
1663
|
# EMBEDDING_PROVIDER=local
|
|
1408
1664
|
# VOYAGE_API_KEY=...
|
|
1409
1665
|
# OPENAI_API_KEY=sk-...
|
|
1410
1666
|
# OPENAI_BASE_URL=https://api.openai.com # Override for Azure / vLLM / LM Studio / proxies
|
|
1411
1667
|
# OPENAI_EMBEDDING_MODEL=text-embedding-3-small
|
|
1412
1668
|
# OPENAI_EMBEDDING_DIMENSIONS=1536 # Required when the model is not in the known-models table
|
|
1669
|
+
# OPENAI_EMBEDDING_BASE_URL=https://... # Embeddings only; falls back to OPENAI_BASE_URL
|
|
1670
|
+
# OPENAI_EMBEDDING_API_KEY=sk-... # Embeddings only; wins over OPENAI_API_KEY when set
|
|
1413
1671
|
|
|
1414
1672
|
# Outbound LLM / embedding timeout
|
|
1415
1673
|
# AGENTMEMORY_LLM_TIMEOUT_MS=60000 # Default: 60 000 ms (60 s). Applies to every
|
|
@@ -1427,14 +1685,20 @@ Create `~/.agentmemory/.env`:
|
|
|
1427
1685
|
# VECTOR_WEIGHT=0.6
|
|
1428
1686
|
# TOKEN_BUDGET=2000
|
|
1429
1687
|
|
|
1430
|
-
# Auth
|
|
1688
|
+
# Auth (generated into ~/.agentmemory/secret on first start when unset)
|
|
1431
1689
|
# AGENTMEMORY_SECRET=your-secret
|
|
1690
|
+
# VIEWER_ALLOWED_ORIGINS=https://memory.example.com
|
|
1691
|
+
# AGENTMEMORY_IMPORT_ROOT=~/projects
|
|
1432
1692
|
|
|
1433
1693
|
# Ports (defaults: 3111 API, 3113 viewer)
|
|
1434
1694
|
# III_REST_PORT=3111
|
|
1435
1695
|
|
|
1696
|
+
# Engine usage telemetry (iii). Off unless you set it; true opts in.
|
|
1697
|
+
# III_TELEMETRY_ENABLED=false
|
|
1698
|
+
|
|
1436
1699
|
# Features
|
|
1437
|
-
# AGENTMEMORY_AUTO_COMPRESS=false # OFF by default.
|
|
1700
|
+
# AGENTMEMORY_AUTO_COMPRESS=false # OFF by default. Requires an LLM
|
|
1701
|
+
# provider as well. When both are on,
|
|
1438
1702
|
# every PostToolUse hook calls your
|
|
1439
1703
|
# LLM provider to compress the
|
|
1440
1704
|
# observation — expect significant
|
|
@@ -1471,6 +1735,10 @@ Create `~/.agentmemory/.env`:
|
|
|
1471
1735
|
# Observations are still captured via
|
|
1472
1736
|
# PostToolUse regardless of this flag.
|
|
1473
1737
|
# GRAPH_EXTRACTION_ENABLED=false
|
|
1738
|
+
# AGENTMEMORY_LLM_NOTHINK=1 # Local reasoning models only: ask the
|
|
1739
|
+
# model to skip its hidden thinking pass
|
|
1740
|
+
# during graph extraction. Faster runs;
|
|
1741
|
+
# relation quality can drop slightly.
|
|
1474
1742
|
# CONSOLIDATION_ENABLED=false # on by default when an LLM provider is configured
|
|
1475
1743
|
# LESSON_DECAY_ENABLED=true
|
|
1476
1744
|
# OBSIDIAN_AUTO_EXPORT=false
|
|
@@ -1478,12 +1746,42 @@ Create `~/.agentmemory/.env`:
|
|
|
1478
1746
|
# CLAUDE_MEMORY_BRIDGE=false
|
|
1479
1747
|
# SNAPSHOT_ENABLED=false
|
|
1480
1748
|
|
|
1749
|
+
# Storage and durability
|
|
1750
|
+
# AGENTMEMORY_STATE_BACKEND=file # file (default) or redis; see "Storage backend" below
|
|
1751
|
+
# AGENTMEMORY_REDIS_URL=redis://localhost:6379 # Required with redis, plain redis:// only
|
|
1752
|
+
# AGENTMEMORY_STATE_SAVE_INTERVAL_MS=2000 # How often the engine writes file state to disk.
|
|
1753
|
+
# A hard kill loses at most this window.
|
|
1754
|
+
# AGENTMEMORY_INDEX_SAVE_INTERVAL_MS=600000 # Minimum time between search index saves;
|
|
1755
|
+
# shutdown and deletes still save at once.
|
|
1756
|
+
# AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=true # One-time background trim of oversized graph
|
|
1757
|
+
# provenance; false skips it
|
|
1758
|
+
|
|
1759
|
+
# Sessions
|
|
1760
|
+
# AGENTMEMORY_SESSION_SWEEP_ENABLED=true # Hourly sweep marks sessions left active past
|
|
1761
|
+
# the threshold as abandoned. Deletes nothing;
|
|
1762
|
+
# new activity makes the session active again.
|
|
1763
|
+
# AGENTMEMORY_SESSION_SWEEP_STALE_HOURS=24
|
|
1764
|
+
|
|
1765
|
+
# Capture filters (hooks)
|
|
1766
|
+
# AGENTMEMORY_CAPTURE_ALLOW= # Comma or space list of tool names or globs;
|
|
1767
|
+
# when set, only these tools are captured
|
|
1768
|
+
# AGENTMEMORY_CAPTURE_DENY= # Extra names or globs to skip, added to the
|
|
1769
|
+
# defaults: memory_*, toolsearch,
|
|
1770
|
+
# listmcpresources, fetchmcpresource
|
|
1771
|
+
# AGENTMEMORY_CAPTURE_OUTPUT_MAX=8000 # Max characters of tool output per observation
|
|
1772
|
+
# AGENTMEMORY_PRE_COMPACT_BUDGET=1500 # Token budget for PreCompact context; 0 disables
|
|
1773
|
+
|
|
1774
|
+
# Audit log
|
|
1775
|
+
# AGENTMEMORY_AUDIT_RETENTION_MONTHS=0 # Drop month scopes older than N months; 0 keeps all
|
|
1776
|
+
# AGENTMEMORY_AUDIT_INDEX_PERSIST=false # 1 or true records index migration and cleanup
|
|
1777
|
+
# rows (debugging only)
|
|
1778
|
+
|
|
1481
1779
|
# Team
|
|
1482
1780
|
# TEAM_ID=
|
|
1483
1781
|
# USER_ID=
|
|
1484
1782
|
# TEAM_MODE=private
|
|
1485
1783
|
|
|
1486
|
-
# Tool visibility: "
|
|
1784
|
+
# Tool visibility: "all" (54 tools, default) or "core" (8 tools, lean)
|
|
1487
1785
|
# AGENTMEMORY_TOOLS=core
|
|
1488
1786
|
```
|
|
1489
1787
|
|
|
@@ -1491,7 +1789,19 @@ Create `~/.agentmemory/.env`:
|
|
|
1491
1789
|
|
|
1492
1790
|
<h2 id="api"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-api.svg"><img src="assets/tags/section-api.svg" alt="API" height="32" /></picture></h2>
|
|
1493
1791
|
|
|
1494
|
-
|
|
1792
|
+
138 endpoints on port `3111`. The REST API binds to `127.0.0.1` by default. Protected endpoints require `Authorization: Bearer <secret>`, and mesh sync endpoints require an explicitly set `AGENTMEMORY_SECRET` on both peers.
|
|
1793
|
+
|
|
1794
|
+
**Authentication is on by default.** When `AGENTMEMORY_SECRET` is not set (in the shell or in `~/.agentmemory/.env`), the server generates a random secret on first start and stores it in `~/.agentmemory/secret` with mode `0600`. Every bundled client reads it from there when it talks to a local server: the CLI, the viewer, the hooks under `plugin/scripts`, the MCP server and the `@agentmemory/mcp` shim, the configs written by `agentmemory connect`, and the bundled OpenCode, Pi, OpenClaw, Hermes and filesystem-watcher integrations. The stored secret is only sent to loopback URLs (`localhost`, `127.0.0.0/8`, `::1`). An explicit `AGENTMEMORY_SECRET` always wins, and remote clients still need it set. Docker and the `deploy/` entrypoints already generate and export their own secret. To call the API by hand:
|
|
1795
|
+
|
|
1796
|
+
```bash
|
|
1797
|
+
curl -H "Authorization: Bearer $(cat ~/.agentmemory/secret)" http://localhost:3111/agentmemory/health
|
|
1798
|
+
```
|
|
1799
|
+
|
|
1800
|
+
**Request rules for writes.** `POST`, `PUT`, `PATCH` and `DELETE` requests to the REST API and the viewer must send `Content-Type: application/json` (a `charset` parameter is fine) whenever they carry a body, and an `Origin` header, when present, must be a loopback origin for the configured REST or viewer port or be listed in `VIEWER_ALLOWED_ORIGINS` (comma-separated, e.g. `https://memory.example.com`). Clients that send no `Origin` header (CLI, hooks, MCP, curl, server-to-server) are unaffected. The viewer also accepts its own origin.
|
|
1801
|
+
|
|
1802
|
+
**File paths.** Endpoints that read or write files (`/compress-file`, `/replay/import-jsonl`, `/graph/import-graphify`) only accept paths under `~/.agentmemory`, the instance data directory, or a directory listed in `AGENTMEMORY_IMPORT_ROOT` (separate several with `:`, or `;` on Windows). `/replay/import-jsonl` also accepts its default `~/.claude/projects`. `/obsidian/export` stays inside `AGENTMEMORY_EXPORT_ROOT` and `/migrate` inside `~/.agentmemory`. Symlinks are resolved before every check.
|
|
1803
|
+
|
|
1804
|
+
**Secret scrubbing.** API keys, bearer tokens, PEM private key blocks and credentials embedded in URLs (`scheme://user:password@host`) are redacted before text is stored, on every write path: observations, remember, evolve, slots, lessons, actions, sketches, signals, checkpoints, imports, jsonl replay, mesh sync, team shares, compression and summary output, crystals and graph nodes.
|
|
1495
1805
|
|
|
1496
1806
|
<details>
|
|
1497
1807
|
<summary>Key endpoints</summary>
|
|
@@ -1499,9 +1809,14 @@ Create `~/.agentmemory/.env`:
|
|
|
1499
1809
|
| Method | Path | Description |
|
|
1500
1810
|
|--------|------|-------------|
|
|
1501
1811
|
| `GET` | `/agentmemory/health` | Health check (always public) |
|
|
1812
|
+
| `GET` | `/agentmemory/status` | What is wrong and how to fix it (HTML for browsers, JSON otherwise) |
|
|
1813
|
+
| `GET` | `/agentmemory/viewer/snapshot` | Everything the viewer shows, in one response |
|
|
1502
1814
|
| `POST` | `/agentmemory/session/start` | Start session + get context |
|
|
1503
1815
|
| `POST` | `/agentmemory/session/end` | End session |
|
|
1504
|
-
| `POST` | `/agentmemory/observe` | Capture observation |
|
|
1816
|
+
| `POST` | `/agentmemory/observe` | Capture observation (see capture delivery below) |
|
|
1817
|
+
| `GET` | `/agentmemory/capture` | Capture inbox, dead letters and offline spool |
|
|
1818
|
+
| `POST` | `/agentmemory/capture/retry` | Retry dead-letter captures |
|
|
1819
|
+
| `POST` | `/agentmemory/capture/drain` | Send the local offline spool now |
|
|
1505
1820
|
| `POST` | `/agentmemory/smart-search` | Hybrid search |
|
|
1506
1821
|
| `POST` | `/agentmemory/context` | Generate context |
|
|
1507
1822
|
| `POST` | `/agentmemory/remember` | Save to long-term memory |
|
|
@@ -1511,6 +1826,7 @@ Create `~/.agentmemory/.env`:
|
|
|
1511
1826
|
| `GET` | `/agentmemory/export` | Export all data |
|
|
1512
1827
|
| `POST` | `/agentmemory/import` | Import from JSON |
|
|
1513
1828
|
| `POST` | `/agentmemory/graph/query` | Knowledge graph query |
|
|
1829
|
+
| `POST` | `/agentmemory/graph/compact` | Trim oversized graph provenance |
|
|
1514
1830
|
| `POST` | `/agentmemory/team/share` | Share with team |
|
|
1515
1831
|
| `GET` | `/agentmemory/audit` | Audit trail |
|
|
1516
1832
|
|
|
@@ -1518,6 +1834,35 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
|
|
|
1518
1834
|
|
|
1519
1835
|
</details>
|
|
1520
1836
|
|
|
1837
|
+
**Capture delivery.** Hooks send each observation once to `POST /agentmemory/observe` with an `eventId`. It is the host's own id for the call when the payload has one (for example Claude Code's `tool_use_id`), otherwise a hash of the session, hook type, tool name, input, output and host timestamp. The server writes the event to a capture inbox in the state store, stores the observation, then removes the inbox entry. The status code says what happened:
|
|
1838
|
+
|
|
1839
|
+
| Status | `status` field | Meaning |
|
|
1840
|
+
|---|---|---|
|
|
1841
|
+
| `201` | `accepted` | Stored. `observationId` is the new observation. |
|
|
1842
|
+
| `202` | `accepted` (`state: "retrying"`) | Accepted, but storing failed. The server retries it, also after a restart. |
|
|
1843
|
+
| `200` | `duplicate` | This `eventId` was already accepted. `observationId` is the existing observation; nothing new is stored. |
|
|
1844
|
+
| `400` / `422` | `rejected` | Invalid payload, or storing failed for good (the event is kept as a dead letter). |
|
|
1845
|
+
| `503` | `rejected` (`retryable: true`) | The inbox is full (`AGENTMEMORY_CAPTURE_INBOX_MAX`). Hooks spool the event and send it later. |
|
|
1846
|
+
|
|
1847
|
+
Failed events are retried every `AGENTMEMORY_CAPTURE_RETRY_INTERVAL_MS` (10 s) with doubling backoff, up to `AGENTMEMORY_CAPTURE_MAX_ATTEMPTS` (5). Events that still fail stay in the inbox as dead letters, are listed on `/agentmemory/status` and the viewer Health page, and can be retried with `POST /agentmemory/capture/retry` (`{"eventId": "..."}` or `{"all": true}`). Accepted event ids are remembered for `AGENTMEMORY_CAPTURE_DEDUP_HOURS` (168 hours, at most `AGENTMEMORY_CAPTURE_EVENTS_MAX` ids), so a hook replayed after a timeout or a restart is stored once, while two separate tool calls with their own host ids are stored twice even when their content is identical. When an observation is deleted (forget, session delete, eviction, auto-forget or an import that replaces the store), its event is marked as deleted before the observation is removed, so a replay of that event inside the same window is answered as a duplicate and stores nothing. The state store writes to disk every 2 seconds, so an answered event can still be only in memory for a moment. To cover that, every `2xx` answer also carries the server's `bootId` (new at every start), `acceptedAt` and `durableAfterMs` (the save interval plus 1.5 s on the file store, 1.5 s on redis, where persistence is the operator's setting). Hooks keep the event in the local spool until that window has passed and delete it on a later call without another request. If the `bootId` has changed by then, the server restarted, so the hook sends the event again with the same `eventId`; an event that did reach the disk is not stored twice. The server also sends such events itself at start and every retry interval, so a restart loses nothing even when no hook runs afterwards. Older hooks ignore the extra fields, and new hooks against an older server discard the event on `2xx` as before.
|
|
1848
|
+
|
|
1849
|
+
When the server is down, does not answer in time or returns a 5xx, the hook appends the observation to a local spool file, `<data dir>/capture-spool/<host>-<port>.jsonl` (override the folder with `AGENTMEMORY_CAPTURE_SPOOL_DIR`). The file is private to your user (mode 600), secrets are redacted the same way the server redacts them, it holds at most `AGENTMEMORY_CAPTURE_SPOOL_MAX_BYTES` (5 MiB) and drops entries older than `AGENTMEMORY_CAPTURE_SPOOL_MAX_AGE_HOURS` (168). When it is full, new entries are dropped and counted, and `/agentmemory/status` reports it. The hook still exits 0 within its time limit and adds no request when the server is healthy. The spool is sent at the next start and by the first hook that reaches the server again, in a background process so the agent does not wait. Event ids make this safe: an observation that did arrive before a timeout is not stored twice. `npx @agentmemory/agentmemory capture` shows the spool and the server inbox, `--drain` sends the spool now, and `GET /agentmemory/capture` returns the same as JSON. Set `AGENTMEMORY_CAPTURE_SPOOL=false` to turn the spool off.
|
|
1850
|
+
|
|
1851
|
+
**Compacting graph provenance.** Each knowledge graph node and edge keeps the ids of the newest 32 observations it came from. Stores written before that cap can hold thousands of ids per hot node, which makes graph search and the viewer slow or drops the worker. agentmemory fixes this by itself: on the first start after upgrading it trims every node, edge, superseded edge (the temporal graph history) and the cached snapshot to the cap in the background, in small slices with a pause between them, so search, capture and the viewer keep working. It saves its progress, resumes after a restart and never runs again once it has finished. `/agentmemory/status` and the viewer Health page show it as pending, running (with the current scope and position), done or failed. Set `AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=false` to turn it off.
|
|
1852
|
+
|
|
1853
|
+
To run it by hand, call `POST /agentmemory/graph/compact`. It walks the name and edge-key indexes instead of listing every node and edge, and is safe to re-run. When it trims ids it writes a `graph_compact` audit entry.
|
|
1854
|
+
|
|
1855
|
+
```bash
|
|
1856
|
+
curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: application/json" -d '{}'
|
|
1857
|
+
```
|
|
1858
|
+
|
|
1859
|
+
On a large store, or when the call returns 504, run it in slices. Send `scope` (`nodes`, `edges` or `history`), `offset` and `limit`, then call again with the returned `nextOffset` until it is `null`. Do this for `nodes`, `edges` and `history`, and finish with one `{"scope":"snapshot"}` call, because a sliced run does not touch the cached snapshot.
|
|
1860
|
+
|
|
1861
|
+
```bash
|
|
1862
|
+
curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: application/json" -d '{"scope":"nodes","offset":0,"limit":200}'
|
|
1863
|
+
curl -X POST http://localhost:3111/agentmemory/graph/compact -H "Content-Type: application/json" -d '{"scope":"snapshot"}'
|
|
1864
|
+
```
|
|
1865
|
+
|
|
1521
1866
|
---
|
|
1522
1867
|
|
|
1523
1868
|
<h2 id="development"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-development.svg"><img src="assets/tags/section-development.svg" alt="Development" height="32" /></picture></h2>
|
|
@@ -1525,11 +1870,11 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
|
|
|
1525
1870
|
```bash
|
|
1526
1871
|
npm run dev # Hot reload
|
|
1527
1872
|
npm run build # Production build
|
|
1528
|
-
npm test #
|
|
1873
|
+
npm test # 2,500+ tests
|
|
1529
1874
|
npm run test:integration # API tests (requires running services)
|
|
1530
1875
|
```
|
|
1531
1876
|
|
|
1532
|
-
**Prerequisites:** Node.js >= 20
|
|
1877
|
+
**Prerequisites:** Node.js >= 20 with npm/npx; [iii-engine](https://iii.dev/docs) v0.22.1 or Docker. The macOS/Linux automatic engine install also requires `curl`, a POSIX `sh`, and `tar`; native Windows uses the manual pinned `iii.exe`, WSL2, or Docker Desktop.
|
|
1533
1878
|
|
|
1534
1879
|
<h2 id="license"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-license.svg"><img src="assets/tags/section-license.svg" alt="License" height="32" /></picture></h2>
|
|
1535
1880
|
|