dore-memory 0.1.3 → 0.2.0

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 CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  <p align="center">
4
4
  <strong>Memory for Claude Code. Say it once, it remembers in every new session.</strong><br/>
5
- Runs on your laptop · free to learn · nothing leaves your machine
5
+ Runs on your laptop · your notes never leave your machine · optional Haiku learning between sessions
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- <img src="https://img.shields.io/badge/Claude_Code-plugin_0.6.0-d97757?style=flat-square" alt="Claude Code plugin 0.6.0" />
9
+ <img src="https://img.shields.io/badge/Claude_Code-plugin_0.6.1-d97757?style=flat-square" alt="Claude Code plugin 0.6.1" />
10
10
  <a href="https://github.com/SopheaII/dore-memory/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/SopheaII/dore-memory/ci.yml?branch=master&style=flat-square&label=CI" alt="CI" /></a>
11
11
  <a href="https://www.npmjs.com/package/dore-memory"><img src="https://img.shields.io/npm/v/dore-memory?style=flat-square&logo=npm" alt="npm" /></a>
12
12
  <img src="https://img.shields.io/badge/python-3.11+-3776ab?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+" />
13
- <img src="https://img.shields.io/badge/data-stays_local-2ea44f?style=flat-square" alt="Data stays local" />
13
+ <img src="https://img.shields.io/badge/memory-stays_local-2ea44f?style=flat-square" alt="Memory stays local" />
14
14
  <img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT license" />
15
15
  </p>
16
16
 
@@ -40,13 +40,15 @@ dore manages the memory itself, outside the AI:
40
40
 
41
41
  | | Usual memory tools | dore |
42
42
  |---|---|---|
43
- | Who decides what to save | The AI (costs tokens, and it can forget) | dore, from what you type (free, every time) |
44
- | What Claude receives | The whole memory, or what the AI searched for | Only the notes that match your message (usually none) |
43
+ | Who decides what to save | The AI (costs tokens, and it can forget) | dore, from what you type: local rules (free), or, if you turn it on, Haiku in one small batch a day |
44
+ | What Claude receives | The whole memory, or what the AI searched for | Only the notes that match your message (usually none), plus your standing rules once per session |
45
45
  | When a fact changes | Old and new notes may both stay | The old note is replaced |
46
46
  | When notes disagree | No rule | What you said wins over what the AI guessed |
47
- | Where it runs | Sometimes a cloud service | Only on your computer |
47
+ | Where it runs | Sometimes a cloud service | On your computer (with Haiku learning on, the sentences you type also go to Haiku, after each session) |
48
48
 
49
- Learning costs 0 Claude tokens and adds about 13 ms to each message.
49
+ Learning adds a few ms to each message. By default it costs 0 Claude tokens (local word rules). If you say yes at
50
+ install, dore learns better with Claude Haiku instead: after each session, in the background, one small batch
51
+ (about 5-10k Haiku tokens a day on real use) sorts what you typed into facts, rules and noise.
50
52
 
51
53
  ## See it work in Claude Code
52
54
 
@@ -109,13 +111,19 @@ Then start a new Claude Code session and talk as usual. That's it.
109
111
  |---|---|
110
112
  | `npx dore-memory install` | Sets up dore and turns on its Claude Code plugin |
111
113
  | `npx dore-memory status` | Shows where dore is and whether the plugin is on |
112
- | `npx dore-memory update` | Gets the latest dore |
114
+ | `npx dore-memory@latest update` | Gets the latest dore and its plugin |
113
115
  | `npx dore-memory uninstall` | Removes dore and the plugin (your memory is kept) |
114
116
 
115
117
  **What `install` does:** sets up dore in `~/.dore-memory` and turns on its Claude Code plugin.
116
118
  Your memory is saved in `~/.dore-memory/data`. Change the folder with `DORE_HOME`.
117
119
  The first install downloads about 200 MB (Python packages and a small search model).
118
120
 
121
+ **Updates are automatic.** Once a day, while you are not typing, dore asks npm whether a newer version is
122
+ out and, if so, updates itself in the background at low priority (no message; log in `~/.dore-memory/data/update.log`).
123
+ Turn this off with `DORE_NO_AUTO_UPDATE=1` (`NO_UPDATE_NOTIFIER=1`, `DO_NOT_TRACK=1` and Claude Code's
124
+ `DISABLE_AUTOUPDATER=1` also turn it off), then update by hand with `npx dore-memory@latest update`.
125
+ Installs from source never update by themselves.
126
+
119
127
  ### From source
