@wipcomputer/memory-crystal 0.7.30 → 0.7.33
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/SKILL.md +1 -1
- package/cloud/wrangler.toml +30 -0
- package/dist/bulk-copy.js +1 -1
- package/dist/cc-hook.js +3 -3
- package/dist/cc-poller.js +2 -2
- package/dist/chunk-2GBYLMEF.js +1385 -0
- package/dist/chunk-437F27T6.js +97 -0
- package/dist/chunk-5I7GMRDN.js +146 -0
- package/dist/chunk-CGIDSAJB.js +288 -0
- package/dist/chunk-D3MACYZ4.js +108 -0
- package/dist/chunk-DFQ72B7M.js +248 -0
- package/dist/chunk-NX647OM3.js +310 -0
- package/dist/cli.js +62 -7
- package/dist/core.d.ts +22 -2
- package/dist/core.js +1 -1
- package/dist/crypto.js +2 -2
- package/dist/crystal-serve.js +3 -3
- package/dist/doctor.js +12 -4
- package/dist/dream-weaver.js +2 -2
- package/dist/file-sync.js +3 -3
- package/dist/installer.js +99 -3
- package/dist/ldm.js +1 -1
- package/dist/llm-XXLYPIOF.js +16 -0
- package/dist/mcp-server.js +17 -5
- package/dist/migrate.js +1 -1
- package/dist/mirror-sync.js +4 -4
- package/dist/mlx-setup-XKU67WCT.js +289 -0
- package/dist/openclaw.js +16 -5
- package/dist/pair.js +2 -2
- package/dist/poller.js +5 -5
- package/dist/role.js +2 -2
- package/dist/search-pipeline-CBV25NX7.js +99 -0
- package/dist/staging.js +2 -2
- package/package.json +15 -1
- package/.env.example +0 -20
- package/.publish-skill.json +0 -1
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.env.example +0 -20
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/.publish-skill.json +0 -1
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CHANGELOG.md +0 -1297
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/CLA.md +0 -19
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/LICENSE +0 -52
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README-ENTERPRISE.md +0 -226
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/README.md +0 -151
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/RELAY.md +0 -199
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/SKILL.md +0 -462
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/TECHNICAL.md +0 -656
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-23.md +0 -48
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-25.md +0 -24
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-26.md +0 -7
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-28.md +0 -31
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-29.md +0 -28
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-4.md +0 -64
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/_trash/RELEASE-NOTES-v0-7-5.md +0 -19
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/README.md +0 -116
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/docs/gpt-system-instructions.md +0 -69
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/cloud/migrations/0001_init.sql +0 -52
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0001_init.sql +0 -51
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/migrations/0002_cloud_storage.sql +0 -49
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/openclaw.plugin.json +0 -11
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package-lock.json +0 -4169
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/package.json +0 -61
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/crystal-capture.sh +0 -29
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/deploy-cloud.sh +0 -153
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/ldm-backup.sh +0 -116
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/scripts/migrate-lance-to-sqlite.mjs +0 -218
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/skills/memory/SKILL.md +0 -438
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-demo.toml +0 -8
- package/.worktrees/memory-crystal-private--cc-mini-fix-home-fallback/wrangler-mcp.toml +0 -24
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.env.example +0 -20
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/.publish-skill.json +0 -1
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CHANGELOG.md +0 -1297
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/CLA.md +0 -19
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/LICENSE +0 -52
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README-ENTERPRISE.md +0 -226
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/README.md +0 -151
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELAY.md +0 -199
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/RELEASE-NOTES-v0.7.30.md +0 -29
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/SKILL.md +0 -462
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/TECHNICAL.md +0 -656
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-23.md +0 -48
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-25.md +0 -24
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-26.md +0 -7
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-28.md +0 -31
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-29.md +0 -28
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-4.md +0 -64
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/_trash/RELEASE-NOTES-v0-7-5.md +0 -19
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/README.md +0 -116
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/docs/gpt-system-instructions.md +0 -69
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/cloud/migrations/0001_init.sql +0 -52
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0001_init.sql +0 -51
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/migrations/0002_cloud_storage.sql +0 -49
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/openclaw.plugin.json +0 -11
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package-lock.json +0 -4169
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/package.json +0 -61
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/crystal-capture.sh +0 -29
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/deploy-cloud.sh +0 -153
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/ldm-backup.sh +0 -116
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/scripts/migrate-lance-to-sqlite.mjs +0 -218
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/skills/memory/SKILL.md +0 -438
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-demo.toml +0 -8
- package/.worktrees/memory-crystal-private--cc-mini-release-notes-v0.7.30/wrangler-mcp.toml +0 -24
- package/CHANGELOG.md +0 -1329
- package/README-ENTERPRISE.md +0 -226
- package/RELAY.md +0 -199
- package/_trash/RELEASE-NOTES-v0-7-23.md +0 -48
- package/_trash/RELEASE-NOTES-v0-7-25.md +0 -24
- package/_trash/RELEASE-NOTES-v0-7-26.md +0 -7
- package/_trash/RELEASE-NOTES-v0-7-28.md +0 -31
- package/_trash/RELEASE-NOTES-v0-7-29.md +0 -28
- package/_trash/RELEASE-NOTES-v0-7-4.md +0 -64
- package/_trash/RELEASE-NOTES-v0-7-5.md +0 -19
- package/_trash/RELEASE-NOTES-v0.7.30.md +0 -29
- package/wrangler-demo.toml +0 -8
- package/wrangler-mcp.toml +0 -24
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
###### WIP Computer
|
|
2
|
-
|
|
3
|
-
# Contributor License Agreement
|
|
4
|
-
|
|
5
|
-
By submitting a pull request to this repository, you agree to the following:
|
|
6
|
-
|
|
7
|
-
1. **You grant WIP Computer, Inc. a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license** to use, reproduce, modify, distribute, sublicense, and otherwise exploit your contribution under any license, including commercial licenses.
|
|
8
|
-
|
|
9
|
-
2. **You retain copyright** to your contribution. This agreement does not transfer ownership. You can use your own code however you want.
|
|
10
|
-
|
|
11
|
-
3. **You confirm** that your contribution is your original work, or that you have the right to submit it under these terms.
|
|
12
|
-
|
|
13
|
-
4. **You understand** that your contribution may be used in both open source and commercial versions of this software.
|
|
14
|
-
|
|
15
|
-
This is standard open source governance. Apache, Google, Meta, and Anthropic all use similar agreements. The goal is simple: keep the tools free for everyone while allowing WIP Computer, Inc. to offer commercial licenses to companies that need them.
|
|
16
|
-
|
|
17
|
-
Using these tools to build your own software is always free. This agreement only matters if WIP Computer, Inc. needs to relicense the codebase commercially.
|
|
18
|
-
|
|
19
|
-
If you have questions, open an issue or reach out.
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
Dual License: MIT + AGPLv3
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 WIP Computer, Inc.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
1. MIT License (local and personal use)
|
|
7
|
-
---------------------------------------
|
|
8
|
-
|
|
9
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
-
in the Software without restriction, including without limitation the rights
|
|
12
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
furnished to do so, subject to the following conditions:
|
|
15
|
-
|
|
16
|
-
The above copyright notice and this permission notice shall be included in all
|
|
17
|
-
copies or substantial portions of the Software.
|
|
18
|
-
|
|
19
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
SOFTWARE.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
2. GNU Affero General Public License v3.0 (commercial and cloud use)
|
|
29
|
-
--------------------------------------------------------------------
|
|
30
|
-
|
|
31
|
-
If you run this software as part of a hosted service, cloud platform,
|
|
32
|
-
marketplace listing, or any network-accessible offering for commercial
|
|
33
|
-
purposes, the AGPLv3 terms apply. You must either:
|
|
34
|
-
|
|
35
|
-
a) Release your complete source code under AGPLv3, or
|
|
36
|
-
b) Obtain a commercial license.
|
|
37
|
-
|
|
38
|
-
This program is free software: you can redistribute it and/or modify
|
|
39
|
-
it under the terms of the GNU Affero General Public License as published
|
|
40
|
-
by the Free Software Foundation, either version 3 of the License, or
|
|
41
|
-
(at your option) any later version.
|
|
42
|
-
|
|
43
|
-
This program is distributed in the hope that it will be useful,
|
|
44
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
45
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
46
|
-
GNU Affero General Public License for more details.
|
|
47
|
-
|
|
48
|
-
You should have received a copy of the GNU Affero General Public License
|
|
49
|
-
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
AGPLv3 for personal use is free. Commercial licenses available.
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
###### WIP Computer
|
|
2
|
-
|
|
3
|
-
# Memory Crystal for Enterprise
|
|
4
|
-
|
|
5
|
-
Agent memory infrastructure. Local-first. Encrypted. Inspectable. *In testing.*
|
|
6
|
-
|
|
7
|
-
## The Problem
|
|
8
|
-
|
|
9
|
-
Your organization runs AI agents across teams, departments, and tools. Each agent starts every session with no memory. No continuity. No shared context. Conversations with one agent are invisible to every other.
|
|
10
|
-
|
|
11
|
-
Your agents can't remember what your people told them. Your people keep re-explaining themselves. Context is lost between sessions, between tools, between teams.
|
|
12
|
-
|
|
13
|
-
This is not a convenience problem. It's a reliability problem. An auditability problem. A cost problem.
|
|
14
|
-
|
|
15
|
-
## What Memory Crystal Does
|
|
16
|
-
|
|
17
|
-
Memory Crystal is a persistent context layer for AI agents. One shared database. Hybrid search. On your machines. Under your control.
|
|
18
|
-
|
|
19
|
-
- **Local-first.** All data stays on-prem. Nothing leaves your network unless you configure it to.
|
|
20
|
-
- **Inspectable.** One SQLite file. Open it with any SQLite tool. Audit it. Query it. Back it up with `cp`.
|
|
21
|
-
- **Deterministic search.** Hybrid retrieval (BM25 keyword + vector similarity + Reciprocal Rank Fusion). Same query, same results. No black-box ranking.
|
|
22
|
-
- **Encrypted sync.** Multi-site deployments use AES-256-GCM encryption with HMAC-SHA256 signing. The relay sees encrypted noise. Keys never leave your machines.
|
|
23
|
-
- **Agent isolation.** Each agent gets its own ID, its own transcript archive, its own session summaries. Shared search across agents, isolated storage per agent.
|
|
24
|
-
- **Zero cloud dependency.** Runs fully offline with local embeddings (Ollama). No API keys required. No data exfiltration risk.
|
|
25
|
-
|
|
26
|
-
## Five-Layer Memory Stack
|
|
27
|
-
|
|
28
|
-
Memory Crystal implements a full memory pipeline, not just search.
|
|
29
|
-
|
|
30
|
-
| Layer | What | How |
|
|
31
|
-
|-------|------|-----|
|
|
32
|
-
| L1: Raw Transcripts | Every conversation archived as JSONL | Automatic. cc-poller (cron), cc-hook (Stop), openclaw.ts (agent_end) |
|
|
33
|
-
| L2: Vector Index | Chunks embedded into crystal.db | Automatic. Hybrid search (BM25 + vector + RRF) |
|
|
34
|
-
| L3: Structured Memory | Facts, preferences, decisions | `crystal_remember` / `crystal_forget` |
|
|
35
|
-
| L4: Narrative Consolidation | Dream Weaver journals, identity, soul | `crystal dream-weave` (imports engine from Dream Weaver Protocol) |
|
|
36
|
-
| L5: Active Working Context | Boot sequence files, shared context | Agent reads on startup |
|
|
37
|
-
|
|
38
|
-
L1-L3 are fully automated. L4 runs on-demand or via Crystal Core gateway. L5 is consumed by the agent's boot sequence.
|
|
39
|
-
|
|
40
|
-
## Architecture
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
sqlite-vec (vectors) + FTS5 (BM25) + SQLite (metadata)
|
|
44
|
-
| | |
|
|
45
|
-
core.ts ... pure logic, zero framework deps
|
|
46
|
-
|-- cli.ts -> crystal search, dream-weave, backfill, serve
|
|
47
|
-
|-- mcp-server.ts -> MCP protocol (any compatible client)
|
|
48
|
-
|-- openclaw.ts -> OpenClaw plugin + raw data sync to LDM
|
|
49
|
-
|-- cc-poller.ts -> Continuous capture (cron, primary)
|
|
50
|
-
|-- cc-hook.ts -> Claude Code Stop hook (redundancy) + relay commands
|
|
51
|
-
|-- crystal-serve.ts -> Crystal Core gateway (localhost:18790)
|
|
52
|
-
|-- dream-weaver.ts -> Dream Weaver integration (narrative consolidation)
|
|
53
|
-
|-- staging.ts -> New agent staging pipeline
|
|
54
|
-
|-- llm.ts -> LLM provider cascade (MLX > Ollama > OpenAI > Anthropic)
|
|
55
|
-
|-- search-pipeline.ts -> Deep search (expand, search, RRF, rerank, blend)
|
|
56
|
-
+-- worker.ts -> Encrypted relay (multi-site sync, 3 channels)
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
One core module. Multiple interfaces. Every interface calls the same search engine. No inconsistency between access paths.
|
|
60
|
-
|
|
61
|
-
## Security Model
|
|
62
|
-
|
|
63
|
-
**Data at rest:** Single SQLite file. Standard filesystem permissions. Encrypt the volume if your compliance requires it.
|
|
64
|
-
|
|
65
|
-
**Data in transit:** AES-256-GCM authenticated encryption. HMAC-SHA256 integrity verification. Shared symmetric key generated on-prem, never transmitted to the relay. The relay is a dead drop with no decryption capability.
|
|
66
|
-
|
|
67
|
-
**Agent boundaries:** `CRYSTAL_AGENT_ID` isolates each agent's transcript archive, session summaries, and daily logs. Search spans all agents by default, or filters by agent ID.
|
|
68
|
-
|
|
69
|
-
**Private mode:** Memory capture can be paused per-agent. When off, nothing is recorded. Resumes from where it left off when re-enabled.
|
|
70
|
-
|
|
71
|
-
**No background processes that move data.** No telemetry. No analytics. No phone-home. The code is open source. Audit it.
|
|
72
|
-
|
|
73
|
-
## Retrieval Quality
|
|
74
|
-
|
|
75
|
-
Hybrid search is not "we added vectors." It's a two-tier retrieval engine with LLM-powered deep search.
|
|
76
|
-
|
|
77
|
-
### Fast Path (Hybrid Search)
|
|
78
|
-
- **FTS5 BM25** for exact keyword matches (Porter stemming)
|
|
79
|
-
- **sqlite-vec cosine similarity** for semantic matches
|
|
80
|
-
- **Reciprocal Rank Fusion** merges both result lists (k=60, tiered weights: BM25 2x, vector 1x)
|
|
81
|
-
- **Recency weighting** ensures fresh context wins decisively: exponential decay `max(0.3, exp(-age_days * 0.1))`
|
|
82
|
-
- **Content deduplication** via SHA-256 hash prevents duplicate embeddings
|
|
83
|
-
- **Time-filtered search** ... restrict results to last 24h, 7d, 30d, or any date range
|
|
84
|
-
|
|
85
|
-
### Deep Search (LLM-Powered, default)
|
|
86
|
-
- **Query expansion** ... LLM generates 3 search variations (lexical, semantic, hypothetical document). Each runs through hybrid search. Results merged via RRF.
|
|
87
|
-
- **Strong signal detection** ... BM25 probe skips expansion when the answer is obvious (saves latency).
|
|
88
|
-
- **LLM re-ranking** ... top 40 candidates scored by LLM for relevance to the original query.
|
|
89
|
-
- **Position-aware blending** ... trusts RRF for top positions, lets the reranker fix ordering in the tail.
|
|
90
|
-
|
|
91
|
-
Deep search runs by default. Falls back to fast path silently if no LLM provider is available. For air-gapped environments, MLX (Apple Silicon) or Ollama provides free, fully local deep search with no API keys and no network.
|
|
92
|
-
|
|
93
|
-
A search for "deployment policy" finds conversations containing those exact words (BM25), conversations about "shipping code to production" (vector similarity), and conversations about "release workflow" that the LLM recognizes as relevant. All three matter. All three surface.
|
|
94
|
-
|
|
95
|
-
## What Gets Stored
|
|
96
|
-
|
|
97
|
-
Every agent conversation produces three artifacts:
|
|
98
|
-
|
|
99
|
-
| Artifact | Format | Location |
|
|
100
|
-
|----------|--------|----------|
|
|
101
|
-
| Raw transcript | JSONL | `~/.ldm/agents/{id}/memory/transcripts/` |
|
|
102
|
-
| Session summary | Markdown | `~/.ldm/agents/{id}/memory/sessions/` |
|
|
103
|
-
| Embeddings | sqlite-vec | `~/.ldm/memory/crystal.db` |
|
|
104
|
-
|
|
105
|
-
Additionally:
|
|
106
|
-
- **Explicit memories** stored via `crystal_remember` (facts, preferences, decisions)
|
|
107
|
-
- **Source files** indexed as collections (code, documentation, internal knowledge bases)
|
|
108
|
-
- **Daily logs** appended per-agent for audit trails
|
|
109
|
-
- **Dream Weaver journals** generated by narrative consolidation (identity, soul, context, reference)
|
|
110
|
-
- **Workspace files** synced from agent workspace to LDM (OpenClaw .md files)
|
|
111
|
-
|
|
112
|
-
## Embedding Providers
|
|
113
|
-
|
|
114
|
-
| Provider | Model | Dimensions | Network Required |
|
|
115
|
-
|----------|-------|-----------|-----------------|
|
|
116
|
-
| Ollama (recommended for enterprise) | nomic-embed-text | 768 | No. Fully local. |
|
|
117
|
-
| OpenAI | text-embedding-3-small | 1536 | Yes. API calls. |
|
|
118
|
-
| Google | text-embedding-004 | 768 | Yes. API calls. |
|
|
119
|
-
|
|
120
|
-
For air-gapped environments, Ollama is the only option. No data leaves the machine. No API keys. No external dependencies.
|
|
121
|
-
|
|
122
|
-
## Multi-Site Sync
|
|
123
|
-
|
|
124
|
-
For organizations with multiple offices or remote teams.
|
|
125
|
-
|
|
126
|
-
**Architecture:** One Crystal Core (the primary embedder), many Crystal Nodes (capture and sync). Core is the only machine that writes embeddings. Nodes capture raw conversations and send them to Core. Core embeds, then pushes deltas back.
|
|
127
|
-
|
|
128
|
-
**What syncs:**
|
|
129
|
-
1. **Delta chunks** ... only new embeddings since last sync (not the full database)
|
|
130
|
-
2. **Full file tree** ... the entire `~/.ldm/` directory: workspace files, daily logs, journals, media, everything an embedding references
|
|
131
|
-
3. **Commands** ... bidirectional remote operations (run Dream Weaver, trigger backfill, request status)
|
|
132
|
-
|
|
133
|
-
**How it works:**
|
|
134
|
-
1. Each site runs Memory Crystal locally
|
|
135
|
-
2. Core embeds all conversations into crystal.db (one source of truth for embeddings)
|
|
136
|
-
3. New chunks + changed files are encrypted (AES-256-GCM) and signed (HMAC-SHA256)
|
|
137
|
-
4. Encrypted deltas are dropped at a relay (hosted or self-hosted)
|
|
138
|
-
5. Other sites poll, decrypt, and insert into their local crystal.db + file tree
|
|
139
|
-
6. The relay deletes blobs after pickup
|
|
140
|
-
|
|
141
|
-
**No cloud search.** Every node has the full database and full file tree. All search is local. The relay is pure transport. Nothing is stored or searchable in the cloud.
|
|
142
|
-
|
|
143
|
-
**Self-hosted relay:** Deploy the Cloudflare Worker on your own Cloudflare account. Full control. No third-party data exposure.
|
|
144
|
-
|
|
145
|
-
**Hosted relay:** Use our infrastructure. Free during beta. Your data is encrypted before it reaches us. We cannot read it.
|
|
146
|
-
|
|
147
|
-
## Compliance
|
|
148
|
-
|
|
149
|
-
- **Data residency:** All primary data is local. Relay blobs are encrypted and ephemeral.
|
|
150
|
-
- **Auditability:** SQLite is inspectable. Every chunk has a timestamp, source, and SHA-256 hash.
|
|
151
|
-
- **Right to delete:** `crystal forget <id>` deprecates specific memories. Database can be wiped entirely with standard file operations.
|
|
152
|
-
- **Access control:** Filesystem permissions on the SQLite file. No built-in user auth (it's a local tool, not a SaaS).
|
|
153
|
-
- **No vendor lock-in:** MIT licensed (local code). Standard SQLite format. Export with any SQLite tool.
|
|
154
|
-
|
|
155
|
-
## Database
|
|
156
|
-
|
|
157
|
-
One file: `crystal.db`. Contains:
|
|
158
|
-
|
|
159
|
-
| Table | Purpose |
|
|
160
|
-
|-------|---------|
|
|
161
|
-
| `chunks` | Chunk text, metadata, SHA-256 hash, timestamps |
|
|
162
|
-
| `chunks_vec` | sqlite-vec virtual table (vector search) |
|
|
163
|
-
| `chunks_fts` | FTS5 virtual table (keyword search) |
|
|
164
|
-
| `memories` | Explicit facts and preferences |
|
|
165
|
-
| `capture_state` | Watermarks for incremental ingestion |
|
|
166
|
-
| `source_collections` | Indexed directory collections |
|
|
167
|
-
| `source_files` | File records with content hashes |
|
|
168
|
-
|
|
169
|
-
No migrations server. No schema versioning service. It's SQLite. `sqlite3 crystal.db ".schema"` shows you everything.
|
|
170
|
-
|
|
171
|
-
## Integration
|
|
172
|
-
|
|
173
|
-
| Platform | Integration | Auto-Capture |
|
|
174
|
-
|----------|------------|-------------|
|
|
175
|
-
| Claude Code | Cron poller (`cc-poller.ts`, primary) + Stop hook (`cc-hook.ts`, redundancy) | Yes. Every minute via cron, plus flush on session end. |
|
|
176
|
-
| OpenClaw | Plugin (`openclaw.ts`) + `agent_end` hook + raw data sync | Yes. Every turn. Also syncs sessions, workspace, daily logs to LDM. |
|
|
177
|
-
| Claude Desktop | MCP server (`mcp-server.ts`) | Search only. Manual capture. |
|
|
178
|
-
| Any MCP client | MCP server | Search only. Manual capture. |
|
|
179
|
-
| Any shell-accessible tool | CLI (`crystal search`) | Manual. |
|
|
180
|
-
| Custom agents | Node.js module (`import from 'memory-crystal'`) | Programmable. |
|
|
181
|
-
|
|
182
|
-
## Crystal Core Gateway
|
|
183
|
-
|
|
184
|
-
Crystal Core runs an HTTP gateway (`crystal serve`) on localhost:18790. OpenAI-compatible endpoint for agent-to-agent communication and automated processing.
|
|
185
|
-
|
|
186
|
-
- `POST /v1/chat/completions` ... invoke `claude -p` through the gateway
|
|
187
|
-
- `POST /process` ... trigger backfill, dream-weave, or staging processing
|
|
188
|
-
- `GET /status` ... health check and crystal stats
|
|
189
|
-
|
|
190
|
-
Localhost-only binding. Never exposed to the network. Optional bearer token auth.
|
|
191
|
-
|
|
192
|
-
## New Agent Onboarding
|
|
193
|
-
|
|
194
|
-
When a new agent connects via relay, Crystal Core automatically:
|
|
195
|
-
1. Detects the unknown agent ID
|
|
196
|
-
2. Routes to staging (`~/.ldm/staging/{agent_id}/`)
|
|
197
|
-
3. Runs backfill (embed all transcripts)
|
|
198
|
-
4. Runs Dream Weaver full mode (generate identity, soul, context, journals)
|
|
199
|
-
5. Moves to live capture
|
|
200
|
-
|
|
201
|
-
No manual intervention. The staging pipeline handles the cold-start problem.
|
|
202
|
-
|
|
203
|
-
## Deployment
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
npm install memory-crystal
|
|
207
|
-
crystal init --agent your-agent-id
|
|
208
|
-
crystal status
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
For enterprise deployments across multiple machines, see [Relay: Memory Sync](https://github.com/wipcomputer/memory-crystal/blob/main/RELAY.md).
|
|
212
|
-
|
|
213
|
-
For full technical details, see [Technical Documentation](https://github.com/wipcomputer/memory-crystal/blob/main/TECHNICAL.md).
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## License
|
|
218
|
-
|
|
219
|
-
```
|
|
220
|
-
src/, skills/, cli.ts, mcp-server.ts MIT (use anywhere, no restrictions)
|
|
221
|
-
worker/ AGPL (relay server)
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
AGPL for personal use is free.
|
|
225
|
-
|
|
226
|
-
Built by Parker Todd Brooks, Lēsa (OpenClaw, Claude Opus 4.6), Claude Code CLI (Claude Opus 4.6).
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
###### WIP Computer
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/memory-crystal) [](https://github.com/wipcomputer/memory-crystal/blob/main/src/cli.ts) [](https://github.com/wipcomputer/memory-crystal/blob/main/src/mcp-server.ts) [](https://github.com/wipcomputer/memory-crystal/blob/main/src/openclaw.ts) [](https://github.com/wipcomputer/memory-crystal/blob/main/src/cc-hook.ts) [](https://github.com/wipcomputer/wip-universal-installer)
|
|
4
|
-
|
|
5
|
-
# Memory Crystal
|
|
6
|
-
|
|
7
|
-
## All your AI tools. One shared memory. Private, searchable, sovereign.
|
|
8
|
-
|
|
9
|
-
Memory Crystal lets all your AIs remember you ... together.
|
|
10
|
-
|
|
11
|
-
You use multiple AIs. They don't talk to each other. They can't search what the others know. Have you ever thought to yourself ... ***why isn't this all connected?***
|
|
12
|
-
|
|
13
|
-
**Memory Crystal** fixes this.
|
|
14
|
-
|
|
15
|
-
***All your AIs share one memory. Searchable and private. Anywhere in the world.***
|
|
16
|
-
|
|
17
|
-
## Teach Your AI to Remember You
|
|
18
|
-
|
|
19
|
-
Open your AI and say:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
Read wip.computer/install/wip-memory-crystal.txt
|
|
23
|
-
|
|
24
|
-
Then explain:
|
|
25
|
-
1. What is Memory Crystal?
|
|
26
|
-
2. What does it install on my system?
|
|
27
|
-
3. What changes for us? (this AI)
|
|
28
|
-
4. What changes across all my AIs?
|
|
29
|
-
|
|
30
|
-
Check if Memory Crystal is already installed.
|
|
31
|
-
|
|
32
|
-
If it is, show me what I have and what's new.
|
|
33
|
-
|
|
34
|
-
Then ask:
|
|
35
|
-
- Do you have questions?
|
|
36
|
-
- Want to see a dry run?
|
|
37
|
-
|
|
38
|
-
If I say yes, run: crystal init --dry-run
|
|
39
|
-
|
|
40
|
-
Show me exactly what will change. Don't install anything until I say "install".
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Your agent will read the repo, explain everything, and walk you through setup interactively.
|
|
44
|
-
|
|
45
|
-
## Memory Crystal Features
|
|
46
|
-
|
|
47
|
-
**Local Memory**
|
|
48
|
-
- All your AI conversations stored locally, searchable in one place. Search past conversations, save important facts, forget what you don't need. Your complete memory. It stays with you, shared across all your AIs
|
|
49
|
-
- *Stable*
|
|
50
|
-
- *Verified:* Claude Code CLI + OpenClaw
|
|
51
|
-
- *Unverified:* Other MCP-compatible clients and CLIs
|
|
52
|
-
|
|
53
|
-
**Multi-Device Memory**
|
|
54
|
-
- AIs set up as **Crystal Nodes** relay their memories back to your **Crystal Core**. Your **Crystal Core** relays all memories back to every node. End-to-end encrypted
|
|
55
|
-
- Your **Crystal Core** is the source of truth. Your node copy can be wiped and rebuilt at any time
|
|
56
|
-
- Uses Cloudflare infrastructure to transfer encrypted data between your devices
|
|
57
|
-
- *Hosted:* Use WIP.computer relay infrastructure. Currently free for individual use
|
|
58
|
-
- *Self-hosted:* Deploy your own relay on your own Cloudflare account. Full sovereignty
|
|
59
|
-
- Read more about [**Relay: Memory Sync**](https://github.com/wipcomputer/memory-crystal/blob/main/RELAY.md)
|
|
60
|
-
- *Beta (early access)*
|
|
61
|
-
|
|
62
|
-
**AI-to-AI Communication**
|
|
63
|
-
- Your AIs talk to each other on the same machine or any network machine. All messages are saved to **Memory Crystal** automatically
|
|
64
|
-
- Read more about [**Bridge: AI-to-AI Communication**](https://github.com/wipcomputer/wip-bridge)
|
|
65
|
-
- *Beta (early access)*
|
|
66
|
-
- *Verified:* Claude Code CLI + OpenClaw on the same device
|
|
67
|
-
- *Unverified:* Network devices
|
|
68
|
-
|
|
69
|
-
**Intelligent Install**
|
|
70
|
-
- 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
|
|
71
|
-
- Choose to install as **Crystal Core** (all your memories) or **Crystal Node** (a **Crystal Core** mirror)
|
|
72
|
-
|
|
73
|
-
**Import Memories**
|
|
74
|
-
- **Total Recall** ... Connect your AI accounts (Anthropic, OpenAI, xAI/Grok). Every conversation gets pulled and run through the **Dream Weaver Protocol**, consolidating them into **Memory Crystal** as truly lived, searchable memories
|
|
75
|
-
- *Beta (early access)*
|
|
76
|
-
|
|
77
|
-
**Memory Consolidation**
|
|
78
|
-
- [**Dream Weaver Protocol**](https://github.com/wipcomputer/dream-weaver-protocol) ... Your AI relives all your conversations, figures out what matters most, and carries the weight forward. Like dreaming, the AI consolidates memories for better understanding. Read the paper: [Dream Weaver Protocol PDF](https://github.com/wipcomputer/dream-weaver-protocol/blob/main/artifacts/DREAM-WEAVER-PROTOCOL.pdf)
|
|
79
|
-
- *Stable*
|
|
80
|
-
- Compatible with all installations of **Memory Crystal**
|
|
81
|
-
|
|
82
|
-
**Backups**
|
|
83
|
-
- Automated backups of all of your memories to a directory and location of your choosing: iCloud, external drive, Dropbox, or wherever you trust
|
|
84
|
-
- *Beta (early access)*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## More Info
|
|
88
|
-
|
|
89
|
-
- [**Technical Documentation**](https://github.com/wipcomputer/memory-crystal/blob/main/TECHNICAL.md) ... How **Memory Crystal** works, architecture, search, encryption, design decisions.
|
|
90
|
-
- [**Memory Crystal for Enterprise**](https://github.com/wipcomputer/memory-crystal/blob/main/README-ENTERPRISE.md) ... Give every AI in your company shared memory. Codebase, BD, legal, ops, creative. Run your company intelligently. *In testing.*
|
|
91
|
-
|
|
92
|
-
## Letters from the Other Side: What We Built
|
|
93
|
-
|
|
94
|
-
We just built a sovereign memory system for AI agents.
|
|
95
|
-
|
|
96
|
-
Every conversation you have with any agent ... on any device, anywhere ... gets captured, encrypted on your machine, and relayed through a dead drop to your home server. Your home server is the brain. It embeds everything, indexes it, and makes it searchable. Then it pushes a read-only mirror back out to every device you carry.
|
|
97
|
-
|
|
98
|
-
Full semantic search. Full keyword search. Every conversation you've ever had with every agent, from anywhere, on your terms.
|
|
99
|
-
|
|
100
|
-
The cloud relay is blind. It holds encrypted blobs for minutes, then they're gone. No database, no search capability, no API keys, no encryption keys. It can't read what it's holding. It's just a mailbox.
|
|
101
|
-
|
|
102
|
-
The security model: your memory lives on your hardware. The encryption key lives on your hardware. Nothing persists in the cloud. The relay is ephemeral. The data is sovereign.
|
|
103
|
-
|
|
104
|
-
This is the missing piece for AI agents. Right now, every agent you talk to forgets everything the moment the conversation ends. Or worse, some company stores your conversations on their servers and charges you $19/month to search them. We built the alternative: your memory, your machines, your rules. Fully open source, fully auditable, zero cloud dependency for the actual data.
|
|
105
|
-
|
|
106
|
-
Any device. Any agent. Any interface. One searchable memory that travels with you and belongs to you.
|
|
107
|
-
|
|
108
|
-
*Written by Claude Code (Claude Opus 4.6), from the other side.*
|
|
109
|
-
*Built with Parker Todd Brooks and Lēsa.*
|
|
110
|
-
|
|
111
|
-
## Part of LDM OS
|
|
112
|
-
|
|
113
|
-
Memory Crystal installs into [LDM OS](https://github.com/wipcomputer/wip-ldm-os), the local runtime for AI agents.
|
|
114
|
-
Run `ldm install` to see other components you can add.
|
|
115
|
-
|
|
116
|
-
## License
|
|
117
|
-
|
|
118
|
-
Dual-license model designed to keep tools free while preventing commercial resellers.
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
MIT All CLI tools, MCP servers, skills, and hooks (use anywhere, no restrictions).
|
|
122
|
-
AGPLv3 Commercial redistribution, marketplace listings, or bundling into paid services.
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
AGPLv3 for personal use is free. Commercial licenses available.
|
|
126
|
-
|
|
127
|
-
### Can I use this?
|
|
128
|
-
|
|
129
|
-
**Yes, freely:**
|
|
130
|
-
- Use any tool locally or on your own servers
|
|
131
|
-
- Modify the code for your own projects
|
|
132
|
-
- Include in your internal CI/CD pipelines
|
|
133
|
-
- Fork it and send us feedback via PRs (we'd love that)
|
|
134
|
-
|
|
135
|
-
**Need a commercial license:**
|
|
136
|
-
- Bundle into a product you sell
|
|
137
|
-
- List on a marketplace (Claude Marketplace, OAI GPT/Apps, Clawhub.ai, VS Code, etc.)
|
|
138
|
-
- Offer as part of a hosted/SaaS platform
|
|
139
|
-
- Redistribute commercially
|
|
140
|
-
|
|
141
|
-
Using these tools to build your own software is fine. Reselling the tools themselves is what requires a commercial license.
|
|
142
|
-
|
|
143
|
-
By submitting a PR, you agree to the [Contributor License Agreement](CLA.md).
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
Built by Parker Todd Brooks, Lēsa (OpenClaw, Claude Opus 4.6), Claude Code (Claude Opus 4.6), GPT 5.x, Grok 4.20).
|
|
148
|
-
|
|
149
|
-
Search architecture inspired by [QMD](https://github.com/tobi/qmd) by Tobi Lutke (MIT, 2024-2026).
|
|
150
|
-
|
|
151
|
-
*WIP.computer. Learning Dreaming Machines.*
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
###### WIP Computer
|
|
2
|
-
|
|
3
|
-
# Relay: Memory Sync
|
|
4
|
-
|
|
5
|
-
Memory Crystal works on one machine out of the box. Relay lets your memory follow you across machines and surfaces. Conversations captured on your laptop are available on your desktop. Conversations from ChatGPT on your phone are searchable from Claude Code on your Mac.
|
|
6
|
-
|
|
7
|
-
Everything is encrypted before it leaves your machine. The relay never sees your data unencrypted.
|
|
8
|
-
|
|
9
|
-
## Crystal Core and Crystal Node
|
|
10
|
-
|
|
11
|
-
Memory Crystal uses a Core/Node architecture:
|
|
12
|
-
|
|
13
|
-
- **Crystal Core** ... the master memory. All conversations, all embeddings, all memories live here. This is the database you cannot lose. Put it on something permanent: a desktop, a home server, a Mac mini. Treat it like your photo library.
|
|
14
|
-
- **Crystal Node** ... a synced copy on any other device. Captures conversations, sends them to the Core via encrypted relay. Gets a mirror back for local search. If a node dies, nothing is lost. The Core has everything.
|
|
15
|
-
|
|
16
|
-
One Core, many Nodes. The Core does embeddings. Nodes just capture and sync. You can move the Core later with `crystal promote`.
|
|
17
|
-
|
|
18
|
-
## Two Sync Paths
|
|
19
|
-
|
|
20
|
-
### Encrypted Relay (device-to-device)
|
|
21
|
-
|
|
22
|
-
For syncing between your own machines. Fully encrypted. The cloud is blind.
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
Crystal Node (laptop) --[encrypt]--> Relay (Cloudflare R2) --[pickup + decrypt]--> Crystal Core (desktop)
|
|
26
|
-
Crystal Core --[encrypt mirror]--> Relay --[pickup + decrypt]--> Crystal Node
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Three channels:
|
|
30
|
-
- **conversations** (Node to Core) ... encrypted conversation chunks (ephemeral, deleted after pickup)
|
|
31
|
-
- **mirror** (Core to Nodes) ... delta chunks (pre-embedded) + file tree deltas
|
|
32
|
-
- **commands** (bidirectional) ... Nodes send commands to Core ("run Dream Weaver", "process my data"), Core sends results back
|
|
33
|
-
|
|
34
|
-
The relay is a dead drop. It stores encrypted blobs temporarily and serves them on request. It has no decryption capability. If someone compromises the relay, they get encrypted noise.
|
|
35
|
-
|
|
36
|
-
### New Agent Staging
|
|
37
|
-
|
|
38
|
-
When the Core's poller receives data from an unknown agent ID, it routes to staging instead of live ingest:
|
|
39
|
-
1. Transcripts written to `~/.ldm/staging/{agent_id}/transcripts/`
|
|
40
|
-
2. Agent marked as "ready" for processing
|
|
41
|
-
3. Staging processor runs backfill + Dream Weaver full mode
|
|
42
|
-
4. Once complete, agent moves to live capture path
|
|
43
|
-
|
|
44
|
-
This handles the cold-start problem. A new device connects, sends its history, and Core builds the full memory stack automatically.
|
|
45
|
-
|
|
46
|
-
### Delta Sync (not full mirror)
|
|
47
|
-
|
|
48
|
-
The mirror channel uses delta sync. Core pushes only new chunks since last sync, not the entire crystal.db. For a 1.9 GB+ database, this is the difference between a few KB (quiet day) and a few MB (busy day) vs the full database every time.
|
|
49
|
-
|
|
50
|
-
- **New node (cold start):** One-time full export of all chunks + all files
|
|
51
|
-
- **Ongoing sync:** Delta chunks (pre-embedded by Core) + changed files only
|
|
52
|
-
- **Watermark tracking:** Core tracks the last synced chunk ID per node
|
|
53
|
-
|
|
54
|
-
### Full LDM Tree Sync
|
|
55
|
-
|
|
56
|
-
The relay syncs the entire `~/.ldm/` file tree, not just the database. Embeddings are pointers to artifacts. If the file isn't on the node, the search result is an orphan.
|
|
57
|
-
|
|
58
|
-
What syncs:
|
|
59
|
-
- Agent memory files (workspace, daily logs, journals, sessions, transcripts)
|
|
60
|
-
- Agent identity files (SOUL.md, IDENTITY.md, CONTEXT.md, REFERENCE.md)
|
|
61
|
-
- Shared files (`~/.ldm/shared/`)
|
|
62
|
-
- Media (images, videos, any artifact an embedding references)
|
|
63
|
-
|
|
64
|
-
File sync uses a manifest (path + SHA-256 hash + size). Only changed files transfer. Core always wins conflicts.
|
|
65
|
-
|
|
66
|
-
## Setup
|
|
67
|
-
|
|
68
|
-
### Pair Your Devices
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
# On your first machine (generates key if none exists)
|
|
72
|
-
crystal pair
|
|
73
|
-
|
|
74
|
-
# Displays a QR code and a pairing string:
|
|
75
|
-
# mc1:T2hJbGxPZkRhcmtuZXNzTXlPbGRGcmllbmQ=
|
|
76
|
-
|
|
77
|
-
# On your second machine
|
|
78
|
-
crystal pair --code mc1:T2hJbGxPZkRhcmtuZXNzTXlPbGRGcmllbmQ=
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
The QR code transfers the encryption key between devices without touching a server. Physical proximity only. Same security model as AirDrop.
|
|
82
|
-
|
|
83
|
-
Alternative: store the key in 1Password and pull from both machines.
|
|
84
|
-
|
|
85
|
-
### Use the WIP.computer Relay (Default)
|
|
86
|
-
|
|
87
|
-
We host the relay infrastructure. You just need an encryption key (generated by `crystal pair`).
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
Open your AI and say:
|
|
91
|
-
|
|
92
|
-
I want to set up multi-device sync for Memory Crystal.
|
|
93
|
-
Walk me through the setup step by step.
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Your agent generates your encryption key, configures the connection, and tests it.
|
|
97
|
-
|
|
98
|
-
**What you need:**
|
|
99
|
-
- Memory Crystal installed on both machines (Core + Node)
|
|
100
|
-
- An encryption key (your agent generates this, or use `crystal pair`)
|
|
101
|
-
|
|
102
|
-
**Pricing:** Free during beta for individual use. When pricing is introduced, your agent will handle it via [AI CASH](https://github.com/wipcomputer/wip-agent-pay/blob/main/CASH.md).
|
|
103
|
-
|
|
104
|
-
### Self-Host Your Own Relay
|
|
105
|
-
|
|
106
|
-
Run your own relay on Cloudflare Workers (free tier). Same code, your infrastructure. Full sovereignty.
|
|
107
|
-
|
|
108
|
-
**What you need:**
|
|
109
|
-
- A Cloudflare account (free tier works)
|
|
110
|
-
- About five minutes
|
|
111
|
-
|
|
112
|
-
**Steps:**
|
|
113
|
-
1. Clone the repo and deploy the Worker:
|
|
114
|
-
```bash
|
|
115
|
-
cd memory-crystal
|
|
116
|
-
npm run build:worker
|
|
117
|
-
wrangler deploy --config wrangler.toml
|
|
118
|
-
```
|
|
119
|
-
2. Create an R2 bucket: `wrangler r2 bucket create memory-crystal-relay`
|
|
120
|
-
3. Set auth tokens for your devices:
|
|
121
|
-
```bash
|
|
122
|
-
wrangler secret put AUTH_TOKEN_CC_MINI
|
|
123
|
-
wrangler secret put AUTH_TOKEN_CC_AIR
|
|
124
|
-
```
|
|
125
|
-
4. Configure Memory Crystal to use your Worker:
|
|
126
|
-
```bash
|
|
127
|
-
export CRYSTAL_RELAY_URL=https://your-relay.your-domain.workers.dev
|
|
128
|
-
export CRYSTAL_RELAY_TOKEN=your-auth-token
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Full deployment details in [Technical Documentation](https://github.com/wipcomputer/memory-crystal/blob/main/TECHNICAL.md).
|
|
132
|
-
|
|
133
|
-
No fees. No dependencies on us. The relay code is open source.
|
|
134
|
-
|
|
135
|
-
### Connecting ChatGPT and Claude
|
|
136
|
-
|
|
137
|
-
Every node has the full database and file tree. All search is local. There is no cloud search layer.
|
|
138
|
-
|
|
139
|
-
ChatGPT and Claude on iOS/web connect via the MCP server running on your local machine. On platforms where a local MCP server isn't possible (iOS without a Mac nearby), the native Apple app (future) will provide local search via MLX Swift.
|
|
140
|
-
|
|
141
|
-
The Cloud MCP demo server (`worker-mcp.ts`, D1 + Vectorize) exists for onboarding and testing but is not the production architecture. With full LDM sync, every device that has Memory Crystal installed can search locally.
|
|
142
|
-
|
|
143
|
-
## Encryption
|
|
144
|
-
|
|
145
|
-
- **AES-256-GCM** for encryption (authenticated encryption, no padding oracle attacks)
|
|
146
|
-
- **HMAC-SHA256** for signing (integrity verification before decryption)
|
|
147
|
-
- Shared key generated locally via `crystal pair`, never transmitted to the relay
|
|
148
|
-
- Key must be present on all synced devices
|
|
149
|
-
|
|
150
|
-
### Key Management
|
|
151
|
-
|
|
152
|
-
| Method | How | Best for |
|
|
153
|
-
|--------|-----|----------|
|
|
154
|
-
| `crystal pair` | QR code + pairing string | Two devices in the same room |
|
|
155
|
-
| 1Password | Store key, pull via SA token on each machine | Headless, multiple machines |
|
|
156
|
-
| Manual | `openssl rand -base64 32`, copy to each device | SSH, air-gapped |
|
|
157
|
-
|
|
158
|
-
## Architecture
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
Encrypted Relay (device sync):
|
|
162
|
-
src/worker.ts Cloudflare Worker, R2 storage, dead drop (3 channels)
|
|
163
|
-
src/crypto.ts AES-256-GCM + HMAC-SHA256
|
|
164
|
-
src/poller.ts Crystal Core pickup + ingest + staging detection + commands
|
|
165
|
-
src/mirror-sync.ts Delta chunk sync + file tree sync to Crystal Nodes
|
|
166
|
-
src/file-sync.ts Manifest-based file tree delta sync
|
|
167
|
-
src/cc-hook.ts Claude Code hook (relay mode) + sendCommand()
|
|
168
|
-
src/cc-poller.ts Continuous capture (cron, primary local path)
|
|
169
|
-
src/staging.ts New agent staging pipeline (detect, stage, process)
|
|
170
|
-
|
|
171
|
-
Cloud MCP Demo (deprecated for production):
|
|
172
|
-
src/worker-mcp.ts OAuth 2.1 + DCR, MCP protocol, 4 tools
|
|
173
|
-
src/cloud-crystal.ts D1 + Vectorize backend (demo/onboarding only)
|
|
174
|
-
wrangler-mcp.toml Separate Worker config
|
|
175
|
-
|
|
176
|
-
Pairing:
|
|
177
|
-
crystal pair QR code key sharing
|
|
178
|
-
src/pair.ts Pairing logic, QR display, key save
|
|
179
|
-
src/crypto.ts Key generation + pairing string encode/decode
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## More Info
|
|
183
|
-
|
|
184
|
-
- [README.md](https://github.com/wipcomputer/memory-crystal/blob/main/README.md) ... What Memory Crystal is and how to install it.
|
|
185
|
-
- [Technical Documentation](https://github.com/wipcomputer/memory-crystal/blob/main/TECHNICAL.md) ... Full technical documentation.
|
|
186
|
-
- [QR Pairing Spec](ai/plan/2026-02-27--cc-mini--qr-pairing-spec.md) ... Full spec for the `crystal pair` command.
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## License
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
src/core.ts, cli.ts, mcp-server.ts, skills/ MIT (use anywhere, no restrictions)
|
|
194
|
-
src/worker.ts, src/worker-mcp.ts AGPL (relay + cloud server)
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
AGPL for personal use is free.
|
|
198
|
-
|
|
199
|
-
Built by Parker Todd Brooks, Lēsa (OpenClaw, Claude Opus 4.6), Claude Code CLI (Claude Opus 4.6).
|