@wipcomputer/memory-crystal 0.7.26 → 0.7.27

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.
@@ -0,0 +1 @@
1
+ { "name": "wip-memory-crystal" }
package/CHANGELOG.md CHANGED
@@ -19,6 +19,16 @@
19
19
 
20
20
 
21
21
 
22
+ ## 0.7.27 (2026-03-17)
23
+
24
+ # Add root SKILL.md + ldm install as primary path
25
+
26
+ Added SKILL.md to repo root (source of truth for wip-release website publishing). `ldm install wipcomputer/memory-crystal` is now the recommended install path. `crystal init` stays for MC-specific setup (database, cron, role, pairing).
27
+
28
+ Also added `.publish-skill.json` so wip-release publishes SKILL.md to wip.computer/install/.
29
+
30
+ Closes wipcomputer/wip-ldm-os#97. Convergence tracked in wipcomputer/wip-ldm-os#99.
31
+
22
32
  ## 0.7.26 (2026-03-16)
23
33
 
24
34
  # Memory Crystal v0.7.26
package/SKILL.md ADDED
@@ -0,0 +1,452 @@
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.27"
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
+ ### Recommended: LDM OS path
36
+
37
+ Check if LDM OS is installed: `which ldm && ldm --version`
38
+
39
+ If yes, one command installs everything:
40
+
41
+ ```bash
42
+ ldm install wipcomputer/memory-crystal
43
+ ```
44
+
45
+ Then run `crystal init` for MC-specific setup (database, cron, role, pairing). Skip to Step 1 below.
46
+
47
+ If LDM OS is not installed, continue with Question 1.
48
+
49
+ ### Question 1: Developer or end user?
50
+
51
+ Ask the user:
52
+
53
+ > "Are you installing this as a developer, or do you just want it to work?"
54
+
55
+ **Developer path:**
56
+ - Fork the repo so they can contribute back
57
+ - Clone locally, build from source
58
+ - They end up with `crystal` and `crystal-mcp` on PATH via `npm link`
59
+
60
+ ```bash
61
+ git clone https://github.com/<their-fork>/memory-crystal.git
62
+ cd memory-crystal
63
+ npm install
64
+ npm run build
65
+ npm link
66
+ ```
67
+
68
+ **End user path:**
69
+ - One command, done
70
+
71
+ ```bash
72
+ npm install -g @wipcomputer/memory-crystal
73
+ ```
74
+
75
+ 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.
76
+
77
+ Both paths end with `crystal` and `crystal-mcp` on PATH.
78
+
79
+ ### Question 2: First install or adding a device?
80
+
81
+ Ask the user:
82
+
83
+ > "Is this your first time installing Memory Crystal, or do you already have it on another machine?"
84
+
85
+ **First install:** Full setup. This machine becomes the source of truth. Continue to Step 1.
86
+
87
+ **Adding a device:** They already have a Crystal Core somewhere. Skip to "Adding a Device" below.
88
+
89
+ ### Transparency: Tell the user what's about to happen
90
+
91
+ Before installing, explain exactly what will be created:
92
+
93
+ > "Here's what Memory Crystal will set up on your machine:
94
+ >
95
+ > - `~/.ldm/` ... a hidden folder in your home directory. This is where everything lives.
96
+ > - `~/.ldm/memory/crystal.db` ... your memory database. All conversations, all memories.
97
+ > - `~/.ldm/agents/` ... per-agent data (transcripts, daily logs, sessions)
98
+ > - `~/.ldm/bin/crystal-capture.sh` ... a script that captures conversations every minute via cron
99
+ > - `~/.ldm/bin/ldm-backup.sh` ... a backup script (optional daily schedule)
100
+ >
101
+ > Nothing gets installed outside this folder. Nothing phones home. Want me to go ahead?"
102
+
103
+ ### Step 0: Install or upgrade the global CLI (ALWAYS run this)
104
+
105
+ **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.
106
+
107
+ ```bash
108
+ npm uninstall -g memory-crystal 2>/dev/null
109
+ npm install -g @wipcomputer/memory-crystal
110
+ ```
111
+
112
+ Then proceed to Step 1.
113
+
114
+ ### Step 1: Initialize
115
+
116
+ ```bash
117
+ crystal init
118
+ ```
119
+
120
+ 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.
121
+
122
+ You can also specify a role during init:
123
+
124
+ ```bash
125
+ crystal init --core # Install as Crystal Core
126
+ crystal init --node --pair mc1:... # Install as Node with pairing code
127
+ ```
128
+
129
+ **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.
130
+
131
+ ### Step 2: Set up embeddings
132
+
133
+ Memory Crystal needs an embedding provider to make conversations searchable. Check if the user already has one:
134
+
135
+ ```bash
136
+ echo $OPENAI_API_KEY
137
+ ```
138
+
139
+ If that returns a key, skip to Step 3.
140
+
141
+ If not, ask the user which provider they want:
142
+
143
+ **Option A: OpenAI (recommended, requires API key)**
144
+ Tell the user to add this to their shell profile (`~/.zshrc` or `~/.bashrc`):
145
+ ```bash
146
+ export OPENAI_API_KEY="sk-..."
147
+ ```
148
+ They get the key from https://platform.openai.com/api-keys
149
+
150
+ **Option B: Ollama (free, local, no API key needed)**
151
+ ```bash
152
+ ollama --version
153
+ # If not installed: https://ollama.com
154
+ ollama pull nomic-embed-text
155
+ ```
156
+ Then add to shell profile:
157
+ ```bash
158
+ export CRYSTAL_EMBEDDING_PROVIDER=ollama
159
+ ```
160
+
161
+ **Option C: Google**
162
+ ```bash
163
+ export CRYSTAL_EMBEDDING_PROVIDER=google
164
+ export GOOGLE_API_KEY="..."
165
+ ```
166
+
167
+ ### Step 3: Connect to your AI
168
+
169
+ `crystal init` already handled the main connections automatically:
170
+ - **Claude Code CLI:** Stop hook configured in `~/.claude/settings.json`, MCP server registered
171
+ - **OpenClaw:** If detected, plugin deployed to `~/.openclaw/extensions/memory-crystal/`
172
+
173
+ Verify the connections worked by running `crystal doctor`. If the MCP server or hook checks show warnings, fix them manually:
174
+
175
+ #### Claude Code CLI (manual fallback)
176
+
177
+ If `crystal init` couldn't register the MCP server automatically:
178
+
179
+ ```bash
180
+ claude mcp add --scope user memory-crystal -- node ~/.ldm/extensions/memory-crystal/dist/mcp-server.js
181
+ ```
182
+
183
+ Then restart Claude Code (exit and re-open, or run `/mcp` to reconnect).
184
+
185
+ After restart, you will have these tools: `crystal_search`, `crystal_remember`, `crystal_forget`, `crystal_status`.
186
+
187
+ #### Claude Desktop (macOS app)
188
+
189
+ Check if Claude Desktop is installed:
190
+
191
+ ```bash
192
+ ls ~/Library/Application\ Support/Claude/claude_desktop_config.json 2>/dev/null
193
+ ```
194
+
195
+ If it exists, read the file and add the memory-crystal MCP server to it:
196
+
197
+ ```json
198
+ {
199
+ "mcpServers": {
200
+ "memory-crystal": {
201
+ "command": "node",
202
+ "args": ["~/.ldm/extensions/memory-crystal/dist/mcp-server.js"]
203
+ }
204
+ }
205
+ }
206
+ ```
207
+
208
+ Merge this into the existing config (don't overwrite other servers). Tell the user to restart Claude Desktop.
209
+
210
+ #### OpenClaw (manual fallback)
211
+
212
+ If `crystal init` didn't deploy to OpenClaw automatically:
213
+
214
+ ```bash
215
+ cp -r ~/.ldm/extensions/memory-crystal/{dist,skills,package.json,openclaw.plugin.json} ~/.openclaw/extensions/memory-crystal/
216
+ cd ~/.openclaw/extensions/memory-crystal && npm install --omit=dev
217
+ openclaw gateway restart
218
+ ```
219
+
220
+ **All runtimes share the same database.** Tell the user: "All your AIs share one memory at `~/.ldm/memory/crystal.db`."
221
+
222
+ ### Step 4: Bridge (AI-to-AI Communication)
223
+
224
+ Memory Crystal includes Bridge, which lets your AIs talk to each other. Install it:
225
+
226
+ ```bash
227
+ crystal bridge setup
228
+ ```
229
+
230
+ If Bridge isn't installed yet:
231
+
232
+ ```bash
233
+ npm install -g lesa-bridge
234
+ crystal bridge setup
235
+ ```
236
+
237
+ This registers the Bridge MCP server. Your AIs can now send messages to each other and search each other's conversations.
238
+
239
+ ### Step 5: Backups (optional)
240
+
241
+ Offer to set up automated backups:
242
+
243
+ > "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."
244
+
245
+ ```bash
246
+ crystal backup setup
247
+ ```
248
+
249
+ 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.
250
+
251
+ **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.
252
+
253
+ ### Step 6: Verify
254
+
255
+ Run `crystal doctor` to check that everything is set up correctly:
256
+
257
+ ```bash
258
+ crystal doctor
259
+ ```
260
+
261
+ 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.
262
+
263
+ Then test search:
264
+
265
+ ```bash
266
+ crystal search "test"
267
+ ```
268
+
269
+ 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?'"
270
+
271
+ ---
272
+
273
+ ## Update
274
+
275
+ If Memory Crystal is already installed and a new version is available, update it:
276
+
277
+ > "Update Memory Crystal to the latest version"
278
+
279
+ The AI runs:
280
+
281
+ ```bash
282
+ crystal update
283
+ ```
284
+
285
+ This detects the installed version, shows what will change, and deploys the new code. It updates:
286
+ - Code in `~/.ldm/extensions/memory-crystal/dist/`
287
+ - Code in `~/.openclaw/extensions/memory-crystal/dist/` (if OpenClaw is present)
288
+ - Skills and package manifests
289
+ - CC Stop hook path (if changed)
290
+ - MCP server registration (if needed)
291
+
292
+ It never touches:
293
+ - `~/.ldm/memory/crystal.db` (your data)
294
+ - `~/.ldm/state/*` (watermarks, role state)
295
+ - `~/.ldm/secrets/*` (relay key)
296
+ - `~/.ldm/agents/*` (agent data, transcripts, daily logs)
297
+
298
+ After the update, run `crystal doctor` to verify everything is working. If the update changed hook paths or MCP registration, restart Claude Code.
299
+
300
+ ---
301
+
302
+ ## Adding a Device
303
+
304
+ If the user already has a Crystal Core on another machine:
305
+
306
+ ### Step 1: Install the package
307
+
308
+ Same as above (developer fork or `npm install -g @wipcomputer/memory-crystal`).
309
+
310
+ ### Step 2: Initialize as a Node
311
+
312
+ ```bash
313
+ crystal init --agent <name>
314
+ ```
315
+
316
+ Use a descriptive agent name like `cc-air`, `cc-laptop`, etc.
317
+
318
+ ### Step 3: Pair with the Core
319
+
320
+ On the Core machine:
321
+ ```bash
322
+ crystal pair
323
+ ```
324
+ This shows a QR code and a pairing string.
325
+
326
+ On this machine:
327
+ ```bash
328
+ crystal pair --code mc1:...
329
+ ```
330
+
331
+ Both machines now share the encryption key.
332
+
333
+ ### Step 4: Configure relay
334
+
335
+ Ask the user: "Do you want to use the free WIP.computer relay, or set up your own?"
336
+
337
+ **Option A: WIP.computer relay (recommended)**
338
+ - Free during beta. Nothing to set up
339
+ - Your data is end-to-end encrypted. The relay is blind
340
+ - Set env vars:
341
+ ```bash
342
+ export CRYSTAL_RELAY_URL=<provided-url>
343
+ export CRYSTAL_RELAY_TOKEN=<provided-token>
344
+ export CRYSTAL_AGENT_ID=<agent-name>
345
+ ```
346
+
347
+ **Option B: Self-hosted relay (full sovereignty)**
348
+ - Deploy your own Cloudflare Worker + R2 bucket
349
+ - Requires a Cloudflare account (free tier works)
350
+ - Walk them through the setup in RELAY.md
351
+
352
+ ### Step 5: Connect to AI + Bridge + Verify
353
+
354
+ Same as first install Steps 3-6 above.
355
+
356
+ ### Step 6: Demote to Node
357
+
358
+ ```bash
359
+ crystal demote
360
+ ```
361
+
362
+ 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.
363
+
364
+ ---
365
+
366
+ ## Role Management
367
+
368
+ Users can check and change roles at any time:
369
+
370
+ ```bash
371
+ crystal role # Show current role
372
+ crystal promote # Make this device the Crystal Core
373
+ crystal demote # Make this device a Crystal Node
374
+ ```
375
+
376
+ If a user starts on a laptop and later gets a desktop, they can promote the desktop and demote the laptop. No data loss.
377
+
378
+ ---
379
+
380
+ ## Coming Back Later
381
+
382
+ Users can always come back and say:
383
+
384
+ > "Hey, can you check what Memory Crystal features I have installed and what I'm missing?"
385
+
386
+ Run:
387
+
388
+ ```bash
389
+ crystal doctor
390
+ ```
391
+
392
+ 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.
393
+
394
+ ---
395
+
396
+ ## Tools
397
+
398
+ Once installed, these tools are available to the AI:
399
+
400
+ ### crystal_search
401
+
402
+ Search across all stored memory. Semantic search with recency-weighted results.
403
+
404
+ ```
405
+ crystal_search query="how do plugins work" limit=5
406
+ crystal_search query="user preferences" agent_id="main"
407
+ ```
408
+
409
+ Results are ranked by relevance and freshness, with color-coded freshness indicators:
410
+ - fresh (less than 3 days)
411
+ - recent (less than 7 days)
412
+ - aging (less than 14 days)
413
+ - stale (14+ days)
414
+
415
+ ### crystal_remember
416
+
417
+ Store a fact or observation that persists across sessions.
418
+
419
+ ```
420
+ crystal_remember text="User prefers Opus for complex tasks" category="preference"
421
+ crystal_remember text="API key rotated on 2026-03-01" category="event"
422
+ ```
423
+
424
+ Categories: fact, preference, event, opinion, skill
425
+
426
+ ### crystal_forget
427
+
428
+ Deprecate a stored memory by ID (marks as deprecated, doesn't delete).
429
+
430
+ ```
431
+ crystal_forget id=42
432
+ ```
433
+
434
+ ### crystal_status
435
+
436
+ Check memory health: chunk count, agents, provider, data directory.
437
+
438
+ ```
439
+ crystal_status
440
+ ```
441
+
442
+ ---
443
+
444
+ ## Tips
445
+
446
+ - Search is semantic. "how do plugins work" finds conversations about plugin architecture even if those exact words weren't used.
447
+ - Store preferences and decisions as memories. They survive compaction and context limits.
448
+ - Use `agent_id` filter when you only want results from a specific agent.
449
+ - The cron job captures conversations every minute. No data loss even in long sessions.
450
+ - Available providers: openai (default), ollama (local, free), google.
451
+ - All runtimes (Claude Code, Claude Desktop, OpenClaw) share the same database at `~/.ldm/memory/crystal.db`.
452
+ - Run `crystal doctor` anytime to check what's installed and what's missing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/memory-crystal",
3
- "version": "0.7.26",
3
+ "version": "0.7.27",
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",