Skip to content

#1 Persistent memory for AI coding agents based on real-world benchmarks

fix: simplify review — temporal-graph name, test precision, stale counts

Rohit Ghumare5510e94e39a6
diff --git a/AGENTS.md b/AGENTS.md
index 223eea5e..6b34419a 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -98,7 +98,7 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
## Testing
-- All tests must pass before PR: `npm test` (573+ tests)
+- All tests must pass before PR: `npm test` (613+ tests)
- Mock pattern: `vi.mock("iii-sdk")` with mock `sdk.trigger`, `kv.get/set/list`
- Test files go in `test/` with `.test.ts` extension
- Follow existing patterns in `test/crystallize.test.ts` for function tests
@@ -110,4 +110,4 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
- 6 MCP resources, 3 MCP prompts
- 12 hooks, 4 skills
- 50+ iii functions
-- 581 tests
+- 614 tests
diff --git a/README.md b/README.md
index 878fb43a..db31f6b0 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@
---
-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 — 41 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. 581 tests. Zero external DB dependencies.
+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 — 41 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. 614 tests. Zero external DB dependencies.
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.
@@ -724,7 +724,7 @@ agentmemory is built on iii-engine's three primitives:
| Prometheus / Grafana | iii OTEL + built-in health monitor |
| Redis (circuit breaker) | In-process circuit breaker + fallback chain |
-**113 source files. ~20,000 LOC. 581 tests. Zero external DB dependencies.**
+**113 source files. ~20,000 LOC. 614 tests. Zero external DB dependencies.**
### Functions (89 mem:: functions)
@@ -740,7 +740,7 @@ agentmemory is built on iii-engine's three primitives:
| | `consolidate`, `consolidate-pipeline` | Merge duplicates, 4-tier consolidation (working→episodic→semantic→procedural) |
| | `verify`, `cascade-update` | Citation chain provenance, staleness propagation |
| **Knowledge Graph** | `graph-extract`, `graph-query`, `graph-stats` | LLM entity extraction, BFS traversal, statistics |
-| | `temporal-graph` | Append-only versioned edges with point-in-time queries |
+| | `temporal-graph-extract`, `temporal-query` | Temporal knowledge extraction + point-in-time queries |
| **Relationships** | `relate`, `get-related`, `timeline`, `profile` | Memory relations, chronological view, project profiles |
| **Claude Bridge** | `claude-bridge-read`, `claude-bridge-sync` | Bi-directional sync with MEMORY.md |
| **Actions** | `action-create`, `action-update`, `action-get`, `action-list` | Dependency-aware work items with typed edges |
@@ -808,7 +808,7 @@ agentmemory is built on iii-engine's three primitives:
```bash
npm run dev # Hot reload
npm run build # Production build (~425KB)
-npm test # Unit tests (581 tests, ~1.5s)
+npm test # Unit tests (614 tests, ~1.5s)
npm run test:integration # API tests (requires running services)
```
diff --git a/test/lessons.test.ts b/test/lessons.test.ts
index 9cf673b4..ce85dfaa 100644
--- a/test/lessons.test.ts
+++ b/test/lessons.test.ts
@@ -246,7 +246,7 @@ describe("Lessons", () => {
expect(result.success).toBe(true);
expect(result.lesson.reinforcements).toBe(1);
- expect(result.lesson.confidence).toBeCloseTo(0.55, 1);
+ expect(result.lesson.confidence).toBeCloseTo(0.55, 2);
expect(result.lesson.lastReinforcedAt).toBeDefined();
});
@@ -344,7 +344,7 @@ describe("Lessons", () => {
await sdk.trigger("mem::lesson-decay-sweep", {});
const after = await kv.get<Lesson>("mem:lessons", saved.lesson.id);
- expect(after!.confidence).toBeCloseTo(0.55, 1);
+ expect(after!.confidence).toBeCloseTo(0.55, 2);
expect(after!.confidence).toBeGreaterThan(0.4);
});
});
diff --git a/test/obsidian-export.test.ts b/test/obsidian-export.test.ts
index a7ce709f..7da338da 100644
--- a/test/obsidian-export.test.ts
+++ b/test/obsidian-export.test.ts
@@ -273,4 +273,16 @@ describe("Obsidian Export", () => {
expect(moc).toContain("[[crystals/crys_001|");
expect(moc).toContain("[[sessions/ses_001|");
});
+
+ it("returns undefined errors on success", async () => {
+ await kv.set("mem:memories", "mem_001", makeMemory("mem_001"));
+
+ const result = (await sdk.trigger("mem::obsidian-export", {})) as {
+ success: boolean;
+ errors?: unknown[];
+ };
+
+ expect(result.success).toBe(true);
+ expect(result.errors).toBeUndefined();
+ });
});