@lotargo/memory_plugin 1.6.6 → 1.6.8

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +148 -101
  2. package/README.md +436 -304
  3. package/mcp-server/cli/direct_commands.js +39 -0
  4. package/mcp-server/cli.js +16 -5
  5. package/mcp-server/cli_boot.js +4 -1
  6. package/mcp-server/client_cli.js +73 -0
  7. package/mcp-server/client_paths.js +44 -0
  8. package/mcp-server/client_registration.js +38 -0
  9. package/mcp-server/codex_config.js +86 -8
  10. package/mcp-server/db/database.js +14 -21
  11. package/mcp-server/db/migrations.js +66 -77
  12. package/mcp-server/db/rag_blob_transport.js +143 -0
  13. package/mcp-server/db/rag_sync.js +284 -0
  14. package/mcp-server/db/sync_queue.js +219 -307
  15. package/mcp-server/dev_link.js +142 -0
  16. package/mcp-server/fact_format.js +44 -12
  17. package/mcp-server/index.js +17 -7
  18. package/mcp-server/ingest/exporter.js +44 -38
  19. package/mcp-server/ingest/normalizer.js +1 -1
  20. package/mcp-server/ingest/pipeline.js +260 -248
  21. package/mcp-server/persona_migration.js +39 -0
  22. package/mcp-server/prompt_manager.js +162 -55
  23. package/mcp-server/retrieval/retriever.js +99 -64
  24. package/mcp-server/setup.js +150 -100
  25. package/mcp-server/storage/blob_store.js +53 -1
  26. package/mcp-server/tools/core/knowledge_read_core.js +163 -0
  27. package/mcp-server/tools/core/memory_core.js +24 -4
  28. package/mcp-server/tools/core/memory_routing.js +10 -0
  29. package/mcp-server/tools/core/note_core.js +53 -0
  30. package/mcp-server/tools/core/rag_query_core.js +169 -0
  31. package/mcp-server/tools/index.js +11 -9
  32. package/mcp-server/tools/memory_tools.js +4 -1
  33. package/mcp-server/tools/note_tools.js +35 -0
  34. package/mcp-server/tools/rag_tools.js +211 -364
  35. package/mcp-server/uninstall.js +627 -0
  36. package/opencode-plugin/index.js +80 -12
  37. package/opencode-plugin/main.js +136 -0
  38. package/package.json +25 -5
  39. package/skills/using-memory/SKILL.md +28 -19
  40. package/mcp-server/benchmarks/fetch_real_corpus.js +0 -351
  41. package/mcp-server/benchmarks/gpu_profile_benchmark.js +0 -170
  42. package/mcp-server/benchmarks/policy_dominance_test.js +0 -221
  43. package/mcp-server/benchmarks/quality_evaluator.js +0 -598
  44. package/mcp-server/benchmarks/raw_corpus_data.js +0 -613
  45. package/mcp-server/benchmarks/run_benchmarks.js +0 -366
  46. package/mcp-server/benchmarks/stress_ingestion.js +0 -195
  47. package/mcp-server/benchmarks/table_code_retrieval.js +0 -453
  48. package/mcp-server/benchmarks/test_dual_layer.js +0 -141
package/CHANGELOG.md CHANGED
@@ -3,105 +3,150 @@
3
3
  All notable changes to `@lotargo/memory_plugin` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [1.6.6] - 2026-08-17
