@wipcomputer/memory-crystal 0.7.29 → 0.7.30

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 (70) hide show
  1. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.env.example +20 -0
  2. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.publish-skill.json +1 -0
  3. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CHANGELOG.md +1297 -0
  4. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CLA.md +19 -0
  5. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/LICENSE +52 -0
  6. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README-ENTERPRISE.md +226 -0
  7. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README.md +151 -0
  8. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/RELAY.md +199 -0
  9. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/SKILL.md +462 -0
  10. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/TECHNICAL.md +656 -0
  11. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-23.md +48 -0
  12. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-25.md +24 -0
  13. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-26.md +7 -0
  14. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-28.md +31 -0
  15. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-29.md +28 -0
  16. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-4.md +64 -0
  17. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-5.md +19 -0
  18. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/README.md +116 -0
  19. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/docs/gpt-system-instructions.md +69 -0
  20. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/migrations/0001_init.sql +52 -0
  21. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0001_init.sql +51 -0
  22. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0002_cloud_storage.sql +49 -0
  23. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/openclaw.plugin.json +11 -0
  24. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package-lock.json +4169 -0
  25. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package.json +61 -0
  26. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/crystal-capture.sh +29 -0
  27. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/deploy-cloud.sh +153 -0
  28. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/ldm-backup.sh +116 -0
  29. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/migrate-lance-to-sqlite.mjs +218 -0
  30. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/skills/memory/SKILL.md +438 -0
  31. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-demo.toml +8 -0
  32. package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-mcp.toml +24 -0
  33. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.env.example +20 -0
  34. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.publish-skill.json +1 -0
  35. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CHANGELOG.md +1297 -0
  36. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CLA.md +19 -0
  37. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/LICENSE +52 -0
  38. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README-ENTERPRISE.md +226 -0
  39. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README.md +151 -0
  40. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELAY.md +199 -0
  41. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELEASE-NOTES-v0.7.30.md +29 -0
  42. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/SKILL.md +462 -0
  43. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/TECHNICAL.md +656 -0
  44. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-23.md +48 -0
  45. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-25.md +24 -0
  46. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-26.md +7 -0
  47. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-28.md +31 -0
  48. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-29.md +28 -0
  49. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-4.md +64 -0
  50. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-5.md +19 -0
  51. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/README.md +116 -0
  52. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/docs/gpt-system-instructions.md +69 -0
  53. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/migrations/0001_init.sql +52 -0
  54. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0001_init.sql +51 -0
  55. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0002_cloud_storage.sql +49 -0
  56. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/openclaw.plugin.json +11 -0
  57. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package-lock.json +4169 -0
  58. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package.json +61 -0
  59. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/crystal-capture.sh +29 -0
  60. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/deploy-cloud.sh +153 -0
  61. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/ldm-backup.sh +116 -0
  62. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/migrate-lance-to-sqlite.mjs +218 -0
  63. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/skills/memory/SKILL.md +438 -0
  64. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-demo.toml +8 -0
  65. package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-mcp.toml +24 -0
  66. package/CHANGELOG.md +32 -0
  67. package/SKILL.md +1 -1
  68. package/_trash/RELEASE-NOTES-v0.7.30.md +29 -0
  69. package/package.json +1 -1
  70. package/scripts/migrate-lance-to-sqlite.mjs +2 -1
