@agentmemory/agentmemory 0.9.16 → 0.9.18
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 +6 -0
- package/AGENTS.md +5 -5
- package/README.md +41 -6
- package/dist/.env.example +6 -0
- package/dist/cli.mjs +12 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +324 -17
- package/dist/index.mjs.map +1 -1
- package/dist/{src-3Oy_OOlF.mjs → src-C7vygXCj.mjs} +315 -15
- package/dist/src-C7vygXCj.mjs.map +1 -0
- package/dist/{standalone-BQOaGF4z.mjs → standalone-kg2TedgD.mjs} +18 -9
- package/dist/standalone-kg2TedgD.mjs.map +1 -0
- package/dist/standalone.mjs +17 -8
- package/dist/standalone.mjs.map +1 -1
- package/dist/{tools-registry-BF0pgZmI.mjs → tools-registry-BFKFKmYh.mjs} +11 -4
- package/dist/tools-registry-BFKFKmYh.mjs.map +1 -0
- package/dist/viewer/favicon.svg +1 -0
- package/dist/viewer/index.html +190 -60
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/src-3Oy_OOlF.mjs.map +0 -1
- package/dist/standalone-BQOaGF4z.mjs.map +0 -1
- package/dist/tools-registry-BF0pgZmI.mjs.map +0 -1
package/.env.example
CHANGED
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
|
|
46
46
|
# MAX_TOKENS=4096 # Cap LLM completion tokens for compression / summarise calls
|
|
47
47
|
|
|
48
|
+
# Outbound LLM / embedding timeout — shared across every raw-fetch provider
|
|
49
|
+
# (Gemini, OpenRouter, MiniMax, OpenAI LLM, and OpenAI/Cohere/Voyage/OpenRouter
|
|
50
|
+
# embedding). The OpenAI LLM path also honours the OpenAI-scoped
|
|
51
|
+
# OPENAI_TIMEOUT_MS alias for back-compat with v0.9.17 (precedence).
|
|
52
|
+
# AGENTMEMORY_LLM_TIMEOUT_MS=60000 # Default: 60 000 ms (60 s)
|
|
53
|
+
|
|
48
54
|
# Opt-in Claude-subscription fallback (spawns @anthropic-ai/claude-agent-sdk
|
|
49
55
|
# child sessions). Off by default — the agent-sdk fallback can trigger
|
|
50
56
|
# Stop-hook recursion (#149 follow-up) when invoked from inside Claude Code.
|
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` (
|
|
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.
|
|
112
|
+
## Current Stats (v0.9.16)
|
|
113
113
|
|
|
114
|
-
-
|
|
115
|
-
-
|
|
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
|
-
-
|
|
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="
|
|
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">
|
|
@@ -777,7 +777,7 @@ npm install @xenova/transformers
|
|
|
777
777
|
|
|
778
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`.
|
|
779
779
|
|
|
780
|
-
###
|
|
780
|
+
### 51 Tools
|
|
781
781
|
|
|
782
782
|
<details>
|
|
783
783
|
<summary>Core tools (always available)</summary>
|
|
@@ -799,7 +799,7 @@ npm install @xenova/transformers
|
|
|
799
799
|
</details>
|
|
800
800
|
|
|
801
801
|
<details>
|
|
802
|
-
<summary>Extended tools (
|
|
802
|
+
<summary>Extended tools (51 total — set AGENTMEMORY_TOOLS=all)</summary>
|
|
803
803
|
|
|
804
804
|
| Tool | Description |
|
|
805
805
|
|------|-------------|
|
|
@@ -1017,7 +1017,7 @@ Full registry: [workers.iii.dev](https://workers.iii.dev). Every worker there co
|
|
|
1017
1017
|
| Prometheus / Grafana | iii OTEL + health monitor |
|
|
1018
1018
|
| Custom plugin systems | `iii worker add <name>` |
|
|
1019
1019
|
|
|
1020
|
-
**118 source files · ~21,800 LOC ·
|
|
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.
|
|
1021
1021
|
|
|
1022
1022
|
---
|
|
1023
1023
|
|
|
@@ -1047,6 +1047,30 @@ Create `~/.agentmemory/.env`:
|
|
|
1047
1047
|
# GEMINI_API_KEY=...
|
|
1048
1048
|
# OPENROUTER_API_KEY=...
|
|
1049
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: OpenAI-scoped alias for the outbound fetch
|
|
1062
|
+
# # timeout. Takes precedence over AGENTMEMORY_LLM_TIMEOUT_MS
|
|
1063
|
+
# # for back-compat with v0.9.17. New configs should
|
|
1064
|
+
# # prefer the global AGENTMEMORY_LLM_TIMEOUT_MS below.
|
|
1065
|
+
# OPENAI_REASONING_EFFORT=none # Optional: "low" | "medium" | "high" | "none"
|
|
1066
|
+
# # Honored only by OpenAI's reasoning models (o1, o3,
|
|
1067
|
+
# # gpt-*-reasoning) and providers that mirror that
|
|
1068
|
+
# # schema (Ollama Cloud thinking models). Standard
|
|
1069
|
+
# # chat models reject this field with 400. Set to
|
|
1070
|
+
# # "none" for thinking models that return reasoning
|
|
1071
|
+
# # but no content.
|
|
1072
|
+
# OPENAI_API_KEY_FOR_LLM=false # Optional: set to false to skip OpenAI auto-detection
|
|
1073
|
+
# # for LLM (useful if you only want OpenAI for embeddings)
|
|
1050
1074
|
# Opt-in Claude-subscription fallback (spawns @anthropic-ai/claude-agent-sdk);
|
|
1051
1075
|
# leave OFF unless you understand the Stop-hook recursion risk (#149 follow-up):
|
|
1052
1076
|
# AGENTMEMORY_ALLOW_AGENT_SDK=true
|
|
@@ -1059,6 +1083,17 @@ Create `~/.agentmemory/.env`:
|
|
|
1059
1083
|
# OPENAI_EMBEDDING_MODEL=text-embedding-3-small
|
|
1060
1084
|
# OPENAI_EMBEDDING_DIMENSIONS=1536 # Required when the model is not in the known-models table
|
|
1061
1085
|
|
|
1086
|
+
# Outbound LLM / embedding timeout
|
|
1087
|
+
# AGENTMEMORY_LLM_TIMEOUT_MS=60000 # Default: 60 000 ms (60 s). Applies to every
|
|
1088
|
+
# raw-fetch provider (Gemini, OpenRouter, MiniMax,
|
|
1089
|
+
# OpenAI LLM, OpenAI/Cohere/Voyage/OpenRouter
|
|
1090
|
+
# embedding). For the OpenAI LLM path, the
|
|
1091
|
+
# OpenAI-scoped OPENAI_TIMEOUT_MS alias (above)
|
|
1092
|
+
# takes precedence when set, for back-compat
|
|
1093
|
+
# with v0.9.17.
|
|
1094
|
+
# Increase for slow networks or large batch calls;
|
|
1095
|
+
# decrease to fail-fast on rate-limit holds.
|
|
1096
|
+
|
|
1062
1097
|
# Search tuning
|
|
1063
1098
|
# BM25_WEIGHT=0.4
|
|
1064
1099
|
# VECTOR_WEIGHT=0.6
|
|
@@ -1128,7 +1163,7 @@ Create `~/.agentmemory/.env`:
|
|
|
1128
1163
|
|
|
1129
1164
|
<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>
|
|
1130
1165
|
|
|
1131
|
-
|
|
1166
|
+
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.
|
|
1132
1167
|
|
|
1133
1168
|
<details>
|
|
1134
1169
|
<summary>Key endpoints</summary>
|
|
@@ -1162,7 +1197,7 @@ Full endpoint list: [`src/triggers/api.ts`](src/triggers/api.ts)
|
|
|
1162
1197
|
```bash
|
|
1163
1198
|
npm run dev # Hot reload
|
|
1164
1199
|
npm run build # Production build
|
|
1165
|
-
npm test #
|
|
1200
|
+
npm test # 950+ tests
|
|
1166
1201
|
npm run test:integration # API tests (requires running services)
|
|
1167
1202
|
```
|
|
1168
1203
|
|
package/dist/.env.example
CHANGED
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
|
|
46
46
|
# MAX_TOKENS=4096 # Cap LLM completion tokens for compression / summarise calls
|
|
47
47
|
|
|
48
|
+
# Outbound LLM / embedding timeout — shared across every raw-fetch provider
|
|
49
|
+
# (Gemini, OpenRouter, MiniMax, OpenAI LLM, and OpenAI/Cohere/Voyage/OpenRouter
|
|
50
|
+
# embedding). The OpenAI LLM path also honours the OpenAI-scoped
|
|
51
|
+
# OPENAI_TIMEOUT_MS alias for back-compat with v0.9.17 (precedence).
|
|
52
|
+
# AGENTMEMORY_LLM_TIMEOUT_MS=60000 # Default: 60 000 ms (60 s)
|
|
53
|
+
|
|
48
54
|
# Opt-in Claude-subscription fallback (spawns @anthropic-ai/claude-agent-sdk
|
|
49
55
|
# child sessions). Off by default — the agent-sdk fallback can trigger
|
|
50
56
|
# Stop-hook recursion (#149 follow-up) when invoked from inside Claude Code.
|
package/dist/cli.mjs
CHANGED
|
@@ -1433,7 +1433,7 @@ function bootLog(msg) {
|
|
|
1433
1433
|
|
|
1434
1434
|
//#endregion
|
|
1435
1435
|
//#region src/version.ts
|
|
1436
|
-
const VERSION = "0.9.
|
|
1436
|
+
const VERSION = "0.9.18";
|
|
1437
1437
|
|
|
1438
1438
|
//#endregion
|
|
1439
1439
|
//#region src/cli.ts
|
|
@@ -2088,7 +2088,7 @@ async function main() {
|
|
|
2088
2088
|
if (firstRun || IS_RESET) await runOnboarding();
|
|
2089
2089
|
if (skipEngine) {
|
|
2090
2090
|
if (IS_VERBOSE) p.log.info("Skipping engine check (--no-engine)");
|
|
2091
|
-
await import("./src-
|
|
2091
|
+
await import("./src-C7vygXCj.mjs");
|
|
2092
2092
|
if (await waitForAgentmemoryReady(15e3)) {
|
|
2093
2093
|
const consoleState = await ensureIiiConsole();
|
|
2094
2094
|
await maybeOfferGlobalInstall();
|
|
@@ -2100,7 +2100,7 @@ async function main() {
|
|
|
2100
2100
|
if (IS_VERBOSE) p.log.success("iii-engine is running");
|
|
2101
2101
|
warnIfEngineVersionMismatch(whichBinary("iii") ?? fallbackIiiPaths().find((p) => existsSync(p)) ?? null);
|
|
2102
2102
|
adoptRunningEngine();
|
|
2103
|
-
await import("./src-
|
|
2103
|
+
await import("./src-C7vygXCj.mjs");
|
|
2104
2104
|
if (await waitForAgentmemoryReady(15e3)) {
|
|
2105
2105
|
const consoleState = await ensureIiiConsole();
|
|
2106
2106
|
await maybeOfferGlobalInstall();
|
|
@@ -2149,7 +2149,7 @@ async function main() {
|
|
|
2149
2149
|
process.exit(1);
|
|
2150
2150
|
}
|
|
2151
2151
|
s.stop("iii-engine is ready");
|
|
2152
|
-
await import("./src-
|
|
2152
|
+
await import("./src-C7vygXCj.mjs");
|
|
2153
2153
|
if (await waitForAgentmemoryReady(15e3)) {
|
|
2154
2154
|
const consoleState = await ensureIiiConsole();
|
|
2155
2155
|
await maybeOfferGlobalInstall();
|
|
@@ -2159,7 +2159,13 @@ async function main() {
|
|
|
2159
2159
|
}
|
|
2160
2160
|
async function apiFetch(base, path, timeoutMs = 5e3) {
|
|
2161
2161
|
try {
|
|
2162
|
-
|
|
2162
|
+
const headers = {};
|
|
2163
|
+
const secret = process.env["AGENTMEMORY_SECRET"];
|
|
2164
|
+
if (secret) headers["Authorization"] = `Bearer ${secret}`;
|
|
2165
|
+
return await (await fetch(`${base}/agentmemory/${path}`, {
|
|
2166
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
2167
|
+
headers
|
|
2168
|
+
})).json();
|
|
2163
2169
|
} catch {
|
|
2164
2170
|
return null;
|
|
2165
2171
|
}
|
|
@@ -3034,7 +3040,7 @@ async function runStop() {
|
|
|
3034
3040
|
p.outro("Stopped. Memories persisted to disk; restart anytime with: npx @agentmemory/agentmemory");
|
|
3035
3041
|
}
|
|
3036
3042
|
async function runMcp() {
|
|
3037
|
-
await import("./standalone-
|
|
3043
|
+
await import("./standalone-kg2TedgD.mjs");
|
|
3038
3044
|
}
|
|
3039
3045
|
async function runConnectCmd() {
|
|
3040
3046
|
const { runConnect } = await Promise.resolve().then(() => connect_exports);
|