@agentmemory/agentmemory 0.9.20 → 0.9.21
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 +2 -0
- package/README.md +16 -5
- package/dist/.env.example +2 -0
- package/dist/cli.mjs +24 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +416 -24
- package/dist/index.mjs.map +1 -1
- package/dist/{src-DPSaLB5-.mjs → src-D5arboxc.mjs} +414 -25
- package/dist/src-D5arboxc.mjs.map +1 -0
- package/dist/{standalone-DMLk7YxP.mjs → standalone-C7BgzzIN.mjs} +32 -8
- package/dist/standalone-C7BgzzIN.mjs.map +1 -0
- package/dist/standalone.d.mts.map +1 -1
- package/dist/standalone.mjs +31 -7
- package/dist/standalone.mjs.map +1 -1
- package/dist/{tools-registry-Dz8ssuMf.mjs → tools-registry-CRTWUFw9.mjs} +5 -2
- package/dist/tools-registry-CRTWUFw9.mjs.map +1 -0
- package/dist/viewer/index.html +57 -12
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.codex.json +6 -6
- package/plugin/hooks/hooks.json +12 -12
- package/plugin/opencode/README.md +229 -0
- package/plugin/opencode/agentmemory-capture.ts +662 -0
- package/plugin/opencode/commands/recall.md +19 -0
- package/plugin/opencode/commands/remember.md +19 -0
- package/plugin/opencode/plugin.json +12 -0
- package/dist/src-DPSaLB5-.mjs.map +0 -1
- package/dist/standalone-DMLk7YxP.mjs.map +0 -1
- package/dist/tools-registry-Dz8ssuMf.mjs.map +0 -1
package/.env.example
CHANGED
|
@@ -98,6 +98,8 @@
|
|
|
98
98
|
# AGENTMEMORY_GRAPH_WEIGHT=0.2 # Graph traversal bonus on smart-search ranking
|
|
99
99
|
# TOKEN_BUDGET=2000 # Max tokens injected via mem::context per session
|
|
100
100
|
# MAX_OBS_PER_SESSION=500 # Per-session observation cap before consolidation kicks in
|
|
101
|
+
# SUMMARIZE_CHUNK_SIZE=400 # When mem::summarize sees a session larger than this, it chunks observations and map-reduces (chunk-summarize → reduce-merge) to stay within the LLM's context window. Default 400 ≈ 50k tokens per chunk at ~110 tok/obs. Native sessions are capped by MAX_OBS_PER_SESSION; chunking primarily matters for bulk-imported jsonl sessions, which bypass that cap.
|
|
102
|
+
# SUMMARIZE_CHUNK_CONCURRENCY=6 # Parallel chunk LLM calls during chunked summarize. Default 6 fits ~100-chunk sessions under iii's 180s function-invocation timeout at typical ~8s/call. High-throughput providers (Novita, DeepInfra, DeepSeek) commonly allow 100+ concurrent — bump this for very large imported sessions.
|
|
101
103
|
|
|
102
104
|
# -----------------------------------------------------------------------------
|
|
103
105
|
# 5. Behaviour flags
|
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
<p align="center">
|
|
36
36
|
<a href="https://www.npmjs.com/package/@agentmemory/agentmemory"><img src="https://img.shields.io/npm/v/@agentmemory/agentmemory?color=CB3837&label=npm&style=for-the-badge&logo=npm" alt="npm version" /></a>
|
|
37
|
+
<a href="https://www.npmjs.com/package/@agentmemory/agentmemory"><img src="https://img.shields.io/npm/dm/@agentmemory/agentmemory?color=CB3837&label=downloads&style=for-the-badge&logo=npm" alt="npm downloads" /></a>
|
|
37
38
|
<a href="https://github.com/rohitg00/agentmemory/actions"><img src="https://img.shields.io/github/actions/workflow/status/rohitg00/agentmemory/ci.yml?label=tests&style=for-the-badge&logo=github" alt="CI" /></a>
|
|
38
39
|
<a href="https://github.com/rohitg00/agentmemory/blob/main/LICENSE"><img src="https://img.shields.io/github/license/rohitg00/agentmemory?color=blue&style=for-the-badge" alt="License" /></a>
|
|
39
40
|
<a href="https://github.com/rohitg00/agentmemory/stargazers"><img src="https://img.shields.io/github/stars/rohitg00/agentmemory?style=for-the-badge&color=yellow&logo=github" alt="Stars" /></a>
|
|
@@ -141,7 +142,7 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen
|
|
|
141
142
|
<td align="center" width="12.5%">
|
|
142
143
|
<a href="https://github.com/opencode-ai/opencode"><img src="https://github.com/opencode-ai.png?size=120" alt="OpenCode" width="48" height="48" /></a><br/>
|
|
143
144
|
<strong>OpenCode</strong><br/>
|
|
144
|
-
<sub>MCP
|
|
145
|
+
<sub>22 hooks + MCP + plugin</sub>
|
|
145
146
|
</td>
|
|
146
147
|
<td align="center" width="12.5%">
|
|
147
148
|
<a href="https://github.com/cline/cline"><img src="https://github.com/cline.png?size=120" alt="Cline" width="48" height="48" /></a><br/>
|
|
@@ -475,12 +476,13 @@ The agentmemory entry is the **same MCP server block** across every host that us
|
|
|
475
476
|
"command": "npx",
|
|
476
477
|
"args": ["-y", "@agentmemory/mcp"],
|
|
477
478
|
"env": {
|
|
478
|
-
"AGENTMEMORY_URL": "
|
|
479
|
+
"AGENTMEMORY_URL": "${AGENTMEMORY_URL}",
|
|
480
|
+
"AGENTMEMORY_SECRET": "${AGENTMEMORY_SECRET}"
|
|
479
481
|
}
|
|
480
482
|
}
|
|
481
483
|
```
|
|
482
484
|
|
|
483
|
-
**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": { ... } }`.
|
|
485
|
+
**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.
|
|
484
486
|
|
|
485
487
|
| Agent | Config file | Notes |
|
|
486
488
|
|---|---|---|
|
|
@@ -492,7 +494,8 @@ The agentmemory entry is the **same MCP server block** across every host that us
|
|
|
492
494
|
| **OpenClaw** | OpenClaw MCP config | Same `mcpServers` block, or use the deeper [memory plugin](integrations/openclaw/). |
|
|
493
495
|
| **Codex CLI (MCP only)** | `.codex/config.toml` | TOML shape: `codex mcp add agentmemory -- npx -y @agentmemory/mcp`, or add `[mcp_servers.agentmemory]` manually. |
|
|
494
496
|
| **Codex CLI (full plugin)** | Codex plugin marketplace | `codex plugin marketplace add rohitg00/agentmemory` then `codex plugin install agentmemory`. Registers MCP + 6 lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, Stop) + 4 skills. |
|
|
495
|
-
| **OpenCode** | `opencode.json` | Different shape — top-level `mcp` key, command as array: `{"mcp": {"agentmemory": {"type": "local", "command": ["npx", "-y", "@agentmemory/mcp"], "enabled": true}}}`. |
|
|
497
|
+
| **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}}}`. |
|
|
498
|
+
| **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. |
|
|
496
499
|
| **pi** | `~/.pi/agent/extensions/agentmemory` | Copy [`integrations/pi`](integrations/pi/) and restart pi. |
|
|
497
500
|
| **Hermes Agent** | `~/.hermes/config.yaml` | Use the deeper [memory provider plugin](integrations/hermes/) with `memory.provider: agentmemory`. |
|
|
498
501
|
| **Goose** | Goose MCP settings UI | Same `mcpServers` block. |
|
|
@@ -890,10 +893,18 @@ OpenCode (`opencode.json`):
|
|
|
890
893
|
"command": ["npx", "-y", "@agentmemory/mcp"],
|
|
891
894
|
"enabled": true
|
|
892
895
|
}
|
|
893
|
-
}
|
|
896
|
+
},
|
|
897
|
+
"plugin": ["./plugins/agentmemory-capture.ts"]
|
|
894
898
|
}
|
|
895
899
|
```
|
|
896
900
|
|
|
901
|
+
Copy the plugin file from the repo:
|
|
902
|
+
```bash
|
|
903
|
+
mkdir -p ~/.config/opencode/plugins
|
|
904
|
+
cp plugin/opencode/agentmemory-capture.ts ~/.config/opencode/plugins/
|
|
905
|
+
cp plugin/opencode/commands/*.md ~/.config/opencode/commands/
|
|
906
|
+
```
|
|
907
|
+
|
|
897
908
|
---
|
|
898
909
|
|
|
899
910
|
<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>
|
package/dist/.env.example
CHANGED
|
@@ -98,6 +98,8 @@
|
|
|
98
98
|
# AGENTMEMORY_GRAPH_WEIGHT=0.2 # Graph traversal bonus on smart-search ranking
|
|
99
99
|
# TOKEN_BUDGET=2000 # Max tokens injected via mem::context per session
|
|
100
100
|
# MAX_OBS_PER_SESSION=500 # Per-session observation cap before consolidation kicks in
|
|
101
|
+
# SUMMARIZE_CHUNK_SIZE=400 # When mem::summarize sees a session larger than this, it chunks observations and map-reduces (chunk-summarize → reduce-merge) to stay within the LLM's context window. Default 400 ≈ 50k tokens per chunk at ~110 tok/obs. Native sessions are capped by MAX_OBS_PER_SESSION; chunking primarily matters for bulk-imported jsonl sessions, which bypass that cap.
|
|
102
|
+
# SUMMARIZE_CHUNK_CONCURRENCY=6 # Parallel chunk LLM calls during chunked summarize. Default 6 fits ~100-chunk sessions under iii's 180s function-invocation timeout at typical ~8s/call. High-throughput providers (Novita, DeepInfra, DeepSeek) commonly allow 100+ concurrent — bump this for very large imported sessions.
|
|
101
103
|
|
|
102
104
|
# -----------------------------------------------------------------------------
|
|
103
105
|
# 5. Behaviour flags
|
package/dist/cli.mjs
CHANGED
|
@@ -1263,7 +1263,25 @@ async function seedEnvFile(provider) {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
return target;
|
|
1265
1265
|
}
|
|
1266
|
+
function shouldSkipInteractiveOnboarding() {
|
|
1267
|
+
const ci = process.env["CI"];
|
|
1268
|
+
return process.stdin.isTTY !== true || process.stdout.isTTY !== true || ci !== void 0 && ci !== "" && ci !== "0" && ci.toLowerCase() !== "false";
|
|
1269
|
+
}
|
|
1270
|
+
function writeDefaultOnboardingPrefs() {
|
|
1271
|
+
writePrefs({
|
|
1272
|
+
lastAgent: null,
|
|
1273
|
+
lastAgents: [],
|
|
1274
|
+
lastProvider: null,
|
|
1275
|
+
skipSplash: true,
|
|
1276
|
+
firstRunAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1277
|
+
});
|
|
1278
|
+
return {
|
|
1279
|
+
agents: [],
|
|
1280
|
+
provider: null
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1266
1283
|
async function runOnboarding() {
|
|
1284
|
+
if (shouldSkipInteractiveOnboarding()) return writeDefaultOnboardingPrefs();
|
|
1267
1285
|
p.note([
|
|
1268
1286
|
"Welcome to agentmemory.",
|
|
1269
1287
|
"",
|
|
@@ -1437,7 +1455,7 @@ function bootLog(msg) {
|
|
|
1437
1455
|
|
|
1438
1456
|
//#endregion
|
|
1439
1457
|
//#region src/version.ts
|
|
1440
|
-
const VERSION = "0.9.
|
|
1458
|
+
const VERSION = "0.9.21";
|
|
1441
1459
|
|
|
1442
1460
|
//#endregion
|
|
1443
1461
|
//#region src/cli.ts
|
|
@@ -1752,7 +1770,7 @@ function detectIiiConsole() {
|
|
|
1752
1770
|
};
|
|
1753
1771
|
return { kind: "missing" };
|
|
1754
1772
|
}
|
|
1755
|
-
const III_CONSOLE_INSTALL_CMD = "curl -fsSL https://install.iii.dev/console/main/install.sh |
|
|
1773
|
+
const III_CONSOLE_INSTALL_CMD = "curl -fsSL https://install.iii.dev/console/main/install.sh | sh";
|
|
1756
1774
|
async function ensureIiiConsole() {
|
|
1757
1775
|
const state = detectIiiConsole();
|
|
1758
1776
|
if (state.kind === "installed") return state;
|
|
@@ -2092,7 +2110,7 @@ async function main() {
|
|
|
2092
2110
|
if (firstRun || IS_RESET) await runOnboarding();
|
|
2093
2111
|
if (skipEngine) {
|
|
2094
2112
|
if (IS_VERBOSE) p.log.info("Skipping engine check (--no-engine)");
|
|
2095
|
-
await import("./src-
|
|
2113
|
+
await import("./src-D5arboxc.mjs");
|
|
2096
2114
|
if (await waitForAgentmemoryReady(15e3)) {
|
|
2097
2115
|
const consoleState = await ensureIiiConsole();
|
|
2098
2116
|
await maybeOfferGlobalInstall();
|
|
@@ -2104,7 +2122,7 @@ async function main() {
|
|
|
2104
2122
|
if (IS_VERBOSE) p.log.success("iii-engine is running");
|
|
2105
2123
|
warnIfEngineVersionMismatch(whichBinary("iii") ?? fallbackIiiPaths().find((p) => existsSync(p)) ?? null);
|
|
2106
2124
|
adoptRunningEngine();
|
|
2107
|
-
await import("./src-
|
|
2125
|
+
await import("./src-D5arboxc.mjs");
|
|
2108
2126
|
if (await waitForAgentmemoryReady(15e3)) {
|
|
2109
2127
|
const consoleState = await ensureIiiConsole();
|
|
2110
2128
|
await maybeOfferGlobalInstall();
|
|
@@ -2153,7 +2171,7 @@ async function main() {
|
|
|
2153
2171
|
process.exit(1);
|
|
2154
2172
|
}
|
|
2155
2173
|
s.stop("iii-engine is ready");
|
|
2156
|
-
await import("./src-
|
|
2174
|
+
await import("./src-D5arboxc.mjs");
|
|
2157
2175
|
if (await waitForAgentmemoryReady(15e3)) {
|
|
2158
2176
|
const consoleState = await ensureIiiConsole();
|
|
2159
2177
|
await maybeOfferGlobalInstall();
|
|
@@ -3044,7 +3062,7 @@ async function runStop() {
|
|
|
3044
3062
|
p.outro("Stopped. Memories persisted to disk; restart anytime with: npx @agentmemory/agentmemory");
|
|
3045
3063
|
}
|
|
3046
3064
|
async function runMcp() {
|
|
3047
|
-
await import("./standalone-
|
|
3065
|
+
await import("./standalone-C7BgzzIN.mjs");
|
|
3048
3066
|
}
|
|
3049
3067
|
async function runConnectCmd() {
|
|
3050
3068
|
const { runConnect } = await Promise.resolve().then(() => connect_exports);
|