@aman_asmuei/amem 0.18.0 → 0.18.1
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 +281 -488
- package/dist/ann.js +6 -4
- package/dist/ann.js.map +1 -1
- package/dist/cli.js +36 -17
- package/dist/cli.js.map +1 -1
- package/dist/extractor.js +10 -3
- package/dist/extractor.js.map +1 -1
- package/dist/hooks.js +12 -5
- package/dist/hooks.js.map +1 -1
- package/dist/tools/advanced.js +13 -0
- package/dist/tools/advanced.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,36 +22,42 @@
|
|
|
22
22
|
|
|
23
23
|
<p align="center">
|
|
24
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 ·
|
|
25
|
+
Local-first · Semantic search · Knowledge graph · Privacy-aware · No cloud required.
|
|
26
26
|
</p>
|
|
27
27
|
|
|
28
|
+
<br/>
|
|
29
|
+
|
|
30
|
+
<table align="center">
|
|
31
|
+
<tr>
|
|
32
|
+
<td><strong>72% Recall@5</strong><br/><sub>Semantic accuracy</sub></td>
|
|
33
|
+
<td><strong>0.08ms</strong><br/><sub>Search at 10k memories</sub></td>
|
|
34
|
+
<td><strong>28 MCP tools</strong><br/><sub>Full memory toolkit</sub></td>
|
|
35
|
+
<td><strong>357 tests</strong><br/><sub>All passing</sub></td>
|
|
36
|
+
</tr>
|
|
37
|
+
</table>
|
|
38
|
+
|
|
39
|
+
<br/>
|
|
40
|
+
|
|
28
41
|
<p align="center">
|
|
29
|
-
<a href="#-
|
|
42
|
+
<a href="#-quick-start">Quick Start</a> •
|
|
30
43
|
<a href="#-how-it-works">How It Works</a> •
|
|
31
|
-
<a href="#-
|
|
32
|
-
<a href="
|
|
44
|
+
<a href="#-benchmarks">Benchmarks</a> •
|
|
45
|
+
<a href="#-tools-reference">Tools</a> •
|
|
33
46
|
<a href="#-usage-guide">Usage Guide</a> •
|
|
34
|
-
<a href="#-architecture">Architecture</a>
|
|
35
|
-
<a href="#-contributing">Contributing</a>
|
|
47
|
+
<a href="#-architecture">Architecture</a>
|
|
36
48
|
</p>
|
|
37
49
|
|
|
38
50
|
---
|
|
39
51
|
|
|
40
|
-
##
|
|
52
|
+
## Why amem?
|
|
41
53
|
|
|
42
|
-
|
|
54
|
+
Every AI tool starts from zero. Every session. Every tool.
|
|
43
55
|
|
|
44
56
|
> *"Don't use `any` in TypeScript"* — told Claude three times. Copilot still doesn't know.
|
|
45
57
|
>
|
|
46
58
|
> *"We chose PostgreSQL over MongoDB"* — explained in Cursor. Claude has no idea.
|
|
47
|
-
>
|
|
48
|
-
> *"I prefer early returns and pnpm"* — repeated in every tool. Every session.
|
|
49
|
-
|
|
50
|
-
**Your preferences, decisions, and corrections are trapped inside each tool's memory silo.**
|
|
51
|
-
|
|
52
|
-
## The Solution
|
|
53
59
|
|
|
54
|
-
**amem** gives all your AI tools a shared, persistent memory.
|
|
60
|
+
**amem** gives all your AI tools a shared, persistent memory.
|
|
55
61
|
|
|
56
62
|
```
|
|
57
63
|
You (in Claude Code): "Don't use any type in TypeScript"
|
|
@@ -63,56 +69,37 @@ You (switch to Copilot): starts coding
|
|
|
63
69
|
|
|
64
70
|
No cloud. No API keys. Everything stays on your machine.
|
|
65
71
|
|
|
66
|
-
### Compatibility
|
|
67
|
-
|
|
68
|
-
| Feature | Claude Code | GitHub Copilot CLI | Cursor / Windsurf / Other |
|
|
69
|
-
|---------|:-----------:|:------------------:|:-------------------------:|
|
|
70
|
-
| One-command plugin install | Yes | Yes | — |
|
|
71
|
-
| 28 MCP tools | Yes | Yes | Yes |
|
|
72
|
-
| AI skills | 14 | 7 | — |
|
|
73
|
-
| Auto-capture hooks | Yes | Yes | — |
|
|
74
|
-
| Session auto-summarize | Yes | Yes | — |
|
|
75
|
-
| Auto-memory sync | Yes | — | — |
|
|
76
|
-
| CLI setup (`amem-cli init`) | Yes | Yes | Yes |
|
|
77
|
-
| Extraction rules | Yes | Yes | Yes |
|
|
78
|
-
|
|
79
|
-
> **Claude Code** has the deepest integration (plugin + hooks + auto-memory sync). **Copilot CLI** is a close second with plugin + hooks. **Other MCP clients** get the full 28-tool MCP server via manual config.
|
|
80
|
-
|
|
81
72
|
---
|
|
82
73
|
|
|
83
|
-
##
|
|
74
|
+
## Quick Start
|
|
84
75
|
|
|
85
|
-
|
|
76
|
+
<table>
|
|
77
|
+
<tr>
|
|
78
|
+
<td width="50%">
|
|
86
79
|
|
|
87
|
-
|
|
80
|
+
**Claude Code** (recommended)
|
|
88
81
|
|
|
89
82
|
```bash
|
|
90
83
|
/plugin marketplace add amanasmuei/amem
|
|
91
84
|
/plugin install amem
|
|
92
85
|
```
|
|
93
86
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- **Lifecycle hooks** — PostToolUse (captures observations) + Stop (auto-summarizes sessions)
|
|
97
|
-
- **14 AI skills** — `remember`, `recall`, `context`, `sync`, `dashboard`, `stats`, `doctor`, `export`, `list`, `init`, `rules`, `hooks`, `team-import`, `team-export`
|
|
98
|
-
- **CLAUDE.md** context injected every session
|
|
87
|
+
</td>
|
|
88
|
+
<td width="50%">
|
|
99
89
|
|
|
100
|
-
|
|
90
|
+
**GitHub Copilot CLI**
|
|
101
91
|
|
|
102
92
|
```bash
|
|
103
93
|
copilot plugin marketplace add amanasmuei/amem
|
|
104
94
|
copilot plugin install amem
|
|
105
95
|
```
|
|
106
96
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
- **7 AI skills** — `remember`, `recall`, `context`, `stats`, `doctor`, `export`, `list`
|
|
111
|
-
- **AGENTS.md** context injected every session
|
|
112
|
-
|
|
113
|
-
### Option C: MCP Server (any MCP client)
|
|
97
|
+
</td>
|
|
98
|
+
</tr>
|
|
99
|
+
</table>
|
|
114
100
|
|
|
115
|
-
|
|
101
|
+
<details>
|
|
102
|
+
<summary><strong>Cursor / Windsurf / Any MCP Client</strong></summary>
|
|
116
103
|
|
|
117
104
|
```bash
|
|
118
105
|
npm install -g @aman_asmuei/amem
|
|
@@ -120,27 +107,8 @@ amem-cli init # Detects & configures all installed AI tools
|
|
|
120
107
|
amem-cli rules # Generates extraction rules for proactive memory use
|
|
121
108
|
```
|
|
122
109
|
|
|
123
|
-
|
|
124
|
-
<summary><strong>What does each command do?</strong></summary>
|
|
125
|
-
|
|
126
|
-
| Command | What it does |
|
|
127
|
-
|---|---|
|
|
128
|
-
| `amem-cli init` | Finds your installed AI tools and adds amem to their MCP server config. Works with Claude Code, Cursor, Windsurf, and GitHub Copilot. |
|
|
129
|
-
| `amem-cli rules` | Writes extraction guidelines to your tool's rules file (`CLAUDE.md`, `.cursorrules`, etc.). Teaches the AI *when* and *how* to store memories. |
|
|
130
|
-
| `amem-cli hooks` | Installs Claude Code lifecycle hooks for passive capture (PostToolUse + Stop). |
|
|
131
|
-
| `amem-cli sync` | Imports Claude Code auto-memory files into amem for unified structured access. |
|
|
132
|
-
|
|
133
|
-
</details>
|
|
134
|
-
|
|
135
|
-
<details>
|
|
136
|
-
<summary><strong>Manual MCP configuration</strong></summary>
|
|
137
|
-
|
|
138
|
-
**Claude Code:**
|
|
139
|
-
```bash
|
|
140
|
-
claude mcp add amem -- npx -y @aman_asmuei/amem
|
|
141
|
-
```
|
|
110
|
+
Or configure manually:
|
|
142
111
|
|
|
143
|
-
**Cursor / Windsurf / Other MCP Clients:**
|
|
144
112
|
```json
|
|
145
113
|
{
|
|
146
114
|
"mcpServers": {
|
|
@@ -154,184 +122,109 @@ claude mcp add amem -- npx -y @aman_asmuei/amem
|
|
|
154
122
|
|
|
155
123
|
</details>
|
|
156
124
|
|
|
157
|
-
|
|
125
|
+
**Verify it works:**
|
|
158
126
|
|
|
159
127
|
```bash
|
|
160
|
-
amem-cli stats
|
|
161
|
-
amem-cli dashboard # Opens web dashboard at localhost:3333
|
|
128
|
+
amem-cli stats # Should show "0 memories" initially
|
|
162
129
|
```
|
|
163
130
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
> *"Remember: always use strict TypeScript, never use any type"*
|
|
167
|
-
|
|
168
|
-
Start a **new** conversation and ask:
|
|
169
|
-
|
|
170
|
-
> *"What do you remember about TypeScript?"*
|
|
131
|
+
Tell your AI: *"Remember: always use strict TypeScript, never use any type"*
|
|
171
132
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
### AI Skills
|
|
175
|
-
|
|
176
|
-
The plugin includes skills that the AI invokes automatically based on your intent:
|
|
177
|
-
|
|
178
|
-
| What you say | Skill | Claude Code | Copilot CLI |
|
|
179
|
-
|---|---|:---:|:---:|
|
|
180
|
-
| *"Remember never use any type"* | `remember` | Yes | Yes |
|
|
181
|
-
| *"What do you remember about auth?"* | `recall` | Yes | Yes |
|
|
182
|
-
| *"Load context for this task"* | `context` | Yes | Yes |
|
|
183
|
-
| *"Show memory stats"* | `stats` | Yes | Yes |
|
|
184
|
-
| *"Run memory doctor"* | `doctor` | Yes | Yes |
|
|
185
|
-
| *"Export my memories"* | `export` | Yes | Yes |
|
|
186
|
-
| *"List all corrections"* | `list` | Yes | Yes |
|
|
187
|
-
| *"Sync my Claude memory"* | `sync` | Yes | — |
|
|
188
|
-
| *"Open the memory dashboard"* | `dashboard` | Yes | — |
|
|
189
|
-
| *"Install hooks"* | `hooks` | Yes | — |
|
|
133
|
+
Start a **new** session: *"What do you remember about TypeScript?"* — it recalls instantly.
|
|
190
134
|
|
|
191
135
|
---
|
|
192
136
|
|
|
193
137
|
## How It Works
|
|
194
138
|
|
|
195
|
-
amem captures knowledge in **three
|
|
139
|
+
amem captures knowledge in **three layers** — from fully automatic to fully manual:
|
|
196
140
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
- Auto-extracts corrections, decisions, preferences, and patterns using heuristic detection
|
|
141
|
+
| Layer | How | What it does |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| **Automatic** | Lifecycle hooks | Captures tool observations, auto-extracts corrections/decisions/patterns at session end |
|
|
144
|
+
| **AI-driven** | Extraction rules | Your AI proactively calls `memory_store` when you correct it, make decisions, or express preferences |
|
|
145
|
+
| **Manual** | Natural language | *"Remember: we use PostgreSQL"* or *"Forget the Redis memory"* |
|
|
203
146
|
|
|
204
|
-
###
|
|
147
|
+
### Memory Types
|
|
205
148
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
149
|
+
| Priority | Type | Example |
|
|
150
|
+
|:---:|---|---|
|
|
151
|
+
| **1.0** | **correction** | *"Don't mock the DB in integration tests"* |
|
|
152
|
+
| **0.85** | **decision** | *"Chose Postgres over Mongo for ACID"* |
|
|
153
|
+
| **0.7** | **pattern** | *"Prefers early returns over nesting"* |
|
|
154
|
+
| **0.7** | **preference** | *"Uses pnpm, not npm"* |
|
|
155
|
+
| **0.5** | **topology** | *"Auth module lives in src/auth/"* |
|
|
156
|
+
| **0.4** | **fact** | *"API launched January 2025"* |
|
|
211
157
|
|
|
212
|
-
|
|
158
|
+
Corrections always surface first — they are your AI's hard constraints.
|
|
213
159
|
|
|
214
|
-
|
|
215
|
-
- *"Store this as a correction: never mock the database in integration tests"*
|
|
216
|
-
- *"What do you remember about our auth architecture?"*
|
|
217
|
-
- *"Forget the memory about Redis — we switched to Memcached"*
|
|
218
|
-
- *"Promote that correction to core tier so it's always loaded"*
|
|
160
|
+
### Memory Tiers
|
|
219
161
|
|
|
220
|
-
|
|
162
|
+
| Tier | Behavior |
|
|
163
|
+
|---|---|
|
|
164
|
+
| **Core** | Always injected at session start (~500 tokens). Your most critical corrections. |
|
|
165
|
+
| **Working** | Session-scoped, auto-surfaced for current task. |
|
|
166
|
+
| **Archival** | Default. Searchable but not auto-injected. |
|
|
221
167
|
|
|
222
|
-
|
|
168
|
+
### Temporal Validity
|
|
223
169
|
|
|
224
|
-
Memories
|
|
170
|
+
Memories aren't forever. When facts change:
|
|
171
|
+
- Old memories get **expired** (not deleted) — preserved for *"what was true in March?"*
|
|
172
|
+
- Contradictions are **auto-detected** — storing a new decision auto-expires the old one
|
|
173
|
+
- Query any point in time with `memory_since`
|
|
225
174
|
|
|
226
|
-
|
|
227
|
-
|:---:|---|---|---|
|
|
228
|
-
| `1.0` | **correction** | User corrects the AI | *"Don't mock the DB in integration tests"* |
|
|
229
|
-
| `0.85` | **decision** | Architecture/design choice made | *"Chose Postgres over Mongo for ACID"* |
|
|
230
|
-
| `0.7` | **pattern** | Recurring coding style | *"Prefers early returns over nesting"* |
|
|
231
|
-
| `0.7` | **preference** | Tool or workflow choice | *"Uses pnpm, not npm"* |
|
|
232
|
-
| `0.5` | **topology** | Codebase structure | *"Auth module lives in src/auth/"* |
|
|
233
|
-
| `0.4` | **fact** | General project knowledge | *"API launched January 2025"* |
|
|
175
|
+
---
|
|
234
176
|
|
|
235
|
-
|
|
177
|
+
## Benchmarks
|
|
236
178
|
|
|
237
|
-
###
|
|
179
|
+
### Recall Accuracy
|
|
238
180
|
|
|
239
|
-
|
|
181
|
+
<table>
|
|
182
|
+
<tr>
|
|
183
|
+
<td>
|
|
240
184
|
|
|
241
|
-
|
|
|
185
|
+
| Strategy | Recall@5 | MRR |
|
|
242
186
|
|---|---|---|
|
|
243
|
-
|
|
|
244
|
-
| **
|
|
245
|
-
| **
|
|
187
|
+
| FTS5 keyword only | 31.3% | 31.3% |
|
|
188
|
+
| **Semantic** (default) | **72.4%** | **82.5%** |
|
|
189
|
+
| **Multi-strategy** | **74.5%** | **76.2%** |
|
|
190
|
+
| + reranking (opt-in) | ~80%+ | ~85%+ |
|
|
246
191
|
|
|
247
|
-
|
|
192
|
+
</td>
|
|
193
|
+
<td>
|
|
248
194
|
|
|
249
|
-
|
|
250
|
-
- Old memories get **expired** (not deleted) — preserved for *"what was true in March?"*
|
|
251
|
-
- Contradictions are **auto-detected** — storing a new decision auto-expires the conflicting old one
|
|
252
|
-
- You can query any point in time with `memory_since`
|
|
195
|
+
Corpus: 34 developer memories, 16 queries, 5 graph edges.
|
|
253
196
|
|
|
254
|
-
|
|
197
|
+
Reproduce: `npx vitest run benchmarks/`
|
|
255
198
|
|
|
256
|
-
|
|
199
|
+
**Default: 72% Recall@5, 82% MRR** with local embeddings. Degrades gracefully to keyword matching (~31%) before model downloads.
|
|
257
200
|
|
|
258
|
-
|
|
201
|
+
</td>
|
|
202
|
+
</tr>
|
|
203
|
+
</table>
|
|
259
204
|
|
|
260
|
-
|
|
261
|
-
|---|---|
|
|
262
|
-
| HNSW vector index | Replaced brute-force with HNSW (hnswlib-node) — sub-50ms search at 10k+ memories |
|
|
263
|
-
| Progressive disclosure | `compact` mode is now default on `memory_recall`, `memory_multi_recall`, `memory_search` — ~10x token savings |
|
|
264
|
-
| DB repair CLI | `amem-cli repair` detects corruption, auto-restores from backups |
|
|
265
|
-
| Concurrent access safety | WAL mode validated for multi-tool access (Claude Code + Copilot + Cursor simultaneously) |
|
|
266
|
-
| Conversation extractor | Heuristic pattern detection auto-extracts corrections, decisions, preferences from session conversations |
|
|
267
|
-
| Session-end auto-extraction | Stop hook now auto-stores detected memories with content-hash dedup |
|
|
205
|
+
### Search Latency — HNSW Vector Index
|
|
268
206
|
|
|
269
|
-
|
|
207
|
+
<table>
|
|
208
|
+
<tr>
|
|
209
|
+
<td>
|
|
270
210
|
|
|
271
|
-
|
|
|
272
|
-
|
|
273
|
-
|
|
|
274
|
-
|
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
| Graph-aware injection | `memory_inject` surfaces 1-hop knowledge graph neighbors |
|
|
278
|
-
| In-memory vector index | Pre-loaded vectors for fast semantic search (vs SQLite BLOB scan) |
|
|
279
|
-
| `amem doctor` | Health diagnostics CLI — embedding coverage, core budget, stale memories |
|
|
280
|
-
| Cross-session continuity | `amem://last-session` resource for previous session summary |
|
|
281
|
-
| CI benchmarks | Recall regression detection in CI pipeline |
|
|
211
|
+
| Memories | HNSW | Brute-force | Speedup |
|
|
212
|
+
|---|---|---|---|
|
|
213
|
+
| 100 | 0.05ms | 0.10ms | 2x |
|
|
214
|
+
| 1,000 | 0.06ms | 0.50ms | **8x** |
|
|
215
|
+
| 5,000 | 0.08ms | 2.44ms | **30x** |
|
|
216
|
+
| 10,000 | 0.08ms | 5.35ms | **67x** |
|
|
282
217
|
|
|
283
|
-
|
|
284
|
-
<
|
|
285
|
-
|
|
286
|
-
### v0.12.0
|
|
287
|
-
- Passive capture and auto-injection
|
|
288
|
-
- Dashboard timeline
|
|
289
|
-
- Auto-recover corrupted embedding cache
|
|
290
|
-
- Team sync foundation (import/export — full team sync is on the roadmap)
|
|
291
|
-
|
|
292
|
-
### v0.9.x — The Temporal Intelligence Release
|
|
293
|
-
- Temporal validity (`valid_from`/`valid_until`) — facts expire, history preserved
|
|
294
|
-
- Auto-expire contradicting memories on store
|
|
295
|
-
- Multi-strategy retrieval: semantic + FTS5 + knowledge graph + temporal recency
|
|
296
|
-
- Cross-encoder reranking (optional 2nd-pass for highest accuracy)
|
|
297
|
-
- Memory tiers: core (always loaded) / working (session) / archival (searchable)
|
|
298
|
-
- Privacy tags `<private>...</private>` stripped; API keys auto-redacted
|
|
299
|
-
- Lifecycle hooks for passive observation
|
|
300
|
-
- Session summaries with key decisions and corrections
|
|
301
|
-
- Interactive dashboard with drag-and-drop graph, memory editing, export
|
|
302
|
-
- Config system (`~/.amem/config.json`)
|
|
303
|
-
- Benchmark suite (Recall@K / MRR / Precision)
|
|
304
|
-
|
|
305
|
-
### v0.8.0
|
|
306
|
-
- `amem init` — auto-configure all AI tools in one command
|
|
307
|
-
- `amem rules` — generate extraction rules
|
|
308
|
-
- `amem dashboard` — web-based memory browser
|
|
309
|
-
|
|
310
|
-
### v0.7.0
|
|
311
|
-
- Memory import/export with content-hash dedup
|
|
312
|
-
- Confidence decay for stale memories
|
|
313
|
-
- Embedding cache (LRU, 128 entries)
|
|
314
|
-
- Multi-process safe database
|
|
315
|
-
|
|
316
|
-
### v0.5.x
|
|
317
|
-
- Progressive disclosure (`compact` mode, ~10x token savings)
|
|
318
|
-
- Persistent cross-session reminders with deadlines
|
|
319
|
-
|
|
320
|
-
### v0.4.0
|
|
321
|
-
- Lossless conversation log (append-only)
|
|
322
|
-
- Surgical patch system with version history
|
|
323
|
-
- Knowledge graph with typed relations
|
|
324
|
-
- Temporal queries with natural language ranges
|
|
325
|
-
- Full-text search (FTS5)
|
|
326
|
-
|
|
327
|
-
### v0.1.0 — v0.3.0
|
|
328
|
-
- Core store/recall with semantic search
|
|
329
|
-
- Local embeddings (HuggingFace)
|
|
330
|
-
- SQLite + WAL persistence
|
|
331
|
-
- Memory consolidation engine
|
|
332
|
-
- Project-aware scoping
|
|
218
|
+
</td>
|
|
219
|
+
<td>
|
|
333
220
|
|
|
334
|
-
|
|
221
|
+
Measured: 100 searches averaged, 384-dim embeddings, top-10 results.
|
|
222
|
+
|
|
223
|
+
**Sub-0.1ms at any scale** — effectively O(log n). HNSW is an optional dependency; brute-force is used as fallback when unavailable.
|
|
224
|
+
|
|
225
|
+
</td>
|
|
226
|
+
</tr>
|
|
227
|
+
</table>
|
|
335
228
|
|
|
336
229
|
---
|
|
337
230
|
|
|
@@ -341,143 +234,123 @@ Memories aren't forever. When facts change:
|
|
|
341
234
|
|
|
342
235
|
| Tool | Description |
|
|
343
236
|
|---|---|
|
|
344
|
-
| `memory_store` | Store a memory with type, tags, confidence. Auto-redacts private content
|
|
345
|
-
| `memory_recall` | Semantic search
|
|
346
|
-
| `memory_detail` | Retrieve full content by ID after compact recall |
|
|
347
|
-
| `memory_context` | Load all relevant context for a topic, organized by type |
|
|
348
|
-
| `memory_extract` | Batch-save multiple memories from conversation |
|
|
349
|
-
| `memory_forget` | Delete by ID or query (with confirmation) |
|
|
350
|
-
| `memory_inject` | Surface corrections + decisions before coding starts |
|
|
237
|
+
| `memory_store` | Store a memory with type, tags, confidence. Auto-redacts private content, auto-expires contradictions. |
|
|
238
|
+
| `memory_recall` | Semantic search — compact mode by default (~10x token savings). Use `memory_detail` for full content. |
|
|
239
|
+
| `memory_detail` | Retrieve full content by ID after compact recall. |
|
|
240
|
+
| `memory_context` | Load all relevant context for a topic, organized by type with token budgeting. |
|
|
241
|
+
| `memory_extract` | Batch-save multiple memories from conversation. |
|
|
242
|
+
| `memory_forget` | Delete by ID or query (with confirmation). |
|
|
243
|
+
| `memory_inject` | Surface corrections + decisions + graph neighbors before coding starts. |
|
|
244
|
+
|
|
245
|
+
<details>
|
|
246
|
+
<summary><strong>Precision, History, Advanced, Reminders, and Maintenance tools (21 more)</strong></summary>
|
|
351
247
|
|
|
352
248
|
### Precision & History (5 tools)
|
|
353
249
|
|
|
354
250
|
| Tool | Description |
|
|
355
251
|
|---|---|
|
|
356
|
-
| `memory_patch` | Surgical field-level edit with auto-snapshot |
|
|
357
|
-
| `memory_versions` | View full edit history or restore any version |
|
|
358
|
-
| `memory_search` | Exact full-text search via FTS5 with
|
|
359
|
-
| `memory_since` | Temporal query with natural language ranges (`7d`, `2w`, `1h`) |
|
|
360
|
-
| `memory_relate` | Build a typed knowledge graph between memories |
|
|
252
|
+
| `memory_patch` | Surgical field-level edit with auto-snapshot. |
|
|
253
|
+
| `memory_versions` | View full edit history or restore any version. |
|
|
254
|
+
| `memory_search` | Exact full-text search via FTS5 with compact mode. |
|
|
255
|
+
| `memory_since` | Temporal query with natural language ranges (`7d`, `2w`, `1h`). |
|
|
256
|
+
| `memory_relate` | Build a typed knowledge graph between memories. |
|
|
361
257
|
|
|
362
258
|
### Advanced (5 tools)
|
|
363
259
|
|
|
364
260
|
| Tool | Description |
|
|
365
261
|
|---|---|
|
|
366
|
-
| `memory_multi_recall` | Multi-strategy search with
|
|
367
|
-
| `memory_tier` | Move memories between tiers: core / working / archival |
|
|
368
|
-
| `memory_expire` | Mark as no longer valid — preserved for history, excluded from recall |
|
|
369
|
-
| `memory_summarize` | Store structured session summary with decisions, corrections, metrics |
|
|
370
|
-
| `memory_history` | View past session summaries |
|
|
262
|
+
| `memory_multi_recall` | Multi-strategy search with compact mode: semantic + FTS5 + graph + temporal. |
|
|
263
|
+
| `memory_tier` | Move memories between tiers: core / working / archival. |
|
|
264
|
+
| `memory_expire` | Mark as no longer valid — preserved for history, excluded from recall. |
|
|
265
|
+
| `memory_summarize` | Store structured session summary with decisions, corrections, metrics. |
|
|
266
|
+
| `memory_history` | View past session summaries. |
|
|
371
267
|
|
|
372
268
|
### Reminders (4 tools)
|
|
373
269
|
|
|
374
270
|
| Tool | Description |
|
|
375
271
|
|---|---|
|
|
376
|
-
| `reminder_set` | Create reminder with optional deadline and scope |
|
|
377
|
-
| `reminder_list` | List active (or all) reminders, filterable by scope |
|
|
378
|
-
| `reminder_check` | Show overdue, today, and upcoming (7 days) |
|
|
379
|
-
| `reminder_complete` | Mark as done (supports partial ID) |
|
|
272
|
+
| `reminder_set` | Create reminder with optional deadline and scope. |
|
|
273
|
+
| `reminder_list` | List active (or all) reminders, filterable by scope. |
|
|
274
|
+
| `reminder_check` | Show overdue, today, and upcoming (7 days). |
|
|
275
|
+
| `reminder_complete` | Mark as done (supports partial ID). |
|
|
380
276
|
|
|
381
277
|
### Log & Maintenance (7 tools)
|
|
382
278
|
|
|
383
279
|
| Tool | Description |
|
|
384
280
|
|---|---|
|
|
385
|
-
| `memory_log` | Append raw conversation turns (lossless, append-only) |
|
|
386
|
-
| `memory_log_recall` | Search or replay log by session, keyword, or recency |
|
|
387
|
-
| `memory_log_cleanup` | Prune old entries with configurable retention |
|
|
388
|
-
| `memory_stats` | Counts, type breakdown, confidence distribution |
|
|
389
|
-
| `memory_export` | Export as Markdown or JSON |
|
|
390
|
-
| `memory_import` | Bulk import from JSON with automatic dedup |
|
|
391
|
-
| `memory_consolidate` | Merge duplicates, prune stale, promote frequent, decay idle |
|
|
281
|
+
| `memory_log` | Append raw conversation turns (lossless, append-only). |
|
|
282
|
+
| `memory_log_recall` | Search or replay log by session, keyword, or recency. |
|
|
283
|
+
| `memory_log_cleanup` | Prune old entries with configurable retention. |
|
|
284
|
+
| `memory_stats` | Counts, type breakdown, confidence distribution. |
|
|
285
|
+
| `memory_export` | Export as Markdown or JSON. |
|
|
286
|
+
| `memory_import` | Bulk import from JSON with automatic dedup. |
|
|
287
|
+
| `memory_consolidate` | Merge duplicates, prune stale, promote frequent, decay idle. |
|
|
288
|
+
|
|
289
|
+
</details>
|
|
392
290
|
|
|
393
291
|
---
|
|
394
292
|
|
|
395
293
|
## Usage Guide
|
|
396
294
|
|
|
397
|
-
### Starting a Session
|
|
398
|
-
|
|
399
|
-
Your AI will automatically load context if rules are installed. You can also ask:
|
|
400
|
-
|
|
401
|
-
> *"Load context for authentication"*
|
|
402
|
-
> *"What corrections do you have for this project?"*
|
|
403
|
-
> *"Check my reminders"*
|
|
404
|
-
|
|
405
295
|
### Storing Memories
|
|
406
296
|
|
|
407
|
-
<
|
|
408
|
-
<
|
|
297
|
+
<table>
|
|
298
|
+
<tr>
|
|
299
|
+
<td width="50%">
|
|
409
300
|
|
|
410
|
-
|
|
301
|
+
**Natural language** (easiest)
|
|
411
302
|
|
|
412
303
|
```
|
|
413
304
|
"Remember: we use PostgreSQL, not MongoDB"
|
|
414
305
|
"Store a correction: never use console.log in production"
|
|
415
|
-
"Note that the auth module is in src/auth/
|
|
306
|
+
"Note that the auth module is in src/auth/"
|
|
416
307
|
```
|
|
417
308
|
|
|
418
|
-
</
|
|
309
|
+
</td>
|
|
310
|
+
<td width="50%">
|
|
419
311
|
|
|
420
|
-
|
|
421
|
-
<summary><strong>Explicit tool calls</strong></summary>
|
|
312
|
+
**Explicit tool calls**
|
|
422
313
|
|
|
423
314
|
```js
|
|
424
|
-
// Store a correction — highest priority
|
|
425
315
|
memory_store({
|
|
426
|
-
content: "Never use 'any'
|
|
316
|
+
content: "Never use 'any' — define proper interfaces",
|
|
427
317
|
type: "correction",
|
|
428
|
-
tags: ["typescript"
|
|
318
|
+
tags: ["typescript"],
|
|
429
319
|
confidence: 1.0
|
|
430
320
|
})
|
|
431
|
-
|
|
432
|
-
// Batch extract from conversation
|
|
433
|
-
memory_extract({
|
|
434
|
-
memories: [
|
|
435
|
-
{ content: "Uses pnpm, not npm", type: "preference", tags: ["tooling"], confidence: 0.9 },
|
|
436
|
-
{ content: "Auth uses OAuth2 with PKCE", type: "decision", tags: ["auth"], confidence: 0.9 },
|
|
437
|
-
]
|
|
438
|
-
})
|
|
439
321
|
```
|
|
440
322
|
|
|
441
|
-
</
|
|
323
|
+
</td>
|
|
324
|
+
</tr>
|
|
325
|
+
</table>
|
|
442
326
|
|
|
443
327
|
### Recalling Memories
|
|
444
328
|
|
|
445
|
-
<details open>
|
|
446
|
-
<summary><strong>Progressive disclosure (recommended)</strong></summary>
|
|
447
|
-
|
|
448
329
|
```js
|
|
449
330
|
// Step 1: Compact index — ~50-100 tokens (default)
|
|
450
331
|
memory_recall({ query: "auth decisions", limit: 5 })
|
|
451
|
-
//
|
|
452
|
-
//
|
|
332
|
+
// -> a1b2c3d4 [decision] Auth service uses JWT tokens... (92%)
|
|
333
|
+
// -> e5f6g7h8 [correction] Never store tokens in localStorage... (100%)
|
|
453
334
|
|
|
454
|
-
// Step 2: Full details only for what you need
|
|
335
|
+
// Step 2: Full details only for what you need
|
|
455
336
|
memory_detail({ ids: ["a1b2c3d4", "e5f6g7h8"] })
|
|
456
337
|
```
|
|
457
338
|
|
|
458
|
-
</details>
|
|
459
|
-
|
|
460
339
|
<details>
|
|
461
|
-
<summary><strong>
|
|
340
|
+
<summary><strong>More search options</strong></summary>
|
|
462
341
|
|
|
463
342
|
```js
|
|
464
|
-
//
|
|
343
|
+
// Multi-strategy: semantic + FTS5 + graph + temporal
|
|
465
344
|
memory_multi_recall({
|
|
466
345
|
query: "authentication architecture",
|
|
467
346
|
limit: 10,
|
|
468
347
|
weights: { semantic: 0.4, fts: 0.3, graph: 0.15, temporal: 0.15 }
|
|
469
348
|
})
|
|
470
|
-
```
|
|
471
349
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
```js
|
|
478
|
-
memory_search({ query: "OAuth PKCE" }) // exact terms
|
|
479
|
-
memory_search({ query: '"event sourcing"' }) // phrase match
|
|
480
|
-
memory_search({ query: "auth* NOT legacy" }) // FTS5 boolean syntax
|
|
350
|
+
// Exact keyword search (FTS5 syntax)
|
|
351
|
+
memory_search({ query: "OAuth PKCE" })
|
|
352
|
+
memory_search({ query: '"event sourcing"' }) // phrase match
|
|
353
|
+
memory_search({ query: "auth* NOT legacy" }) // boolean
|
|
481
354
|
```
|
|
482
355
|
|
|
483
356
|
</details>
|
|
@@ -485,81 +358,23 @@ memory_search({ query: "auth* NOT legacy" }) // FTS5 boolean syntax
|
|
|
485
358
|
### Managing Memories
|
|
486
359
|
|
|
487
360
|
<details>
|
|
488
|
-
<summary><strong>Edit
|
|
361
|
+
<summary><strong>Edit, expire, promote, link</strong></summary>
|
|
489
362
|
|
|
490
363
|
```js
|
|
491
|
-
//
|
|
492
|
-
memory_patch({
|
|
493
|
-
id: "a1b2c3d4",
|
|
494
|
-
field: "content",
|
|
495
|
-
value: "Never use 'any' — use interfaces or 'unknown'",
|
|
496
|
-
reason: "added unknown guidance"
|
|
497
|
-
})
|
|
364
|
+
// Surgical edit with auto-snapshot for rollback
|
|
365
|
+
memory_patch({ id: "a1b2c3d4", field: "content", value: "Updated text", reason: "clarified" })
|
|
498
366
|
|
|
499
|
-
// View history
|
|
367
|
+
// View edit history / restore
|
|
500
368
|
memory_versions({ memory_id: "a1b2c3d4" })
|
|
501
369
|
|
|
502
|
-
//
|
|
503
|
-
|
|
504
|
-
```
|
|
505
|
-
|
|
506
|
-
</details>
|
|
507
|
-
|
|
508
|
-
<details>
|
|
509
|
-
<summary><strong>Expire outdated memories</strong></summary>
|
|
510
|
-
|
|
511
|
-
```js
|
|
512
|
-
// Mark as expired — preserved for history, excluded from recall
|
|
513
|
-
memory_expire({ id: "a1b2c3d4", reason: "Migrated from REST to GraphQL" })
|
|
514
|
-
|
|
515
|
-
// Store the replacement — contradictions are also auto-detected
|
|
516
|
-
memory_store({
|
|
517
|
-
content: "API uses GraphQL with Apollo Server",
|
|
518
|
-
type: "decision",
|
|
519
|
-
tags: ["api", "graphql"],
|
|
520
|
-
confidence: 0.9
|
|
521
|
-
})
|
|
370
|
+
// Expire (preserve for history, exclude from recall)
|
|
371
|
+
memory_expire({ id: "a1b2c3d4", reason: "Migrated to GraphQL" })
|
|
522
372
|
|
|
523
|
-
//
|
|
524
|
-
memory_since({ since: "2025-01-01", until: "2025-03-01", type: "decision" })
|
|
525
|
-
```
|
|
526
|
-
|
|
527
|
-
</details>
|
|
528
|
-
|
|
529
|
-
<details>
|
|
530
|
-
<summary><strong>Promote to core tier</strong></summary>
|
|
531
|
-
|
|
532
|
-
```js
|
|
533
|
-
// Core memories are always injected at session start
|
|
373
|
+
// Promote to core tier (always loaded at session start)
|
|
534
374
|
memory_tier({ id: "a1b2c3d4", tier: "core" })
|
|
535
375
|
|
|
536
|
-
//
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
// Demote back to archival
|
|
540
|
-
memory_tier({ id: "a1b2c3d4", tier: "archival" })
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
</details>
|
|
544
|
-
|
|
545
|
-
### Knowledge Graph
|
|
546
|
-
|
|
547
|
-
> **New in v0.13.0:** The graph builds itself. When you store a memory, amem automatically finds and links the top-3 most similar existing memories. You can also link manually:
|
|
548
|
-
|
|
549
|
-
<details>
|
|
550
|
-
<summary><strong>Link related memories</strong></summary>
|
|
551
|
-
|
|
552
|
-
```js
|
|
553
|
-
memory_relate({
|
|
554
|
-
action: "relate",
|
|
555
|
-
from_id: "decision-abc",
|
|
556
|
-
to_id: "pattern-xyz",
|
|
557
|
-
relation_type: "supports",
|
|
558
|
-
strength: 0.9
|
|
559
|
-
})
|
|
560
|
-
|
|
561
|
-
// View all connections for a memory
|
|
562
|
-
memory_relate({ action: "graph", memory_id: "decision-abc" })
|
|
376
|
+
// Link related memories (graph builds itself, but you can add manual links)
|
|
377
|
+
memory_relate({ action: "relate", from_id: "abc", to_id: "xyz", relation_type: "supports" })
|
|
563
378
|
```
|
|
564
379
|
|
|
565
380
|
Relation types: `supports`, `contradicts`, `depends_on`, `supersedes`, `related_to`, `caused_by`, `implements` — or define your own.
|
|
@@ -572,17 +387,12 @@ Relation types: `supports`, `contradicts`, `depends_on`, `supersedes`, `related_
|
|
|
572
387
|
<summary><strong>Cross-session deadline tracking</strong></summary>
|
|
573
388
|
|
|
574
389
|
```js
|
|
575
|
-
reminder_set({
|
|
576
|
-
content: "Review PR #42",
|
|
577
|
-
due_at: 1743033600000,
|
|
578
|
-
scope: "global"
|
|
579
|
-
})
|
|
390
|
+
reminder_set({ content: "Review PR #42", due_at: 1743033600000, scope: "global" })
|
|
580
391
|
|
|
581
|
-
// Check what's due (your AI does this automatically at session start)
|
|
582
392
|
reminder_check({})
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
393
|
+
// -> [OVERDUE] Review PR #42
|
|
394
|
+
// -> [TODAY] Deploy auth service
|
|
395
|
+
// -> [upcoming] Write quarterly report
|
|
586
396
|
|
|
587
397
|
reminder_complete({ id: "a1b2c3d4" })
|
|
588
398
|
```
|
|
@@ -592,49 +402,58 @@ reminder_complete({ id: "a1b2c3d4" })
|
|
|
592
402
|
### Privacy
|
|
593
403
|
|
|
594
404
|
<details>
|
|
595
|
-
<summary><strong>
|
|
405
|
+
<summary><strong>Automatic redaction</strong></summary>
|
|
596
406
|
|
|
597
407
|
```js
|
|
598
|
-
// Private blocks
|
|
408
|
+
// Private blocks stripped before storage
|
|
599
409
|
memory_store({
|
|
600
410
|
content: "DB password is <private>hunter2</private>, connect to prod at db.example.com",
|
|
601
|
-
type: "topology",
|
|
602
|
-
tags: ["database"]
|
|
411
|
+
type: "topology", tags: ["database"]
|
|
603
412
|
})
|
|
604
|
-
// Stored
|
|
413
|
+
// Stored: "DB password is [REDACTED], connect to prod at db.example.com"
|
|
605
414
|
|
|
606
|
-
// API keys, tokens,
|
|
415
|
+
// API keys, tokens, passwords auto-redacted by pattern matching
|
|
607
416
|
// Configure patterns in ~/.amem/config.json
|
|
608
417
|
```
|
|
609
418
|
|
|
610
419
|
</details>
|
|
611
420
|
|
|
612
|
-
|
|
421
|
+
---
|
|
613
422
|
|
|
614
|
-
|
|
615
|
-
<summary><strong>Structured session digests</strong></summary>
|
|
423
|
+
## Platform Compatibility
|
|
616
424
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
425
|
+
| Feature | Claude Code | GitHub Copilot CLI | Cursor / Windsurf / Other |
|
|
426
|
+
|---|:---:|:---:|:---:|
|
|
427
|
+
| One-command plugin install | Yes | Yes | -- |
|
|
428
|
+
| 28 MCP tools | Yes | Yes | Yes |
|
|
429
|
+
| AI skills | 14 | 7 | -- |
|
|
430
|
+
| Auto-capture hooks | Yes | Yes | -- |
|
|
431
|
+
| Session auto-summarize | Yes | Yes | -- |
|
|
432
|
+
| Auto-memory sync | Yes | -- | -- |
|
|
433
|
+
| CLI setup (`amem-cli init`) | Yes | Yes | Yes |
|
|
626
434
|
|
|
627
|
-
|
|
628
|
-
memory_history({ limit: 5 })
|
|
629
|
-
```
|
|
435
|
+
**Claude Code** has the deepest integration (plugin + hooks + auto-memory sync). **Copilot CLI** is a close second. **Other MCP clients** get the full 28-tool server via manual config.
|
|
630
436
|
|
|
631
|
-
|
|
437
|
+
### AI Skills
|
|
438
|
+
|
|
439
|
+
| What you say | Skill | Claude Code | Copilot CLI |
|
|
440
|
+
|---|---|:---:|:---:|
|
|
441
|
+
| *"Remember never use any type"* | `remember` | Yes | Yes |
|
|
442
|
+
| *"What do you remember about auth?"* | `recall` | Yes | Yes |
|
|
443
|
+
| *"Load context for this task"* | `context` | Yes | Yes |
|
|
444
|
+
| *"Show memory stats"* | `stats` | Yes | Yes |
|
|
445
|
+
| *"Run memory doctor"* | `doctor` | Yes | Yes |
|
|
446
|
+
| *"Export my memories"* | `export` | Yes | Yes |
|
|
447
|
+
| *"List all corrections"* | `list` | Yes | Yes |
|
|
448
|
+
| *"Sync my Claude memory"* | `sync` | Yes | -- |
|
|
449
|
+
| *"Open the memory dashboard"* | `dashboard` | Yes | -- |
|
|
450
|
+
| *"Install hooks"* | `hooks` | Yes | -- |
|
|
632
451
|
|
|
633
452
|
---
|
|
634
453
|
|
|
635
454
|
## Working with Claude Code Auto-Memory
|
|
636
455
|
|
|
637
|
-
|
|
456
|
+
amem complements Claude's built-in auto-memory — it doesn't replace it.
|
|
638
457
|
|
|
639
458
|
| | Claude auto-memory | amem |
|
|
640
459
|
|---|---|---|
|
|
@@ -644,21 +463,17 @@ Claude Code has a built-in auto-memory feature that stores a flat markdown file
|
|
|
644
463
|
| **History** | Overwritten on update | Versioned, temporal validity |
|
|
645
464
|
| **Search** | None | Semantic + FTS5 + graph + reranking |
|
|
646
465
|
|
|
647
|
-
|
|
466
|
+
**Recommended:** Keep both enabled. Run `amem-cli sync` to import Claude's memories into amem for unified, structured access.
|
|
648
467
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
3. **amem handles the specifics** — corrections, decisions, patterns get typed, scored, and searchable
|
|
468
|
+
<details>
|
|
469
|
+
<summary><strong>Sync details</strong></summary>
|
|
652
470
|
|
|
653
471
|
```bash
|
|
654
|
-
# Import Claude auto-memory into amem (one-time or periodic)
|
|
655
472
|
amem-cli sync # Import all projects
|
|
656
473
|
amem-cli sync --dry-run # Preview what would be imported
|
|
657
|
-
amem-cli sync --project myapp # Import specific project
|
|
474
|
+
amem-cli sync --project myapp # Import specific project
|
|
658
475
|
```
|
|
659
476
|
|
|
660
|
-
Type mapping when syncing:
|
|
661
|
-
|
|
662
477
|
| Claude type | amem type | Confidence |
|
|
663
478
|
|---|---|---|
|
|
664
479
|
| `feedback` | `correction` | 1.0 |
|
|
@@ -666,29 +481,18 @@ Type mapping when syncing:
|
|
|
666
481
|
| `user` | `preference` | 0.8 |
|
|
667
482
|
| `reference` | `topology` | 0.7 |
|
|
668
483
|
|
|
669
|
-
>
|
|
484
|
+
</details>
|
|
670
485
|
|
|
671
486
|
---
|
|
672
487
|
|
|
673
488
|
## Dashboard
|
|
674
489
|
|
|
675
|
-
Launch the interactive web dashboard:
|
|
676
|
-
|
|
677
490
|
```bash
|
|
678
491
|
amem-cli dashboard # Opens at localhost:3333
|
|
679
492
|
amem-cli dashboard --port=8080 # Custom port
|
|
680
493
|
```
|
|
681
494
|
|
|
682
|
-
|
|
683
|
-
- Memory list with search, type filter, and tier filter
|
|
684
|
-
- Search term highlighting
|
|
685
|
-
- Inline actions: Promote to Core, Demote, Expire
|
|
686
|
-
- Export as JSON or Markdown with one click
|
|
687
|
-
- Interactive knowledge graph (drag nodes, click to inspect)
|
|
688
|
-
- Confidence distribution and type breakdown charts
|
|
689
|
-
- Session summaries timeline
|
|
690
|
-
- Reminders with status badges
|
|
691
|
-
- Recent conversation log
|
|
495
|
+
Memory list with search and filters, inline actions (promote, demote, expire), interactive knowledge graph, confidence charts, session timeline, reminders, and conversation log.
|
|
692
496
|
|
|
693
497
|
---
|
|
694
498
|
|
|
@@ -700,20 +504,17 @@ amem-cli init # Auto-configure AI tools
|
|
|
700
504
|
amem-cli rules # Generate extraction rules
|
|
701
505
|
amem-cli hooks # Install automatic capture hooks
|
|
702
506
|
amem-cli hooks --uninstall # Remove hooks
|
|
703
|
-
amem-cli sync # Import Claude auto-memory
|
|
704
|
-
amem-cli sync --dry-run # Preview sync without importing
|
|
507
|
+
amem-cli sync # Import Claude auto-memory
|
|
705
508
|
amem-cli doctor # Health diagnostics
|
|
706
509
|
amem-cli repair # Repair corrupted database from backups
|
|
707
510
|
|
|
708
511
|
# Dashboard
|
|
709
512
|
amem-cli dashboard # Web dashboard (localhost:3333)
|
|
710
|
-
amem-cli dashboard --port=8080 # Custom port
|
|
711
513
|
|
|
712
514
|
# Memory operations
|
|
713
515
|
amem-cli recall "authentication" # Semantic search
|
|
714
516
|
amem-cli stats # Statistics
|
|
715
|
-
amem-cli list
|
|
716
|
-
amem-cli list --type correction # Filter by type
|
|
517
|
+
amem-cli list --type correction # List by type
|
|
717
518
|
amem-cli export --file memories.md # Export to file
|
|
718
519
|
amem-cli forget abc12345 # Delete by short ID
|
|
719
520
|
amem-cli reset --confirm # Wipe all data
|
|
@@ -724,88 +525,59 @@ amem-cli reset --confirm # Wipe all data
|
|
|
724
525
|
## Architecture
|
|
725
526
|
|
|
726
527
|
```
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
528
|
+
Your AI Tool
|
|
529
|
+
Claude Code / Copilot CLI / any MCP client
|
|
530
|
+
| |
|
|
531
|
+
| MCP (stdio) | Lifecycle Hooks
|
|
532
|
+
v v
|
|
533
|
+
+---------------------------------+
|
|
534
|
+
| amem MCP Server |
|
|
535
|
+
| |
|
|
536
|
+
| 28 Tools . 7 Resources . 2 Prompts
|
|
537
|
+
| |
|
|
538
|
+
| Multi-Strategy Retrieval |
|
|
539
|
+
| [HNSW] + [FTS5] + [Graph] + [Temporal]
|
|
540
|
+
| + query expansion |
|
|
541
|
+
| + cross-encoder (opt-in) |
|
|
542
|
+
| |
|
|
543
|
+
| +---------------------------+ |
|
|
544
|
+
| | SQLite + WAL + FTS5 | |
|
|
545
|
+
| | ~/.amem/memory.db | |
|
|
546
|
+
| | | |
|
|
547
|
+
| | memories (tiered) | |
|
|
548
|
+
| | conversation_log (raw) | |
|
|
549
|
+
| | memory_versions (history) | |
|
|
550
|
+
| | memory_relations (graph) | |
|
|
551
|
+
| | session_summaries | |
|
|
552
|
+
| | reminders | |
|
|
553
|
+
| +---------------------------+ |
|
|
554
|
+
| |
|
|
555
|
+
| Embeddings: bge-small-en-v1.5 |
|
|
556
|
+
| Config: ~/.amem/config.json |
|
|
557
|
+
+---------------------------------+
|
|
757
558
|
```
|
|
758
559
|
|
|
759
560
|
### Ranking Formula
|
|
760
561
|
|
|
761
562
|
```
|
|
762
|
-
score = relevance
|
|
563
|
+
score = relevance x 0.45 + recency x 0.2 + confidence x 0.2 + importance x 0.15
|
|
763
564
|
```
|
|
764
565
|
|
|
765
566
|
| Factor | How it works |
|
|
766
567
|
|---|---|
|
|
767
|
-
| **Relevance** | Cosine similarity via
|
|
568
|
+
| **Relevance** | Cosine similarity via HNSW index; query-expanded keyword fallback |
|
|
768
569
|
| **Recency** | Exponential decay (`0.995^hours`) |
|
|
769
570
|
| **Confidence** | Reinforced by repeated confirmation (0-1) |
|
|
770
|
-
| **Importance** | Type-based: corrections `1.0`
|
|
771
|
-
|
|
772
|
-
> **Additive weighted scoring** ensures no single low factor kills the ranking. A memory with low confidence but high relevance still surfaces — unlike multiplicative scoring where one zero kills everything.
|
|
773
|
-
|
|
774
|
-
### Benchmark Results
|
|
571
|
+
| **Importance** | Type-based: corrections `1.0` ... facts `0.4` |
|
|
775
572
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
| Strategy | Recall@5 | Recall@10 | MRR | Precision@5 |
|
|
779
|
-
|---|---|---|---|---|
|
|
780
|
-
| Keyword-only (no embeddings) | 34.4% | 62.0% | 36.7% | 13.8% |
|
|
781
|
-
| FTS5-only | 31.3% | 31.3% | 31.3% | --- |
|
|
782
|
-
| Multi-strategy (FTS + graph + temporal) | 31.3% | 31.3% | 31.3% | 25.0% |
|
|
783
|
-
| **Multi-strategy + embeddings** (default) | **~70%+** | **~85%+** | **~75%+** | **~35%+** |
|
|
784
|
-
| + cross-encoder reranking (opt-in) | ~80%+ | ~90%+ | ~85%+ | ~45%+ |
|
|
785
|
-
|
|
786
|
-
> **Default out-of-box performance is ~70% Recall@5** with embeddings. Cross-encoder reranking improves this to ~80%+ but is opt-in — enable it with `"rerankerEnabled": true` in `~/.amem/config.json`. Without embeddings (first run before model downloads), retrieval gracefully degrades to keyword-only (~34%).
|
|
787
|
-
|
|
788
|
-
---
|
|
789
|
-
|
|
790
|
-
## MCP Resources
|
|
791
|
-
|
|
792
|
-
These are automatically available to your AI tool:
|
|
793
|
-
|
|
794
|
-
| URI | Description |
|
|
795
|
-
|---|---|
|
|
796
|
-
| `amem://corrections` | All active corrections (hard constraints) |
|
|
797
|
-
| `amem://decisions` | Architectural decisions |
|
|
798
|
-
| `amem://profile` | Preferences and coding patterns |
|
|
799
|
-
| `amem://summary` | Memory count and type breakdown |
|
|
800
|
-
| `amem://log/recent` | Last 50 raw conversation log entries |
|
|
801
|
-
| `amem://graph` | Knowledge graph overview |
|
|
802
|
-
| `amem://last-session` | Previous session summary — decisions, corrections, and metrics |
|
|
573
|
+
Additive scoring ensures no single low factor kills the ranking.
|
|
803
574
|
|
|
804
575
|
---
|
|
805
576
|
|
|
806
577
|
## Configuration
|
|
807
578
|
|
|
808
|
-
|
|
579
|
+
<details>
|
|
580
|
+
<summary><strong>Environment variables</strong></summary>
|
|
809
581
|
|
|
810
582
|
| Variable | Default | Description |
|
|
811
583
|
|---|---|---|
|
|
@@ -813,9 +585,12 @@ These are automatically available to your AI tool:
|
|
|
813
585
|
| `AMEM_DB` | `~/.amem/memory.db` | Database path |
|
|
814
586
|
| `AMEM_PROJECT` | *(auto from git)* | Project scope override |
|
|
815
587
|
|
|
816
|
-
|
|
588
|
+
</details>
|
|
589
|
+
|
|
590
|
+
<details>
|
|
591
|
+
<summary><strong>Config file (~/.amem/config.json)</strong></summary>
|
|
817
592
|
|
|
818
|
-
Created automatically with defaults
|
|
593
|
+
Created automatically with defaults:
|
|
819
594
|
|
|
820
595
|
```json
|
|
821
596
|
{
|
|
@@ -824,15 +599,11 @@ Created automatically with defaults. Edit to customize:
|
|
|
824
599
|
"ftsWeight": 0.3,
|
|
825
600
|
"graphWeight": 0.15,
|
|
826
601
|
"temporalWeight": 0.15,
|
|
827
|
-
"
|
|
828
|
-
"rerankerEnabled": false,
|
|
829
|
-
"rerankerTopK": 20
|
|
602
|
+
"rerankerEnabled": false
|
|
830
603
|
},
|
|
831
604
|
"privacy": {
|
|
832
605
|
"enablePrivateTags": true,
|
|
833
|
-
"redactPatterns": [
|
|
834
|
-
"(?:api[_-]?key|secret|token|password)\\s*[:=]\\s*['\"]?[A-Za-z0-9_\\-\\.]{8,}"
|
|
835
|
-
]
|
|
606
|
+
"redactPatterns": ["..."]
|
|
836
607
|
},
|
|
837
608
|
"tiers": {
|
|
838
609
|
"coreMaxTokens": 500,
|
|
@@ -846,6 +617,28 @@ Created automatically with defaults. Edit to customize:
|
|
|
846
617
|
}
|
|
847
618
|
```
|
|
848
619
|
|
|
620
|
+
</details>
|
|
621
|
+
|
|
622
|
+
<details>
|
|
623
|
+
<summary><strong>Version history</strong></summary>
|
|
624
|
+
|
|
625
|
+
### v0.18.0 — Progressive Disclosure & Scale
|
|
626
|
+
HNSW vector index (67x faster at 10k), compact mode default on recall/search, DB repair CLI, concurrent access safety, heuristic conversation extractor, session-end auto-extraction.
|
|
627
|
+
|
|
628
|
+
### v0.13.0 — World-Class Recall
|
|
629
|
+
bge-small-en-v1.5 embeddings, additive scoring, query expansion, auto-relate knowledge graph, graph-aware injection, amem doctor, CI benchmarks.
|
|
630
|
+
|
|
631
|
+
### v0.9.x — Temporal Intelligence
|
|
632
|
+
Temporal validity, auto-expire contradictions, multi-strategy retrieval, cross-encoder reranking, memory tiers, privacy tags, lifecycle hooks, session summaries, dashboard, config system.
|
|
633
|
+
|
|
634
|
+
### v0.7.0 — v0.8.0
|
|
635
|
+
Import/export, confidence decay, embedding cache, multi-process safety, auto-configure CLI, dashboard.
|
|
636
|
+
|
|
637
|
+
### v0.1.0 — v0.5.x
|
|
638
|
+
Core store/recall, local embeddings, SQLite + WAL, consolidation, project scoping, reminders, conversation log, knowledge graph, FTS5, progressive disclosure.
|
|
639
|
+
|
|
640
|
+
</details>
|
|
641
|
+
|
|
849
642
|
---
|
|
850
643
|
|
|
851
644
|
## Tech Stack
|
|
@@ -855,11 +648,11 @@ Created automatically with defaults. Edit to customize:
|
|
|
855
648
|
| Protocol | MCP SDK ^1.25 |
|
|
856
649
|
| Language | TypeScript 5.6+, strict mode |
|
|
857
650
|
| Database | SQLite + WAL + FTS5 |
|
|
858
|
-
| Embeddings | HuggingFace
|
|
859
|
-
| Reranking |
|
|
651
|
+
| Embeddings | HuggingFace bge-small-en-v1.5 (local, 80MB) + HNSW vector index |
|
|
652
|
+
| Reranking | ms-marco-MiniLM-L-6-v2 (optional, local) |
|
|
860
653
|
| Validation | Zod 3.25+ with `.strict()` schemas |
|
|
861
654
|
| Testing | Vitest — 357 tests across 28 suites + recall benchmarks |
|
|
862
|
-
| CI/CD | GitHub Actions
|
|
655
|
+
| CI/CD | GitHub Actions, npm publish on release |
|
|
863
656
|
|
|
864
657
|
---
|
|
865
658
|
|
|
@@ -869,7 +662,7 @@ Created automatically with defaults. Edit to customize:
|
|
|
869
662
|
git clone https://github.com/amanasmuei/amem.git
|
|
870
663
|
cd amem && npm install
|
|
871
664
|
npm run build # zero TS errors
|
|
872
|
-
npm test #
|
|
665
|
+
npm test # 357 tests pass
|
|
873
666
|
```
|
|
874
667
|
|
|
875
668
|
PRs must pass CI before merge. See [Issues](https://github.com/amanasmuei/amem/issues) for open tasks.
|