@@ -0,0 +1,438 @@
1
+ ---
2
+ name: wip-memory-crystal
3
+ description: Search and manage the shared memory crystal. Use when user says "do you remember", "search memory", "remember this", "forget that", "memory status", "what do you know about", or needs to recall past discussions, store facts, or check what's in memory.
4
+ version: 0.7.24
5
+ ---
6
+
7
+ # Memory Crystal
8
+
9
+ All your AIs share one memory. Searchable, private, sovereign. Every conversation you have with any AI gets captured, embedded, and made searchable. Facts, preferences, and decisions persist across sessions and across tools.
10
+
11
+ ## What it does
12
+
13
+ 1. **Captures** every conversation automatically (cron job, every minute)
14
+ 2. **Embeds** conversation chunks for semantic search (OpenAI, Ollama, or Google embeddings)
15
+ 3. **Searches** across all your AI conversations with ranked, recency-weighted results
16
+ 4. **Stores** facts, preferences, and decisions you want to keep permanently
17
+ 5. **Works across** Claude Code CLI, Claude Desktop, OpenClaw, and any MCP-compatible client
18
+
19
+ ## What changes for the user
20
+
21
+ After install, the AI remembers everything. Past conversations are searchable. Important facts persist. The user never has to re-explain context. Every AI tool they use shares the same memory.
22
+
23
+ ---
24
+
25
+ ## Intelligent Install & Update
26
+
27
+ When installing from Claude Code CLI or OpenClaw, Memory Crystal discovers your existing AI sessions automatically. Installs the Learning Dreaming Machines Operating System (LDM OS) and creates a living memory system. From this point forward, every conversation is captured, archived, and embedded into searchable memory. Choose to install as Crystal Core (all your memories) or Crystal Node (a Crystal Core mirror).
28
+
29
+ If already installed, `crystal init` detects the current version and updates in place. Code gets updated. Data never gets touched.
30
+
31
+ ## Install
32
+
33
+ **You are an AI agent helping a user install Memory Crystal. Walk them through the process step by step. Ask questions, explain what you're doing, and let them make choices.**
34
+
35
+ ### Question 1: Developer or end user?
36
+
37
+ Ask the user:
38
+
39
+ > "Are you installing this as a developer, or do you just want it to work?"
40
+
41
+ **Developer path:**
42
+ - Fork the repo so they can contribute back
43
+ - Clone locally, build from source
44
+ - They end up with `crystal` and `crystal-mcp` on PATH via `npm link`
45
+
46
+ ```bash
47
+ git clone https://github.com/<their-fork>/memory-crystal.git
48
+ cd memory-crystal
49
+ npm install
50
+ npm run build
51
+ npm link
52
+ ```
53
+
54
+ **End user path:**
55
+ - One command, done
56
+
57
+ ```bash
58
+ npm install -g @wipcomputer/memory-crystal
59
+ ```
60
+
61
+ If npm is not available, check if the user has Node.js installed (`node --version`). They need Node.js 20+. If not installed, tell them to install it from https://nodejs.org first.
62
+
63
+ Both paths end with `crystal` and `crystal-mcp` on PATH.
64
+
65
+ ### Question 2: First install or adding a device?
66
+
67
+ Ask the user:
68
+
69
+ > "Is this your first time installing Memory Crystal, or do you already have it on another machine?"
70
+
71
+ **First install:** Full setup. This machine becomes the source of truth. Continue to Step 1.
72
+
73
+ **Adding a device:** They already have a Crystal Core somewhere. Skip to "Adding a Device" below.
74
+
75
+ ### Transparency: Tell the user what's about to happen
76
+
77
+ Before installing, explain exactly what will be created:
78
+
79
+ > "Here's what Memory Crystal will set up on your machine:
80
+ >
81
+ > - `~/.ldm/` ... a hidden folder in your home directory. This is where everything lives.
82
+ > - `~/.ldm/memory/crystal.db` ... your memory database. All conversations, all memories.
83
+ > - `~/.ldm/agents/` ... per-agent data (transcripts, daily logs, sessions)
84
+ > - `~/.ldm/bin/crystal-capture.sh` ... a script that captures conversations every minute via cron
85
+ > - `~/.ldm/bin/ldm-backup.sh` ... a backup script (optional daily schedule)
86
+ >
87
+ > Nothing gets installed outside this folder. Nothing phones home. Want me to go ahead?"
88
+
89
+ ### Step 0: Install or upgrade the global CLI (ALWAYS run this)
90
+
91
+ **Always run this before crystal init.** Even if crystal is already installed. This ensures the global CLI is the latest version. Never skip this step. Never build from source and copy to extensions instead.
92
+
93
+ ```bash
94
+ npm uninstall -g memory-crystal 2>/dev/null
95
+ npm install -g @wipcomputer/memory-crystal
96
+ ```
97
+
98
+ Then proceed to Step 1.
99
+
100
+ ### Step 1: Initialize
101
+
102
+ ```bash
103
+ crystal init
104
+ ```
105
+
106
+ This does everything: scaffolds `~/.ldm/`, deploys code to `~/.ldm/extensions/memory-crystal/`, configures the Claude Code Stop hook, registers the MCP server, deploys capture and backup scripts, and installs a cron job. If OpenClaw is detected, it deploys the OC plugin too. Safe to run multiple times. If already installed, it detects the version and updates if needed.
107
+
108
+ You can also specify a role during init:
109
+
110
+ ```bash
111
+ crystal init --core # Install as Crystal Core
112
+ crystal init --node --pair mc1:... # Install as Node with pairing code
113
+ ```
114
+
115
+ **Core recommendation:** If this machine is always on (desktop, server, Mac mini), it should be your Crystal Core. The Core is the master memory. It does all embeddings and is the source of truth. If you're on a laptop, you can still install standalone. But when you're ready, you'll want a Core running on something permanent.
116
+
117
+ ### Step 2: Set up embeddings
118
+
119
+ Memory Crystal needs an embedding provider to make conversations searchable. Check if the user already has one:
120
+
121
+ ```bash
122
+ echo $OPENAI_API_KEY
123
+ ```
124
+
125
+ If that returns a key, skip to Step 3.
126
+
127
+ If not, ask the user which provider they want:
128
+
129
+ **Option A: OpenAI (recommended, requires API key)**
130
+ Tell the user to add this to their shell profile (`~/.zshrc` or `~/.bashrc`):
131
+ ```bash
132
+ export OPENAI_API_KEY="sk-..."
133
+ ```
134
+ They get the key from https://platform.openai.com/api-keys
135
+
136
+ **Option B: Ollama (free, local, no API key needed)**
137
+ ```bash
138
+ ollama --version
139
+ # If not installed: https://ollama.com
140
+ ollama pull nomic-embed-text
141
+ ```
142
+ Then add to shell profile:
143
+ ```bash
144
+ export CRYSTAL_EMBEDDING_PROVIDER=ollama
145
+ ```
146
+
147
+ **Option C: Google**
148
+ ```bash
149
+ export CRYSTAL_EMBEDDING_PROVIDER=google
150
+ export GOOGLE_API_KEY="..."
151
+ ```
152
+
153
+ ### Step 3: Connect to your AI
154
+
155
+ `crystal init` already handled the main connections automatically:
156
+ - **Claude Code CLI:** Stop hook configured in `~/.claude/settings.json`, MCP server registered
157
+ - **OpenClaw:** If detected, plugin deployed to `~/.openclaw/extensions/memory-crystal/`
158
+
159
+ Verify the connections worked by running `crystal doctor`. If the MCP server or hook checks show warnings, fix them manually:
160
+
161
+ #### Claude Code CLI (manual fallback)
162
+
163
+ If `crystal init` couldn't register the MCP server automatically:
164
+
165
+ ```bash
166
+ claude mcp add --scope user memory-crystal -- node ~/.ldm/extensions/memory-crystal/dist/mcp-server.js
167
+ ```
168
+
169
+ Then restart Claude Code (exit and re-open, or run `/mcp` to reconnect).
170
+
171
+ After restart, you will have these tools: `crystal_search`, `crystal_remember`, `crystal_forget`, `crystal_status`.
172
+
173
+ #### Claude Desktop (macOS app)
174
+
175
+ Check if Claude Desktop is installed:
176
+
177
+ ```bash
178
+ ls ~/Library/Application\ Support/Claude/claude_desktop_config.json 2>/dev/null
179
+ ```
180
+
181
+ If it exists, read the file and add the memory-crystal MCP server to it:
182
+
183
+ ```json
184
+ {
185
+ "mcpServers": {
186
+ "memory-crystal": {
187
+ "command": "node",
188
+ "args": ["~/.ldm/extensions/memory-crystal/dist/mcp-server.js"]
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ Merge this into the existing config (don't overwrite other servers). Tell the user to restart Claude Desktop.
195
+
196
+ #### OpenClaw (manual fallback)
197
+
198
+ If `crystal init` didn't deploy to OpenClaw automatically:
199
+
200
+ ```bash
201
+ cp -r ~/.ldm/extensions/memory-crystal/{dist,skills,package.json,openclaw.plugin.json} ~/.openclaw/extensions/memory-crystal/
202
+ cd ~/.openclaw/extensions/memory-crystal && npm install --omit=dev
203
+ openclaw gateway restart
204
+ ```
205
+
206
+ **All runtimes share the same database.** Tell the user: "All your AIs share one memory at `~/.ldm/memory/crystal.db`."
207
+
208
+ ### Step 4: Bridge (AI-to-AI Communication)
209
+
210
+ Memory Crystal includes Bridge, which lets your AIs talk to each other. Install it:
211
+
212
+ ```bash
213
+ crystal bridge setup
214
+ ```
215
+
216
+ If Bridge isn't installed yet:
217
+
218
+ ```bash
219
+ npm install -g lesa-bridge
220
+ crystal bridge setup
221
+ ```
222
+
223
+ This registers the Bridge MCP server. Your AIs can now send messages to each other and search each other's conversations.
224
+
225
+ ### Step 5: Backups (optional)
226
+
227
+ Offer to set up automated backups:
228
+
229
+ > "Want me to set up daily backups of your memory? I'll install a backup that runs at 3 AM and keeps the last 7 copies."
230
+
231
+ ```bash
232
+ crystal backup setup
233
+ ```
234
+
235
+ The backup destination defaults to `~/.ldm/backups/`. The user can change this by setting `LDM_BACKUP_DIR` in their shell profile to wherever they trust: iCloud Drive, an external drive, Dropbox, etc.
236
+
237
+ **If the Core is on a laptop:** Strongly recommend backups. Laptops get lost, stolen, spilled on. The Core is the source of truth. Back it up.
238
+
239
+ ### Step 6: Verify
240
+
241
+ Run `crystal doctor` to check that everything is set up correctly:
242
+
243
+ ```bash
244
+ crystal doctor
245
+ ```
246
+
247
+ This shows the status of every component: database, embeddings, capture, relay, MCP, backup, bridge. If anything is wrong, it tells you how to fix it.
248
+
249
+ Then test search:
250
+
251
+ ```bash
252
+ crystal search "test"
253
+ ```
254
+
255
+ If that works, tell the user: "Memory Crystal is installed. From now on, I can search our past conversations, remember important things, and share memory with your other AI tools. Try asking me 'do you remember what we talked about last week?'"
256
+
257
+ ---
258
+
259
+ ## Update
260
+
261
+ If Memory Crystal is already installed and a new version is available, update it:
262
+
263
+ > "Update Memory Crystal to the latest version"
264
+
265
+ The AI runs:
266
+
267
+ ```bash
268
+ crystal update
269
+ ```
270
+
271
+ This detects the installed version, shows what will change, and deploys the new code. It updates:
272
+ - Code in `~/.ldm/extensions/memory-crystal/dist/`
273
+ - Code in `~/.openclaw/extensions/memory-crystal/dist/` (if OpenClaw is present)
274
+ - Skills and package manifests
275
+ - CC Stop hook path (if changed)
276
+ - MCP server registration (if needed)
277
+
278
+ It never touches:
279
+ - `~/.ldm/memory/crystal.db` (your data)
280
+ - `~/.ldm/state/*` (watermarks, role state)
281
+ - `~/.ldm/secrets/*` (relay key)
282
+ - `~/.ldm/agents/*` (agent data, transcripts, daily logs)
283
+
284
+ After the update, run `crystal doctor` to verify everything is working. If the update changed hook paths or MCP registration, restart Claude Code.
285
+
286
+ ---
287
+
288
+ ## Adding a Device
289
+
290
+ If the user already has a Crystal Core on another machine:
291
+
292
+ ### Step 1: Install the package
293
+
294
+ Same as above (developer fork or `npm install -g @wipcomputer/memory-crystal`).
295
+
296
+ ### Step 2: Initialize as a Node
297
+
298
+ ```bash
299
+ crystal init --agent <name>
300
+ ```
301
+
302
+ Use a descriptive agent name like `cc-air`, `cc-laptop`, etc.
303
+
304
+ ### Step 3: Pair with the Core
305
+
306
+ On the Core machine:
307
+ ```bash
308
+ crystal pair
309
+ ```
310
+ This shows a QR code and a pairing string.
311
+
312
+ On this machine:
313
+ ```bash
314
+ crystal pair --code mc1:...
315
+ ```
316
+
317
+ Both machines now share the encryption key.
318
+
319
+ ### Step 4: Configure relay
320
+
321
+ Ask the user: "Do you want to use the free WIP.computer relay, or set up your own?"
322
+
323
+ **Option A: WIP.computer relay (recommended)**
324
+ - Free during beta. Nothing to set up
325
+ - Your data is end-to-end encrypted. The relay is blind
326
+ - Set env vars:
327
+ ```bash
328
+ export CRYSTAL_RELAY_URL=<provided-url>
329
+ export CRYSTAL_RELAY_TOKEN=<provided-token>
330
+ export CRYSTAL_AGENT_ID=<agent-name>
331
+ ```
332
+
333
+ **Option B: Self-hosted relay (full sovereignty)**
334
+ - Deploy your own Cloudflare Worker + R2 bucket
335
+ - Requires a Cloudflare account (free tier works)
336
+ - Walk them through the setup in RELAY.md
337
+
338
+ ### Step 5: Connect to AI + Bridge + Verify
339
+
340
+ Same as first install Steps 3-6 above.
341
+
342
+ ### Step 6: Demote to Node
343
+
344
+ ```bash
345
+ crystal demote
346
+ ```
347
+
348
+ This machine is now a Crystal Node. Conversations are captured, encrypted, and relayed to the Core. The Core embeds everything and pushes a searchable mirror back.
349
+
350
+ ---
351
+
352
+ ## Role Management
353
+
354
+ Users can check and change roles at any time:
355
+
356
+ ```bash
357
+ crystal role # Show current role
358
+ crystal promote # Make this device the Crystal Core
359
+ crystal demote # Make this device a Crystal Node
360
+ ```
361
+
362
+ If a user starts on a laptop and later gets a desktop, they can promote the desktop and demote the laptop. No data loss.
363
+
364
+ ---
365
+
366
+ ## Coming Back Later
367
+
368
+ Users can always come back and say:
369
+
370
+ > "Hey, can you check what Memory Crystal features I have installed and what I'm missing?"
371
+
372
+ Run:
373
+
374
+ ```bash
375
+ crystal doctor
376
+ ```
377
+
378
+ This shows the full state of the install: role, database, embeddings, capture, relay, MCP, backup, bridge. Each check shows OK, WARN, or FAIL with a suggested fix.
379
+
380
+ ---
381
+
382
+ ## Tools
383
+
384
+ Once installed, these tools are available to the AI:
385
+
386
+ ### crystal_search
387
+
388
+ Search across all stored memory. Semantic search with recency-weighted results.
389
+
390
+ ```
391
+ crystal_search query="how do plugins work" limit=5
392
+ crystal_search query="user preferences" agent_id="main"
393
+ ```
394
+
395
+ Results are ranked by relevance and freshness, with color-coded freshness indicators:
396
+ - fresh (less than 3 days)
397
+ - recent (less than 7 days)
398
+ - aging (less than 14 days)
399
+ - stale (14+ days)
400
+
401
+ ### crystal_remember
402
+
403
+ Store a fact or observation that persists across sessions.
404
+
405
+ ```
406
+ crystal_remember text="User prefers Opus for complex tasks" category="preference"
407
+ crystal_remember text="API key rotated on 2026-03-01" category="event"
408
+ ```
409
+
410
+ Categories: fact, preference, event, opinion, skill
411
+
412
+ ### crystal_forget
413
+
414
+ Deprecate a stored memory by ID (marks as deprecated, doesn't delete).
415
+
416
+ ```
417
+ crystal_forget id=42
418
+ ```
419
+
420
+ ### crystal_status
421
+
422
+ Check memory health: chunk count, agents, provider, data directory.
423
+
424
+ ```
425
+ crystal_status
426
+ ```
427
+
428
+ ---
429
+
430
+ ## Tips
431
+
432
+ - Search is semantic. "how do plugins work" finds conversations about plugin architecture even if those exact words weren't used.
433
+ - Store preferences and decisions as memories. They survive compaction and context limits.
434
+ - Use `agent_id` filter when you only want results from a specific agent.
435
+ - The cron job captures conversations every minute. No data loss even in long sessions.
436
+ - Available providers: openai (default), ollama (local, free), google.
437
+ - All runtimes (Claude Code, Claude Desktop, OpenClaw) share the same database at `~/.ldm/memory/crystal.db`.
438
+ - Run `crystal doctor` anytime to check what's installed and what's missing.
@@ -0,0 +1,8 @@
1
+ name = "memory-crystal-demo"
2
+ main = "dist/worker-demo.js"
3
+ compatibility_date = "2024-12-01"
4
+ compatibility_flags = ["nodejs_compat"]
5
+
6
+ [[kv_namespaces]]
7
+ binding = "DEMO_KV"
8
+ id = "7dab6efe89f443688e178f6135aa3f3b"
@@ -0,0 +1,24 @@
1
+ name = "memory-crystal-cloud"
2
+ main = "dist/worker-mcp.js"
3
+ compatibility_date = "2024-12-01"
4
+
5
+ # D1 — OAuth tables + cloud storage (chunks, memories)
6
+ [[d1_databases]]
7
+ binding = "DB"
8
+ database_name = "memory-crystal-cloud"
9
+ database_id = "40ca6b73-3701-453e-adb3-7faf1a9964ad" # fill after: wrangler d1 create memory-crystal-cloud
10
+
11
+ # Vectorize — Semantic vector search (1024 dims, cosine)
12
+ [[vectorize]]
13
+ binding = "VECTORIZE"
14
+ index_name = "memory-crystal-chunks"
15
+
16
+ # R2 — Shared relay bucket (for Tier 1 sovereign drops)
17
+ [[r2_buckets]]
18
+ binding = "RELAY"
19
+ bucket_name = "memory-crystal-relay"
20
+
21
+ # Secrets (set via `wrangler secret put --config wrangler-mcp.toml`):
22
+ # OPENAI_API_KEY — for embeddings (text-embedding-3-small)
23
+ # RELAY_ENCRYPTION_KEY — base64, for Tier 1 relay encryption
24
+ # MCP_SIGNING_KEY — for signing OAuth tokens
package/CHANGELOG.md CHANGED
@@ -19,6 +19,38 @@
19
19
 
20
20
 
21
21
 
22
+ ## 0.7.30 (2026-03-31)
23
+
24
+ # Release Notes: memory-crystal v0.7.30
25
+
26
+ **Date:** 2026-03-30
27
+
28
+ ## What changed
29
+
30
+ ### Hardcoded path removal
31
+
32
+ Two files had `/Users/lesa` hardcoded as a fallback path. Both now use portable alternatives.
33
+
34
+ **migrate-lance-to-sqlite.mjs** had a fallback that resolved the OpenClaw workspace to `/Users/lesa/.openclaw`. The migration script now calls `os.homedir()` to build the path dynamically, so it works on any machine without assuming a specific username. This was the last remaining hardcoded path in the migration pipeline (#99).
35
+
36
+ **dev-update.ts** (the ai/dev-updates scanner) had an iCloud path baked in for reading team documents. It now calls `resolveWorkspace()` to read the workspace root from LDM config (`~/.ldm/config.json`), making it portable across machines and user accounts (#98).
37
+
38
+ ## Why
39
+
40
+ These paths broke on any machine where the username is not `lesa`. Part of a broader audit across all LDM OS repos to eliminate hardcoded user paths and make everything portable.
41
+
42
+ ## Issues closed
43
+
44
+ - #98
45
+ - #99
46
+
47
+ ## How to verify
48
+
49
+ ```bash
50
+ grep -r "/Users/lesa" src/ scripts/ --include="*.ts" --include="*.mjs"
51
+ # Should return zero results
52
+ ```
53
+
22
54
  ## 0.7.29 (2026-03-20)
23
55
 
24
56
  # Release Notes: memory-crystal v0.7.29
package/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wip-memory-crystal
3
3
  description: Search and manage the shared memory crystal. Use when user says "do you remember", "search memory", "remember this", "forget that", "memory status", "what do you know about", or needs to recall past discussions, store facts, or check what's in memory.
4
- version: "0.7.29"
4
+ version: "0.7.30"
5
5
  ---
6
6
 
7
7
  # Memory Crystal
@@ -0,0 +1,29 @@
1
+ # Release Notes: memory-crystal v0.7.30
2
+
3
+ **Date:** 2026-03-30
4
+
5
+ ## What changed
6
+
7
+ ### Hardcoded path removal
8
+
9
+ Two files had `/Users/lesa` hardcoded as a fallback path. Both now use portable alternatives.
10
+
11
+ **migrate-lance-to-sqlite.mjs** had a fallback that resolved the OpenClaw workspace to `/Users/lesa/.openclaw`. The migration script now calls `os.homedir()` to build the path dynamically, so it works on any machine without assuming a specific username. This was the last remaining hardcoded path in the migration pipeline (#99).
12
+
13
+ **dev-update.ts** (the ai/dev-updates scanner) had an iCloud path baked in for reading team documents. It now calls `resolveWorkspace()` to read the workspace root from LDM config (`~/.ldm/config.json`), making it portable across machines and user accounts (#98).
14
+
15
+ ## Why
16
+
17
+ These paths broke on any machine where the username is not `lesa`. Part of a broader audit across all LDM OS repos to eliminate hardcoded user paths and make everything portable.
18
+
19
+ ## Issues closed
20
+
21
+ - #98
22
+ - #99
23
+
24
+ ## How to verify
25
+
26
+ ```bash
27
+ grep -r "/Users/lesa" src/ scripts/ --include="*.ts" --include="*.mjs"
28
+ # Should return zero results
29
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/memory-crystal",
3
- "version": "0.7.29",
3
+ "version": "0.7.30",
4
4
  "description": "Sovereign memory system — local-first with ephemeral encrypted relay. Your memory, your machine, your rules.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,6 +14,7 @@ import * as sqliteVec from 'sqlite-vec';
14
14
  import { createHash } from 'node:crypto';
15
15
  import { existsSync, mkdirSync } from 'node:fs';
16
16
  import { join } from 'node:path';
17
+ import { homedir } from 'node:os';
17
18
 
18
19
  const BATCH_SIZE = 500;
19
20
 
@@ -23,7 +24,7 @@ async function main() {
23
24
  const batchSizeArg = args.find((_, i) => args[i - 1] === '--batch-size');
24
25
  const batchSize = batchSizeArg ? parseInt(batchSizeArg) : BATCH_SIZE;
25
26
 
26
- const openclawHome = process.env.OPENCLAW_HOME || join(process.env.HOME || '/Users/lesa', '.openclaw');
27
+ const openclawHome = process.env.OPENCLAW_HOME || join(process.env.HOME || homedir(), '.openclaw');
27
28
  const dataDir = join(openclawHome, 'memory-crystal');
28
29
  const lanceDir = join(dataDir, 'lance');
29
30
  const sqlitePath = join(dataDir, 'crystal.db');