@agentmemory/agentmemory 0.9.15 → 0.9.17

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/AGENTS.md CHANGED
@@ -104,16 +104,16 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
104
104
 
105
105
  ## Testing
106
106
 
107
- - All tests must pass before PR: `npm test` (699+ tests)
107
+ - All tests must pass before PR: `npm test` (950+ tests)
108
108
  - Mock pattern: `vi.mock("iii-sdk")` with mock `sdk.trigger`, `kv.get/set/list`
109
109
  - Test files go in `test/` with `.test.ts` extension
110
110
  - Follow existing patterns in `test/crystallize.test.ts` for function tests
111
111
 
112
- ## Current Stats (v0.8.9)
112
+ ## Current Stats (v0.9.16)
113
113
 
114
- - 44 MCP tools (8 visible by default, `AGENTMEMORY_TOOLS=all` for all)
115
- - 104 REST endpoints
114
+ - 51 MCP tools (8 visible by default, `AGENTMEMORY_TOOLS=all` for all)
115
+ - 121 REST endpoints
116
116
  - 6 MCP resources, 3 MCP prompts
117
117
  - 12 hooks, 4 skills
118
118
  - 50+ iii functions
119
- - 699 tests
119
+ - 950+ tests
package/README.md CHANGED
@@ -45,7 +45,7 @@
45
45
  <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tools.svg"><img src="assets/tags/stat-tools.svg" alt="51 MCP tools" height="38" /></picture>
46
46
  <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>
47
47
  <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>
48
- <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="827 tests passing" height="38" /></picture>
48
+ <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="950+ tests passing" height="38" /></picture>
49
49
  </p>
50
50
 
51
51
  <p align="center">
@@ -53,6 +53,7 @@
53
53
  </p>
54
54
 
55
55
  <p align="center">
56
+ <a href="#install">Install</a> &bull;
56
57
  <a href="#quick-start">Quick Start</a> &bull;
57
58
  <a href="#benchmarks">Benchmarks</a> &bull;
58
59
  <a href="#vs-competitors">vs Competitors</a> &bull;
@@ -68,6 +69,27 @@
68
69
 
69
70
  ---
70
71
 
72
+ ## Install
73
+
74
+ ```bash
75
+ npm install -g @agentmemory/agentmemory # once — bare `agentmemory` on PATH
76
+ agentmemory # start the memory server on :3111
77
+ agentmemory demo # seed sample sessions + prove recall
78
+ agentmemory connect claude-code # wire your agent (also: codex, cursor, gemini-cli, ...)
79
+ ```
80
+
81
+ Or via `npx` (no install):
82
+
83
+ ```bash
84
+ npx @agentmemory/agentmemory
85
+ ```
86
+
87
+ Heads-up — npx caches per version. If a bare `npx @agentmemory/agentmemory` serves an older release, 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`). The first npx run from v0.9.16+ prompts to install globally inline so the bare `agentmemory` command works everywhere afterwards.
88
+
89
+ Full options at [Quick Start](#quick-start) below. Agent-specific wiring at [Works with every agent](#works-with-every-agent).
90
+
91
+ ---
92
+
71
93
  <h2 id="works-with-every-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>
72
94
 
73
95
  agentmemory works with any agent that supports hooks, MCP, or REST API. All agents share the same memory server.
@@ -321,6 +343,28 @@ npx @agentmemory/agentmemory demo
321
343
 
322
344
  Open `http://localhost:3113` to watch the memory build live.
323
345
 
346
+ ### Recommended: install globally
347
+
348
+ `npx` caches per-version. If you ran `npx @agentmemory/agentmemory@0.9.14` last week, a bare `npx @agentmemory/agentmemory` may serve the stale 0.9.14 from `~/.npm/_npx/`, not the latest release. Install once and the bare `agentmemory` command works everywhere:
349
+
350
+ ```bash
351
+ npm install -g @agentmemory/agentmemory
352
+ agentmemory # start the server (same as the npx form)
353
+ agentmemory stop # tear it down
354
+ agentmemory remove # uninstall everything we created
355
+ agentmemory connect claude-code # wire one agent
356
+ agentmemory doctor # interactive diagnostics + fix prompts
357
+ ```
358
+
359
+ From v0.9.16 onward, the first npx run prompts you to install globally inline — answer `Y` once and you're set. If you skip, fall back to either of these for a fresh fetch:
360
+
361
+ ```bash
362
+ npx -y @agentmemory/agentmemory@latest # forces latest from npm (cross-platform)
363
+ rm -rf ~/.npm/_npx && npx @agentmemory/agentmemory # macOS/Linux only (POSIX shell)
364
+ ```
365
+
366
+ On Windows / PowerShell, the equivalent cache clear is `Remove-Item -Recurse -Force "$env:LOCALAPPDATA\npm-cache\_npx"` — the `npx -y ...@latest` form above is the cross-platform option.
367
+
324
368
  ### Session Replay
325
369
 
326
370
  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.5×–4×), and keyboard shortcuts (space to toggle, arrows to step).
@@ -733,7 +777,7 @@ npm install @xenova/transformers
733
777
 
