yourmemory 1.2.0__tar.gz → 1.2.1__tar.gz
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.
- {yourmemory-1.2.0/yourmemory.egg-info → yourmemory-1.2.1}/PKG-INFO +60 -54
- {yourmemory-1.2.0 → yourmemory-1.2.1}/README.md +58 -52
- {yourmemory-1.2.0 → yourmemory-1.2.1}/pyproject.toml +2 -2
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/extract.py +0 -2
- yourmemory-1.2.1/src/services/extract_fallback.py +34 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1/yourmemory.egg-info}/PKG-INFO +60 -54
- {yourmemory-1.2.0 → yourmemory-1.2.1}/yourmemory.egg-info/SOURCES.txt +1 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/yourmemory.egg-info/requires.txt +1 -1
- {yourmemory-1.2.0 → yourmemory-1.2.1}/LICENSE +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/memory_mcp.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/setup.cfg +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/__init__.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/app.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/db/connection.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/db/duckdb_schema.sql +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/db/migrate.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/db/schema.sql +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/db/sqlite_schema.sql +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/jobs/decay_job.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/routes/__init__.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/routes/agents.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/routes/memories.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/routes/retrieve.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/__init__.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/agent_registry.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/api_keys.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/decay.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/embed.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/resolve.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/src/services/retrieve.py +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/yourmemory.egg-info/dependency_links.txt +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/yourmemory.egg-info/entry_points.txt +0 -0
- {yourmemory-1.2.0 → yourmemory-1.2.1}/yourmemory.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yourmemory
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Persistent memory for Claude — Ebbinghaus forgetting curve, semantic deduplication, MCP-native
|
|
5
5
|
Author-email: Sachit Misra <mishrasachit1@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -181,7 +181,7 @@ Requires-Dist: numpy
|
|
|
181
181
|
Requires-Dist: python-dateutil
|
|
182
182
|
Requires-Dist: duckdb>=0.10.0
|
|
183
183
|
Requires-Dist: apscheduler
|
|
184
|
-
Requires-Dist: spacy<4.0,>=3.
|
|
184
|
+
Requires-Dist: spacy<4.0,>=3.8.13
|
|
185
185
|
Provides-Extra: postgres
|
|
186
186
|
Requires-Dist: psycopg2-binary; extra == "postgres"
|
|
187
187
|
Requires-Dist: pgvector; extra == "postgres"
|
|
@@ -197,7 +197,7 @@ Dynamic: license-file
|
|
|
197
197
|
|
|
198
198
|
**+16pp better recall than Mem0 on LoCoMo. 100% stale memory precision. Biologically-inspired memory decay for AI agents.**
|
|
199
199
|
|
|
200
|
-
Persistent memory for Claude
|
|
200
|
+
Persistent memory for Claude and any MCP-compatible AI — works like human memory. Important things stick, forgotten things fade, outdated facts get pruned automatically.
|
|
201
201
|
|
|
202
202
|
> Early stage — feedback and ideas welcome.
|
|
203
203
|
|
|
@@ -244,7 +244,7 @@ Importance additionally modulates the decay rate within each category. Memories
|
|
|
244
244
|
|
|
245
245
|
## Setup
|
|
246
246
|
|
|
247
|
-
**Zero infrastructure required** — uses
|
|
247
|
+
**Zero infrastructure required** — uses DuckDB out of the box. Two commands and you're done.
|
|
248
248
|
|
|
249
249
|
### 1. Install
|
|
250
250
|
|
|
@@ -252,11 +252,21 @@ Importance additionally modulates the decay rate within each category. Memories
|
|
|
252
252
|
pip install yourmemory
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
All dependencies
|
|
255
|
+
All dependencies installed automatically. No clone, no Docker, no database setup.
|
|
256
256
|
|
|
257
|
-
### 2.
|
|
257
|
+
### 2. Get your config
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
Run this once to get your exact config:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
yourmemory-path
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
It prints your full executable path and a ready-to-paste config for any MCP client. Copy it.
|
|
266
|
+
|
|
267
|
+
### 3. Wire into your AI client
|
|
268
|
+
|
|
269
|
+
The database is created automatically at `~/.yourmemory/memories.duckdb` on first use.
|
|
260
270
|
|
|
261
271
|
#### Claude Code
|
|
262
272
|
|
|
@@ -276,26 +286,45 @@ Reload Claude Code (`Cmd+Shift+P` → `Developer: Reload Window`).
|
|
|
276
286
|
|
|
277
287
|
#### Cline (VS Code)
|
|
278
288
|
|
|
289
|
+
VS Code doesn't inherit your shell PATH, so use the **full path** from `yourmemory-path`.
|
|
290
|
+
|
|
279
291
|
In Cline → **MCP Servers** → **Edit MCP Settings**:
|
|
280
292
|
|
|
281
293
|
```json
|
|
282
294
|
{
|
|
283
295
|
"mcpServers": {
|
|
284
296
|
"yourmemory": {
|
|
285
|
-
"command": "yourmemory",
|
|
297
|
+
"command": "/full/path/to/yourmemory",
|
|
286
298
|
"args": [],
|
|
287
299
|
"env": {
|
|
288
|
-
"
|
|
289
|
-
"
|
|
300
|
+
"YOURMEMORY_USER": "your_name",
|
|
301
|
+
"DATABASE_URL": ""
|
|
290
302
|
}
|
|
291
303
|
}
|
|
292
304
|
}
|
|
293
305
|
}
|
|
294
306
|
```
|
|
295
307
|
|
|
296
|
-
|
|
308
|
+
Run `yourmemory-path` in terminal — it prints the exact config to paste.
|
|
309
|
+
|
|
310
|
+
#### Cursor
|
|
297
311
|
|
|
298
|
-
|
|
312
|
+
Add to `~/.cursor/mcp.json`:
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"mcpServers": {
|
|
317
|
+
"yourmemory": {
|
|
318
|
+
"command": "/full/path/to/yourmemory",
|
|
319
|
+
"args": [],
|
|
320
|
+
"env": {
|
|
321
|
+
"YOURMEMORY_USER": "your_name",
|
|
322
|
+
"DATABASE_URL": ""
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
299
328
|
|
|
300
329
|
#### Claude Desktop
|
|
301
330
|
|
|
@@ -315,9 +344,9 @@ Restart Claude Desktop.
|
|
|
315
344
|
|
|
316
345
|
#### Any MCP-compatible client
|
|
317
346
|
|
|
318
|
-
YourMemory is a standard stdio MCP server.
|
|
347
|
+
YourMemory is a standard stdio MCP server. Works with Claude Code, Claude Desktop, Cline, Cursor, Windsurf, Continue, and Zed. Use the full path from `yourmemory-path` if the client doesn't inherit shell PATH.
|
|
319
348
|
|
|
320
|
-
###
|
|
349
|
+
### 4. Add memory instructions to your project
|
|
321
350
|
|
|
322
351
|
Copy `sample_CLAUDE.md` into your project root as `CLAUDE.md` and replace:
|
|
323
352
|
- `YOUR_NAME` — your name (e.g. `Alice`)
|
|
@@ -329,13 +358,19 @@ Claude will now follow the recall → store → update workflow automatically on
|
|
|
329
358
|
|
|
330
359
|
### PostgreSQL (optional — for teams or large datasets)
|
|
331
360
|
|
|
332
|
-
|
|
361
|
+
Install with Postgres support:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
pip install yourmemory[postgres]
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Then create a `.env` file:
|
|
333
368
|
|
|
334
369
|
```bash
|
|
335
370
|
DATABASE_URL=postgresql://YOUR_USER@localhost:5432/yourmemory
|
|
336
371
|
```
|
|
337
372
|
|
|
338
|
-
The backend is selected automatically — `postgresql://` in `DATABASE_URL` → Postgres + pgvector, anything else →
|
|
373
|
+
The backend is selected automatically — `postgresql://` in `DATABASE_URL` → Postgres + pgvector, anything else → DuckDB.
|
|
339
374
|
|
|
340
375
|
**macOS**
|
|
341
376
|
```bash
|
|
@@ -349,8 +384,6 @@ sudo apt install postgresql postgresql-contrib postgresql-16-pgvector
|
|
|
349
384
|
createdb yourmemory
|
|
350
385
|
```
|
|
351
386
|
|
|
352
|
-
> **One-liner setup script** (macOS/Linux): `bash scripts/setup_db.sh` handles install + DB creation automatically.
|
|
353
|
-
|
|
354
387
|
---
|
|
355
388
|
|
|
356
389
|
## MCP Tools
|
|
@@ -402,47 +435,20 @@ Runs automatically every 24 hours on startup — no cron needed. Memories below
|
|
|
402
435
|
|
|
403
436
|
---
|
|
404
437
|
|
|
405
|
-
## REST API
|
|
406
|
-
|
|
407
|
-
```bash
|
|
408
|
-
# Store
|
|
409
|
-
curl -X POST http://localhost:8000/memories \
|
|
410
|
-
-H "Content-Type: application/json" \
|
|
411
|
-
-d '{"userId":"u1","content":"Prefers dark mode","importance":0.8}'
|
|
412
|
-
|
|
413
|
-
# Retrieve
|
|
414
|
-
curl -X POST http://localhost:8000/retrieve \
|
|
415
|
-
-H "Content-Type: application/json" \
|
|
416
|
-
-d '{"userId":"u1","query":"UI preferences"}'
|
|
417
|
-
|
|
418
|
-
# List all
|
|
419
|
-
curl "http://localhost:8000/memories?userId=u1"
|
|
420
|
-
|
|
421
|
-
# Update
|
|
422
|
-
curl -X PUT http://localhost:8000/memories/42 \
|
|
423
|
-
-H "Content-Type: application/json" \
|
|
424
|
-
-d '{"content":"Prefers dark mode in all apps","importance":0.85}'
|
|
425
|
-
|
|
426
|
-
# Delete
|
|
427
|
-
curl -X DELETE http://localhost:8000/memories/42
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
---
|
|
431
|
-
|
|
432
438
|
## Stack
|
|
433
439
|
|
|
434
|
-
- **
|
|
440
|
+
- **DuckDB** — default backend, zero setup, native vector similarity (same quality as pgvector)
|
|
435
441
|
- **sentence-transformers** — local embeddings (`all-mpnet-base-v2`, 768 dims, no external service needed)
|
|
436
|
-
- **FastAPI** — REST server
|
|
437
442
|
- **APScheduler** — automatic 24h decay job
|
|
438
443
|
- **MCP** — Claude integration via Model Context Protocol
|
|
444
|
+
- **PostgreSQL + pgvector** — optional, for teams / large datasets
|
|
439
445
|
|
|
440
446
|
---
|
|
441
447
|
|
|
442
448
|
## Architecture
|
|
443
449
|
|
|
444
450
|
```
|
|
445
|
-
Claude
|
|
451
|
+
Claude / Cline / Cursor / Any MCP client
|
|
446
452
|
│
|
|
447
453
|
├── recall_memory(query)
|
|
448
454
|
│ └── embed → cosine similarity → score = sim × strength → top-k
|
|
@@ -455,12 +461,12 @@ Claude Code
|
|
|
455
461
|
└── update_memory(id, new_content)
|
|
456
462
|
└── embed(new_content) → UPDATE memories
|
|
457
463
|
|
|
458
|
-
PostgreSQL (
|
|
459
|
-
└── memories
|
|
460
|
-
├── embedding vector(768)
|
|
461
|
-
├── importance float
|
|
462
|
-
├── recall_count int
|
|
463
|
-
└── last_accessed_at
|
|
464
|
+
DuckDB (default) PostgreSQL + pgvector (optional)
|
|
465
|
+
└── memories.duckdb └── memories table
|
|
466
|
+
├── embedding FLOAT[768] ├── embedding vector(768)
|
|
467
|
+
├── importance FLOAT ├── importance float
|
|
468
|
+
├── recall_count INTEGER ├── recall_count int
|
|
469
|
+
└── last_accessed_at └── last_accessed_at
|
|
464
470
|
```
|
|
465
471
|
|
|
466
472
|
---
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**+16pp better recall than Mem0 on LoCoMo. 100% stale memory precision. Biologically-inspired memory decay for AI agents.**
|
|
4
4
|
|
|
5
|
-
Persistent memory for Claude
|
|
5
|
+
Persistent memory for Claude and any MCP-compatible AI — works like human memory. Important things stick, forgotten things fade, outdated facts get pruned automatically.
|
|
6
6
|
|
|
7
7
|
> Early stage — feedback and ideas welcome.
|
|
8
8
|
|
|
@@ -49,7 +49,7 @@ Importance additionally modulates the decay rate within each category. Memories
|
|
|
49
49
|
|
|
50
50
|
## Setup
|
|
51
51
|
|
|
52
|
-
**Zero infrastructure required** — uses
|
|
52
|
+
**Zero infrastructure required** — uses DuckDB out of the box. Two commands and you're done.
|
|
53
53
|
|
|
54
54
|
### 1. Install
|
|
55
55
|
|
|
@@ -57,11 +57,21 @@ Importance additionally modulates the decay rate within each category. Memories
|
|
|
57
57
|
pip install yourmemory
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
All dependencies
|
|
60
|
+
All dependencies installed automatically. No clone, no Docker, no database setup.
|
|
61
61
|
|
|
62
|
-
### 2.
|
|
62
|
+
### 2. Get your config
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Run this once to get your exact config:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
yourmemory-path
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
It prints your full executable path and a ready-to-paste config for any MCP client. Copy it.
|
|
71
|
+
|
|
72
|
+
### 3. Wire into your AI client
|
|
73
|
+
|
|
74
|
+
The database is created automatically at `~/.yourmemory/memories.duckdb` on first use.
|
|
65
75
|
|
|
66
76
|
#### Claude Code
|
|
67
77
|
|
|
@@ -81,26 +91,45 @@ Reload Claude Code (`Cmd+Shift+P` → `Developer: Reload Window`).
|
|
|
81
91
|
|
|
82
92
|
#### Cline (VS Code)
|
|
83
93
|
|
|
94
|
+
VS Code doesn't inherit your shell PATH, so use the **full path** from `yourmemory-path`.
|
|
95
|
+
|
|
84
96
|
In Cline → **MCP Servers** → **Edit MCP Settings**:
|
|
85
97
|
|
|
86
98
|
```json
|
|
87
99
|
{
|
|
88
100
|
"mcpServers": {
|
|
89
101
|
"yourmemory": {
|
|
90
|
-
"command": "yourmemory",
|
|
102
|
+
"command": "/full/path/to/yourmemory",
|
|
91
103
|
"args": [],
|
|
92
104
|
"env": {
|
|
93
|
-
"
|
|
94
|
-
"
|
|
105
|
+
"YOURMEMORY_USER": "your_name",
|
|
106
|
+
"DATABASE_URL": ""
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
```
|
|
100
112
|
|
|
101
|
-
|
|
113
|
+
Run `yourmemory-path` in terminal — it prints the exact config to paste.
|
|
114
|
+
|
|
115
|
+
#### Cursor
|
|
102
116
|
|
|
103
|
-
|
|
117
|
+
Add to `~/.cursor/mcp.json`:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"mcpServers": {
|
|
122
|
+
"yourmemory": {
|
|
123
|
+
"command": "/full/path/to/yourmemory",
|
|
124
|
+
"args": [],
|
|
125
|
+
"env": {
|
|
126
|
+
"YOURMEMORY_USER": "your_name",
|
|
127
|
+
"DATABASE_URL": ""
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
104
133
|
|
|
105
134
|
#### Claude Desktop
|
|
106
135
|
|
|
@@ -120,9 +149,9 @@ Restart Claude Desktop.
|
|
|
120
149
|
|
|
121
150
|
#### Any MCP-compatible client
|
|
122
151
|
|
|
123
|
-
YourMemory is a standard stdio MCP server.
|
|
152
|
+
YourMemory is a standard stdio MCP server. Works with Claude Code, Claude Desktop, Cline, Cursor, Windsurf, Continue, and Zed. Use the full path from `yourmemory-path` if the client doesn't inherit shell PATH.
|
|
124
153
|
|
|
125
|
-
###
|
|
154
|
+
### 4. Add memory instructions to your project
|
|
126
155
|
|
|
127
156
|
Copy `sample_CLAUDE.md` into your project root as `CLAUDE.md` and replace:
|
|
128
157
|
- `YOUR_NAME` — your name (e.g. `Alice`)
|
|
@@ -134,13 +163,19 @@ Claude will now follow the recall → store → update workflow automatically on
|
|
|
134
163
|
|
|
135
164
|
### PostgreSQL (optional — for teams or large datasets)
|
|
136
165
|
|
|
137
|
-
|
|
166
|
+
Install with Postgres support:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
pip install yourmemory[postgres]
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Then create a `.env` file:
|
|
138
173
|
|
|
139
174
|
```bash
|
|
140
175
|
DATABASE_URL=postgresql://YOUR_USER@localhost:5432/yourmemory
|
|
141
176
|
```
|
|
142
177
|
|
|
143
|
-
The backend is selected automatically — `postgresql://` in `DATABASE_URL` → Postgres + pgvector, anything else →
|
|
178
|
+
The backend is selected automatically — `postgresql://` in `DATABASE_URL` → Postgres + pgvector, anything else → DuckDB.
|
|
144
179
|
|
|
145
180
|
**macOS**
|
|
146
181
|
```bash
|
|
@@ -154,8 +189,6 @@ sudo apt install postgresql postgresql-contrib postgresql-16-pgvector
|
|
|
154
189
|
createdb yourmemory
|
|
155
190
|
```
|
|
156
191
|
|
|
157
|
-
> **One-liner setup script** (macOS/Linux): `bash scripts/setup_db.sh` handles install + DB creation automatically.
|
|
158
|
-
|
|
159
192
|
---
|
|
160
193
|
|
|
161
194
|
## MCP Tools
|
|
@@ -207,47 +240,20 @@ Runs automatically every 24 hours on startup — no cron needed. Memories below
|
|
|
207
240
|
|
|
208
241
|
---
|
|
209
242
|
|
|
210
|
-
## REST API
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
# Store
|
|
214
|
-
curl -X POST http://localhost:8000/memories \
|
|
215
|
-
-H "Content-Type: application/json" \
|
|
216
|
-
-d '{"userId":"u1","content":"Prefers dark mode","importance":0.8}'
|
|
217
|
-
|
|
218
|
-
# Retrieve
|
|
219
|
-
curl -X POST http://localhost:8000/retrieve \
|
|
220
|
-
-H "Content-Type: application/json" \
|
|
221
|
-
-d '{"userId":"u1","query":"UI preferences"}'
|
|
222
|
-
|
|
223
|
-
# List all
|
|
224
|
-
curl "http://localhost:8000/memories?userId=u1"
|
|
225
|
-
|
|
226
|
-
# Update
|
|
227
|
-
curl -X PUT http://localhost:8000/memories/42 \
|
|
228
|
-
-H "Content-Type: application/json" \
|
|
229
|
-
-d '{"content":"Prefers dark mode in all apps","importance":0.85}'
|
|
230
|
-
|
|
231
|
-
# Delete
|
|
232
|
-
curl -X DELETE http://localhost:8000/memories/42
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
243
|
## Stack
|
|
238
244
|
|
|
239
|
-
- **
|
|
245
|
+
- **DuckDB** — default backend, zero setup, native vector similarity (same quality as pgvector)
|
|
240
246
|
- **sentence-transformers** — local embeddings (`all-mpnet-base-v2`, 768 dims, no external service needed)
|
|
241
|
-
- **FastAPI** — REST server
|
|
242
247
|
- **APScheduler** — automatic 24h decay job
|
|
243
248
|
- **MCP** — Claude integration via Model Context Protocol
|
|
249
|
+
- **PostgreSQL + pgvector** — optional, for teams / large datasets
|
|
244
250
|
|
|
245
251
|
---
|
|
246
252
|
|
|
247
253
|
## Architecture
|
|
248
254
|
|
|
249
255
|
```
|
|
250
|
-
Claude
|
|
256
|
+
Claude / Cline / Cursor / Any MCP client
|
|
251
257
|
│
|
|
252
258
|
├── recall_memory(query)
|
|
253
259
|
│ └── embed → cosine similarity → score = sim × strength → top-k
|
|
@@ -260,12 +266,12 @@ Claude Code
|
|
|
260
266
|
└── update_memory(id, new_content)
|
|
261
267
|
└── embed(new_content) → UPDATE memories
|
|
262
268
|
|
|
263
|
-
PostgreSQL (
|
|
264
|
-
└── memories
|
|
265
|
-
├── embedding vector(768)
|
|
266
|
-
├── importance float
|
|
267
|
-
├── recall_count int
|
|
268
|
-
└── last_accessed_at
|
|
269
|
+
DuckDB (default) PostgreSQL + pgvector (optional)
|
|
270
|
+
└── memories.duckdb └── memories table
|
|
271
|
+
├── embedding FLOAT[768] ├── embedding vector(768)
|
|
272
|
+
├── importance FLOAT ├── importance float
|
|
273
|
+
├── recall_count INTEGER ├── recall_count int
|
|
274
|
+
└── last_accessed_at └── last_accessed_at
|
|
269
275
|
```
|
|
270
276
|
|
|
271
277
|
---
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "yourmemory"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.1"
|
|
8
8
|
description = "Persistent memory for Claude — Ebbinghaus forgetting curve, semantic deduplication, MCP-native"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -28,7 +28,7 @@ dependencies = [
|
|
|
28
28
|
"python-dateutil",
|
|
29
29
|
"duckdb>=0.10.0",
|
|
30
30
|
"apscheduler",
|
|
31
|
-
"spacy>=3.
|
|
31
|
+
"spacy>=3.8.13,<4.0",
|
|
32
32
|
]
|
|
33
33
|
|
|
34
34
|
[project.optional-dependencies]
|
|
@@ -29,9 +29,7 @@ def categorize(text: str) -> str:
|
|
|
29
29
|
"""
|
|
30
30
|
Use spaCy dependency parse to classify:
|
|
31
31
|
fact — declarative sentence with an explicit subject
|
|
32
|
-
e.g. "Novak is world number 1", "I love Python", "My name is Sachit"
|
|
33
32
|
assumption — imperative sentence with no subject (command/instruction)
|
|
34
|
-
e.g. "Use python instead of JS", "Please convert this image"
|
|
35
33
|
"""
|
|
36
34
|
doc = _nlp(text)
|
|
37
35
|
has_subject = any(tok.dep_ in ("nsubj", "nsubjpass") for tok in doc)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
_QUESTION_WORDS = {"what", "who", "where", "when", "why", "how", "which", "whose", "whom"}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def is_question(text: str) -> bool:
|
|
7
|
+
"""Return True if the text is a question — questions are not stored as memories."""
|
|
8
|
+
stripped = text.strip()
|
|
9
|
+
if stripped.endswith("?"):
|
|
10
|
+
return True
|
|
11
|
+
first_word = re.split(r"\s+", stripped.lower())[0]
|
|
12
|
+
return first_word in _QUESTION_WORDS
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def categorize(text: str) -> str:
|
|
16
|
+
"""
|
|
17
|
+
Fallback categorization without spaCy:
|
|
18
|
+
Simple heuristics to classify as fact vs assumption
|
|
19
|
+
"""
|
|
20
|
+
text_lower = text.lower().strip()
|
|
21
|
+
|
|
22
|
+
# Commands/imperatives typically start with verbs or "please"
|
|
23
|
+
imperative_patterns = [
|
|
24
|
+
r'^(please|use|try|do|don\'t|make|create|add|remove|delete|update)',
|
|
25
|
+
r'^(convert|transform|change|modify|fix|help|show|tell)',
|
|
26
|
+
r'^(install|run|execute|start|stop|restart|configure)'
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
for pattern in imperative_patterns:
|
|
30
|
+
if re.match(pattern, text_lower):
|
|
31
|
+
return "assumption"
|
|
32
|
+
|
|
33
|
+
# Default to fact for declarative statements
|
|
34
|
+
return "fact"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yourmemory
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Persistent memory for Claude — Ebbinghaus forgetting curve, semantic deduplication, MCP-native
|
|
5
5
|
Author-email: Sachit Misra <mishrasachit1@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -181,7 +181,7 @@ Requires-Dist: numpy
|
|
|
181
181
|
Requires-Dist: python-dateutil
|
|
182
182
|
Requires-Dist: duckdb>=0.10.0
|
|
183
183
|
Requires-Dist: apscheduler
|
|
184
|
-
Requires-Dist: spacy<4.0,>=3.
|
|
184
|
+
Requires-Dist: spacy<4.0,>=3.8.13
|
|
185
185
|
Provides-Extra: postgres
|
|
186
186
|
Requires-Dist: psycopg2-binary; extra == "postgres"
|
|
187
187
|
Requires-Dist: pgvector; extra == "postgres"
|
|
@@ -197,7 +197,7 @@ Dynamic: license-file
|
|
|
197
197
|
|
|
198
198
|
**+16pp better recall than Mem0 on LoCoMo. 100% stale memory precision. Biologically-inspired memory decay for AI agents.**
|
|
199
199
|
|
|
200
|
-
Persistent memory for Claude
|
|
200
|
+
Persistent memory for Claude and any MCP-compatible AI — works like human memory. Important things stick, forgotten things fade, outdated facts get pruned automatically.
|
|
201
201
|
|
|
202
202
|
> Early stage — feedback and ideas welcome.
|
|
203
203
|
|
|
@@ -244,7 +244,7 @@ Importance additionally modulates the decay rate within each category. Memories
|
|
|
244
244
|
|
|
245
245
|
## Setup
|
|
246
246
|
|
|
247
|
-
**Zero infrastructure required** — uses
|
|
247
|
+
**Zero infrastructure required** — uses DuckDB out of the box. Two commands and you're done.
|
|
248
248
|
|
|
249
249
|
### 1. Install
|
|
250
250
|
|
|
@@ -252,11 +252,21 @@ Importance additionally modulates the decay rate within each category. Memories
|
|
|
252
252
|
pip install yourmemory
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
All dependencies
|
|
255
|
+
All dependencies installed automatically. No clone, no Docker, no database setup.
|
|
256
256
|
|
|
257
|
-
### 2.
|
|
257
|
+
### 2. Get your config
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
Run this once to get your exact config:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
yourmemory-path
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
It prints your full executable path and a ready-to-paste config for any MCP client. Copy it.
|
|
266
|
+
|
|
267
|
+
### 3. Wire into your AI client
|
|
268
|
+
|
|
269
|
+
The database is created automatically at `~/.yourmemory/memories.duckdb` on first use.
|
|
260
270
|
|
|
261
271
|
#### Claude Code
|
|
262
272
|
|
|
@@ -276,26 +286,45 @@ Reload Claude Code (`Cmd+Shift+P` → `Developer: Reload Window`).
|
|
|
276
286
|
|
|
277
287
|
#### Cline (VS Code)
|
|
278
288
|
|
|
289
|
+
VS Code doesn't inherit your shell PATH, so use the **full path** from `yourmemory-path`.
|
|
290
|
+
|
|
279
291
|
In Cline → **MCP Servers** → **Edit MCP Settings**:
|
|
280
292
|
|
|
281
293
|
```json
|
|
282
294
|
{
|
|
283
295
|
"mcpServers": {
|
|
284
296
|
"yourmemory": {
|
|
285
|
-
"command": "yourmemory",
|
|
297
|
+
"command": "/full/path/to/yourmemory",
|
|
286
298
|
"args": [],
|
|
287
299
|
"env": {
|
|
288
|
-
"
|
|
289
|
-
"
|
|
300
|
+
"YOURMEMORY_USER": "your_name",
|
|
301
|
+
"DATABASE_URL": ""
|
|
290
302
|
}
|
|
291
303
|
}
|
|
292
304
|
}
|
|
293
305
|
}
|
|
294
306
|
```
|
|
295
307
|
|
|
296
|
-
|
|
308
|
+
Run `yourmemory-path` in terminal — it prints the exact config to paste.
|
|
309
|
+
|
|
310
|
+
#### Cursor
|
|
297
311
|
|
|
298
|
-
|
|
312
|
+
Add to `~/.cursor/mcp.json`:
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"mcpServers": {
|
|
317
|
+
"yourmemory": {
|
|
318
|
+
"command": "/full/path/to/yourmemory",
|
|
319
|
+
"args": [],
|
|
320
|
+
"env": {
|
|
321
|
+
"YOURMEMORY_USER": "your_name",
|
|
322
|
+
"DATABASE_URL": ""
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
299
328
|
|
|
300
329
|
#### Claude Desktop
|
|
301
330
|
|
|
@@ -315,9 +344,9 @@ Restart Claude Desktop.
|
|
|
315
344
|
|
|
316
345
|
#### Any MCP-compatible client
|
|
317
346
|
|
|
318
|
-
YourMemory is a standard stdio MCP server.
|
|
347
|
+
YourMemory is a standard stdio MCP server. Works with Claude Code, Claude Desktop, Cline, Cursor, Windsurf, Continue, and Zed. Use the full path from `yourmemory-path` if the client doesn't inherit shell PATH.
|
|
319
348
|
|
|
320
|
-
###
|
|
349
|
+
### 4. Add memory instructions to your project
|
|
321
350
|
|
|
322
351
|
Copy `sample_CLAUDE.md` into your project root as `CLAUDE.md` and replace:
|
|
323
352
|
- `YOUR_NAME` — your name (e.g. `Alice`)
|
|
@@ -329,13 +358,19 @@ Claude will now follow the recall → store → update workflow automatically on
|
|
|
329
358
|
|
|
330
359
|
### PostgreSQL (optional — for teams or large datasets)
|
|
331
360
|
|
|
332
|
-
|
|
361
|
+
Install with Postgres support:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
pip install yourmemory[postgres]
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Then create a `.env` file:
|
|
333
368
|
|
|
334
369
|
```bash
|
|
335
370
|
DATABASE_URL=postgresql://YOUR_USER@localhost:5432/yourmemory
|
|
336
371
|
```
|
|
337
372
|
|
|
338
|
-
The backend is selected automatically — `postgresql://` in `DATABASE_URL` → Postgres + pgvector, anything else →
|
|
373
|
+
The backend is selected automatically — `postgresql://` in `DATABASE_URL` → Postgres + pgvector, anything else → DuckDB.
|
|
339
374
|
|
|
340
375
|
**macOS**
|
|
341
376
|
```bash
|
|
@@ -349,8 +384,6 @@ sudo apt install postgresql postgresql-contrib postgresql-16-pgvector
|
|
|
349
384
|
createdb yourmemory
|
|
350
385
|
```
|
|
351
386
|
|
|
352
|
-
> **One-liner setup script** (macOS/Linux): `bash scripts/setup_db.sh` handles install + DB creation automatically.
|
|
353
|
-
|
|
354
387
|
---
|
|
355
388
|
|
|
356
389
|
## MCP Tools
|
|
@@ -402,47 +435,20 @@ Runs automatically every 24 hours on startup — no cron needed. Memories below
|
|
|
402
435
|
|
|
403
436
|
---
|
|
404
437
|
|
|
405
|
-
## REST API
|
|
406
|
-
|
|
407
|
-
```bash
|
|
408
|
-
# Store
|
|
409
|
-
curl -X POST http://localhost:8000/memories \
|
|
410
|
-
-H "Content-Type: application/json" \
|
|
411
|
-
-d '{"userId":"u1","content":"Prefers dark mode","importance":0.8}'
|
|
412
|
-
|
|
413
|
-
# Retrieve
|
|
414
|
-
curl -X POST http://localhost:8000/retrieve \
|
|
415
|
-
-H "Content-Type: application/json" \
|
|
416
|
-
-d '{"userId":"u1","query":"UI preferences"}'
|
|
417
|
-
|
|
418
|
-
# List all
|
|
419
|
-
curl "http://localhost:8000/memories?userId=u1"
|
|
420
|
-
|
|
421
|
-
# Update
|
|
422
|
-
curl -X PUT http://localhost:8000/memories/42 \
|
|
423
|
-
-H "Content-Type: application/json" \
|
|
424
|
-
-d '{"content":"Prefers dark mode in all apps","importance":0.85}'
|
|
425
|
-
|
|
426
|
-
# Delete
|
|
427
|
-
curl -X DELETE http://localhost:8000/memories/42
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
---
|
|
431
|
-
|
|
432
438
|
## Stack
|
|
433
439
|
|
|
434
|
-
- **
|
|
440
|
+
- **DuckDB** — default backend, zero setup, native vector similarity (same quality as pgvector)
|
|
435
441
|
- **sentence-transformers** — local embeddings (`all-mpnet-base-v2`, 768 dims, no external service needed)
|
|
436
|
-
- **FastAPI** — REST server
|
|
437
442
|
- **APScheduler** — automatic 24h decay job
|
|
438
443
|
- **MCP** — Claude integration via Model Context Protocol
|
|
444
|
+
- **PostgreSQL + pgvector** — optional, for teams / large datasets
|
|
439
445
|
|
|
440
446
|
---
|
|
441
447
|
|
|
442
448
|
## Architecture
|
|
443
449
|
|
|
444
450
|
```
|
|
445
|
-
Claude
|
|
451
|
+
Claude / Cline / Cursor / Any MCP client
|
|
446
452
|
│
|
|
447
453
|
├── recall_memory(query)
|
|
448
454
|
│ └── embed → cosine similarity → score = sim × strength → top-k
|
|
@@ -455,12 +461,12 @@ Claude Code
|
|
|
455
461
|
└── update_memory(id, new_content)
|
|
456
462
|
└── embed(new_content) → UPDATE memories
|
|
457
463
|
|
|
458
|
-
PostgreSQL (
|
|
459
|
-
└── memories
|
|
460
|
-
├── embedding vector(768)
|
|
461
|
-
├── importance float
|
|
462
|
-
├── recall_count int
|
|
463
|
-
└── last_accessed_at
|
|
464
|
+
DuckDB (default) PostgreSQL + pgvector (optional)
|
|
465
|
+
└── memories.duckdb └── memories table
|
|
466
|
+
├── embedding FLOAT[768] ├── embedding vector(768)
|
|
467
|
+
├── importance FLOAT ├── importance float
|
|
468
|
+
├── recall_count INTEGER ├── recall_count int
|
|
469
|
+
└── last_accessed_at └── last_accessed_at
|
|
464
470
|
```
|
|
465
471
|
|
|
466
472
|
---
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|