@agentmemory/agentmemory 0.7.7 → 0.7.9

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 CHANGED
@@ -3,8 +3,8 @@
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
- <strong>Persistent memory for AI coding agents.</strong><br/>
7
- Powered by <a href="https://iii.dev">iii-engine</a>.
6
+ <strong>Your coding agent remembers everything. No more re-explaining.</strong><br/>
7
+ Persistent memory for Claude Code, Cursor, Gemini CLI, OpenCode, and any MCP client.
8
8
  </p>
9
9
 
10
10
  <p align="center">
@@ -26,9 +26,11 @@
26
26
 
27
27
  ---
28
28
 
29
- Every AI coding agent has the same blind spot. Session ends, memory vanishes. You re-explain architecture. You re-discover bugs. You re-teach preferences. Built-in memory files like CLAUDE.md and .cursorrules are 200-line sticky notes that overflow and go stale. agentmemory replaces that with a searchable, versioned, cross-agent database 43 MCP tools, triple-stream retrieval (BM25 + vector + knowledge graph), 4-tier memory consolidation, provenance-tracked citations, and cascading staleness so retired facts never pollute your context again. One instance serves Claude Code, Cursor, Codex, Windsurf, and any MCP client simultaneously. 627 tests. Zero external DB dependencies.
29
+ 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.
30
30
 
