@lotargo/memory_plugin 1.6.8 → 1.6.9

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/CHANGELOG.md CHANGED
@@ -5,7 +5,12 @@ All notable changes to `@lotargo/memory_plugin` are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [1.6.9] - 2026-09-08
9
+
10
+ ### Fixed
11
+
12
+ - Fixed Turso browser OAuth on Windows: URLs no longer go through `cmd.exe` (which truncated the query string at `&`), browser launch now uses `rundll32.exe url.dll,FileProtocolHandler`. The OAuth loopback server now binds an ephemeral port before the login URL is built, eliminating the listen race and `EADDRINUSE` on the fixed port.
13
+ - Made the `policy_retrieval` unit test offline-deterministic: ingestion now runs with `generateEmbeddings: false` (BM25/policy path only) and DB/temp cleanup is guaranteed via `try/finally`, so a corrupted ONNX model cache no longer fails the suite and blocks the runner.
9
14
 
10
15
  ## [1.6.8] - 2026-08-25
11
16
 
@@ -289,6 +294,7 @@ a critical retrieval regression introduced after `v1.5.3`.
289
294
  - `BENCHMARKS.md` tables were re-derived from the stored JSON artifacts; the
290
295
  bge-m3 section had carried e5-small numbers shifted by a column.
291
296
 
297
+ [1.6.9]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.9
292
298
  [1.6.8]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.8
293
299
  [1.6.7]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.7
294
300
  [1.6.1]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.1
package/README.md CHANGED
@@ -1,10 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://raw.githubusercontent.com/Lotargo/memory_plugin/main/assets/hero.jpg" alt="@lotargo/memory_plugin" width="800" style="max-width: 100%; border-radius: 12px; margin-bottom: 16px;">
4
-
5
- <br>
6
-
7
- <img src="https://raw.githubusercontent.com/Lotargo/memory_plugin/main/assets/title.svg" alt="@lotargo/memory_plugin" width="520" style="max-width: 100%; margin-bottom: 12px;">
3
+ <img src="./assets/01_hero_banner.png" alt="memory_plugin architecture persistent memory, RAG, persona and CLI runtime" width="100%">
8
4
 
9
5
  <br>
10
6
 