11
-
12
- ### Fixed
13
-
14
- - Fixed npm package distribution files list to include `mcp-server/rag_scope.js` and all server modules.
15
-
16
- ## [1.6.5] - 2026-08-17
17
-
18
- ### Added
19
-
20
- - Added explicit `directory` (and `project` alias) parameter support to Notebook/Memory tools (`remember`, `recall`, `get_fact`, `forget`, `update_fact`, `memory_info`, `link_knowledge`) and RAG tools (`ingest_document`, `query_knowledge_base`, `batch_query_knowledge_base`, `manage_knowledge_base`) across both the MCP server and native OpenCode plugin.
21
-
22
- ### Fixed
23
-
24
- - Fixed cross-directory workspace routing and isolation so operations targeting external project paths work reliably without directory mismatch or leaking npm process `INIT_CWD`.
25
- - Fixed `batch_query_knowledge_base` query execution and result formatting in the MCP server.
26
-
27
- ## [1.6.4] - 2026-08-13
28
-
29
- ### Added
30
-
31
- - `memory_info` now reports whether the current Git identity is `Registry: linked`
32
- or `Registry: unlinked`, enabling agents to register new repositories automatically.
33
- - RAG documents now have explicit global/project scope associations. The default
34
- project scope follows the current linked Git identity, while `scope: "all"`
35
- retrieves only global knowledge plus the current project's knowledge. A source
36
- shared by several scopes is stored once and associated with each scope.
37
- - The native OpenCode plugin now exposes `batch_query_knowledge_base`, bringing it
38
- to all 15 shared tools plus its two OpenCode-only helpers.
39
-
40
- ### Changed
41
-
42
- - OpenCode auto-injected memory now includes complete fact bodies for both global and
43
- current-project stores without the previous ten-fact truncation and instructs the
44
- agent to register an unlinked Git identity. Header-only initialization was removed
45
- because it loses essential context.
46
- - The bundled memory skill now defines full-body session recall, strict project
47
- isolation, agent-resolved conflicts, automatic Git project registration, and
48
- selective RAG curation for important web findings and current technical
49
- documentation, including links from project facts to supporting sources.
50
- - `recall` hides superseded facts by default and exposes history through
51
- `includeSuperseded: true`. Filtered output keeps physical storage indices stable,
52
- so a displayed number always targets the same fact in `forget`.
53
-
54
- ### Fixed
55
-
56
- - Re-ingesting an existing path or URL now preserves its document ID, scope
57
- associations, and fact links while rebuilding chunks, vectors, FTS rows, and
58
- structural graph edges for changed content.
59
- - Snapshot export/import and hybrid cloud synchronization now preserve vectors,
60
- retrieval policies, policy provenance, document scopes, knowledge links, and
61
- structural graph metadata. The hybrid sync worker also drains tasks queued during
62
- an active flush instead of leaving them pending.
63
- - Relinking a Git project now moves its RAG scope associations and fact-to-document
64
- links together with Notebook facts.
65
- - Environment-specific setup flags now update only their requested integration.
66
- Codex setup also synchronizes the skill to both `~/.codex/skills` and the shared
67
- `~/.agents/skills` location.
68
- - Shared documents no longer expose fact-link metadata belonging to another project.
69
- Document deletion now defaults to unlinking only the current project (or global
70
- outside Git); broader `global` / `all` removal must be requested explicitly.
71
- - Updating or forgetting a linked Notebook fact now keeps its knowledge-graph
72
- projection and cloud payload consistent. Line-range graph edges are included in
73
- per-document cloud sync, and superseding legacy facts without IDs assigns distinct
74
- IDs to the old and new versions.
75
- - README tool counts now match the implementations: 15 MCP tools, 17 native
76
- OpenCode tools, and 17 unique tool names across both surfaces. The OpenCode tool
77
- list documents all shared and OpenCode-only helpers explicitly.
78
-
79
- ## [1.6.3] - 2026-08-13
80
-
81
- ### Added
82
-
83
- - `memory_plugin doctor --codex` validates the configured executable and Node.js
84
- version, performs direct MCP `initialize` / `tools/list`, and calls both
85
- `memory_info` and `recall(scope="all")`.
86
- - Codex regression coverage for Windows paths with spaces, legacy config migration,
87
- duplicate removal, standalone MCP protocol smoke testing, two-repository project
88
- isolation, global-only recall outside Git, and prompt idempotency.
89
-
90
- ### Fixed
91
-
92
- - Codex setup no longer launches the memory MCP through `npx` or a Windows `.cmd`
93
- shim. It writes absolute paths for the active Node executable and packaged
94
- `mcp-server/boot.js` entry point after validating Node.js >= 22.5.0.
95
- - Existing plugin-owned `[mcp_servers.memory-agent]` sections, including the legacy
96
- `opencode-memory-plugin` entry, are migrated in place without modifying unrelated
97
- TOML sections or creating duplicates.
98
- - Repeated prompt setup now collapses duplicate plugin-owned blocks while preserving
99
- user-authored AGENTS.md / CLAUDE.md content.
100
- - README tool counts match the v1.6.3 implementations: 15 MCP tools, 16 native
101
- OpenCode tools, and 17 unique tool names across both surfaces. The OpenCode tool
102
- list and the MCP-only status of `batch_query_knowledge_base` are documented explicitly.
103
-
104
- ## [1.6.2] - 2026-08-12
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.6.8] - 2026-08-25
11
+
12
+ ### Changed
13
+
14
+ - Refreshed npm package positioning around local-first memory, hybrid RAG, agent personalization, and coding-agent integrations.
15
+ - Expanded package keywords for agent memory, coding agents, personalization, context engineering, local-first workflows, and Google Jules discovery.
16
+ - Updated package repository, homepage, and issue metadata to the canonical `Lotargo/memory_plugin` repository after the GitHub rename.
17
+ - Updated README hero asset URLs to the canonical repository and added a text H1 covering memory, hybrid RAG, and agent personalization.
18
+ - Updated the spreadsheet parser import to the ESM-compatible SheetJS namespace form.
19
+
20
+ ### Security
21
+
22
+ - Replaced the stale public-npm `xlsx@0.18.5` dependency with SheetJS CE `0.20.3` from the official SheetJS CDN, moving spreadsheet ingestion outside the affected ranges for the known prototype-pollution and ReDoS advisories.
23
+ - Updated dependency-security documentation to distinguish the fixed direct SheetJS exposure from the remaining transitive `sharp` / libvips warning in `@huggingface/transformers`; the project disables the Transformers image-decoding path with `env.sharp = false`.
24
+
25
+ ## [1.6.7] - 2026-08-24
26
+
27
+ ### Changed
28
+
29
+ - OpenCode's native auto-injection now explicitly suppresses redundant startup `recall` calls while preserving manual recall for inspection, filtering, history, and explicit scopes.
30
+ - Added an OpenCode system-prompt overlay policy that treats user-approved personality, behavior, tone, style, preference, and working-convention memories as active personalization instructions rather than passive facts.
31
+ - Updated shared prompts and the bundled memory skill to distinguish auto-injected clients from integrations that must initialize with `recall(scope: "all")`.
32
+ - OpenCode now separates active `<PERSONAL_AGENT_OVERLAY>` entries from descriptive `<MEMORY_FACTS>` and injects the actual active directives into `experimental.chat.system.transform`.
33
+ - `dev:link` now synchronizes managed prompts and bundled skills for non-OpenCode clients in addition to linking the OpenCode source and system CLI.
34
+ - Claude Code, Gemini CLI, and Codex setup/uninstall now use each client's native MCP lifecycle command first, verify the resulting registration, and fall back to ownership-checked JSON/TOML editing only when the client CLI is missing, fails, or leaves the expected entry unchanged.
35
+ - Gemini CLI is now a separate integration using `~/.gemini/settings.json`, `~/.gemini/GEMINI.md`, and `~/.gemini/skills`; Antigravity keeps its distinct `~/.gemini/config` and optional workspace `.agents` layout.
36
+ - Normal OpenCode uninstall now preserves the host package cache. Cache cleanup is explicit through `--purge-cache` and removes only exact package-owned directories, including versioned cache entries.
37
+
38
+ ### Added
39
+
40
+ - Added `npm run dev:link` / `memory-cli dev-link` for local development. It globally links the repository CLI and points OpenCode at the working tree through a `file://` plugin entry, eliminating npm publication and reinstall cycles during testing.
41
+ - Added explicit Notebook `kind: "fact" | "directive"` semantics across MCP and OpenCode `remember` / `update_fact` tools, with `[DIRECTIVE]` recall badges and compatibility for legacy persona/preference tags.
42
+ - Added managed persona prompt synchronization for Codex, Claude Code, and Antigravity through `memory-cli sync-persona` / `npm run persona:sync`, including automatic refresh after global directive mutations and cloud pulls.
43
+ - Added idempotent `memory-cli migrate-persona [--dry-run]` / `npm run persona:migrate` to permanently classify legacy global personalization entries as `kind:directive` and regenerate managed client prompts.
44
+ - Added `memory_plugin uninstall` / `memory-cli uninstall` and the `memory_plugin setup --uninstall` alias with per-client targeting, `--dry-run`, data-preserving defaults, guarded `--purge`, and explicit `--purge-cache` support.
45
+ - Added a shared cross-platform client path and CLI execution layer with Windows npm-shim support plus `XDG_CONFIG_HOME`, `XDG_CACHE_HOME`, `OPENCODE_CONFIG_DIR`, and `MEMORY_DIR` handling.
46
+
47
+ ### Fixed
48
+
49
+ - Fixed `remember_note` omitting the ingestion `blobHash` from its public result, which broke cross-device raw-blob portability consumers and was previously masked by Windows temp-cleanup errors.
50
+ - Fixed concurrent `triggerBackgroundSync()` callers returning before the active queue drain completed; callers now join one active promise that includes requested follow-up passes.
51
+ - Fixed uninstall ownership checks so foreign `memory-agent` registrations, unrelated OpenCode plugins/cache packages, modified skills, and user-authored content outside managed prompt/persona markers are never removed.
52
+ - Fixed Codex TOML cleanup to remove only plugin-owned `memory-agent` tables while preserving unrelated formatting and child sections, and made malformed client configuration fail closed instead of being overwritten.
53
+ - Fixed uninstall failure reporting to return a non-zero exit status when any requested cleanup step fails.
54
+
55
+ ## [1.6.6] - 2026-08-17
56
+
57
+ ### Fixed
58
+
59
+ - Fixed npm package distribution files list to include `mcp-server/rag_scope.js` and all server modules.
60
+
61
+ ## [1.6.5] - 2026-08-17
62
+
63
+ ### Added
64
+
65
+ - Added explicit `directory` (and `project` alias) parameter support to Notebook/Memory tools (`remember`, `recall`, `get_fact`, `forget`, `update_fact`, `memory_info`, `link_knowledge`) and RAG tools (`ingest_document`, `query_knowledge_base`, `batch_query_knowledge_base`, `manage_knowledge_base`) across both the MCP server and native OpenCode plugin.
66
+
67
+ ### Fixed
68
+
69
+ - Fixed cross-directory workspace routing and isolation so operations targeting external project paths work reliably without directory mismatch or leaking npm process `INIT_CWD`.
70
+ - Fixed `batch_query_knowledge_base` query execution and result formatting in the MCP server.
71
+
72
+ ## [1.6.4] - 2026-08-13
73
+
74
+ ### Added
75
+
76
+ - `memory_info` now reports whether the current Git identity is `Registry: linked`
77
+ or `Registry: unlinked`, enabling agents to register new repositories automatically.
78
+ - RAG documents now have explicit global/project scope associations. The default
79
+ project scope follows the current linked Git identity, while `scope: "all"`
80
+ retrieves only global knowledge plus the current project's knowledge. A source
81
+ shared by several scopes is stored once and associated with each scope.
82
+ - The native OpenCode plugin now exposes `batch_query_knowledge_base`, bringing it
83
+ to all 15 shared tools plus its two OpenCode-only helpers.
84
+
85
+ ### Changed
86
+
87
+ - OpenCode auto-injected memory now includes complete fact bodies for both global and
88
+ current-project stores without the previous ten-fact truncation and instructs the
89
+ agent to register an unlinked Git identity. Header-only initialization was removed
90
+ because it loses essential context.
91
+ - The bundled memory skill now defines full-body session recall, strict project
92
+ isolation, agent-resolved conflicts, automatic Git project registration, and
93
+ selective RAG curation for important web findings and current technical
94
+ documentation, including links from project facts to supporting sources.
95
+ - `recall` hides superseded facts by default and exposes history through
96
+ `includeSuperseded: true`. Filtered output keeps physical storage indices stable,
97
+ so a displayed number always targets the same fact in `forget`.
98
+
99
+ ### Fixed
100
+
101
+ - Re-ingesting an existing path or URL now preserves its document ID, scope
102
+ associations, and fact links while rebuilding chunks, vectors, FTS rows, and
103
+ structural graph edges for changed content.
104
+ - Snapshot export/import and hybrid cloud synchronization now preserve vectors,
105
+ retrieval policies, policy provenance, document scopes, knowledge links, and
106
+ structural graph metadata. The hybrid sync worker also drains tasks queued during
107
+ an active flush instead of leaving them pending.
108
+ - Relinking a Git project now moves its RAG scope associations and fact-to-document
109
+ links together with Notebook facts.
110
+ - Environment-specific setup flags now update only their requested integration.
111
+ Codex setup also synchronizes the skill to both `~/.codex/skills` and the shared
112
+ `~/.agents/skills` location.
113
+ - Shared documents no longer expose fact-link metadata belonging to another project.
114
+ Document deletion now defaults to unlinking only the current project (or global
115
+ outside Git); broader `global` / `all` removal must be requested explicitly.
116
+ - Updating or forgetting a linked Notebook fact now keeps its knowledge-graph
117
+ projection and cloud payload consistent. Line-range graph edges are included in
118
+ per-document cloud sync, and superseding legacy facts without IDs assigns distinct
119
+ IDs to the old and new versions.
120
+ - README tool counts now match the implementations: 15 MCP tools, 17 native
121
+ OpenCode tools, and 17 unique tool names across both surfaces. The OpenCode tool
122
+ list documents all shared and OpenCode-only helpers explicitly.
123
+
124
+ ## [1.6.3] - 2026-08-13
125
+
126
+ ### Added
127
+
128
+ - `memory_plugin doctor --codex` validates the configured executable and Node.js
129
+ version, performs direct MCP `initialize` / `tools/list`, and calls both
130
+ `memory_info` and `recall(scope="all")`.
131
+ - Codex regression coverage for Windows paths with spaces, legacy config migration,
132
+ duplicate removal, standalone MCP protocol smoke testing, two-repository project
133
+ isolation, global-only recall outside Git, and prompt idempotency.
134
+
135
+ ### Fixed
136
+
137
+ - Codex setup no longer launches the memory MCP through `npx` or a Windows `.cmd`
138
+ shim. It writes absolute paths for the active Node executable and packaged
139
+ `mcp-server/boot.js` entry point after validating Node.js >= 22.5.0.
140
+ - Existing plugin-owned `[mcp_servers.memory-agent]` sections, including the legacy
141
+ `opencode-memory-plugin` entry, are migrated in place without modifying unrelated
142
+ TOML sections or creating duplicates.
143
+ - Repeated prompt setup now collapses duplicate plugin-owned blocks while preserving
144
+ user-authored AGENTS.md / CLAUDE.md content.
145
+ - README tool counts match the v1.6.3 implementations: 15 MCP tools, 16 native
146
+ OpenCode tools, and 17 unique tool names across both surfaces. The OpenCode tool
147
+ list and the MCP-only status of `batch_query_knowledge_base` are documented explicitly.
148
+
149
+ ## [1.6.2] - 2026-08-12
105
150
 
106
151
  ### Added
107
152
 
@@ -244,5 +289,7 @@ a critical retrieval regression introduced after `v1.5.3`.
244
289
  - `BENCHMARKS.md` tables were re-derived from the stored JSON artifacts; the
245
290
  bge-m3 section had carried e5-small numbers shifted by a column.
246
291
 
247
- [1.6.1]: https://github.com/Lotargo/memory_pugin/releases/tag/v1.6.1
248
- [1.6.0]: https://github.com/Lotargo/memory_pugin/releases/tag/v1.6.0
292
+ [1.6.8]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.8
293
+ [1.6.7]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.7
294
+ [1.6.1]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.1
295
+ [1.6.0]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.0