31
- The result is measurable. On 240 real observations across 30 sessions, agentmemory hits 64% Recall@10 and perfect MRR while using 92% fewer tokens than dumping everything into context. When an agent searches "database performance optimization," it finds the N+1 fix you made three weeks ago something keyword grep literally cannot do. Memories version automatically, supersede each other, propagate staleness to related graph nodes, and sync across agent instances via P2P mesh. Your agents stop repeating mistakes. Your context stays clean. Your sessions start fast.
31
+ **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. No re-explaining. No copy-pasting. The agent just *knows*.
32
+
33
+ **95.2% retrieval accuracy** on [LongMemEval](https://arxiv.org/abs/2410.10813) (ICLR 2025). 43 MCP tools. 12 hooks. Real-time viewer. Works with Claude Code, Cursor, Gemini CLI, OpenCode, and any MCP client. 646 tests. Zero external DB dependencies.
32
34
 
33
35
  ```bash
34
36
  npx @agentmemory/agentmemory # installs iii-engine if missing, starts everything
@@ -38,7 +40,7 @@ npx @agentmemory/agentmemory # installs iii-engine if missing, starts everythi
38
40
 
39
41
  ## Why agentmemory
40
42
 
41
- AI coding agents forget everything between sessions. You explain the same architecture, re-discover the same patterns, and re-learn the same preferences every time. agentmemory fixes that.
43
+ Every coding agent forgets everything when the session ends. You waste the first 5 minutes of every session re-explaining your stack, your conventions, your recent decisions. agentmemory runs in the background and eliminates that entirely.
42
44
 
43
45
  ```
44
46
  Session 1: "Add auth to the API"
@@ -47,15 +49,14 @@ Session 1: "Add auth to the API"
47
49
  Session ends -> observations compressed into structured memory
48
50
 
49
51
  Session 2: "Now add rate limiting"
50
- agentmemory injects context from Session 1:
52
+ Agent already knows:
51
53
  - Auth uses JWT middleware in src/middleware/auth.ts
52
54
  - Tests in test/auth.test.ts cover token validation
53
- - Decision: chose jose over jsonwebtoken for Edge compatibility
54
- Agent starts with full project awareness
55
+ - You chose jose over jsonwebtoken for Edge compatibility
56
+ - The rate limit discussion from last week's debugging session
57
+ Zero re-explaining. Starts working immediately.
55
58
  ```
56
59
 
57
- No manual notes. No copy-pasting. The agent just *knows*.
58
-
59
60
  ### What it gives you
60
61
 
61
62
  | Capability | What it does |
@@ -97,14 +98,25 @@ agentmemory is the searchable database behind the sticky notes.
97
98
  | Multi-agent coordination | Impossible | Leases, signals, actions, routines |
98
99
  | Cross-agent sync | No | P2P mesh (7 scopes: memories, actions, semantic, procedural, relations, graph) |
99
100
  | Memory trust | No verification | Citation chain back to source observations with confidence scores |
100
- | Semantic search | No (keyword grep) | Yes (Recall@10: 64% vs 56% for grep) |
101
+ | Semantic search | No (keyword grep) | Yes (95.2% R@5 on LongMemEval-S) |
101
102
  | Memory lifecycle | Manual pruning | Ebbinghaus decay + tiered eviction |
102
103
  | Knowledge graph | No | Entity extraction + temporal versioning |
103
104
  | Observability | Read files manually | Real-time viewer on :3113 |
104
105
 
105
106
  ### Benchmarks (measured, not projected)
106
107
 
107
- Evaluated on 240 real-world coding observations across 30 sessions with 20 labeled queries:
108
+ #### LongMemEval-S (ICLR 2025, 500 questions)
109
+
110
+ Evaluated on [LongMemEval-S](https://arxiv.org/abs/2410.10813), an academic benchmark with 500 questions across ~48 sessions per question (~115K tokens). Same dataset and metric (`recall_any@K`) used by other memory systems.
111
+
112
+ | System | R@5 | R@10 | NDCG@10 | MRR |
113
+ |---|---|---|---|---|
114
+ | **agentmemory BM25+Vector** | **95.2%** | **98.6%** | **87.9%** | **88.2%** |
115
+ | agentmemory BM25-only | 86.2% | 94.6% | 73.0% | 71.5% |
116
+
117
+ These are retrieval recall scores (not end-to-end QA accuracy). Embedding model: `all-MiniLM-L6-v2` (local, no API key).
118
+
119
+ #### Internal benchmark (240 observations, 20 queries)
108
120
 
109
121
  | System | Recall@10 | NDCG@10 | MRR | Tokens/query |
110
122
  |---|---|---|---|---|
@@ -112,9 +124,9 @@ Evaluated on 240 real-world coding observations across 30 sessions with 20 label
112
124
  | agentmemory BM25 (stemmed + synonyms) | 55.9% | 82.7% | 95.5% | 1,571 |
113
125
  | agentmemory + Xenova embeddings | **64.1%** | **94.9%** | **100.0%** | **1,571** |
114
126
 
115
- With real embeddings, agentmemory finds "N+1 query fix" when you search "database performance optimization" — something keyword matching literally cannot do.
127
+ agentmemory finds "N+1 query fix" when you search "database performance optimization" — something keyword matching literally cannot do.
116
128
 
117
- Full benchmark reports: [`benchmark/QUALITY.md`](benchmark/QUALITY.md), [`benchmark/SCALE.md`](benchmark/SCALE.md), [`benchmark/REAL-EMBEDDINGS.md`](benchmark/REAL-EMBEDDINGS.md)
129
+ Full benchmark reports: [`benchmark/LONGMEMEVAL.md`](benchmark/LONGMEMEVAL.md), [`benchmark/QUALITY.md`](benchmark/QUALITY.md), [`benchmark/SCALE.md`](benchmark/SCALE.md), [`benchmark/REAL-EMBEDDINGS.md`](benchmark/REAL-EMBEDDINGS.md)
118
130
 
119
131
  ## Supported Agents
120
132
 
@@ -135,9 +147,10 @@ Any agent that connects to MCP servers can use agentmemory's 43 tools, 6 resourc
135
147
 
136
148
  | Agent | How to connect |
137
149
  |---|---|
150
+ | **Cursor** | Add MCP server in settings or `~/.cursor/mcp.json` |
138
151
  | **Claude Desktop** | Add to `claude_desktop_config.json` MCP servers |
139
- | **Cursor** | Add MCP server in settings |
140
- | **Windsurf** | MCP server configuration |
152
+ | **Gemini CLI** | `gemini mcp add agentmemory -- npx agentmemory-mcp` |
153
+ | **OpenCode** | Add to `.opencode/config.json` MCP servers |
141
154
  | **Cline / Continue** | MCP server configuration |
142
155
  | **Any MCP client** | Point to `http://localhost:3111/agentmemory/mcp/*` |
143
156
 
@@ -160,13 +173,30 @@ GET /agentmemory/profile # Get project intelligence
160
173
  |---|---|
161
174
  | Claude Code user | Plugin install (hooks + MCP + skills) |
162
175
  | Building a custom agent with Claude SDK | AgentSDKProvider (zero config) |
163
- | Using Cursor, Windsurf, or any MCP client | MCP server (41 tools + 6 resources + 3 prompts) |
176
+ | Using Cursor, Gemini CLI, OpenCode, or any MCP client | MCP server (43 tools + 6 resources + 3 prompts) |
164
177
  | Building your own agent framework | REST API (103 endpoints) |
165
178
  | Sharing memory across multiple agents | All agents point to the same iii-engine instance |
166
179
 
167
180
  ## Quick Start
168
181
 
169
- ### 1. Install the Plugin (Claude Code)
182
+ ### 1. Start agentmemory
183
+
184
+ ```bash
185
+ npx @agentmemory/agentmemory
186
+ ```
187
+
188
+ This auto-installs iii-engine if missing, starts it, and runs the worker. One command.
189
+
190
+ Or from source:
191
+
192
+ ```bash
193
+ git clone https://github.com/rohitg00/agentmemory.git && cd agentmemory
194
+ npm install && npm run build && npm start
195
+ ```
196
+
197
+ ### 2. Connect your agent
198
+
199
+ **Claude Code (plugin — hooks + MCP + skills):**
170
200
 
171
201
  ```bash
172
202
  /plugin marketplace add rohitg00/agentmemory
@@ -175,35 +205,66 @@ GET /agentmemory/profile # Get project intelligence
175
205
 
176
206
  All 12 hooks, 4 skills, and MCP server are registered automatically.
177
207
 
178
- ### 2. Start agentmemory
208
+ **Cursor / Claude Desktop / Cline / any MCP client:**
209
+
210
+ Add to your MCP config (e.g. `~/.cursor/mcp.json`, `claude_desktop_config.json`):
211
+
212
+ ```json
213
+ {
214
+ "mcpServers": {
215
+ "agentmemory": {
216
+ "command": "npx",
217
+ "args": ["agentmemory-mcp"]
218
+ }
219
+ }
220
+ }
221
+ ```
222
+
223
+ **Gemini CLI:**
179
224
 
180
225
  ```bash
181
- npx @agentmemory/agentmemory
226
+ gemini mcp add agentmemory -- npx agentmemory-mcp
182
227
  ```
183
228
 
184
- This auto-installs iii-engine if missing, starts it, and runs the worker. One command.
229
+ **OpenCode:**
185
230
 
186
- Or from source:
231
+ Add to `.opencode/config.json`:
232
+
233
+ ```json
234
+ {
235
+ "mcpServers": {
236
+ "agentmemory": {
237
+ "command": "npx",
238
+ "args": ["agentmemory-mcp"]
239
+ }
240
+ }
241
+ }
242
+ ```
243
+
244
+ **REST API (any agent, any language):**
187
245
 
188
246
  ```bash
189
- git clone https://github.com/rohitg00/agentmemory.git && cd agentmemory
190
- npm install && npm run build && npm start
247
+ curl -X POST http://localhost:3111/agentmemory/remember \
248
+ -H "Content-Type: application/json" \
249
+ -d '{"content": "Always use jose for JWT on Edge", "type": "preference"}'
250
+
251
+ curl -X POST http://localhost:3111/agentmemory/smart-search \
252
+ -H "Content-Type: application/json" \
253
+ -d '{"query": "JWT authentication"}'
191
254
  ```
192
255
 
193
256
  ### 3. Verify
194
257
 
195
258
  ```bash
196
259
  curl http://localhost:3111/agentmemory/health
197
-
198
- # Real-time viewer (auto-starts on port 3113)
199
- open http://localhost:3113
260
+ open http://localhost:3113 # Real-time viewer
200
261
  ```
201
262
 
202
263
  ```json
203
264
  {
204
265
  "status": "healthy",
205
266
  "service": "agentmemory",
206
- "version": "0.7.4",
267
+ "version": "0.7.7",
207
268
  "health": {
208
269
  "memory": { "heapUsed": 42000000, "heapTotal": 67000000 },
209
270
  "cpu": { "percent": 2.1 },
@@ -424,7 +485,7 @@ Collects every 30 seconds: heap usage, CPU percentage (delta sampling), event lo
424
485
 
425
486
  ## MCP Server
426
487
 
427
- ### Tools (38)
488
+ ### Tools (43)
428
489
 
429
490
  | Tool | Description |
430
491
  |------|-------------|
@@ -488,7 +549,7 @@ Collects every 30 seconds: heap usage, CPU percentage (delta sampling), event lo
488
549
 
489
550
  ### Standalone MCP Server
490
551
 
491
- Run agentmemory as a standalone MCP server for any MCP-compatible agent (Cursor, Codex, Gemini CLI, Windsurf):
552
+ Run agentmemory as a standalone MCP server for any MCP-compatible agent (Cursor, Gemini CLI, OpenCode, Claude Desktop, Cline):
492
553
 
493
554
  ```bash
494
555
  npx agentmemory-mcp
@@ -616,7 +677,7 @@ ANTHROPIC_API_KEY=sk-ant-...
616
677
  # Obsidian Export (v0.7.0)
617
678
  # OBSIDIAN_AUTO_EXPORT=false
618
679
 
619
- # MCP Tool Visibility (v0.7.0) — "core" (7 tools) or "all" (41 tools)
680
+ # MCP Tool Visibility (v0.7.0) — "core" (7 tools) or "all" (43 tools)
620
681
  # AGENTMEMORY_TOOLS=core
621
682
 
622
683
  # Team Memory (v0.5.0)
@@ -724,9 +785,9 @@ agentmemory is built on iii-engine's three primitives:
724
785
  | Prometheus / Grafana | iii OTEL + built-in health monitor |
725
786
  | Redis (circuit breaker) | In-process circuit breaker + fallback chain |
726
787
 
727
- **113 source files. ~20,000 LOC. 627 tests. Zero external DB dependencies.**
788
+ **118 source files. ~21,800 LOC. 646 tests. Zero external DB dependencies.**
728
789
 
729
- ### Functions (89 mem:: functions)
790
+ ### Functions (123 mem:: functions)
730
791
 
731
792
  | Category | Functions | Purpose |
732
793
  |----------|-----------|---------|
@@ -808,7 +869,7 @@ agentmemory is built on iii-engine's three primitives:
808
869
  ```bash
809
870
  npm run dev # Hot reload
810
871
  npm run build # Production build (~425KB)
811
- npm test # Unit tests (627 tests, ~1.5s)
872
+ npm test # Unit tests (646 tests, ~1.7s)
812
873
  npm run test:integration # API tests (requires running services)
813
874
  ```
814
875
 
package/dist/cli.mjs CHANGED
@@ -160,12 +160,12 @@ async function main() {
160
160
  p.intro("agentmemory");
161
161
  if (skipEngine) {
162
162
  p.log.info("Skipping engine check (--no-engine)");
163
- await import("./src-C_TC9frp.mjs");
163
+ await import("./src-DNbB7fd7.mjs");
164
164
  return;
165
165
  }
166
166
  if (await isEngineRunning()) {
167
167
  p.log.success("iii-engine is running");
168
- await import("./src-C_TC9frp.mjs");
168
+ await import("./src-DNbB7fd7.mjs");
169
169
  return;
170
170
  }
171
171
  if (!await startEngine()) {
@@ -193,7 +193,7 @@ async function main() {
193
193
  process.exit(1);
194
194
  }
195
195
  s.stop("iii-engine is ready");
196
- await import("./src-C_TC9frp.mjs");
196
+ await import("./src-DNbB7fd7.mjs");
197
197
  }
198
198
  main().catch((err) => {
199
199
  p.log.error(err instanceof Error ? err.message : String(err));
package/dist/index.mjs CHANGED
@@ -3805,7 +3805,7 @@ function registerAutoForgetFunction(sdk, kv) {
3805
3805
 
3806
3806
  //#endregion
3807
3807
  //#region src/version.ts
3808
- const VERSION = "0.7.7";
3808
+ const VERSION = "0.7.9";
3809
3809
 
3810
3810
  //#endregion
3811
3811
  //#region src/functions/export-import.ts
@@ -3909,7 +3909,8 @@ function registerExportImportFunction(sdk, kv) {
3909
3909
  "0.7.4",
3910
3910
  "0.7.5",
3911
3911
  "0.7.6",
3912
- "0.7.7"
3912
+ "0.7.7",
3913
+ "0.7.9"
3913
3914
  ]).has(importData.version)) return {
3914
3915
  success: false,
3915
3916
  error: `Unsupported export version: ${importData.version}`