@@ -15,8 +11,6 @@
15
11
  [![mcp](https://img.shields.io/badge/MCP-Supported-8A2BE2)](https://modelcontextprotocol.io)
16
12
  [![storage](https://img.shields.io/badge/Storage-Local%20%2B%20Cloud%20Sync-success)](#storage-privacy-and-security)
17
13
 
18
- <br>
19
-
20
14
  **Local-first long-term memory, hybrid RAG, and agent personalization for AI coding agents**
21
15
 
22
16
  One memory system for OpenCode, Codex, Claude Code, Gemini CLI, Antigravity, Google Jules, and other MCP clients.
@@ -25,6 +19,16 @@ One memory system for OpenCode, Codex, Claude Code, Gemini CLI, Antigravity, Goo
25
19
 
26
20
  # @lotargo/memory_plugin — Local-First Memory, Hybrid RAG & Agent Personalization
27
21
 
22
+ <p align="center">
23
+ <a href="#quick-start">Quick Start</a> ·
24
+ <a href="#memory-architecture">Memory Architecture</a> ·
25
+ <a href="#persona-and-agent-personalization">Persona</a> ·
26
+ <a href="#retrieval-and-knowledge-graph">RAG & Retrieval</a> ·
27
+ <a href="#cloud-synchronization">Cloud Sync</a> ·
28
+ <a href="#client-integration">Clients</a> ·
29
+ <a href="#storage-privacy-and-security">Security</a>
30
+ </p>
31
+
28
32
  ---
29
33
 
30
34
  ## Why This Project Exists
@@ -41,6 +45,10 @@ AI coding assistants forget user preferences, architectural decisions, investiga
41
45
 
42
46
  The same engine adds Git-based project isolation, semantic search, full raw-source expansion, explicit fact-to-document links, optional Turso synchronization, and native OpenCode auto-injection.
43
47
 
48
+ ### Architecture at a Glance
49
+
50
+ <img src="./assets/02_project_evolution.png" alt="Evolution of memory_plugin from notebook memory through RAG, persona and cross-client agent state" width="100%">
51
+
44
52
  ### Highlights
45
53
 
46
54
  - Human-readable Markdown Notebook facts with stable IDs, TTL, protection, tags, superseding, and explicit `fact` / `directive` semantics.
@@ -68,75 +76,83 @@ The same engine adds Git-based project isolation, semantic search, full raw-sour
68
76
 
69
77
  CPU execution with `Xenova/multilingual-e5-small` is the recommended stable default. WebGPU execution is experimental.
70
78
 
71
- ### Install and Configure
79
+ ### Install / Uninstall All Clients
72
80
 
73
- Configure every supported client location:
81
+ The normal installation path is one command. It configures every supported client directly, so there is no separate package-only installation step:
74
82
 
75
83
  ```bash
76
- npm install -g @lotargo/memory_plugin
77
- memory_plugin setup
84
+ npx -y @lotargo/memory_plugin setup
78
85
  ```
79
86
 
80
- Or run setup without a permanent global installation:
87
+ This registers memory_plugin in OpenCode, Codex, Claude Code, Gemini CLI, and Antigravity, installs the bundled `using-memory` skill, and adds managed memory instructions where supported. Existing unrelated configuration is preserved.
88
+
89
+ Remove the integration from all clients while keeping Notebook/RAG data:
81
90
 
82
91
  ```bash
83
- npx @lotargo/memory_plugin setup
92
+ npx -y @lotargo/memory_plugin uninstall
84
93
  ```
85
94
 
86
- Target one client when needed:
95
+ Remove the integrations and delete local memory data:
87
96
 
88
97
  ```bash
89
- memory_plugin setup --opencode
90
- memory_plugin setup --codex
91
- memory_plugin setup --claude
92
- memory_plugin setup --antigravity
93
- memory_plugin setup --gemini # Gemini CLI (~/.gemini/settings.json)
98
+ npx -y @lotargo/memory_plugin uninstall --purge --yes
94
99
  ```
95
100
 
96
- Use `--local` with Antigravity setup to create the workspace-local `.agents/mcp_config.json` even when `.agents/` does not yet exist.
101
+ Preview the uninstall without changing anything:
97
102
 
98
- Claude Code, Gemini CLI, and Codex setup/uninstall use their native MCP lifecycle commands when available. An ownership-checked config edit is retained as a compatibility fallback for missing, older, or non-functional client CLIs. Antigravity remains a separate integration because it uses a different config layout.
103
+ ```bash
104
+ npx -y @lotargo/memory_plugin uninstall --dry-run
105
+ ```
106
+
107
+ What `uninstall` removes by default (without `--purge`):
108
+
109
+ - `~/.config/opencode/opencode.json` - plugin entry, including `file://` dev links.
110
+ - `~/.claude.json` - `mcpServers.memory-agent`.
111
+ - `~/.gemini/settings.json` - Gemini CLI `mcpServers.memory-agent`.
112
+ - `~/.gemini/config/mcp_config.json` and `.agents/mcp_config.json` - Antigravity `mcpServers.memory-agent`.
113
+ - `~/.codex/config.toml` - `[mcp_servers.memory-agent]` only when owned by this plugin.
114
+ - Managed prompt blocks from Codex, Claude Code, Gemini CLI, and Antigravity instruction files.
115
+ - The bundled `using-memory` skill from each client's managed `skills/` directory.
99
116
 
100
- Setup also installs the bundled `using-memory` skill and managed memory instructions for the selected clients. Existing unrelated configuration is preserved.
117
+ Existing user content outside plugin-owned markers is preserved. Foreign `memory-agent` registrations, modified/non-owned skills, unrelated file plugins, and other packages in the `@lotargo` OpenCode cache namespace are left untouched.
101
118
 
102
- ### Uninstall
119
+ Normal uninstall keeps OpenCode's package cache. `--purge-cache` removes only exact cache directories owned by this package. With `--purge`, the plugin also deletes `MEMORY_DIR` and its prompt state after resolving and validating every target, rejecting dangerous roots and broad parent paths, and displaying the targets before confirmation.
103
120
 
104
- Remove the plugin from one or all clients without deleting Notebook/RAG data:
121
+ On Linux/macOS, `XDG_CONFIG_HOME` and `XDG_CACHE_HOME` are respected. `OPENCODE_CONFIG_DIR` and `MEMORY_DIR` remain explicit overrides on every platform.
122
+
123
+ ### Install One Client
124
+
125
+ Use the same one-shot setup command with a client flag when you only want one integration:
105
126
 
106
127
  ```bash
107
- memory_plugin uninstall --dry-run # preview
108
- memory_plugin uninstall # remove all clients, keep data
109
- memory_plugin uninstall --purge --yes # also delete local data (MEMORY_DIR, prompt state)
110
- memory_plugin uninstall --opencode --purge-cache # explicitly remove this plugin's OpenCode cache
111
- memory_plugin uninstall --opencode --claude # only selected clients
112
- npx @lotargo/memory_plugin uninstall --dry-run
113
- memory_plugin setup --uninstall --purge # alias
128
+ npx -y @lotargo/memory_plugin setup --opencode
129
+ npx -y @lotargo/memory_plugin setup --codex
130
+ npx -y @lotargo/memory_plugin setup --claude
131
+ npx -y @lotargo/memory_plugin setup --antigravity
132
+ npx -y @lotargo/memory_plugin setup --gemini
114
133
  ```
115
134
 
116
- What `uninstall` removes by default (without `--purge`):
117
-
118
- - `~/.config/opencode/opencode.json` — plugin entry (including `file://` dev link)
119
- - `~/.claude.json` — `mcpServers.memory-agent`
120
- - `~/.gemini/settings.json` — Gemini CLI `mcpServers.memory-agent`
121
- - `~/.gemini/config/mcp_config.json` and `.agents/mcp_config.json` — Antigravity `mcpServers.memory-agent`
122
- - `~/.codex/config.toml` — `[mcp_servers.memory-agent]` (only if owned by this plugin)
123
- - Managed prompt blocks from `~/.codex/AGENTS.md`, `~/.claude/CLAUDE.md`, `~/.gemini/GEMINI.md`, and `~/.gemini/config/AGENTS.md`
124
- - `using-memory` skill from each client's `skills/` directory
135
+ Use `--local` with Antigravity to create the workspace-local `.agents/mcp_config.json` even when `.agents/` does not yet exist:
125
136
 
126
- Existing user content outside the managed prompt/persona markers is preserved. Foreign `memory-agent` registrations, modified/non-owned `using-memory` skills, unrelated file plugins, and other packages in the `@lotargo` OpenCode cache namespace are left untouched.
137
+ ```bash
138
+ npx -y @lotargo/memory_plugin setup --antigravity --local
139
+ ```
127
140
 
128
- Normal uninstall keeps OpenCode's package cache, matching the host lifecycle. `--purge-cache` removes only exact cache directories owned by this package; unrelated packages, including other packages in the `@lotargo` namespace, remain untouched.
141
+ The same client flags can be used for targeted removal, for example:
129
142
 
130
- With `--purge` it also deletes `MEMORY_DIR` (`~/.config/opencode/memory` by default) and the memory-agent prompt state. Purge resolves and validates every target before changing client configuration, rejects filesystem roots, home/workspace/config roots and broad top-level paths, follows symlinks for validation, and prints the exact targets before interactive confirmation. The npm package itself is removed separately with `npm uninstall -g @lotargo/memory_plugin`. Restart clients after uninstall.
143
+ ```bash
144
+ npx -y @lotargo/memory_plugin uninstall --opencode
145
+ npx -y @lotargo/memory_plugin uninstall --codex
146
+ ```
131
147
 
132
- On Linux/macOS, `XDG_CONFIG_HOME` and `XDG_CACHE_HOME` are respected for OpenCode configuration, prompt state, and package-cache cleanup. `OPENCODE_CONFIG_DIR` and `MEMORY_DIR` remain explicit overrides on every platform.
148
+ Claude Code, Gemini CLI, and Codex setup/uninstall use their native MCP lifecycle commands when available. An ownership-checked config edit is retained as a compatibility fallback for missing, older, or non-functional client CLIs. Antigravity remains a separate integration because it uses a different config layout.
133
149
 
134
150
  ### Verify Codex
135
151
 
136
152
  Codex uses a direct executable chain (`node` -> `mcp-server/boot.js`) instead of an `npx`/`.cmd` launcher, avoiding Windows stdio handshake failures. Setup safely migrates legacy registrations in `~/.codex/config.toml`.
137
153
 
138
154
  ```bash
139
- memory_plugin doctor --codex
155
+ npx -y @lotargo/memory_plugin doctor --codex
140
156
  ```
141
157
 
142
158
  The doctor validates the configured Node runtime, MCP initialization, tool discovery, and real `memory_info` and `recall(scope: "all")` calls.
@@ -145,10 +161,10 @@ The doctor validates the configured Node runtime, MCP initialization, tool disco
145
161
 
146
162
  ```bash
147
163
  # Authenticate with a Turso account token and enable hybrid sync
148
- memory_plugin setup --api-key <TURSO_API_TOKEN> --mode hybrid-sync
164
+ npx -y @lotargo/memory_plugin setup --api-key <TURSO_API_TOKEN> --mode hybrid-sync
149
165
 
150
166
  # Or change mode when credentials already exist
151
- memory_plugin setup --mode only-cloud
167
+ npx -y @lotargo/memory_plugin setup --mode only-cloud
152
168
  ```
153
169
 
154
170
  Prefer `TURSO_API_TOKEN`, `TURSO_DB_URL`, and `TURSO_DB_TOKEN` environment variables over command-line secrets because shell arguments may appear in process lists and history.
@@ -168,6 +184,10 @@ After code changes, restart OpenCode to reload the module. Codex, Claude Code, G
168
184
 
169
185
  ## Memory Architecture
170
186
 
187
+ <img src="./assets/03_hot_memory_vs_cold_rag.png" alt="Hot persistent memory versus cold RAG retrieval architecture in memory_plugin" width="100%">
188
+
189
+ The architecture deliberately separates **small, always-useful context** from **large, on-demand knowledge**. This keeps session initialization useful without turning persistent memory into an ever-growing prompt.
190
+
171
191
  ### 1. Hot Notebook Memory
172
192
 
173
193
  Notebook memory stores concise, high-signal context in Markdown:
@@ -238,15 +258,19 @@ This keeps startup context small while preserving the complete reasoning trail w
238
258
 
239
259
  ## Persona and Agent Personalization
240
260
 
261
+ <img src="./assets/04_fact_vs_directive.png" alt="Fact versus directive semantics in memory_plugin" width="100%">
262
+
241
263
  Notebook entries have explicit semantics:
242
264
 
243
265
  ```text
244
- kind: "fact" # descriptive context
245
- kind: "directive" # active user-approved personality or working configuration
266
+ kind: "fact" # descriptive context — what the agent knows
267
+ kind: "directive" # active configuration how the agent should behave
246
268
  ```
247
269
 
248
270
  Use `kind: "directive"` for personality, behavior, tone, communication style, preferences, or working conventions the agent should actively apply. Explicit `kind` is authoritative; persuasive wording alone does not turn a fact into an instruction.
249
271
 
272
+ <img src="./assets/05_persona_as_runtime_state.png" alt="The same model with neutral, coding-focused and personalized runtime state" width="100%">
273
+
250
274
  ### OpenCode
251
275
 
252
276
  The native plugin performs complete session initialization automatically:
@@ -425,7 +449,7 @@ The MCP server exposes **16 tools**. The native OpenCode plugin exposes the same
425
449
 
426
450
  ## CLI Reference
427
451
 
428
- `memory_plugin` and `memory-agent` are MCP stdio entry points. `memory_plugin setup` performs client installation, while `memory_plugin cli` or `memory-cli` opens the interactive control panel. Direct administration commands should use `memory-cli`.
452
+ `memory_plugin` and `memory-agent` are MCP stdio entry points. The Quick Start uses `npx -y @lotargo/memory_plugin ...`, so a separate global npm installation is not required. If the package is installed globally for development or administration, `memory_plugin setup` performs client installation, while `memory_plugin cli` or `memory-cli` opens the interactive control panel. Direct administration commands should use `memory-cli`.
429
453
 
430
454
  | Command | Purpose |
431
455
  | :--- | :--- |
@@ -539,7 +563,9 @@ Spreadsheet ingestion uses SheetJS CE `0.20.3` from the official SheetJS CDN rat
539
563
 
540
564
  ---
541
565
 
542
- ## Testing and Benchmarks
566
+ ## Repository Testing and Benchmarks
567
+
568
+ > These commands are intended for a **source checkout of the repository**. Test suites and benchmark harnesses are intentionally excluded from the published npm tarball.
543
569
 
544
570
  ```bash
545
571
  npm test # unified unit, integration, and simulated-cloud suites
@@ -551,7 +577,7 @@ npm run benchmark:table-code
551
577
 
552
578
  The fast suites use `generateEmbeddings: false` in retrieval paths for deterministic offline coverage. `npm run smoke` covers the dense-vector path with real cached/downloaded model weights and checks multilingual semantic retrieval. Both modes are needed: lexical-only tests cannot catch a broken vector serialization or ONNX execution path.
553
579
 
554
- The unified suites cover fact formatting, typed directives, persona migration/synchronization, client prompt safety, Codex launcher compatibility, Git identity isolation, RAG scopes, policy expansion, RAG Memory Notes, semantic index output, raw blob portability, reverse sync, tombstones, snapshots, MCP contracts, and cloud authentication workflows.
580
+ The unified suites cover fact formatting, typed directives, persona migration/synchronization, client prompt safety, Codex launcher compatibility, Git identity isolation, RAG scopes, policy expansion, RAG Memory Notes, semantic index output, raw blob portability, reverse sync, tombstones, snapshots, MCP contracts, spreadsheet parsing, and cloud authentication workflows.
555
581
 
556
582
  See [`docs/BENCHMARKS.md`](./docs/BENCHMARKS.md) for methodology and detailed reports.
557
583
 
@@ -571,7 +597,7 @@ The stored 32-document / 21-query technical corpus produced:
571
597
  ## Troubleshooting
572
598
 
573
599
  - **`No such built-in module: node:sqlite`**: install Node.js `22.5.0` or newer.
574
- - **Codex tools are missing**: run `memory_plugin setup --codex`, then `memory_plugin doctor --codex`, and open a new Codex task.
600
+ - **Codex tools are missing**: run `npx -y @lotargo/memory_plugin setup --codex`, then `npx -y @lotargo/memory_plugin doctor --codex`, and open a new Codex task.
575
601
  - **OpenCode still runs old code**: restart OpenCode. For repository development, confirm `npm run dev:link` points its plugin entry to `opencode-plugin/main.js`.
576
602
  - **Persona changes are not visible**: run `memory-cli sync-persona`, then start a new CLI session/task. Use `memory-cli migrate-persona --dry-run` for legacy entries.
577
603
  - **Project recall is empty**: call `memory_info`; if a Git identity is `Registry: unlinked`, run `link_project_memory` or `memory-cli link --dir <repo>`.