120
128
 
121
129
  ```bash
@@ -138,8 +146,30 @@ It also works with opencode and other MCP agents.
138
146
  3. **If it asks about something dore knows**, the hook adds the matching notes (a few lines) to your
139
147
  message, so Claude can answer. If nothing matches, nothing is added (0 tokens).
140
148
  4. **If a fact changes** ("the port is now 9443"), the newer note replaces the old one.
141
-
142
- Learning runs locally with small models, so it costs no Claude tokens and nothing leaves your machine.
149
+ 5. **Rules you repeat** ("never use tabs", said in two sessions, in any words) or that Claude keeps following start
150
+ each new session, in a few lines at most; rules you stop repeating fade, like habits, and still come back when a
151
+ message matches them.
152
+
153
+ With Haiku learning on, steps 2 and 4 still happen at once (so it works from your very first session), and Haiku
154
+ reviews them afterwards: after each session dore's background helper sends what you typed (not code, logs, pastes or Claude's replies) to
155
+ Haiku through your own `claude` command. Haiku says which are lasting facts or rules, which repeat or update an
156
+ existing note, and which are noise; a quick note it doesn't agree with is archived. Nothing is deleted; an old note is hidden only when a second check agrees
157
+ it is out of date. Offline or at your plan's limit, the sentences wait and are tried again later.
158
+
159
+ Without Haiku, learning runs locally with small models: no Claude tokens, and your memory never leaves your machine.
160
+
161
+ ## Privacy
162
+
163
+ - **Stays on your machine:** every note, everything you type, your projects and the search model's work.
164
+ dore has no account, no server and no telemetry.
165
+ - **With Haiku learning on** (you choose at install; change it in `~/.dore-memory/data/learner`): after each session,
166
+ the sentences you typed since the last time go to Claude Haiku through your own `claude` login, like any message
167
+ you send Claude. Your notes stay on your machine.
168
+ - **Otherwise the only thing dore sends:** once a day, one request for the public page
169
+ `https://registry.npmjs.org/dore-memory/latest` to see the newest version number. It carries nothing about
170
+ you or your memory; npm sees an ordinary request from your IP address. When there is a newer version, the
171
+ update downloads it from npm and GitHub. Off with `DORE_NO_AUTO_UPDATE=1`.
172
+ - Installing and updating download packages from npm, GitHub and PyPI, like any installer.
143
173
 
144
174
  ## Limits
145
175
 
