@lotargo/memory_plugin 1.6.8 → 1.6.10
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 +14 -1
- package/README.md +80 -53
- package/mcp-server/admin/auth.js +682 -645
- package/mcp-server/cli.js +1 -1
- package/mcp-server/index.js +2 -2
- package/mcp-server/setup.js +3 -3
- package/mcp-server/uninstall.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,18 @@ 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
|
-
## [
|
|
8
|
+
## [1.6.10] - 2026-09-08
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fixed OAuth callback rejecting every real Turso login: Turso redirects to `/?jwt=<JWT>&username=<USERNAME>` without echoing `state`, so a missing state is now accepted with a warning (the token is still validated against the Turso API); only a present-but-mismatched state is rejected as CSRF.
|
|
13
|
+
|
|
14
|
+
## [1.6.9] - 2026-09-08
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- 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.
|
|
19
|
+
- 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
20
|
|
|
10
21
|
## [1.6.8] - 2026-08-25
|
|
11
22
|
|
|
@@ -289,6 +300,8 @@ a critical retrieval regression introduced after `v1.5.3`.
|
|
|
289
300
|
- `BENCHMARKS.md` tables were re-derived from the stored JSON artifacts; the
|
|
290
301
|
bge-m3 section had carried e5-small numbers shifted by a column.
|
|
291
302
|
|
|
303
|
+
[1.6.10]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.10
|
|
304
|
+
[1.6.9]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.9
|
|
292
305
|
[1.6.8]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.8
|
|
293
306
|
[1.6.7]: https://github.com/Lotargo/memory_plugin/releases/tag/v1.6.7
|
|
294
307
|
[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="
|
|
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
|
[](https://modelcontextprotocol.io)
|
|
16
12
|
[](#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
|
|
79
|
+
### Install / Uninstall All Clients
|
|
72
80
|
|
|
73
|
-
|
|
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
|
-
|
|
77
|
-
memory_plugin setup
|
|
84
|
+
npx -y @lotargo/memory_plugin setup
|
|
78
85
|
```
|
|
79
86
|
|
|
80
|
-
|
|
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
|
|
92
|
+
npx -y @lotargo/memory_plugin uninstall
|
|
84
93
|
```
|
|
85
94
|
|
|
86
|
-
|
|
95
|
+
Remove the integrations and delete local memory data:
|
|
87
96
|
|
|
88
97
|
```bash
|
|
89
|
-
memory_plugin
|
|
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
|
-
|
|
101
|
+
Preview the uninstall without changing anything:
|
|
97
102
|
|
|
98
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
108
|
-
|
|
109
|
-
memory_plugin
|
|
110
|
-
|
|
111
|
-
memory_plugin
|
|
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
|
-
|
|
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
|
-
|
|
137
|
+
```bash
|
|
138
|
+
npx -y @lotargo/memory_plugin setup --antigravity --local
|
|
139
|
+
```
|
|
127
140
|
|
|
128
|
-
|
|
141
|
+
The same client flags can be used for targeted removal, for example:
|
|
129
142
|
|
|
130
|
-
|
|
143
|
+
```bash
|
|
144
|
+
npx -y @lotargo/memory_plugin uninstall --opencode
|
|
145
|
+
npx -y @lotargo/memory_plugin uninstall --codex
|
|
146
|
+
```
|
|
131
147
|
|
|
132
|
-
|
|
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,11 @@ 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
|
-
|
|
164
|
+
# (--api-token and --token are accepted as aliases for --api-key)
|
|
165
|
+
npx -y @lotargo/memory_plugin setup --api-key <TURSO_API_TOKEN> --mode hybrid-sync
|
|
149
166
|
|
|
150
167
|
# Or change mode when credentials already exist
|
|
151
|
-
memory_plugin setup --mode only-cloud
|
|
168
|
+
npx -y @lotargo/memory_plugin setup --mode only-cloud
|
|
152
169
|
```
|
|
153
170
|
|
|
154
171
|
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 +185,10 @@ After code changes, restart OpenCode to reload the module. Codex, Claude Code, G
|
|
|
168
185
|
|
|
169
186
|
## Memory Architecture
|
|
170
187
|
|
|
188
|
+
<img src="./assets/03_hot_memory_vs_cold_rag.png" alt="Hot persistent memory versus cold RAG retrieval architecture in memory_plugin" width="100%">
|
|
189
|
+
|
|
190
|
+
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.
|
|
191
|
+
|
|
171
192
|
### 1. Hot Notebook Memory
|
|
172
193
|
|
|
173
194
|
Notebook memory stores concise, high-signal context in Markdown:
|
|
@@ -238,15 +259,19 @@ This keeps startup context small while preserving the complete reasoning trail w
|
|
|
238
259
|
|
|
239
260
|
## Persona and Agent Personalization
|
|
240
261
|
|
|
262
|
+
<img src="./assets/04_fact_vs_directive.png" alt="Fact versus directive semantics in memory_plugin" width="100%">
|
|
263
|
+
|
|
241
264
|
Notebook entries have explicit semantics:
|
|
242
265
|
|
|
243
266
|
```text
|
|
244
|
-
kind: "fact" # descriptive context
|
|
245
|
-
kind: "directive" # active
|
|
267
|
+
kind: "fact" # descriptive context — what the agent knows
|
|
268
|
+
kind: "directive" # active configuration — how the agent should behave
|
|
246
269
|
```
|
|
247
270
|
|
|
248
271
|
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
272
|
|
|
273
|
+
<img src="./assets/05_persona_as_runtime_state.png" alt="The same model with neutral, coding-focused and personalized runtime state" width="100%">
|
|
274
|
+
|
|
250
275
|
### OpenCode
|
|
251
276
|
|
|
252
277
|
The native plugin performs complete session initialization automatically:
|
|
@@ -425,7 +450,7 @@ The MCP server exposes **16 tools**. The native OpenCode plugin exposes the same
|
|
|
425
450
|
|
|
426
451
|
## CLI Reference
|
|
427
452
|
|
|
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`.
|
|
453
|
+
`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
454
|
|
|
430
455
|
| Command | Purpose |
|
|
431
456
|
| :--- | :--- |
|
|
@@ -539,7 +564,9 @@ Spreadsheet ingestion uses SheetJS CE `0.20.3` from the official SheetJS CDN rat
|
|
|
539
564
|
|
|
540
565
|
---
|
|
541
566
|
|
|
542
|
-
## Testing and Benchmarks
|
|
567
|
+
## Repository Testing and Benchmarks
|
|
568
|
+
|
|
569
|
+
> 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
570
|
|
|
544
571
|
```bash
|
|
545
572
|
npm test # unified unit, integration, and simulated-cloud suites
|
|
@@ -551,7 +578,7 @@ npm run benchmark:table-code
|
|
|
551
578
|
|
|
552
579
|
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
580
|
|
|
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.
|
|
581
|
+
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
582
|
|
|
556
583
|
See [`docs/BENCHMARKS.md`](./docs/BENCHMARKS.md) for methodology and detailed reports.
|
|
557
584
|
|
|
@@ -571,7 +598,7 @@ The stored 32-document / 21-query technical corpus produced:
|
|
|
571
598
|
## Troubleshooting
|
|
572
599
|
|
|
573
600
|
- **`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.
|
|
601
|
+
- **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
602
|
- **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
603
|
- **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
604
|
- **Project recall is empty**: call `memory_info`; if a Git identity is `Registry: unlinked`, run `link_project_memory` or `memory-cli link --dir <repo>`.
|