@aman_asmuei/amem 0.22.0 → 0.23.0
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 +249 -123
- package/dist/cli.js +12 -3
- package/dist/cli.js.map +1 -1
- package/dist/dashboard.js +436 -129
- package/dist/dashboard.js.map +1 -1
- package/dist/hooks.js +20 -18
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +29 -10
- package/dist/index.js.map +1 -1
- package/dist/tools/admin.js +0 -2
- package/dist/tools/admin.js.map +1 -1
- package/dist/tools/log.js +1 -1
- package/dist/tools/log.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,117 +1,74 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/logo.png" alt="amem" width="
|
|
2
|
+
<img src="assets/logo.png" alt="amem" width="140" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">amem</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>
|
|
8
|
+
<strong>The memory layer for AI coding tools.</strong><br/>
|
|
9
|
+
<sub>Tell your AI once — it remembers everywhere.</sub>
|
|
9
10
|
</p>
|
|
10
11
|
|
|
11
12
|
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/@aman_asmuei/amem"><img src="https://img.shields.io/npm/v/@aman_asmuei/amem?style=
|
|
13
|
-
&
|
|
14
|
-
<a href="https://github.com/amanasmuei/amem/
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
<img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?style=for-the-badge" alt="MCP compatible" />
|
|
19
|
-
|
|
20
|
-
<img src="https://img.shields.io/badge/node-%E2%89%A518-brightgreen?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js 18+" />
|
|
21
|
-
</p>
|
|
22
|
-
|
|
23
|
-
<p align="center">
|
|
24
|
-
Tell your AI something once — it remembers across Claude Code, GitHub Copilot, Cursor, Windsurf, and any MCP client.<br/>
|
|
25
|
-
Local-first · Semantic search · Knowledge graph · Self-evolving · Privacy-aware · No cloud required.
|
|
13
|
+
<a href="https://www.npmjs.com/package/@aman_asmuei/amem"><img src="https://img.shields.io/npm/v/@aman_asmuei/amem?style=flat-square&logo=npm&logoColor=white&color=cb3837" alt="npm" /></a>
|
|
14
|
+
<a href="https://github.com/amanasmuei/amem/actions"><img src="https://img.shields.io/github/actions/workflow/status/amanasmuei/amem/ci.yml?style=flat-square&logo=github&label=CI" alt="CI" /></a>
|
|
15
|
+
<a href="https://github.com/amanasmuei/amem/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT" /></a>
|
|
16
|
+
<img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?style=flat-square" alt="MCP" />
|
|
17
|
+
<img src="https://img.shields.io/badge/node-%E2%89%A518-brightgreen?style=flat-square&logo=node.js&logoColor=white" alt="Node 18+" />
|
|
26
18
|
</p>
|
|
27
19
|
|
|
28
20
|
<br/>
|
|
29
21
|
|
|
30
|
-
<
|
|
31
|
-
<tr>
|
|
32
|
-
<td><strong>94.8% R@5</strong><br/><sub>LongMemEval Oracle, 500q</sub></td>
|
|
33
|
-
<td><strong>0.08ms</strong><br/><sub>Search at 10k memories</sub></td>
|
|
34
|
-
<td><strong>29 MCP tools</strong><br/><sub>Full memory toolkit</sub></td>
|
|
35
|
-
<td><strong>Powered by</strong><br/><sub><a href="https://github.com/amanasmuei/amem-core">amem-core</a></sub></td>
|
|
36
|
-
</tr>
|
|
37
|
-
</table>
|
|
22
|
+
<div align="center">
|
|
38
23
|
|
|
39
|
-
|
|
24
|
+
| 🎯 97.8% R@5 | ⚡ ~14ms p50 | 🛠 33 Tools | 🔒 100% Local |
|
|
25
|
+
|:---:|:---:|:---:|:---:|
|
|
26
|
+
| LongMemEval-S, 500q | Full recall pipeline | Complete memory toolkit | No cloud required |
|
|
27
|
+
|
|
28
|
+
</div>
|
|
40
29
|
|
|
41
30
|
<p align="center">
|
|
42
|
-
<a href="#-quick-start">Quick Start</a>
|
|
43
|
-
<a href="#-how-it-works">How It Works</a>
|
|
44
|
-
<a href="#-benchmarks">Benchmarks</a>
|
|
45
|
-
<a href="
|
|
46
|
-
<a href="#-
|
|
31
|
+
<a href="#-quick-start">Quick Start</a> ·
|
|
32
|
+
<a href="#-how-it-works">How It Works</a> ·
|
|
33
|
+
<a href="#-benchmarks">Benchmarks</a> ·
|
|
34
|
+
<a href="#%EF%B8%8F-tools-reference">Tools</a> ·
|
|
35
|
+
<a href="#-dashboard--knowledge-graph">Dashboard</a> ·
|
|
47
36
|
<a href="#-architecture">Architecture</a>
|
|
48
37
|
</p>
|
|
49
38
|
|
|
50
39
|
---
|
|
51
40
|
|
|
52
|
-
##
|
|
41
|
+
## 💡 The Problem
|
|
53
42
|
|
|
54
43
|
Every AI tool starts from zero. Every session. Every tool.
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
```diff
|
|
46
|
+
- You: "Don't use 'any' in TypeScript" → told Claude 3 times. Copilot still doesn't know.
|
|
47
|
+
- You: "We chose PostgreSQL over MongoDB" → explained in Cursor. Claude has no idea.
|
|
48
|
+
+ With amem: tell it once, every AI tool remembers — forever.
|
|
49
|
+
```
|
|
59
50
|
|
|
60
|
-
|
|
51
|
+
<details>
|
|
52
|
+
<summary><b>See it in action</b></summary>
|
|
61
53
|
|
|
62
54
|
```
|
|
63
55
|
You (in Claude Code): "Don't use any type in TypeScript"
|
|
64
|
-
amem stores this as a correction (priority 1.0)
|
|
56
|
+
└─ amem stores this as a correction (priority 1.0, confidence 100%)
|
|
65
57
|
|
|
66
58
|
You (switch to Copilot): starts coding
|
|
67
|
-
Copilot already knows — amem feeds it the same correction
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
No cloud. No API keys. Everything stays on your machine.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 🧬 Powered by `amem-core`
|
|
75
|
-
|
|
76
|
-
`amem` is the **MCP server**. The actual memory engine — embeddings, recall, knowledge graph, contradiction detection, reflection — lives in a separate package: [`@aman_asmuei/amem-core`](https://github.com/amanasmuei/amem-core).
|
|
59
|
+
└─ Copilot already knows — amem feeds it the same correction
|
|
77
60
|
|
|
61
|
+
You (open Cursor): "What do you remember about TypeScript?"
|
|
62
|
+
└─ Instantly recalls: "Don't use any type" + all related preferences
|
|
78
63
|
```
|
|
79
|
-
Claude Code / Copilot / Cursor / any MCP client
|
|
80
|
-
│
|
|
81
|
-
│ MCP (stdio)
|
|
82
|
-
▼
|
|
83
|
-
┌─────────────────────────────────┐
|
|
84
|
-
│ @aman_asmuei/amem (this pkg) │
|
|
85
|
-
│ 29 MCP tools, CLI, hooks │
|
|
86
|
-
└────────────────┬────────────────┘
|
|
87
|
-
│ imports
|
|
88
|
-
▼
|
|
89
|
-
┌─────────────────────────────────┐
|
|
90
|
-
│ @aman_asmuei/amem-core │
|
|
91
|
-
│ embeddings · HNSW · recall │
|
|
92
|
-
│ knowledge graph · reflection │
|
|
93
|
-
│ 91.0% R@5 on LongMemEval │
|
|
94
|
-
└────────────────┬────────────────┘
|
|
95
|
-
│
|
|
96
|
-
▼
|
|
97
|
-
┌────────────────────┐
|
|
98
|
-
│ SQLite (one file) │
|
|
99
|
-
│ ~/.amem/memory.db │
|
|
100
|
-
└────────────────────┘
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
| Package | Role | Install | Use case |
|
|
104
|
-
|---|---|---|---|
|
|
105
|
-
| **`@aman_asmuei/amem`** *(this)* | MCP server + CLI + hooks | `npm install -g @aman_asmuei/amem` | Plug into Claude Code, Copilot, Cursor, any MCP client |
|
|
106
|
-
| **`@aman_asmuei/amem-core`** | Pure TypeScript library, zero MCP deps | `npm install @aman_asmuei/amem-core` | Embed memory directly in your own Node app |
|
|
107
64
|
|
|
108
|
-
|
|
65
|
+
</details>
|
|
109
66
|
|
|
110
|
-
|
|
67
|
+
No cloud. No API keys. One SQLite file. Everything stays on your machine.
|
|
111
68
|
|
|
112
69
|
---
|
|
113
70
|
|
|
114
|
-
## Quick Start
|
|
71
|
+
## 🚀 Quick Start
|
|
115
72
|
|
|
116
73
|
<table>
|
|
117
74
|
<tr>
|
|
@@ -139,7 +96,7 @@ copilot plugin install amem
|
|
|
139
96
|
</table>
|
|
140
97
|
|
|
141
98
|
<details>
|
|
142
|
-
<summary><
|
|
99
|
+
<summary><b>📦 Cursor / Windsurf / Any MCP Client</b></summary>
|
|
143
100
|
|
|
144
101
|
```bash
|
|
145
102
|
npm install -g @aman_asmuei/amem
|
|
@@ -147,7 +104,7 @@ amem-cli init # Detects & configures all installed AI tools
|
|
|
147
104
|
amem-cli rules # Generates extraction rules for proactive memory use
|
|
148
105
|
```
|
|
149
106
|
|
|
150
|
-
Or
|
|
107
|
+
Or add to your MCP config manually:
|
|
151
108
|
|
|
152
109
|
```json
|
|
153
110
|
{
|
|
@@ -168,13 +125,58 @@ Or configure manually:
|
|
|
168
125
|
amem-cli stats # Should show "0 memories" initially
|
|
169
126
|
```
|
|
170
127
|
|
|
171
|
-
Tell your AI: *"Remember: always use strict TypeScript, never use any type"*
|
|
128
|
+
> 💬 Tell your AI: *"Remember: always use strict TypeScript, never use any type"*
|
|
129
|
+
>
|
|
130
|
+
> 🔄 Start a **new** session: *"What do you remember about TypeScript?"* — it recalls instantly.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 🧬 Powered by `amem-core`
|
|
172
135
|
|
|
173
|
-
|
|
136
|
+
`amem` is the MCP server. The retrieval engine lives in [`@aman_asmuei/amem-core`](https://github.com/amanasmuei/amem-core).
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
Claude Code / Copilot / Cursor / any MCP client
|
|
140
|
+
│
|
|
141
|
+
│ MCP (stdio)
|
|
142
|
+
▼
|
|
143
|
+
┌──────────────────────────────────┐
|
|
144
|
+
│ @aman_asmuei/amem (this pkg) │
|
|
145
|
+
│ 33 Tools · 7 Resources · 2 Prompts
|
|
146
|
+
│ CLI · Hooks · Dashboard │
|
|
147
|
+
└───────────────┬──────────────────┘
|
|
148
|
+
│ imports
|
|
149
|
+
▼
|
|
150
|
+
┌──────────────────────────────────┐
|
|
151
|
+
│ @aman_asmuei/amem-core │
|
|
152
|
+
│ Embeddings · HNSW · Recall │
|
|
153
|
+
│ Knowledge Graph · Reflection │
|
|
154
|
+
│ 97.8% R@5 on LongMemEval-S │
|
|
155
|
+
└───────────────┬──────────────────┘
|
|
156
|
+
▼
|
|
157
|
+
┌────────────────────┐
|
|
158
|
+
│ SQLite + WAL │
|
|
159
|
+
│ ~/.amem/memory.db │
|
|
160
|
+
└────────────────────┘
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
<details>
|
|
164
|
+
<summary><b>Why two packages?</b></summary>
|
|
165
|
+
|
|
166
|
+
| Package | Role | Install |
|
|
167
|
+
|---|---|---|
|
|
168
|
+
| **`@aman_asmuei/amem`** *(this)* | MCP server + CLI + hooks | `npm i -g @aman_asmuei/amem` |
|
|
169
|
+
| [**`@aman_asmuei/amem-core`**](https://github.com/amanasmuei/amem-core) | Pure TS library, zero MCP deps | `npm i @aman_asmuei/amem-core` |
|
|
170
|
+
|
|
171
|
+
The same engine powers `amem` (MCP server), `aman-agent` (CLI), `aman-tg` (Telegram bot), and any Node app you give memory to. Retrieval improvements ship via `amem-core`. MCP-tool changes ship via `amem`. They version independently.
|
|
172
|
+
|
|
173
|
+
> The **97.8% R@5** headline is the engine quality from `amem-core` (LongMemEval-S, session-level, 500 questions, zero API calls) — exactly what you get whether you call it through MCP or import the library directly.
|
|
174
|
+
|
|
175
|
+
</details>
|
|
174
176
|
|
|
175
177
|
---
|
|
176
178
|
|
|
177
|
-
## How It Works
|
|
179
|
+
## ⚙️ How It Works
|
|
178
180
|
|
|
179
181
|
amem captures knowledge in **three layers** — from fully automatic to fully manual:
|
|
180
182
|
|
|
@@ -197,6 +199,9 @@ amem captures knowledge in **three layers** — from fully automatic to fully ma
|
|
|
197
199
|
|
|
198
200
|
Corrections always surface first — they are your AI's hard constraints.
|
|
199
201
|
|
|
202
|
+
<details>
|
|
203
|
+
<summary><b>🔄 Memory Tiers & Temporal Validity</b></summary>
|
|
204
|
+
|
|
200
205
|
### Memory Tiers
|
|
201
206
|
|
|
202
207
|
| Tier | Behavior |
|
|
@@ -212,7 +217,10 @@ Memories aren't forever. When facts change:
|
|
|
212
217
|
- Contradictions are **auto-detected** ��� storing a new decision auto-expires the old one
|
|
213
218
|
- Query any point in time with `memory_since`
|
|
214
219
|
|
|
215
|
-
|
|
220
|
+
</details>
|
|
221
|
+
|
|
222
|
+
<details>
|
|
223
|
+
<summary><b>🧠 Self-Evolving Memory Loop</b></summary>
|
|
216
224
|
|
|
217
225
|
Your memory doesn't just store — it **learns from its own structure**. Call `memory_reflect` to trigger the reflection engine:
|
|
218
226
|
|
|
@@ -236,7 +244,7 @@ memory_reflect → Analyzes your entire memory graph
|
|
|
236
244
|
The system auto-nudges when reflection is due (>7 days or >50 new memories since last run).
|
|
237
245
|
|
|
238
246
|
<details>
|
|
239
|
-
<summary><
|
|
247
|
+
<summary><b>📊 What the reflection report looks like</b></summary>
|
|
240
248
|
|
|
241
249
|
```
|
|
242
250
|
# Memory Reflection Report
|
|
@@ -276,40 +284,67 @@ Health Score: 68/100
|
|
|
276
284
|
|
|
277
285
|
---
|
|
278
286
|
|
|
279
|
-
## Benchmarks
|
|
287
|
+
## 📈 Benchmarks
|
|
280
288
|
|
|
281
|
-
### Recall Accuracy
|
|
289
|
+
### Recall Accuracy (LongMemEval)
|
|
290
|
+
|
|
291
|
+
All numbers from [`amem-core` v0.5.1](https://github.com/amanasmuei/amem-core) — the retrieval engine powering this MCP server. Zero API calls, all local, fully reproducible.
|
|
282
292
|
|
|
283
293
|
<table>
|
|
284
294
|
<tr>
|
|
285
295
|
<td>
|
|
286
296
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
|
290
|
-
|
|
291
|
-
| **
|
|
292
|
-
|
|
|
297
|
+
**LongMemEval-S (session-level) — headline metric**
|
|
298
|
+
|
|
299
|
+
| Metric | Score |
|
|
300
|
+
|:---:|:---:|
|
|
301
|
+
| **R@1** | **95.0%** |
|
|
302
|
+
| **R@3** | **97.0%** |
|
|
303
|
+
| **R@5** | **🏆 97.8%** |
|
|
304
|
+
| **R@10** | **99.0%** |
|
|
305
|
+
|
|
306
|
+
500 questions · CPU only · zero API calls
|
|
293
307
|
|
|
294
308
|
</td>
|
|
295
309
|
<td>
|
|
296
310
|
|
|
297
|
-
|
|
311
|
+
**LongMemEval Oracle (turn-level)**
|
|
298
312
|
|
|
299
|
-
|
|
313
|
+
| Metric | Score |
|
|
314
|
+
|:---:|:---:|
|
|
315
|
+
| **R@1** | **66.2%** |
|
|
316
|
+
| **R@3** | **90.8%** |
|
|
317
|
+
| **R@5** | **94.6%** |
|
|
318
|
+
| **R@10** | **97.5%** |
|
|
300
319
|
|
|
301
|
-
|
|
320
|
+
479 scoreable questions · 301s runtime · Node 22
|
|
302
321
|
|
|
303
322
|
</td>
|
|
304
323
|
</tr>
|
|
305
324
|
</table>
|
|
306
325
|
|
|
307
|
-
|
|
326
|
+
Pipeline: local `bge-small-en-v1.5` bi-encoder + `ms-marco-MiniLM-L-6-v2` cross-encoder (int8, batched, default-on). See [amem-core benchmarks](https://github.com/amanasmuei/amem-core#-benchmarks) for full per-type breakdowns, pipeline evolution, and honest notes.
|
|
327
|
+
|
|
328
|
+
### Search Latency
|
|
308
329
|
|
|
309
330
|
<table>
|
|
310
331
|
<tr>
|
|
311
332
|
<td>
|
|
312
333
|
|
|
334
|
+
**Full recall pipeline (v0.5.1+)**
|
|
335
|
+
|
|
336
|
+
| Stage | p50 | Share |
|
|
337
|
+
|---|---|---|
|
|
338
|
+
| Embed (bi-encoder) | 3.0ms | 22% |
|
|
339
|
+
| Retrieve (HNSW + multi-strategy) | 0.1ms | 1% |
|
|
340
|
+
| **Rerank (int8 cross-encoder)** | **10.3ms** | **74%** |
|
|
341
|
+
| **Total** | **~14ms** | 100% |
|
|
342
|
+
|
|
343
|
+
</td>
|
|
344
|
+
<td>
|
|
345
|
+
|
|
346
|
+
**HNSW index only (vector search)**
|
|
347
|
+
|
|
313
348
|
| Memories | HNSW | Brute-force | Speedup |
|
|
314
349
|
|---|---|---|---|
|
|
315
350
|
| 100 | 0.05ms | 0.10ms | 2x |
|
|
@@ -330,7 +365,7 @@ Measured: 100 searches averaged, 384-dim embeddings, top-10 results.
|
|
|
330
365
|
|
|
331
366
|
---
|
|
332
367
|
|
|
333
|
-
## Tools Reference
|
|
368
|
+
## 🛠️ Tools Reference
|
|
334
369
|
|
|
335
370
|
### Core Memory (7 tools)
|
|
336
371
|
|
|
@@ -345,7 +380,7 @@ Measured: 100 searches averaged, 384-dim embeddings, top-10 results.
|
|
|
345
380
|
| `memory_inject` | Surface corrections + decisions + graph neighbors before coding starts. |
|
|
346
381
|
|
|
347
382
|
<details>
|
|
348
|
-
<summary><strong>Precision, History, Advanced, Reminders, and Maintenance tools (
|
|
383
|
+
<summary><strong>Precision, History, Advanced, Admin, Reminders, and Maintenance tools (26 more)</strong></summary>
|
|
349
384
|
|
|
350
385
|
### Precision & History (5 tools)
|
|
351
386
|
|
|
@@ -368,6 +403,15 @@ Measured: 100 searches averaged, 384-dim embeddings, top-10 results.
|
|
|
368
403
|
| `memory_history` | View past session summaries. |
|
|
369
404
|
| `memory_reflect` | Self-evolving reflection engine — clusters memories, detects contradictions, identifies synthesis candidates, surfaces knowledge gaps. |
|
|
370
405
|
|
|
406
|
+
### Admin & Sync (4 tools)
|
|
407
|
+
|
|
408
|
+
| Tool | Description |
|
|
409
|
+
|---|---|
|
|
410
|
+
| `memory_doctor` | Run read-only health diagnostics on the amem database. |
|
|
411
|
+
| `memory_repair` | Perform safe, targeted repairs on the amem database. |
|
|
412
|
+
| `memory_config` | Get or set amem configuration with safety guardrails. |
|
|
413
|
+
| `memory_sync` | Import or export memories between amem and other systems (Claude auto-memory, Copilot instructions). |
|
|
414
|
+
|
|
371
415
|
### Reminders (4 tools)
|
|
372
416
|
|
|
373
417
|
| Tool | Description |
|
|
@@ -393,7 +437,7 @@ Measured: 100 searches averaged, 384-dim embeddings, top-10 results.
|
|
|
393
437
|
|
|
394
438
|
---
|
|
395
439
|
|
|
396
|
-
## Usage Guide
|
|
440
|
+
## 📖 Usage Guide
|
|
397
441
|
|
|
398
442
|
### Storing Memories
|
|
399
443
|
|
|
@@ -523,22 +567,90 @@ memory_store({
|
|
|
523
567
|
|
|
524
568
|
---
|
|
525
569
|
|
|
526
|
-
##
|
|
570
|
+
## ⚔️ Honest Comparison: amem vs graphify
|
|
571
|
+
|
|
572
|
+
<details>
|
|
573
|
+
<summary><b>Click to expand — how amem compares to graphify</b></summary>
|
|
574
|
+
|
|
575
|
+
[graphify](https://github.com/safishamsi/graphify) is the most common "what about X?" when people find amem. They solve **fundamentally different problems** and are genuinely complementary.
|
|
576
|
+
|
|
577
|
+
### What each tool does
|
|
578
|
+
|
|
579
|
+
| | **amem** | **graphify** |
|
|
580
|
+
|---|---|---|
|
|
581
|
+
| **One-liner** | Persistent memory across AI sessions | Codebase → knowledge graph |
|
|
582
|
+
| **Core question** | *"What has my AI learned about me?"* | *"What does this codebase look like?"* |
|
|
583
|
+
| **Input** | Natural language (corrections, decisions, preferences) | Files (code, docs, PDFs, images, video) |
|
|
584
|
+
| **Output** | Recalled memories ranked by relevance | Structural graph + report + interactive HTML |
|
|
585
|
+
| **Persistence** | Always — memory survives across sessions and tools | Snapshot — `graph.json` persists, but doesn't learn over time |
|
|
586
|
+
| **When it runs** | Continuously, every session | On-demand (`/graphify .`) or on commit via git hook |
|
|
587
|
+
|
|
588
|
+
### Technical comparison
|
|
589
|
+
|
|
590
|
+
| | **amem** | **graphify** |
|
|
591
|
+
|---|---|---|
|
|
592
|
+
| **Runtime** | TypeScript / Node (≥18) | Python (≥3.10) |
|
|
593
|
+
| **Protocol** | MCP server (33 tools, 7 resources) | AI skill (slash command) + optional MCP server |
|
|
594
|
+
| **Storage** | SQLite + FTS5 + WAL | NetworkX graph → JSON file |
|
|
595
|
+
| **Search** | Semantic embeddings + FTS5 + graph + reranking | Graph traversal (BFS/DFS) + node lookup |
|
|
596
|
+
| **Embeddings** | Local `bge-small-en-v1.5` (384-dim) | None — uses graph topology, not vector similarity |
|
|
597
|
+
| **Code understanding** | None — stores what you tell it | Deep — tree-sitter AST for 25 languages |
|
|
598
|
+
| **Multimodal** | Text only | Code, docs, PDFs, images, video, audio |
|
|
599
|
+
| **LLM required** | No (all local) | Yes for docs/images (code is LLM-free via tree-sitter) |
|
|
600
|
+
| **Benchmark** | 97.8% R@5 on LongMemEval-S | 71.5x token reduction vs raw file reading |
|
|
601
|
+
| **AI tool support** | Claude Code, Copilot, Cursor, any MCP client | Claude Code, Codex, Copilot, Cursor, Gemini, Aider, Kiro, +10 more |
|
|
602
|
+
|
|
603
|
+
### Where each wins
|
|
604
|
+
|
|
605
|
+
**amem wins at:**
|
|
606
|
+
- Remembering your preferences, corrections, and decisions **across projects and tools**
|
|
607
|
+
- Semantic recall — finding the right memory from a vague query (97.8% R@5)
|
|
608
|
+
- Temporal intelligence — tracking what was true *when*, auto-expiring contradictions
|
|
609
|
+
- Self-evolution — reflection engine clusters, detects contradictions, identifies gaps
|
|
610
|
+
- Zero LLM dependency — everything runs locally, no API calls
|
|
611
|
+
|
|
612
|
+
**graphify wins at:**
|
|
613
|
+
- Understanding **code structure** — call graphs, imports, class hierarchies, cross-file relationships
|
|
614
|
+
- Multimodal ingestion — drop in code, papers, screenshots, videos, it graphs them all
|
|
615
|
+
- Token efficiency — 71.5x compression means your AI reads structure, not raw files
|
|
616
|
+
- Breadth of language support — 25 programming languages via tree-sitter AST
|
|
617
|
+
- Breadth of AI tool support — 15+ platforms with dedicated install commands
|
|
618
|
+
|
|
619
|
+
### Honest takeaways
|
|
620
|
+
|
|
621
|
+
1. **They don't compete.** amem remembers *your* knowledge (decisions, corrections, preferences). graphify maps *the codebase's* structure (call graphs, dependencies, architecture). Different data, different access patterns.
|
|
622
|
+
|
|
623
|
+
2. **Use both if you want.** Run `graphify .` to get a structural map of your project. Use amem to remember "we chose this architecture because X." The graph tells your AI *what exists*. The memory tells it *why things are that way*.
|
|
624
|
+
|
|
625
|
+
3. **graphify has broader platform coverage** (15+ AI tools). amem has deeper integration where it works (MCP protocol with 33 tools, structured resources, prompts).
|
|
626
|
+
|
|
627
|
+
4. **graphify needs an LLM for non-code files.** amem is fully local — no API calls, no model inference beyond the local embedding model.
|
|
628
|
+
|
|
629
|
+
5. **The real choice depends on your pain point.** If your AI keeps forgetting your preferences and decisions → amem. If your AI can't navigate your codebase efficiently → graphify. If both → use both.
|
|
630
|
+
|
|
631
|
+
</details>
|
|
632
|
+
|
|
633
|
+
---
|
|
634
|
+
|
|
635
|
+
## 🌐 Platform Compatibility
|
|
527
636
|
|
|
528
637
|
| Feature | Claude Code | GitHub Copilot CLI | Cursor / Windsurf / Other |
|
|
529
638
|
|---|:---:|:---:|:---:|
|
|
530
639
|
| One-command plugin install | Yes | Yes | -- |
|
|
531
|
-
|
|
|
640
|
+
| 33 MCP tools | Yes | Yes | Yes |
|
|
532
641
|
| AI skills | 14 | 7 | -- |
|
|
533
642
|
| Auto-capture hooks | Yes | Yes | -- |
|
|
534
643
|
| Session auto-summarize | Yes | Yes | -- |
|
|
535
644
|
| Auto-memory sync | Yes | -- | -- |
|
|
536
645
|
| CLI setup (`amem-cli init`) | Yes | Yes | Yes |
|
|
537
646
|
|
|
538
|
-
**Claude Code** has the deepest integration (plugin + hooks + auto-memory sync). **Copilot CLI** is a close second. **Other MCP clients** get the full
|
|
647
|
+
**Claude Code** has the deepest integration (plugin + hooks + auto-memory sync). **Copilot CLI** is a close second. **Other MCP clients** get the full 33-tool server via manual config.
|
|
539
648
|
|
|
540
649
|
### AI Skills
|
|
541
650
|
|
|
651
|
+
<details>
|
|
652
|
+
<summary><b>Available skills by platform</b></summary>
|
|
653
|
+
|
|
542
654
|
| What you say | Skill | Claude Code | Copilot CLI |
|
|
543
655
|
|---|---|:---:|:---:|
|
|
544
656
|
| *"Remember never use any type"* | `remember` | Yes | Yes |
|
|
@@ -552,9 +664,11 @@ memory_store({
|
|
|
552
664
|
| *"Open the memory dashboard"* | `dashboard` | Yes | -- |
|
|
553
665
|
| *"Install hooks"* | `hooks` | Yes | -- |
|
|
554
666
|
|
|
667
|
+
</details>
|
|
668
|
+
|
|
555
669
|
---
|
|
556
670
|
|
|
557
|
-
## Working with Claude Code Auto-Memory
|
|
671
|
+
## 🔄 Working with Claude Code Auto-Memory
|
|
558
672
|
|
|
559
673
|
amem complements Claude's built-in auto-memory — it doesn't replace it.
|
|
560
674
|
|
|
@@ -615,18 +729,24 @@ Claude Code → amem sync → amem DB → amem sync --to copilot → copilot-ins
|
|
|
615
729
|
|
|
616
730
|
---
|
|
617
731
|
|
|
618
|
-
## Dashboard
|
|
732
|
+
## 📊 Dashboard & Knowledge Graph
|
|
619
733
|
|
|
620
734
|
```bash
|
|
621
735
|
amem-cli dashboard # Opens at localhost:3333
|
|
622
736
|
amem-cli dashboard --port=8080 # Custom port
|
|
623
737
|
```
|
|
624
738
|
|
|
625
|
-
|
|
739
|
+
Full-featured web dashboard with:
|
|
740
|
+
|
|
741
|
+
- 🔍 **Memory browser** — search, filter by type/tier/source, inline actions (promote, demote, expire)
|
|
742
|
+
- 🕸️ **Interactive knowledge graph** — zoom, pan, click-to-focus with neighborhood highlighting, detail panel, search, directional edges
|
|
743
|
+
- 📈 **Analytics** — confidence distribution, type breakdown, session timeline
|
|
744
|
+
- ⏰ **Reminders** — view and manage cross-session tasks
|
|
745
|
+
- 📋 **Copilot Preview** — see what would be exported to `copilot-instructions.md`
|
|
626
746
|
|
|
627
747
|
---
|
|
628
748
|
|
|
629
|
-
## CLI Reference
|
|
749
|
+
## 💻 CLI Reference
|
|
630
750
|
|
|
631
751
|
```bash
|
|
632
752
|
# Setup
|
|
@@ -654,7 +774,7 @@ amem-cli reset --confirm # Wipe all data
|
|
|
654
774
|
|
|
655
775
|
---
|
|
656
776
|
|
|
657
|
-
## Architecture
|
|
777
|
+
## 🏗 Architecture
|
|
658
778
|
|
|
659
779
|
```
|
|
660
780
|
Your AI Tool
|
|
@@ -665,7 +785,7 @@ amem-cli reset --confirm # Wipe all data
|
|
|
665
785
|
┌─────────────────────────────────┐
|
|
666
786
|
│ @aman_asmuei/amem │ ← this package
|
|
667
787
|
│ │
|
|
668
|
-
│
|
|
788
|
+
│ 33 Tools · 7 Resources · 2 Prompts
|
|
669
789
|
│ Slash commands · CLI · Hooks │
|
|
670
790
|
│ Config: ~/.amem/config.json │
|
|
671
791
|
└────────────────┬────────────────┘
|
|
@@ -677,14 +797,15 @@ amem-cli reset --confirm # Wipe all data
|
|
|
677
797
|
│ Multi-Strategy Retrieval │
|
|
678
798
|
│ [HNSW] + [FTS5] + [Graph] + [Temporal]
|
|
679
799
|
│ + query expansion │
|
|
680
|
-
│ + cross-encoder
|
|
800
|
+
│ + cross-encoder reranker │
|
|
681
801
|
│ │
|
|
682
802
|
│ Self-Evolving Reflection │
|
|
683
803
|
│ [Clustering] + [Contradictions]│
|
|
684
804
|
│ + [Synthesis] + [Gap Detection]│
|
|
685
805
|
│ │
|
|
686
806
|
│ Embeddings: bge-small-en-v1.5 │
|
|
687
|
-
│
|
|
807
|
+
│ Reranker: ms-marco-MiniLM int8 │
|
|
808
|
+
│ 97.8% R@5 on LongMemEval-S │
|
|
688
809
|
└────────────────┬────────────────┘
|
|
689
810
|
│
|
|
690
811
|
▼
|
|
@@ -722,7 +843,7 @@ Additive scoring ensures no single low factor kills the ranking.
|
|
|
722
843
|
|
|
723
844
|
---
|
|
724
845
|
|
|
725
|
-
## Configuration
|
|
846
|
+
## ⚙️ Configuration
|
|
726
847
|
|
|
727
848
|
<details>
|
|
728
849
|
<summary><strong>Environment variables</strong></summary>
|
|
@@ -747,7 +868,7 @@ Created automatically with defaults:
|
|
|
747
868
|
"ftsWeight": 0.3,
|
|
748
869
|
"graphWeight": 0.15,
|
|
749
870
|
"temporalWeight": 0.15,
|
|
750
|
-
"rerankerEnabled":
|
|
871
|
+
"rerankerEnabled": true
|
|
751
872
|
},
|
|
752
873
|
"privacy": {
|
|
753
874
|
"enablePrivateTags": true,
|
|
@@ -768,7 +889,10 @@ Created automatically with defaults:
|
|
|
768
889
|
</details>
|
|
769
890
|
|
|
770
891
|
<details>
|
|
771
|
-
<summary><strong
|
|
892
|
+
<summary><strong>📋 Version history</strong></summary>
|
|
893
|
+
|
|
894
|
+
### v0.23.0 — Interactive Knowledge Graph Dashboard
|
|
895
|
+
Full-width graph explorer with zoom/pan, click-to-focus neighborhood highlighting, detail panel with relation navigation, search & filter, directional edges, force-directed layout. Admin tools (doctor, repair, config, sync). 255 tests across 18 suites.
|
|
772
896
|
|
|
773
897
|
### v0.19.0 — Self-Evolving Memory Loop
|
|
774
898
|
Reflection engine with HNSW-based clustering, 3-layer contradiction detection (negation + numerical + low-overlap), synthesis candidates with lineage tracking, knowledge gap detection, utility scoring, auto-trigger nudge in `memory_inject`. New DB tables: `synthesis_lineage`, `knowledge_gaps`, `reflection_meta`. Migration v5.
|
|
@@ -792,7 +916,7 @@ Core store/recall, local embeddings, SQLite + WAL, consolidation, project scopin
|
|
|
792
916
|
|
|
793
917
|
---
|
|
794
918
|
|
|
795
|
-
## Tech Stack
|
|
919
|
+
## 🧰 Tech Stack
|
|
796
920
|
|
|
797
921
|
| Layer | Technology |
|
|
798
922
|
|---|---|
|
|
@@ -800,36 +924,38 @@ Core store/recall, local embeddings, SQLite + WAL, consolidation, project scopin
|
|
|
800
924
|
| Language | TypeScript 5.6+, strict mode |
|
|
801
925
|
| Database | SQLite + WAL + FTS5 |
|
|
802
926
|
| Embeddings | HuggingFace bge-small-en-v1.5 (local, 80MB) + HNSW vector index |
|
|
803
|
-
| Reranking | ms-marco-MiniLM-L-6-v2 (
|
|
927
|
+
| Reranking | ms-marco-MiniLM-L-6-v2 (default-on, int8, batched, local) |
|
|
804
928
|
| Validation | Zod 3.25+ with `.strict()` schemas |
|
|
805
|
-
| Testing | Vitest —
|
|
929
|
+
| Testing | Vitest — 281 tests across 19 suites + recall benchmarks |
|
|
806
930
|
| CI/CD | GitHub Actions, npm publish on release |
|
|
807
931
|
|
|
808
932
|
---
|
|
809
933
|
|
|
810
|
-
## Contributing
|
|
934
|
+
## 🤝 Contributing
|
|
811
935
|
|
|
812
936
|
```bash
|
|
813
937
|
git clone https://github.com/amanasmuei/amem.git
|
|
814
938
|
cd amem && npm install
|
|
815
939
|
npm run build # zero TS errors
|
|
816
|
-
npm test #
|
|
940
|
+
npm test # 281 tests pass
|
|
817
941
|
```
|
|
818
942
|
|
|
819
943
|
PRs must pass CI before merge. See [Issues](https://github.com/amanasmuei/amem/issues) for open tasks.
|
|
820
944
|
|
|
945
|
+
<br/>
|
|
946
|
+
|
|
821
947
|
---
|
|
822
948
|
|
|
823
949
|
<p align="center">
|
|
824
|
-
Built with ❤️ in 🇲🇾 Malaysia by <a href="https://github.com/amanasmuei"><strong>Aman Asmuei</strong></a>
|
|
950
|
+
<sub>Built with ❤️ in 🇲🇾 Malaysia by <a href="https://github.com/amanasmuei"><strong>Aman Asmuei</strong></a></sub>
|
|
825
951
|
</p>
|
|
826
952
|
|
|
827
953
|
<p align="center">
|
|
828
|
-
<a href="https://github.com/amanasmuei/amem"
|
|
829
|
-
<a href="https://www.npmjs.com/package/@aman_asmuei/amem"
|
|
830
|
-
<a href="https://github.com/amanasmuei/amem/issues"
|
|
954
|
+
<a href="https://github.com/amanasmuei/amem"><img src="https://img.shields.io/badge/GitHub-repo-181717?style=flat-square&logo=github" alt="GitHub" /></a>
|
|
955
|
+
<a href="https://www.npmjs.com/package/@aman_asmuei/amem"><img src="https://img.shields.io/badge/npm-package-cb3837?style=flat-square&logo=npm&logoColor=white" alt="npm" /></a>
|
|
956
|
+
<a href="https://github.com/amanasmuei/amem/issues"><img src="https://img.shields.io/badge/Issues-report-orange?style=flat-square&logo=github" alt="Issues" /></a>
|
|
831
957
|
</p>
|
|
832
958
|
|
|
833
959
|
<p align="center">
|
|
834
|
-
<sub>MIT License</sub>
|
|
960
|
+
<sub>MIT License · Star ⭐ if amem saves your AI from amnesia</sub>
|
|
835
961
|
</p>
|
package/dist/cli.js
CHANGED
|
@@ -51,7 +51,16 @@ if (command === "hooks") {
|
|
|
51
51
|
}
|
|
52
52
|
if (command === "sync") {
|
|
53
53
|
await handleSync(args.slice(1));
|
|
54
|
-
|
|
54
|
+
// Workaround: @huggingface/transformers (ONNX Runtime) has a known
|
|
55
|
+
// teardown crash on macOS — worker threads try to release a mutex that
|
|
56
|
+
// Node has already torn down, producing
|
|
57
|
+
// libc++abi: terminating ... mutex lock failed: Invalid argument
|
|
58
|
+
// and exit code 134. By this point all sync work is committed and the
|
|
59
|
+
// DB is closed, so we flush stdio and hard-exit via SIGKILL before the
|
|
60
|
+
// broken native destructors can run.
|
|
61
|
+
await new Promise((resolve) => process.stdout.write("", () => resolve()));
|
|
62
|
+
await new Promise((resolve) => process.stderr.write("", () => resolve()));
|
|
63
|
+
process.kill(process.pid, "SIGKILL");
|
|
55
64
|
}
|
|
56
65
|
// ── Commands that need a database ───────────────────────
|
|
57
66
|
if (command === "doctor") {
|
|
@@ -658,11 +667,11 @@ function handleReset(db, args) {
|
|
|
658
667
|
try {
|
|
659
668
|
fs.unlinkSync(DB_PATH + "-wal");
|
|
660
669
|
}
|
|
661
|
-
catch { }
|
|
670
|
+
catch { /* WAL file may not exist */ }
|
|
662
671
|
try {
|
|
663
672
|
fs.unlinkSync(DB_PATH + "-shm");
|
|
664
673
|
}
|
|
665
|
-
catch { }
|
|
674
|
+
catch { /* SHM file may not exist */ }
|
|
666
675
|
console.log("All amem data has been wiped. Starting fresh.");
|
|
667
676
|
console.log(`Deleted: ${DB_PATH}`);
|
|
668
677
|
}
|