@@ -112,7 +112,9 @@ function installPython(upgrade) {
112
112
  // waits for a hook (20 s), so the user's first message would be lost. Do it here instead.
113
113
  function warmUp() {
114
114
  say("downloading the search model and opening the memory (one time, about 30 s)...");
115
- const code = "from dore.config import Config\nfrom dore.integrations.hooks import open_store\n"
115
+ // fastembed turns progress bars back on, and huggingface_hub warns that the env var wins: hide that.
116
+ const code = "import warnings\nwarnings.filterwarnings('ignore', message='Cannot enable progress bars')\n"
117
+ + "from dore.config import Config\nfrom dore.integrations.hooks import open_store\n"
116
118
  + "from dore.learn.grammar import nlp\nopen_store(Config()).close()\nnlp()\n";
117
119
  const r = spawnSync(VENV_PY, ["-c", code], {
118
120
  stdio: ["ignore", "ignore", "inherit"],
@@ -121,7 +123,7 @@ function warmUp() {
121
123
  if (r.status !== 0) fail("could not download the search model. Check your internet connection and run install again.");
122
124
  }
123
125
 
124
- function installPlugin() {
126
+ function installPlugin(upgrade) {
125
127
  if (!has("claude")) {
126
128
  say("Claude Code CLI not found. Install Claude Code, then run: npx dore-memory install");
127
129
  return false;
@@ -129,17 +131,47 @@ function installPlugin() {
129
131
  // "add" fails when the marketplace is already known; that is fine.
130
132
  run("claude", ["plugin", "marketplace", "add", MARKET], { allowFail: true });
131
133
  run("claude", ["plugin", "marketplace", "update", "dore-memory"], { allowFail: true });
134
+ if (upgrade && run("claude", ["plugin", "update", PLUGIN], { allowFail: true })) return true;
132
135
  return run("claude", ["plugin", "install", PLUGIN], { allowFail: true });
133
136
  }
134
137
 
138
+ function recordVersion() {
139
+ const version = require(path.join(__dirname, "..", "package.json")).version;
140
+ fs.mkdirSync(DATA, { recursive: true });
141
+ fs.writeFileSync(path.join(DATA, "install.json"), JSON.stringify({ version }) + "\n");
142
+ }
143
+
144
+ // Learning with Haiku uses the user's own Claude Code login, so it is on only after a clear yes (default no; no
145
+ // terminal = no). The choice is kept in data/learner ("haiku" or "rules"); DORE_LEARN overrides it.
146
+ function chooseLearner() {
147
+ const file = path.join(DATA, "learner");
148
+ if (fs.existsSync(file) || process.env.DORE_LEARN) return;
149
+ let yes = false;
150
+ if (process.stdin.isTTY && has("claude")) {
151
+ console.log("dore-memory: dore can learn better with Claude Haiku: about once a day it sends the sentences you");
152
+ console.log(" typed (not code, logs, pastes or Claude's replies) to Haiku through your own `claude` command and");
153
+ console.log(" login, about 5-10k tokens a day. Without it, dore learns with local word rules only.");
154
+ process.stdout.write(" Use Haiku for learning? [y/N] ");
155
+ const buf = Buffer.alloc(256);
156
+ try { yes = buf.toString("utf8", 0, fs.readSync(0, buf, 0, 256, null)).trim().toLowerCase().startsWith("y"); } catch {}
157
+ }
158
+ fs.mkdirSync(DATA, { recursive: true });
159
+ fs.writeFileSync(file, (yes ? "haiku" : "rules") + "\n");
160
+ }
161
+
135
162
  function install(upgrade) {
136
163
  say(`setting up in ${HOME} (first run downloads ~200 MB of packages and models)`);
137
164
  installPython(upgrade);
138
- const plugin = installPlugin();
165
+ recordVersion();
166
+ chooseLearner();
167
+ const plugin = installPlugin(upgrade);
139
168
  say("done.");
140
169
  console.log(` memory: ${DATA}`);
141
170
  console.log(` plugin: ${plugin ? PLUGIN + " installed" : "not installed (see above)"}`);
142
171
  console.log(" Start a new Claude Code session; dore learns from what you tell it.");
172
+ console.log(" Your memory stays on this computer (with Haiku learning on, the sentences you type also go to Haiku,");
173
+ console.log(" once a day; change it in " + path.join(DATA, "learner") + "). Once a day dore asks npm for a newer version and updates");
174
+ console.log(" itself in the background (nothing about you is sent); turn that off with DORE_NO_AUTO_UPDATE=1.");
143
175
  }
144
176
 
145
177
  function uninstall() {
@@ -173,16 +205,23 @@ function status() {
173
205
  const HELP = `Usage: npx dore-memory <command>
174
206
 
175
207
  install set up dore and its Claude Code plugin
176
- update upgrade dore to the latest version
208
+ update upgrade dore to the latest version (use: npx dore-memory@latest update)
177
209
  status show where dore is and whether the plugin is on
178
210
  uninstall remove the plugin and Python environment (keeps your memory)
179
211
 
180
212
  Environment: DORE_HOME (default ~/.dore-memory), DORE_PIP_SPEC (what to pip install),
181
- DORE_MARKETPLACE (where the plugin comes from; default the GitHub repo).`;
213
+ DORE_MARKETPLACE (where the plugin comes from; default the GitHub repo),
214
+ DORE_NO_AUTO_UPDATE=1 (never ask npm for a newer version or update by itself).`;
182
215
 
183
216
  const cmd = process.argv[2];
184
217
  if (cmd === "install") install(false);
185
- else if (cmd === "update") { installPython(true); installPlugin(); say("updated."); }
218
+ else if (cmd === "update") {
219
+ if (fs.existsSync(HOOK)) spawnSync(HOOK, ["quit"], { stdio: "ignore", timeout: 10000 });
220
+ installPython(true);
221
+ recordVersion();
222
+ installPlugin(true);
223
+ say("updated. Run /reload-plugins in open Claude Code sessions, or start a new one.");
224
+ }
186
225
  else if (cmd === "status") status();
187
226
  else if (cmd === "uninstall") uninstall();
188
227
  else { console.log(HELP); process.exit(cmd && !["-h", "--help", "help"].includes(cmd) ? 1 : 0); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dore-memory",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Local long-term memory for Claude Code. Say it once, it remembers in every new session. Installs the dore Python package and its Claude Code plugin.",
5
5
  "keywords": [
6
6
  "claude-code",