@wipcomputer/memory-crystal 0.7.28 → 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.
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.env.example +20 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.publish-skill.json +1 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CHANGELOG.md +1297 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CLA.md +19 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/LICENSE +52 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README-ENTERPRISE.md +226 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README.md +151 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/RELAY.md +199 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/SKILL.md +462 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/TECHNICAL.md +656 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-23.md +48 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-25.md +24 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-26.md +7 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-28.md +31 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-29.md +28 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-4.md +64 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-5.md +19 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/README.md +116 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/docs/gpt-system-instructions.md +69 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/migrations/0001_init.sql +52 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0001_init.sql +51 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0002_cloud_storage.sql +49 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/openclaw.plugin.json +11 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package-lock.json +4169 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package.json +61 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/crystal-capture.sh +29 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/deploy-cloud.sh +153 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/ldm-backup.sh +116 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/migrate-lance-to-sqlite.mjs +218 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/skills/memory/SKILL.md +438 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-demo.toml +8 -0
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-mcp.toml +24 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.env.example +20 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.publish-skill.json +1 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CHANGELOG.md +1297 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CLA.md +19 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/LICENSE +52 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README-ENTERPRISE.md +226 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README.md +151 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELAY.md +199 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELEASE-NOTES-v0.7.30.md +29 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/SKILL.md +462 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/TECHNICAL.md +656 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-23.md +48 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-25.md +24 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-26.md +7 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-28.md +31 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-29.md +28 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-4.md +64 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-5.md +19 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/README.md +116 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/docs/gpt-system-instructions.md +69 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/migrations/0001_init.sql +52 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0001_init.sql +51 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0002_cloud_storage.sql +49 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/openclaw.plugin.json +11 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package-lock.json +4169 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package.json +61 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/crystal-capture.sh +29 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/deploy-cloud.sh +153 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/ldm-backup.sh +116 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/migrate-lance-to-sqlite.mjs +218 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/skills/memory/SKILL.md +438 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-demo.toml +8 -0
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-mcp.toml +24 -0
- package/CHANGELOG.md +63 -0
- package/SKILL.md +13 -3
- package/TECHNICAL.md +30 -2
- package/_trash/RELEASE-NOTES-v0-7-28.md +15 -8
- package/_trash/RELEASE-NOTES-v0-7-29.md +28 -0
- package/_trash/RELEASE-NOTES-v0.7.30.md +29 -0
- package/package.json +1 -1
- package/scripts/migrate-lance-to-sqlite.mjs +2 -1
package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/skills/memory/SKILL.md
ADDED
|
@@ -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,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,69 @@
|
|
|
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
|
+
|
|
54
|
+
## 0.7.29 (2026-03-20)
|
|
55
|
+
|
|
56
|
+
# Release Notes: memory-crystal v0.7.29
|
|
57
|
+
|
|
58
|
+
**Doc audit: MLX setup, deep search params, log paths, role clarification.**
|
|
59
|
+
|
|
60
|
+
## What changed
|
|
61
|
+
|
|
62
|
+
SKILL.md and TECHNICAL.md updated for 2 weeks of undocumented features:
|
|
63
|
+
|
|
64
|
+
- **MLX local LLM:** Added as Option A in SKILL.md Step 2. CLI commands (setup, status, stop) added to TECHNICAL.md.
|
|
65
|
+
- **Deep search parameters:** `--intent`, `--explain`, `--candidates` documented in both SKILL.md (crystal_search tool) and TECHNICAL.md (CLI reference + new sections for intent, explain, candidate limit, LLM cache).
|
|
66
|
+
- **Log paths:** Fixed obsolete `/tmp/ldm-dev-tools/` reference to `~/.ldm/logs/`. Added logs/ to directory structure.
|
|
67
|
+
- **Role clarification:** Two-role architecture (Core and Node) explicitly stated. Standalone role was removed in v0.7.22.
|
|
68
|
+
|
|
69
|
+
## Why
|
|
70
|
+
|
|
71
|
+
29 releases in 13 days. Docs didn't keep pace. Agents using crystal_search didn't know about --intent (query disambiguation) or --explain (scoring transparency).
|
|
72
|
+
|
|
73
|
+
## Issues closed
|
|
74
|
+
|
|
75
|
+
- #57
|
|
76
|
+
|
|
77
|
+
## How to verify
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
grep "intent" SKILL.md TECHNICAL.md
|
|
81
|
+
grep "mlx" SKILL.md TECHNICAL.md
|
|
82
|
+
grep "ldm/logs" TECHNICAL.md
|
|
83
|
+
```
|
|
84
|
+
|
|
22
85
|
## 0.7.28 (2026-03-18)
|
|
23
86
|
|
|
24
87
|
# Release Notes: memory-crystal v0.7.28
|
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.
|
|
4
|
+
version: "0.7.30"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Memory Crystal
|
|
@@ -140,7 +140,13 @@ If that returns a key, skip to Step 3.
|
|
|
140
140
|
|
|
141
141
|
If not, ask the user which provider they want:
|
|
142
142
|
|
|
143
|
-
**Option A:
|
|
143
|
+
**Option A: MLX (free, local, Apple Silicon only)**
|
|
144
|
+
```bash
|
|
145
|
+
crystal mlx setup
|
|
146
|
+
```
|
|
147
|
+
Auto-installs Qwen2.5-3B on M-series Macs. Creates a LaunchAgent on port 18791. `crystal init` detects MLX automatically.
|
|
148
|
+
|
|
149
|
+
**Option B: OpenAI (recommended for non-Apple Silicon, requires API key)**
|
|
144
150
|
Tell the user to add this to their shell profile (`~/.zshrc` or `~/.bashrc`):
|
|
145
151
|
```bash
|
|
146
152
|
export OPENAI_API_KEY="sk-..."
|
|
@@ -365,7 +371,7 @@ This machine is now a Crystal Node. Conversations are captured, encrypted, and r
|
|
|
365
371
|
|
|
366
372
|
## Role Management
|
|
367
373
|
|
|
368
|
-
Users can check and change roles at any time:
|
|
374
|
+
Two-role architecture: **Core** (master database, embedding server, relay sync) and **Node** (mirrors Core, syncs via relay, local search). Users can check and change roles at any time:
|
|
369
375
|
|
|
370
376
|
```bash
|
|
371
377
|
crystal role # Show current role
|
|
@@ -404,8 +410,12 @@ Search across all stored memory. Semantic search with recency-weighted results.
|
|
|
404
410
|
```
|
|
405
411
|
crystal_search query="how do plugins work" limit=5
|
|
406
412
|
crystal_search query="user preferences" agent_id="main"
|
|
413
|
+
crystal_search query="security" intent="1Password"
|
|
414
|
+
crystal_search query="deployment" time_filter="7d" explain=true
|
|
407
415
|
```
|
|
408
416
|
|
|
417
|
+
Parameters: `query` (required), `limit`, `agent_id`, `time_filter` (24h/7d/30d), `intent` (disambiguate without adding search terms), `candidates` (rerank pool size), `explain` (show scoring breakdown).
|
|
418
|
+
|
|
409
419
|
Results are ranked by relevance and freshness, with color-coded freshness indicators:
|
|
410
420
|
- fresh (less than 3 days)
|
|
411
421
|
- recent (less than 7 days)
|
package/TECHNICAL.md
CHANGED
|
@@ -44,7 +44,7 @@ crystal init # Scaffolds ~/.ldm/, deploys capture script, ins
|
|
|
44
44
|
|
|
45
45
|
This copies `crystal-capture.sh` to `~/.ldm/bin/` and installs a cron entry:
|
|
46
46
|
```
|
|
47
|
-
* * * * * ~/.ldm/bin/crystal-capture.sh >> /
|
|
47
|
+
* * * * * ~/.ldm/bin/crystal-capture.sh >> ~/.ldm/logs/crystal-capture.log 2>&1
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
The script calls `node ~/.ldm/extensions/memory-crystal/dist/cc-poller.js`. The poller fetches the OpenAI API key internally via `opRead()` (1Password SA token). No secrets in the shell script.
|
|
@@ -215,6 +215,24 @@ Provider detection in `llm.ts`:
|
|
|
215
215
|
|
|
216
216
|
Search can be filtered by time: `--since 24h`, `--since 7d`, `--since 30d`, or an ISO date. Applied as a SQL WHERE clause before search. Available on CLI and MCP (`time_filter` parameter).
|
|
217
217
|
|
|
218
|
+
### Intent Parameter
|
|
219
|
+
|
|
220
|
+
`--intent <description>` disambiguates queries without adding search terms. Example: `crystal search "security" --intent "1Password"` steers toward 1Password-specific context, not repo permissions or agent secrets.
|
|
221
|
+
|
|
222
|
+
Intent flows through: expansion prompt (guides LLM variations), disables strong-signal bypass, prepended to rerank query for LLM relevance scoring.
|
|
223
|
+
|
|
224
|
+
### Explain Mode
|
|
225
|
+
|
|
226
|
+
`--explain` shows per-result scoring breakdown: FTS (keyword) score, vector (semantic) score, RRF rank after fusion, reranker score from LLM, recency weight, final blended score. Makes search quality transparent and debuggable.
|
|
227
|
+
|
|
228
|
+
### Candidate Limit
|
|
229
|
+
|
|
230
|
+
`--candidates N` tunes the rerank pool size (default 40). Higher values give the LLM more results to evaluate. Lower values are faster.
|
|
231
|
+
|
|
232
|
+
### LLM Cache
|
|
233
|
+
|
|
234
|
+
Expansion + reranking results cached in `llm_cache` table with 7-day TTL. Same query returns instantly on second search. Cache is per-query, per-intent.
|
|
235
|
+
|
|
218
236
|
### Recency Decay
|
|
219
237
|
|
|
220
238
|
Exponential decay from 1.0 to floor 0.3. Day 0: 1.0, Day 1: 0.90, Day 3: 0.74, Day 7: 0.50, Day 14+: 0.3 (floor). Fresh context wins decisively. Old content still surfaces for strong matches but doesn't bury recent results.
|
|
@@ -274,6 +292,9 @@ Memory Crystal manages `~/.ldm/` ... the universal agent home directory for [LDM
|
|
|
274
292
|
config.json version, registered agents array
|
|
275
293
|
bin/
|
|
276
294
|
crystal-capture.sh cron job script (deployed by crystal init)
|
|
295
|
+
logs/
|
|
296
|
+
crystal-capture.log cron output (persists across reboots)
|
|
297
|
+
ldm-backup.log backup script output
|
|
277
298
|
memory/
|
|
278
299
|
crystal.db shared vector DB (all agents)
|
|
279
300
|
extensions/
|
|
@@ -419,7 +440,9 @@ Incremental sync detects changed files via SHA-256 content hashing. Only re-embe
|
|
|
419
440
|
|
|
420
441
|
```bash
|
|
421
442
|
# Search
|
|
422
|
-
crystal search <query> [-n limit] [--agent <id>] [--since <24h|7d|30d>]
|
|
443
|
+
crystal search <query> [-n limit] [--agent <id>] [--since <24h|7d|30d>]
|
|
444
|
+
[--intent <description>] [--candidates N] [--explain]
|
|
445
|
+
[--provider <openai|ollama|google>]
|
|
423
446
|
|
|
424
447
|
# Remember / forget
|
|
425
448
|
crystal remember <text> [--category fact|preference|event|opinion|skill]
|
|
@@ -428,6 +451,11 @@ crystal forget <id>
|
|
|
428
451
|
# Status
|
|
429
452
|
crystal status [--provider <openai|ollama|google>]
|
|
430
453
|
|
|
454
|
+
# MLX local LLM (Apple Silicon)
|
|
455
|
+
crystal mlx setup # auto-install Qwen2.5-3B, create LaunchAgent
|
|
456
|
+
crystal mlx status # check server health
|
|
457
|
+
crystal mlx stop # stop the server
|
|
458
|
+
|
|
431
459
|
# Source file indexing
|
|
432
460
|
crystal sources add <path> --name <name>
|
|
433
461
|
crystal sources sync [name]
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
# Release Notes: memory-crystal v0.7.28
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Move all log paths from /tmp/ to ~/.ldm/logs/ so logs survive reboots.**
|
|
4
4
|
|
|
5
5
|
## What changed
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
- Cron entry for crystal-capture now logs to `~/.ldm/logs/crystal-capture.log` instead of `/tmp/ldm-dev-tools/`
|
|
8
|
+
- LaunchAgent plist template for ldm-backup now logs to `~/.ldm/logs/ldm-backup.log`
|
|
9
|
+
- `mkdirSync` ensures `~/.ldm/logs/` exists instead of creating `/tmp/ldm-dev-tools/`
|
|
10
|
+
- CLI output shows the correct log path
|
|
11
11
|
|
|
12
12
|
## Why
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
macOS clears `/tmp/` on every reboot. All cron and LaunchAgent logs were lost after restart, making it impossible to debug issues. `~/.ldm/logs/` persists across reboots and is the correct home for LDM OS logs.
|
|
15
15
|
|
|
16
16
|
## Issues closed
|
|
17
17
|
|
|
18
|
-
- #
|
|
18
|
+
- wipcomputer/wip-ldm-os#120
|
|
19
19
|
|
|
20
20
|
## How to verify
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
#
|
|
23
|
+
# After install, check that cron entry points to ~/.ldm/logs/
|
|
24
|
+
crystal init --dry-run 2>&1 | grep crystal-capture
|
|
25
|
+
|
|
26
|
+
# Check backup setup points to ~/.ldm/logs/
|
|
27
|
+
crystal backup setup --dry-run 2>&1 | grep ldm-backup
|
|
28
|
+
|
|
29
|
+
# Verify logs land in the right place
|
|
30
|
+
ls ~/.ldm/logs/
|
|
24
31
|
```
|