@justfortytwo/memory 0.1.1 → 0.1.2
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 +14 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -96,13 +96,13 @@ DB_PATH=./memory.db npm run migrate
|
|
|
96
96
|
DB_PATH=./memory.db EMBED_MODEL=qwen3-embedding:0.6b fortytwo-memory
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
The `bin` is `fortytwo-memory` → `dist/index.js`. You can also
|
|
100
|
-
@justfortytwo/memory`
|
|
99
|
+
The `bin` is `fortytwo-memory` → `dist/index.js`. You can also run it with
|
|
100
|
+
`npx -y @justfortytwo/memory` (it is published to npm).
|
|
101
101
|
|
|
102
102
|
### As a library
|
|
103
103
|
|
|
104
104
|
```ts
|
|
105
|
-
import { openDb, runMigrations, OllamaEmbedder, store, recall } from '@justfortytwo/memory';
|
|
105
|
+
import { openDb, runMigrations, OllamaEmbedder, store, recall, deleteByIds } from '@justfortytwo/memory';
|
|
106
106
|
|
|
107
107
|
const h = openDb('memory.db');
|
|
108
108
|
await runMigrations(h.k);
|
|
@@ -110,8 +110,19 @@ const embedder = new OllamaEmbedder();
|
|
|
110
110
|
|
|
111
111
|
await store(h, embedder, { content: 'the deploy script lives in scripts/deploy.sh', source: 'owner', observed: 'stated' });
|
|
112
112
|
const hits = await recall(h, embedder, 'how do I deploy?', 5);
|
|
113
|
+
|
|
114
|
+
deleteByIds(h, [hits[0].id]); // hard-delete (row + vector + FTS); returns the count removed
|
|
113
115
|
```
|
|
114
116
|
|
|
117
|
+
### Deleting memories
|
|
118
|
+
|
|
119
|
+
`deleteByIds(h, ids)` hard-deletes memories — the row, its vector, and its FTS
|
|
120
|
+
entry — so nothing resurfaces in `recall`/`lexical`/`query`. It is intentionally
|
|
121
|
+
a **library API and NOT an MCP tool**: deletion is an owner-privileged operation,
|
|
122
|
+
and exposing it to the assistant's turn loop would let prompt-injected content
|
|
123
|
+
trick it into erasing memories. Selecting *which* ids to remove (by query, tag,
|
|
124
|
+
date range, …) is the caller's job — see `@justfortytwo/installer`'s `forget`.
|
|
125
|
+
|
|
115
126
|
## As a Claude Code plugin
|
|
116
127
|
|
|
117
128
|
`.claude-plugin/plugin.json` declares the plugin; `.mcp.json` registers the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justfortytwo/memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Standalone semantic-memory MCP server (SQLite + sqlite-vec + Ollama embedder). persona-agnostic.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=20"
|
|
18
18
|
},
|
|
19
19
|
"bin": {
|
|
20
20
|
"fortytwo-memory": "dist/index.js"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
43
|
-
"better-sqlite3": "^
|
|
43
|
+
"better-sqlite3": "^12.0.0",
|
|
44
44
|
"knex": "^3.1.0",
|
|
45
45
|
"sqlite-vec": "^0.1.6"
|
|
46
46
|
},
|