linksee-memory 0.17.2 → 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 +25 -1
- package/dist/bin/consolidate.d.ts +12 -0
- package/dist/bin/consolidate.js +216 -0
- package/dist/bin/import-sessions.js +29 -98
- package/dist/bin/sync-session.js +1 -1
- package/dist/lib/consolidate.d.ts +61 -6
- package/dist/lib/consolidate.js +199 -103
- package/dist/lib/distill-triage.js +9 -2
- package/dist/lib/forgetting.js +4 -3
- package/dist/lib/session-import.d.ts +22 -0
- package/dist/lib/session-import.js +161 -0
- package/dist/lib/supersede.d.ts +35 -0
- package/dist/lib/supersede.js +130 -0
- package/dist/lib/test-faults.d.ts +7 -0
- package/dist/lib/test-faults.js +16 -0
- package/dist/mcp/server.js +265 -110
- package/dist/skill/SKILL.md +17 -15
- package/package.json +4 -2
package/dist/skill/SKILL.md
CHANGED
|
@@ -30,9 +30,11 @@ description: |
|
|
|
30
30
|
|
|
31
31
|
Claude Code forgets everything when a session ends. The solution the user taught yesterday, the failure you hit today, the decision made three days ago — all of it is normally lost. **linksee-memory is the "memory that doesn't disappear" device.**
|
|
32
32
|
|
|
33
|
-
Writes
|
|
33
|
+
Writes happen automatically only when `linksee-memory setup` installed the Stop hook. The Claude Code plugin alone has no hooks: nothing is saved unless the agent calls `remember`. Either way, **reads require the agent to actively pull**. This skill instills that "go look first" habit in the agent.
|
|
34
34
|
|
|
35
|
-
*JP: Claude Code は session が終わると全部忘れる。linksee-memory
|
|
35
|
+
*JP: Claude Code は session が終わると全部忘れる。linksee-memory は「消えない記憶」を作る装置。書き込みの自動保存は `setup` で Stop hook を入れた場合だけ。plugin 単独では hook が無いので、`remember` を呼ばない限り何も保存されない。読み出しはどちらでもエージェントが能動的にやる必要がある。*
|
|
36
|
+
|
|
37
|
+
**Tool names depend on how linksee-memory was installed.** The examples below use the short tool name (`recall`, `remember`, …). Registered with `npx -y linksee-memory setup` or `claude mcp add`, the full name is `mcp__linksee__<tool>`; installed as the Claude Code plugin, it is `mcp__plugin_linksee-memory_linksee__<tool>` ([why](https://code.claude.com/docs/en/mcp#plugin-provided-mcp-servers)). Use whichever is present in your tool list.
|
|
36
38
|
|
|
37
39
|
---
|
|
38
40
|
|
|
@@ -155,7 +157,7 @@ open → decided → in_progress → done
|
|
|
155
157
|
|---|---|---|
|
|
156
158
|
| `affects` | string[] | File paths or areas this touches. Critical for future `recall_file` accuracy |
|
|
157
159
|
| `next_action` | string / null | What should happen next. Null if done/completed |
|
|
158
|
-
| `supersedes_id` | number / null | Memory ID this replaces
|
|
160
|
+
| `supersedes_id` | number / null | Memory ID this replaces. Content only — the link that recall acts on is the `remember` argument `supersedes: <id>` (0.18.0) |
|
|
159
161
|
| `prior_belief` | string | What we used to think (for learnings — enables belief-update tracking) |
|
|
160
162
|
| `evidence_refs` | object[] | Links to evidence: `{"type": "session"|"file"|"url", "id": "...", "label": "..."}`. Store as REFERENCES, never inline the full content |
|
|
161
163
|
|
|
@@ -185,7 +187,7 @@ Before starting any new task, inject past context.
|
|
|
185
187
|
**At the very beginning of a conversation**, use `list_entities` first to understand what you know:
|
|
186
188
|
|
|
187
189
|
```
|
|
188
|
-
|
|
190
|
+
list_entities({ min_memories: 5, limit: 10 })
|
|
189
191
|
```
|
|
190
192
|
|
|
191
193
|
The returned "high-momentum entities" are the projects likely to be discussed. Each entity's `layer_breakdown` reveals patterns ("this project has many caveats", "goal is unfinished", etc.).
|
|
@@ -193,7 +195,7 @@ The returned "high-momentum entities" are the projects likely to be discussed. E
|
|
|
193
195
|
Then, once a specific task starts, recall:
|
|
194
196
|
|
|
195
197
|
```
|
|
196
|
-
|
|
198
|
+
recall({
|
|
197
199
|
query: "<keywords of current task — project name + technology>",
|
|
198
200
|
max_tokens: 2000
|
|
199
201
|
})
|
|
@@ -244,7 +246,7 @@ The recall engine uses FTS5 full-text search + heat_score ranking. Your query de
|
|
|
244
246
|
Before touching a specific file, check its edit history:
|
|
245
247
|
|
|
246
248
|
```
|
|
247
|
-
|
|
249
|
+
recall_file({
|
|
248
250
|
path_substring: "<file path or substring match>",
|
|
249
251
|
max_intents: 5
|
|
250
252
|
})
|
|
@@ -259,7 +261,7 @@ Returns: the file's entire edit history + **the user message that drove each edi
|
|
|
259
261
|
When you need to read a file, **use `read_smart` instead of the standard `Read` tool**:
|
|
260
262
|
|
|
261
263
|
```
|
|
262
|
-
|
|
264
|
+
read_smart({
|
|
263
265
|
path: "<absolute path>"
|
|
264
266
|
})
|
|
265
267
|
```
|
|
@@ -290,7 +292,7 @@ update_memory({
|
|
|
290
292
|
The moment an error, failure, or "doesn't work" happens, record immediately:
|
|
291
293
|
|
|
292
294
|
```
|
|
293
|
-
|
|
295
|
+
remember({
|
|
294
296
|
entity_name: "<project name or service name>",
|
|
295
297
|
entity_kind: "project",
|
|
296
298
|
layer: "caveat",
|
|
@@ -330,7 +332,7 @@ mcp__linksee__remember({
|
|
|
330
332
|
When you understand something new, change approaches, or solve a problem:
|
|
331
333
|
|
|
332
334
|
```
|
|
333
|
-
|
|
335
|
+
remember({
|
|
334
336
|
entity_name: "<entity>",
|
|
335
337
|
entity_kind: "project | concept | ...",
|
|
336
338
|
layer: "learning",
|
|
@@ -372,7 +374,7 @@ Recording `prior_belief` leaves a **belief-update history**. Later, this becomes
|
|
|
372
374
|
2. ❌ Solve an error on the spot without recording — future you (or another agent) will hit the same failure
|
|
373
375
|
3. ❌ Use `Read` everywhere instead of `read_smart` (wastes tokens)
|
|
374
376
|
4. ❌ Write caveats in a flippant tone — preserve them seriously
|
|
375
|
-
5. ❌ Try to call a `consolidate` tool — there is none; consolidation is a server opt-in
|
|
377
|
+
5. ❌ Try to call a `consolidate` tool — there is none; consolidation is a CLI subcommand / server opt-in (see below)
|
|
376
378
|
6. ❌ Recall the same entity twice in one session without new context (wastes tokens)
|
|
377
379
|
7. ❌ Write `recall({ query: "what happened last time" })` — use specific keywords
|
|
378
380
|
|
|
@@ -380,9 +382,9 @@ Recording `prior_belief` leaves a **belief-update history**. Later, this becomes
|
|
|
380
382
|
|
|
381
383
|
## 🔁 Consolidation — off unless the user turns it on
|
|
382
384
|
|
|
383
|
-
There is no `consolidate` tool. Consolidation clusters cold, low-importance memories older than 7 days into one `learning`-layer entry
|
|
385
|
+
There is no `consolidate` tool. Consolidation clusters cold, low-importance memories older than 7 days into one `learning`-layer entry. Since 0.18.1 it **keeps the originals**: each gets `consolidated_into: <summary id>` and `recall` hides it by default (`consolidated_hidden` says how many; `include_consolidated: true` shows them). Up to 0.18.0 it deleted them — rows lost that way come back only from a backup. It never runs on its own: the user runs `npx -y linksee-memory consolidate --dry-run` (shows) / `--apply` (folds), or starts the server with `LINKSEE_AUTO_CONSOLIDATE=1` (at start-up, at most weekly).
|
|
384
386
|
|
|
385
|
-
Do not suggest turning it on as routine housekeeping. If the user asks about a large DB,
|
|
387
|
+
Do not suggest turning it on as routine housekeeping. If the user asks about a large DB, say what it does (summaries + hidden originals, nothing deleted) and point at `--dry-run` first.
|
|
386
388
|
|
|
387
389
|
**`caveat` memories and active `goal` memories are never consolidated away.**
|
|
388
390
|
|
|
@@ -435,7 +437,7 @@ User: "Let's switch to Stripe for payments"
|
|
|
435
437
|
→ Look for: type="decision", state="decided" memories on the same topic
|
|
436
438
|
2. If past decision found:
|
|
437
439
|
a. Tell user: "Previously we decided <X> because <reason>. Override?"
|
|
438
|
-
b. If user confirms override →
|
|
440
|
+
b. If user confirms override → `remember({ content, supersedes: <old memory_id> })` (recall then hides the old decision)
|
|
439
441
|
c. If user says "oh right, keep it" → no new memory needed, proceed
|
|
440
442
|
3. If no past decision found → proceed to record (see Case E below)
|
|
441
443
|
```
|
|
@@ -714,7 +716,7 @@ Now you have both bodies of knowledge before starting
|
|
|
714
716
|
|
|
715
717
|
| Moment | recall precision | Why |
|
|
716
718
|
|---|---|---|
|
|
717
|
-
| Day 1 | low (little data) | Stop hook
|
|
719
|
+
| Day 1 | low (little data) | the Stop hook (if `setup` installed it) or your own `remember` calls are still collecting |
|
|
718
720
|
| Week 1 | medium | thousands of memories, FTS5 kicks in |
|
|
719
721
|
| Month 1 | high | heat_score stabilizes, important memories surface |
|
|
720
722
|
| Month 3+ | strongest | learnings crystallized (distilled) |
|
|
@@ -724,6 +726,6 @@ Now you have both bodies of knowledge before starting
|
|
|
724
726
|
---
|
|
725
727
|
|
|
726
728
|
*This skill runs on top of linksee-memory MCP v0.4.0+.*
|
|
727
|
-
*Auto-write via Stop hook, explicit read via recall.*
|
|
729
|
+
*Auto-write via the Stop hook when `setup` installed it (the plugin has no hooks), explicit read via recall.*
|
|
728
730
|
*Listed in MCP Official Registry, PulseMCP, mcpservers.org, Glama.*
|
|
729
731
|
*MIT License — Synapse Arrows PTE. LTD.*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linksee-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"mcpName": "io.github.michielinksee/linksee-memory",
|
|
5
5
|
"description": "Hand a project over — to your next session, to Cursor/Codex/Gemini, to your successor — with the reasons attached. Local-first memory MCP for coding agents: decisions re-injected before the agent acts, drift detection across every project you run. One SQLite file, nothing leaves your machine.",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"linksee-memory-guard": "dist/bin/guard-hook.js",
|
|
17
17
|
"linksee-memory-map": "dist/bin/map-import.js",
|
|
18
18
|
"linksee-memory-export": "dist/bin/export-report.js",
|
|
19
|
-
"linksee-memory-share-draft": "dist/bin/share-draft.js"
|
|
19
|
+
"linksee-memory-share-draft": "dist/bin/share-draft.js",
|
|
20
|
+
"linksee-memory-consolidate": "dist/bin/consolidate.js"
|
|
20
21
|
},
|
|
21
22
|
"main": "./dist/mcp/server.js",
|
|
22
23
|
"files": [
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "tsc && node -e \"require('fs').copyFileSync('src/db/schema.sql','dist/db/schema.sql'); require('fs').mkdirSync('dist/skill',{recursive:true}); require('fs').copyFileSync('src/skill/SKILL.md','dist/skill/SKILL.md')\"",
|
|
32
33
|
"start": "node dist/mcp/server.js",
|
|
34
|
+
"test": "node test/share-draft.mjs && node test/live-check.mjs && node test/supersede-source.mjs && node test/session-import.mjs && node test/import-cli-append-only.mjs && node test/distill-triage.mjs && node test/consolidate-no-delete.mjs && node test/auto-consolidate.mjs",
|
|
33
35
|
"dev": "tsx src/mcp/server.ts",
|
|
34
36
|
"migrate": "node dist/db/migrate.js",
|
|
35
37
|
"migrate:dev": "tsx src/db/migrate.ts",
|