@agentmemory/agentmemory 0.9.4 → 0.9.6
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/README.md +108 -50
- package/dist/cli.mjs +60 -20
- package/dist/cli.mjs.map +1 -1
- package/dist/docker-compose.yml +10 -1
- package/dist/hooks/session-end.mjs +4 -4
- package/dist/hooks/session-end.mjs.map +1 -1
- package/dist/hooks/session-start.mjs +23 -10
- package/dist/hooks/session-start.mjs.map +1 -1
- package/dist/hooks/stop.mjs +1 -1
- package/dist/hooks/stop.mjs.map +1 -1
- package/dist/hooks/subagent-start.mjs +17 -18
- package/dist/hooks/subagent-start.mjs.map +1 -1
- package/dist/image-refs-CZVd2z6E.mjs +3 -0
- package/dist/{image-store-Cn9eD-7D.mjs → image-store-CF4gfkLr.mjs} +1 -1
- package/dist/index.mjs +205 -82
- package/dist/index.mjs.map +1 -1
- package/dist/{src-uDy2jLO-.mjs → src-C7vGxttN.mjs} +147 -24
- package/dist/src-C7vGxttN.mjs.map +1 -0
- package/dist/{standalone-CqqEcfNR.mjs → standalone-DnSJzyXL.mjs} +36 -4
- package/dist/{standalone-CqqEcfNR.mjs.map → standalone-DnSJzyXL.mjs.map} +1 -1
- package/dist/standalone.d.mts.map +1 -1
- package/dist/standalone.mjs +35 -3
- package/dist/standalone.mjs.map +1 -1
- package/dist/{tools-registry-Co8VIL4t.mjs → tools-registry-CKMeHaPN.mjs} +2 -2
- package/dist/{tools-registry-Co8VIL4t.mjs.map → tools-registry-CKMeHaPN.mjs.map} +1 -1
- package/docker-compose.yml +10 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/scripts/session-end.mjs +4 -4
- package/plugin/scripts/session-end.mjs.map +1 -1
- package/plugin/scripts/session-start.mjs +23 -10
- package/plugin/scripts/session-start.mjs.map +1 -1
- package/plugin/scripts/stop.mjs +1 -1
- package/plugin/scripts/stop.mjs.map +1 -1
- package/plugin/scripts/subagent-start.mjs +17 -18
- package/plugin/scripts/subagent-start.mjs.map +1 -1
- package/dist/image-refs-BfT7XAa-.mjs +0 -3
- package/dist/src-uDy2jLO-.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong>
|
|
7
|
-
|
|
6
|
+
<strong>
|
|
7
|
+
Your coding agent remembers everything. No more re-explaining.
|
|
8
|
+
Built on <a href="https://github.com/iii-hq/iii">iii engine</a>
|
|
9
|
+
</strong></br>
|
|
10
|
+
Persistent memory for Claude Code, Cursor, Gemini CLI, Codex CLI, pi, OpenCode, and any MCP client.
|
|
8
11
|
</p>
|
|
9
12
|
|
|
10
13
|
<p align="center">
|
|
@@ -43,7 +46,8 @@
|
|
|
43
46
|
<a href="#how-it-works">How It Works</a> •
|
|
44
47
|
<a href="#mcp-server">MCP</a> •
|
|
45
48
|
<a href="#real-time-viewer">Viewer</a> •
|
|
46
|
-
<a href="#iii-console
|
|
49
|
+
<a href="#iii-console">iii Console</a> •
|
|
50
|
+
<a href="#powered-by-iii">Powered by iii</a> •
|
|
47
51
|
<a href="#configuration">Config</a> •
|
|
48
52
|
<a href="#api">API</a>
|
|
49
53
|
</p>
|
|
@@ -341,7 +345,7 @@ Install agentmemory: run `npx @agentmemory/agentmemory` in a separate terminal t
|
|
|
341
345
|
<summary><b>OpenClaw (paste this prompt)</b></summary>
|
|
342
346
|
|
|
343
347
|
```
|
|
344
|
-
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
|
|
348
|
+
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 43 memory tools:
|
|
345
349
|
|
|
346
350
|
{
|
|
347
351
|
"mcpServers": {
|
|
@@ -352,7 +356,7 @@ Install agentmemory for OpenClaw. Run `npx @agentmemory/agentmemory` in a separa
|
|
|
352
356
|
}
|
|
353
357
|
}
|
|
354
358
|
|
|
355
|
-
Restart OpenClaw. Verify with `curl http://localhost:3111/agentmemory/health`. Open http://localhost:3113 for the real-time viewer. For deeper
|
|
359
|
+
Restart OpenClaw. Verify with `curl http://localhost:3111/agentmemory/health`. Open http://localhost:3113 for the real-time viewer. For deeper memory-slot integration, copy `integrations/openclaw` to `~/.openclaw/extensions/agentmemory` and enable `plugins.slots.memory = "agentmemory"` in `~/.openclaw/openclaw.json`.
|
|
356
360
|
```
|
|
357
361
|
|
|
358
362
|
Full guide: [`integrations/openclaw/`](integrations/openclaw/)
|
|
@@ -363,13 +367,16 @@ Full guide: [`integrations/openclaw/`](integrations/openclaw/)
|
|
|
363
367
|
<summary><b>Hermes Agent (paste this prompt)</b></summary>
|
|
364
368
|
|
|
365
369
|
```
|
|
366
|
-
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
|
|
370
|
+
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 43 memory tools:
|
|
367
371
|
|
|
368
372
|
mcp_servers:
|
|
369
373
|
agentmemory:
|
|
370
374
|
command: npx
|
|
371
375
|
args: ["-y", "@agentmemory/mcp"]
|
|
372
376
|
|
|
377
|
+
memory:
|
|
378
|
+
provider: agentmemory
|
|
379
|
+
|
|
373
380
|
Verify with `curl http://localhost:3111/agentmemory/health`. Open http://localhost:3113 for the real-time viewer. For deeper 6-hook memory provider integration (pre-LLM context injection, turn capture, MEMORY.md mirroring, system prompt block), copy integrations/hermes from the agentmemory repo to ~/.hermes/plugins/agentmemory.
|
|
374
381
|
```
|
|
375
382
|
|
|
@@ -386,11 +393,12 @@ Then add the MCP config for your agent:
|
|
|
386
393
|
| Agent | Setup |
|
|
387
394
|
|---|---|
|
|
388
395
|
| **Cursor** | Add to `~/.cursor/mcp.json`: `{"mcpServers": {"agentmemory": {"command": "npx", "args": ["-y", "@agentmemory/mcp"]}}}` |
|
|
389
|
-
| **OpenClaw** | Add to MCP config: `{"mcpServers": {"agentmemory": {"command": "npx", "args": ["-y", "@agentmemory/mcp"]}}}` or use the [
|
|
390
|
-
| **Gemini CLI** | `gemini mcp add agentmemory
|
|
391
|
-
| **Codex CLI** |
|
|
396
|
+
| **OpenClaw** | Add to MCP config: `{"mcpServers": {"agentmemory": {"command": "npx", "args": ["-y", "@agentmemory/mcp"]}}}` or use the [memory plugin](integrations/openclaw/) |
|
|
397
|
+
| **Gemini CLI** | `gemini mcp add agentmemory npx -y @agentmemory/mcp --scope user` |
|
|
398
|
+
| **Codex CLI** | `codex mcp add agentmemory -- npx -y @agentmemory/mcp` or add `[mcp_servers.agentmemory]` to `.codex/config.toml` |
|
|
399
|
+
| **pi** | Copy [`integrations/pi`](integrations/pi/) to `~/.pi/agent/extensions/agentmemory` and restart pi |
|
|
392
400
|
| **OpenCode** | Add to `opencode.json`: `{"mcp": {"agentmemory": {"type": "local", "command": ["npx", "-y", "@agentmemory/mcp"], "enabled": true}}}` |
|
|
393
|
-
| **Hermes Agent** | Add to `~/.hermes/config.yaml` or use the [memory provider plugin](integrations/hermes/) |
|
|
401
|
+
| **Hermes Agent** | Add to `~/.hermes/config.yaml` with `memory.provider: agentmemory` or use the [memory provider plugin](integrations/hermes/) |
|
|
394
402
|
| **Cline / Goose / Kilo Code** | Add MCP server in settings |
|
|
395
403
|
| **Claude Desktop** | Add to `claude_desktop_config.json`: `{"mcpServers": {"agentmemory": {"command": "npx", "args": ["-y", "@agentmemory/mcp"]}}}` |
|
|
396
404
|
| **Aider** | REST API: `curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}'` |
|
|
@@ -405,12 +413,15 @@ npm install && npm run build && npm start
|
|
|
405
413
|
|
|
406
414
|
This starts agentmemory with a local `iii-engine` if `iii` is already installed, or falls back to Docker Compose if Docker is available. REST, streams, and the viewer bind to `127.0.0.1` by default.
|
|
407
415
|
|
|
408
|
-
Install `iii-engine` manually
|
|
416
|
+
Install `iii-engine` manually. **agentmemory currently pins `iii-engine` to `v0.11.2`** — `v0.11.6` introduces a new sandbox-everything-via-`iii worker add` model that agentmemory hasn't been refactored for yet. Pin lifts once the refactor lands. Override with `AGENTMEMORY_III_VERSION=<version>` if you've migrated to the sandbox model manually.
|
|
409
417
|
|
|
410
|
-
- **macOS /
|
|
411
|
-
- **
|
|
418
|
+
- **macOS arm64:** `mkdir -p ~/.local/bin && curl -fsSL https://github.com/iii-hq/iii/releases/download/iii/v0.11.2/iii-aarch64-apple-darwin.tar.gz | tar -xz -C ~/.local/bin && chmod +x ~/.local/bin/iii`
|
|
419
|
+
- **macOS x64:** swap `aarch64-apple-darwin` for `x86_64-apple-darwin`
|
|
420
|
+
- **Linux x64:** swap for `x86_64-unknown-linux-gnu`
|
|
421
|
+
- **Linux arm64:** swap for `aarch64-unknown-linux-gnu`
|
|
422
|
+
- **Windows:** download `iii-x86_64-pc-windows-msvc.zip` from [iii-hq/iii releases v0.11.2](https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.11.2), extract `iii.exe`, add to PATH
|
|
412
423
|
|
|
413
|
-
Or use Docker (the bundled `docker-compose.yml` pulls `iiidev/iii:
|
|
424
|
+
Or use Docker (the bundled `docker-compose.yml` pulls `iiidev/iii:0.11.2`). Full docs: [iii.dev/docs](https://iii.dev/docs).
|
|
414
425
|
|
|
415
426
|
### Windows
|
|
416
427
|
|
|
@@ -419,7 +430,9 @@ agentmemory runs on Windows 10/11, but the Node.js package alone isn't enough
|
|
|
419
430
|
**Option A — Prebuilt Windows binary (recommended):**
|
|
420
431
|
|
|
421
432
|
```powershell
|
|
422
|
-
# 1. Open https://github.com/iii-hq/iii/releases/
|
|
433
|
+
# 1. Open https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.11.2 in your browser
|
|
434
|
+
# (we pin to v0.11.2 until agentmemory refactors for the new sandbox
|
|
435
|
+
# model that engine v0.11.6+ requires)
|
|
423
436
|
# 2. Download iii-x86_64-pc-windows-msvc.zip
|
|
424
437
|
# (or iii-aarch64-pc-windows-msvc.zip if you're on an ARM machine)
|
|
425
438
|
# 3. Extract iii.exe somewhere on PATH, or place it at:
|
|
@@ -427,6 +440,7 @@ agentmemory runs on Windows 10/11, but the Node.js package alone isn't enough
|
|
|
427
440
|
# (agentmemory checks that location automatically)
|
|
428
441
|
# 4. Verify:
|
|
429
442
|
iii --version
|
|
443
|
+
# Should print: 0.11.2
|
|
430
444
|
|
|
431
445
|
# 5. Then run agentmemory as usual:
|
|
432
446
|
npx -y @agentmemory/agentmemory
|
|
@@ -724,41 +738,57 @@ open http://localhost:3113
|
|
|
724
738
|
|
|
725
739
|
The viewer server binds to `127.0.0.1` by default. The REST-served `/agentmemory/viewer` endpoint follows the normal `AGENTMEMORY_SECRET` bearer-token rules. CSP headers use a per-response script nonce and disable inline handler attributes (`script-src-attr 'none'`).
|
|
726
740
|
|
|
727
|
-
|
|
741
|
+
---
|
|
742
|
+
|
|
743
|
+
<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>
|
|
728
744
|
|
|
729
|
-
|
|
745
|
+
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.
|
|
746
|
+
|
|
747
|
+
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.
|
|
748
|
+
|
|
749
|
+
agentmemory ships this for free because every function, trigger, state scope, and stream is an iii primitive — nothing custom, nothing to instrument.
|
|
730
750
|
|
|
731
751
|
<p align="center">
|
|
732
|
-
<img src="assets/iii-console/
|
|
752
|
+
<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" />
|
|
733
753
|
<br/>
|
|
734
|
-
<em>
|
|
754
|
+
<em>Workers page: every connected worker — including agentmemory itself — with PID, function count, runtime, and last-seen.</em>
|
|
735
755
|
</p>
|
|
736
756
|
|
|
737
|
-
**
|
|
757
|
+
**Already installed.** The console ships with `iii` — no separate installer.
|
|
758
|
+
|
|
759
|
+
**Launch alongside agentmemory:**
|
|
738
760
|
|
|
739
761
|
```bash
|
|
740
|
-
|
|
762
|
+
# agentmemory viewer holds port 3113, so run the console on 3114.
|
|
763
|
+
# Engine REST (3111), WebSocket (3112), and bridge (49134) defaults match agentmemory.
|
|
764
|
+
iii console --port 3114
|
|
741
765
|
```
|
|
742
766
|
|
|
743
|
-
|
|
767
|
+
Then open `http://localhost:3114`. Add `--enable-flow` for the experimental architecture-graph page.
|
|
768
|
+
|
|
769
|
+
Override engine endpoints only if you've moved them:
|
|
744
770
|
|
|
745
771
|
```bash
|
|
746
|
-
|
|
747
|
-
|
|
772
|
+
iii console --port 3114 \
|
|
773
|
+
--engine-port 3111 \
|
|
774
|
+
--ws-port 3112 \
|
|
775
|
+
--bridge-port 49134
|
|
748
776
|
```
|
|
749
777
|
|
|
750
|
-
Then open `http://localhost:3114`.
|
|
751
|
-
|
|
752
778
|
**What you can do from the console:**
|
|
753
779
|
|
|
754
780
|
| Page | Use it to |
|
|
755
781
|
|------|-----------|
|
|
756
|
-
| **
|
|
757
|
-
| **
|
|
758
|
-
| **
|
|
759
|
-
| **
|
|
782
|
+
| **Workers** | See every connected worker and its live metrics — including the agentmemory worker itself. |
|
|
783
|
+
| **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. |
|
|
784
|
+
| **Triggers** | Replay HTTP, cron, event, and state triggers — fire the consolidation cron manually, retry an HTTP route, emit a state change. |
|
|
785
|
+
| **States** | KV browser with full CRUD — sessions, memory slots, lifecycle timers, embeddings index — edit values in place. |
|
|
786
|
+
| **Streams** | Live WebSocket monitor for memory writes, hook events, and observation updates as they flow through iii streams. |
|
|
787
|
+
| **Queues** | Durable queue topics + dead-letter management. Replay or drop failed embedding / compression jobs. |
|
|
760
788
|
| **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. |
|
|
761
|
-
| **Logs** | Structured OTEL logs correlated to trace/span IDs. |
|
|
789
|
+
| **Logs** | Structured OTEL logs filtered and correlated to trace/span IDs. |
|
|
790
|
+
| **Config** | Runtime configuration — see exactly which workers, providers, and ports your engine is running with. |
|
|
791
|
+
| **Flow** | (Optional, `--enable-flow`) Interactive architecture graph of every worker, trigger, and stream. |
|
|
762
792
|
|
|
763
793
|
<p align="center">
|
|
764
794
|
<img src="assets/iii-console/traces-waterfall.png" alt="iii console trace waterfall view showing per-span duration" width="720" />
|
|
@@ -776,6 +806,53 @@ If you want to export to Jaeger/Honeycomb/Grafana Tempo instead, change `exporte
|
|
|
776
806
|
|
|
777
807
|
---
|
|
778
808
|
|
|
809
|
+
<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>
|
|
810
|
+
|
|
811
|
+
agentmemory is **already a running [iii](https://iii.dev) instance**. Functions, triggers, KV state, streams, OTEL traces — all of it is iii primitives. You didn't install Postgres, Redis, Express, pm2, or Prometheus, because iii replaces them.
|
|
812
|
+
|
|
813
|
+
That means one more command extends agentmemory with an entire new capability.
|
|
814
|
+
|
|
815
|
+
### Extend agentmemory with one command
|
|
816
|
+
|
|
817
|
+
```bash
|
|
818
|
+
iii worker add iii-pubsub # fan memory writes out to every connected instance
|
|
819
|
+
iii worker add iii-cron # scheduled consolidation, decay sweeps, snapshot rotation
|
|
820
|
+
iii worker add iii-queue # durable retries for embedding + compression jobs
|
|
821
|
+
iii worker add iii-observability # OTEL traces on every memory op (default on)
|
|
822
|
+
iii worker add iii-sandbox # run recalled code inside an isolated microVM
|
|
823
|
+
iii worker add iii-database # swap in a SQL-backed state adapter
|
|
824
|
+
iii worker add mcp # generic MCP host alongside the agentmemory MCP
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
Each `iii worker add` registers new functions and triggers into the same engine agentmemory is already running on. The viewer and console pick them up immediately — no reload, no new integration, no new container.
|
|
828
|
+
|
|
829
|
+
| `iii worker add` | What you get on top of agentmemory |
|
|
830
|
+
|---|---|
|
|
831
|
+
| [`iii-pubsub`](https://workers.iii.dev/workers/iii-pubsub) | Multi-instance memory: every `remember` fans out, every `search` reads the union |
|
|
832
|
+
| [`iii-cron`](https://workers.iii.dev/workers/iii-cron) | Scheduled lifecycle — nightly consolidation, weekly snapshots, decay on a fixed clock |
|
|
833
|
+
| [`iii-queue`](https://workers.iii.dev/workers/iii-queue) | Durable retries: failed embedding + compression jobs survive restart, no lost observations |
|
|
834
|
+
| [`iii-observability`](https://workers.iii.dev/workers/iii-observability) | OTEL traces, metrics, logs on every function — wired in `iii-config.yaml` from day one |
|
|
835
|
+
| [`iii-sandbox`](https://workers.iii.dev/workers/iii-sandbox) | Code that came out of `memory_recall` runs inside a throwaway VM, not your shell |
|
|
836
|
+
| [`iii-database`](https://workers.iii.dev/workers/iii-database) | SQL-backed state adapter when you outgrow the in-memory KV defaults |
|
|
837
|
+
| [`mcp`](https://workers.iii.dev/workers/mcp) | Stand up extra MCP servers next to agentmemory's, share the same engine |
|
|
838
|
+
|
|
839
|
+
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.
|
|
840
|
+
|
|
841
|
+
### What iii replaces
|
|
842
|
+
|
|
843
|
+
| Traditional stack | agentmemory uses |
|
|
844
|
+
|---|---|
|
|
845
|
+
| Express.js / Fastify | iii HTTP Triggers |
|
|
846
|
+
| SQLite / Postgres + pgvector | iii KV State + in-memory vector index |
|
|
847
|
+
| SSE / Socket.io | iii Streams (WebSocket) |
|
|
848
|
+
| pm2 / systemd | iii engine worker supervision |
|
|
849
|
+
| Prometheus / Grafana | iii OTEL + health monitor |
|
|
850
|
+
| Custom plugin systems | `iii worker add <name>` |
|
|
851
|
+
|
|
852
|
+
**118 source files · ~21,800 LOC · 800 tests · 123 functions · 34 KV scopes** — all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
|
|
853
|
+
|
|
854
|
+
---
|
|
855
|
+
|
|
779
856
|
<h2 id="configuration"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-config.svg"><img src="assets/tags/section-config.svg" alt="Configuration" height="32" /></picture></h2>
|
|
780
857
|
|
|
781
858
|
### LLM Providers
|
|
@@ -912,25 +989,6 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
|
|
|
912
989
|
|
|
913
990
|
---
|
|
914
991
|
|
|
915
|
-
<h2 id="architecture"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-architecture.svg"><img src="assets/tags/section-architecture.svg" alt="Architecture" height="32" /></picture></h2>
|
|
916
|
-
|
|
917
|
-
Built on [iii-engine](https://iii.dev)'s three primitives — no Express, no Postgres, no Redis.
|
|
918
|
-
|
|
919
|
-
**118 source files · ~21,800 LOC · 800 tests · 123 functions · 34 KV scopes**
|
|
920
|
-
|
|
921
|
-
<details>
|
|
922
|
-
<summary>What iii-engine replaces</summary>
|
|
923
|
-
|
|
924
|
-
| Traditional stack | agentmemory uses |
|
|
925
|
-
|---|---|
|
|
926
|
-
| Express.js / Fastify | iii HTTP Triggers |
|
|
927
|
-
| SQLite / Postgres + pgvector | iii KV State + in-memory vector index |
|
|
928
|
-
| SSE / Socket.io | iii Streams (WebSocket) |
|
|
929
|
-
| pm2 / systemd | iii-engine worker management |
|
|
930
|
-
| Prometheus / Grafana | iii OTEL + health monitor |
|
|
931
|
-
|
|
932
|
-
</details>
|
|
933
|
-
|
|
934
992
|
<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>
|
|
935
993
|
|
|
936
994
|
```bash
|
package/dist/cli.mjs
CHANGED
|
@@ -81,6 +81,24 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
81
81
|
const args = process.argv.slice(2);
|
|
82
82
|
const IS_WINDOWS = platform() === "win32";
|
|
83
83
|
const IS_VERBOSE = args.includes("--verbose") || args.includes("-v");
|
|
84
|
+
const IIPINNED_VERSION = process.env["AGENTMEMORY_III_VERSION"] || "0.11.2";
|
|
85
|
+
function iiiReleaseAsset() {
|
|
86
|
+
const p = platform();
|
|
87
|
+
const a = process.arch;
|
|
88
|
+
if (p === "darwin" && a === "arm64") return "iii-aarch64-apple-darwin.tar.gz";
|
|
89
|
+
if (p === "darwin" && a === "x64") return "iii-x86_64-apple-darwin.tar.gz";
|
|
90
|
+
if (p === "linux" && a === "x64") return "iii-x86_64-unknown-linux-gnu.tar.gz";
|
|
91
|
+
if (p === "linux" && a === "arm64") return "iii-aarch64-unknown-linux-gnu.tar.gz";
|
|
92
|
+
if (p === "linux" && a === "arm") return "iii-armv7-unknown-linux-gnueabihf.tar.gz";
|
|
93
|
+
if (p === "win32" && a === "x64") return "iii-x86_64-pc-windows-msvc.zip";
|
|
94
|
+
if (p === "win32" && a === "arm64") return "iii-aarch64-pc-windows-msvc.zip";
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
function iiiReleaseUrl() {
|
|
98
|
+
const asset = iiiReleaseAsset();
|
|
99
|
+
if (!asset) return null;
|
|
100
|
+
return `https://github.com/iii-hq/iii/releases/download/iii/v${IIPINNED_VERSION}/${asset}`;
|
|
101
|
+
}
|
|
84
102
|
function vlog(msg) {
|
|
85
103
|
if (IS_VERBOSE) p.log.info(`[verbose] ${msg}`);
|
|
86
104
|
}
|
|
@@ -288,12 +306,13 @@ async function waitForEngine(timeoutMs) {
|
|
|
288
306
|
return false;
|
|
289
307
|
}
|
|
290
308
|
function installInstructions() {
|
|
309
|
+
const releaseUrl = iiiReleaseUrl();
|
|
291
310
|
if (IS_WINDOWS) return [
|
|
292
|
-
|
|
311
|
+
`agentmemory requires the \`iii-engine\` runtime, pinned to v${IIPINNED_VERSION}. Pick one:`,
|
|
293
312
|
"",
|
|
294
313
|
" A) Download the prebuilt Windows binary:",
|
|
295
|
-
|
|
296
|
-
|
|
314
|
+
` 1. Open https://github.com/iii-hq/iii/releases/tag/iii%2Fv${IIPINNED_VERSION}`,
|
|
315
|
+
` 2. Download iii-x86_64-pc-windows-msvc.zip`,
|
|
297
316
|
" (or iii-aarch64-pc-windows-msvc.zip on ARM)",
|
|
298
317
|
" 3. Extract iii.exe and either add its folder to PATH",
|
|
299
318
|
" or move it to %USERPROFILE%\\.local\\bin\\iii.exe",
|
|
@@ -301,24 +320,31 @@ function installInstructions() {
|
|
|
301
320
|
"",
|
|
302
321
|
" B) Docker Desktop:",
|
|
303
322
|
" 1. Install Docker Desktop for Windows",
|
|
304
|
-
|
|
305
|
-
" 3.
|
|
323
|
+
` 2. docker pull iiidev/iii:${IIPINNED_VERSION}`,
|
|
324
|
+
" 3. Start Docker Desktop (engine must be running)",
|
|
325
|
+
" 4. Re-run: npx @agentmemory/agentmemory",
|
|
306
326
|
"",
|
|
307
327
|
"Or skip the engine entirely for standalone MCP:",
|
|
308
328
|
" npx @agentmemory/agentmemory mcp"
|
|
309
329
|
];
|
|
330
|
+
const linuxInstall = releaseUrl ? ` A) mkdir -p ~/.local/bin && curl -fsSL "${releaseUrl}" | tar -xz -C ~/.local/bin && chmod +x ~/.local/bin/iii` : ` A) Manual download from https://github.com/iii-hq/iii/releases/tag/iii%2Fv${IIPINNED_VERSION}`;
|
|
310
331
|
return [
|
|
311
|
-
|
|
332
|
+
`agentmemory requires the \`iii-engine\` runtime, pinned to v${IIPINNED_VERSION}. Pick one:`,
|
|
312
333
|
"",
|
|
313
|
-
|
|
314
|
-
|
|
334
|
+
linuxInstall,
|
|
335
|
+
` (installs iii v${IIPINNED_VERSION} into ~/.local/bin/iii)`,
|
|
315
336
|
"",
|
|
316
|
-
|
|
337
|
+
` B) Docker: \`docker pull iiidev/iii:${IIPINNED_VERSION}\``,
|
|
317
338
|
"",
|
|
318
339
|
"Or skip the engine entirely for standalone MCP:",
|
|
319
340
|
" npx @agentmemory/agentmemory mcp",
|
|
320
341
|
"",
|
|
321
|
-
"Docs: https://iii.dev/docs"
|
|
342
|
+
"Docs: https://iii.dev/docs",
|
|
343
|
+
`Why pinned: iii v0.11.6 introduces the new sandbox-everything model`,
|
|
344
|
+
`(\`iii worker add\` registration). agentmemory still uses the older`,
|
|
345
|
+
`iii-exec config-file worker model and needs a refactor before it`,
|
|
346
|
+
`runs cleanly under the new engine. Override with`,
|
|
347
|
+
`AGENTMEMORY_III_VERSION=<version> when you've migrated manually.`
|
|
322
348
|
];
|
|
323
349
|
}
|
|
324
350
|
function portInUseDiagnostic(port) {
|
|
@@ -328,12 +354,12 @@ async function main() {
|
|
|
328
354
|
p.intro("agentmemory");
|
|
329
355
|
if (skipEngine) {
|
|
330
356
|
p.log.info("Skipping engine check (--no-engine)");
|
|
331
|
-
await import("./src-
|
|
357
|
+
await import("./src-C7vGxttN.mjs");
|
|
332
358
|
return;
|
|
333
359
|
}
|
|
334
360
|
if (await isEngineRunning()) {
|
|
335
361
|
p.log.success("iii-engine is running");
|
|
336
|
-
await import("./src-
|
|
362
|
+
await import("./src-C7vGxttN.mjs");
|
|
337
363
|
return;
|
|
338
364
|
}
|
|
339
365
|
if (!await startEngine()) {
|
|
@@ -377,7 +403,7 @@ async function main() {
|
|
|
377
403
|
process.exit(1);
|
|
378
404
|
}
|
|
379
405
|
s.stop("iii-engine is ready");
|
|
380
|
-
await import("./src-
|
|
406
|
+
await import("./src-C7vGxttN.mjs");
|
|
381
407
|
}
|
|
382
408
|
async function apiFetch(base, path, timeoutMs = 5e3) {
|
|
383
409
|
try {
|
|
@@ -660,6 +686,8 @@ async function seedDemoSession(base, project, session) {
|
|
|
660
686
|
const payload = {
|
|
661
687
|
hookType: "post_tool_use",
|
|
662
688
|
sessionId: session.id,
|
|
689
|
+
project,
|
|
690
|
+
cwd: project,
|
|
663
691
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
664
692
|
data: {
|
|
665
693
|
tool_name: obs.toolName,
|
|
@@ -804,14 +832,26 @@ async function runUpgrade() {
|
|
|
804
832
|
return process.exit(0);
|
|
805
833
|
}
|
|
806
834
|
if (upgradeEngine === true) {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
835
|
+
const releaseUrl = iiiReleaseUrl();
|
|
836
|
+
const asset = iiiReleaseAsset();
|
|
837
|
+
const isZipAsset = asset?.endsWith(".zip") === true;
|
|
838
|
+
if (!releaseUrl) p.log.warn(`iii-engine binary not available for ${platform()}/${process.arch}. Use Docker (\`docker pull iiidev/iii:${IIPINNED_VERSION}\`) or download manually from https://github.com/iii-hq/iii/releases/tag/iii%2Fv${IIPINNED_VERSION}.`);
|
|
839
|
+
else if (IS_WINDOWS || isZipAsset) p.log.info(`Skipping auto-install on ${platform()} — the ${asset} asset isn't tar-compatible. Install manually:\n 1. Download ${releaseUrl}\n 2. Extract iii.exe and place it on PATH (e.g. %USERPROFILE%\\.local\\bin)\nOr use Docker: docker pull iiidev/iii:${IIPINNED_VERSION}`);
|
|
840
|
+
else {
|
|
841
|
+
const binDir = join(homedir(), ".local", "bin");
|
|
842
|
+
if (!runCommand(shBin, ["-c", [
|
|
843
|
+
`mkdir -p "${binDir}"`,
|
|
844
|
+
`curl -fsSL "${releaseUrl}" | tar -xz -C "${binDir}"`,
|
|
845
|
+
`chmod +x "${binDir}/iii"`
|
|
846
|
+
].join(" && ")], {
|
|
847
|
+
label: `Installing iii-engine v${IIPINNED_VERSION} (pinned)`,
|
|
848
|
+
optional: true
|
|
849
|
+
})) p.log.warn(`iii-engine installer failed. Fallbacks: Docker (\`docker pull iiidev/iii:${IIPINNED_VERSION}\`) or download manually from https://github.com/iii-hq/iii/releases/tag/iii%2Fv${IIPINNED_VERSION}.`);
|
|
850
|
+
}
|
|
811
851
|
} else p.log.info("Skipped iii-engine installer.");
|
|
812
852
|
} else p.log.warn("curl or sh not found. Skipping iii-engine installer.");
|
|
813
|
-
if (dockerBin) runCommand(dockerBin, ["pull",
|
|
814
|
-
label:
|
|
853
|
+
if (dockerBin) runCommand(dockerBin, ["pull", `iiidev/iii:${IIPINNED_VERSION}`], {
|
|
854
|
+
label: `Pulling iii Docker image v${IIPINNED_VERSION} (pinned)`,
|
|
815
855
|
optional: true
|
|
816
856
|
});
|
|
817
857
|
else p.log.info("Docker not found. Skipping Docker image refresh.");
|
|
@@ -825,7 +865,7 @@ async function runUpgrade() {
|
|
|
825
865
|
].join("\n"), "agentmemory upgrade");
|
|
826
866
|
}
|
|
827
867
|
async function runMcp() {
|
|
828
|
-
await import("./standalone-
|
|
868
|
+
await import("./standalone-DnSJzyXL.mjs");
|
|
829
869
|
}
|
|
830
870
|
async function runImportJsonl() {
|
|
831
871
|
const VALUE_FLAGS = new Set(["--port", "--tools"]);
|