734
778
  > **MCP shim vs full server:** the published `@agentmemory/mcp` package is a thin shim. It exposes the full 51-tool surface **only when it can reach a running agentmemory server** via `AGENTMEMORY_URL` (proxy mode). With no server reachable, the shim falls back to a 7-tool local set (`memory_save`, `memory_recall`, `memory_smart_search`, `memory_sessions`, `memory_export`, `memory_audit`, `memory_governance_delete`). The `AGENTMEMORY_TOOLS=core|all` env var is a *server-side* flag — setting it in the shim's `env` block has no effect. If you see only 7 tools in Cursor / OpenCode / Gemini CLI, start `npx @agentmemory/agentmemory` (or the Docker stack) and set `AGENTMEMORY_URL=http://localhost:3111`.
735
779
 
736
- ### 50 Tools
780
+ ### 51 Tools
737
781
 
738
782
  <details>
739
783
  <summary>Core tools (always available)</summary>
@@ -755,7 +799,7 @@ npm install @xenova/transformers
755
799
  </details>
756
800
 
757
801
  <details>
758
- <summary>Extended tools (50 total — set AGENTMEMORY_TOOLS=all)</summary>
802
+ <summary>Extended tools (51 total — set AGENTMEMORY_TOOLS=all)</summary>
759
803
 
760
804
  | Tool | Description |
761
805
  |------|-------------|
@@ -973,7 +1017,7 @@ Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there co
973
1017
  | Prometheus / Grafana | iii OTEL + health monitor |
974
1018
  | Custom plugin systems | `iii worker add <name>` |
975
1019
 
976
- **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.
1020
+ **118 source files · ~21,800 LOC · 950+ tests · 123 functions · 34 KV scopes** — all on three primitives. No `agentmemory plugin install`. The plugin system is iii itself.
977
1021
 
978
1022
  ---
979
1023
 
@@ -1003,6 +1047,27 @@ Create `~/.agentmemory/.env`:
1003
1047
  # GEMINI_API_KEY=...
1004
1048
  # OPENROUTER_API_KEY=...
1005
1049
  # MINIMAX_API_KEY=...
1050
+ # OPENAI_API_KEY=*** # NOTE: this same key auto-activates BOTH the
1051
+ # # OpenAI LLM provider (here) AND the OpenAI
1052
+ # # embedding provider (further below). Set
1053
+ # # OPENAI_API_KEY_FOR_LLM=false to scope it
1054
+ # # to embeddings only.
1055
+ # OPENAI_BASE_URL=https://api.openai.com # Optional: override for Azure / vLLM / LM Studio / proxies
1056
+ # # Azure: https://<resource>.openai.azure.com/openai/deployments/<deployment>
1057
+ # # Auto-detected from `.openai.azure.com` hostname; uses
1058
+ # # api-key header + api-version query param.
1059
+ # OPENAI_API_VERSION=2024-08-01-preview # Optional: Azure api-version query param
1060
+ # OPENAI_MODEL=gpt-4o-mini # Optional: default model
1061
+ # OPENAI_TIMEOUT_MS=60000 # Optional: outbound fetch timeout (default 60s)
1062
+ # OPENAI_REASONING_EFFORT=none # Optional: "low" | "medium" | "high" | "none"
1063
+ # # Honored only by OpenAI's reasoning models (o1, o3,
1064
+ # # gpt-*-reasoning) and providers that mirror that
1065
+ # # schema (Ollama Cloud thinking models). Standard
1066
+ # # chat models reject this field with 400. Set to
1067
+ # # "none" for thinking models that return reasoning
1068
+ # # but no content.
1069
+ # OPENAI_API_KEY_FOR_LLM=false # Optional: set to false to skip OpenAI auto-detection
1070
+ # # for LLM (useful if you only want OpenAI for embeddings)
1006
1071
  # Opt-in Claude-subscription fallback (spawns @anthropic-ai/claude-agent-sdk);
1007
1072
  # leave OFF unless you understand the Stop-hook recursion risk (#149 follow-up):
1008
1073
  # AGENTMEMORY_ALLOW_AGENT_SDK=true
@@ -1084,7 +1149,7 @@ Create `~/.agentmemory/.env`:
1084
1149
 
1085
1150
  <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>
1086
1151
 
1087
- 107 endpoints on port `3111`. The REST API binds to `127.0.0.1` by default. Protected endpoints require `Authorization: Bearer <secret>` when `AGENTMEMORY_SECRET` is set, and mesh sync endpoints require `AGENTMEMORY_SECRET` on both peers.
1152
+ 121 endpoints on port `3111`. The REST API binds to `127.0.0.1` by default. Protected endpoints require `Authorization: Bearer <secret>` when `AGENTMEMORY_SECRET` is set, and mesh sync endpoints require `AGENTMEMORY_SECRET` on both peers.
1088
1153
 
1089
1154
  <details>
1090
1155
  <summary>Key endpoints</summary>
@@ -1118,7 +1183,7 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
1118
1183
  ```bash
1119
1184
  npm run dev # Hot reload
1120
1185
  npm run build # Production build
1121
- npm test # 800 tests (~1.7s)
1186
+ npm test # 950+ tests
1122
1187
  npm run test:integration # API tests (requires running services)
1123
1188
  ```
1124
1189