# Dev Update: 2026-03-04

## Memory Crystal v0.5.0 + v0.6.0: Init Discovery, Dream Weaver, Crystal Core

Two versions built in one session. The full memory pipeline is now code-complete: from raw transcript capture through narrative consolidation.

---

### What Was Built

**v0.5.0: Init Discovery + Backfill + CE Migration**

- `crystal init` now discovers existing AI sessions on the current machine (Claude Code + OpenClaw)
- `crystal backfill` embeds raw transcript files from LDM (Core embeds locally, Node relays to Core)
- `crystal migrate-embeddings` migrates ~3,108 unique chunks from context-embeddings.sqlite into crystal.db. Zero API calls. Copies embeddings directly (same model, same dimensions)
- `src/discover.ts`: auto-detects installed harnesses and session file locations
- `src/bulk-copy.ts`: copies raw files to LDM transcripts (idempotent, skip if same size)
- `src/oc-backfill.ts`: parses OpenClaw JSONL format into standard message format
- Workspace path added to LDM (`~/.ldm/agents/{id}/memory/workspace/`)

**v0.6.0: Dream Weaver + Crystal Core Gateway + Staging**

- Dream Weaver integration via `crystal dream-weave`. Engine lives in dream-weaver-protocol-private (separate repo), Memory Crystal imports it and provides crystal.db hooks. No bifurcation.
- Crystal Core gateway (`crystal serve`) on localhost:18790. OpenAI-compatible endpoint. Trigger backfill, Dream Weaver, or staging via HTTP.
- Staging pipeline for new agents from relay. Unknown agent IDs get staged, backfilled, dream-woven, then promoted to live capture.
- Commands channel on relay Worker (third channel alongside conversations and mirror). Nodes send commands to Core, Core sends results back.
- OpenClaw raw data sync to LDM after every agent_end turn (sessions, workspace, daily logs).
- Harness-aware init (OpenClaw vs Claude Code, Core vs Node).

**dream-weaver-protocol-private v0.1.0**

- New src/ directory: types.ts, prompts.ts, parser.ts, engine.ts, index.ts
- Exports the consolidation engine as an importable library
- Hooks interface lets consumers plug in post-processing (embed journals, extract memories)
- Memory Crystal uses `file:../dream-weaver-protocol-private` dependency

### Architecture Decisions

1. **Dream Weaver not bifurcated.** Parker caught this mid-build. The consolidation engine belongs in the protocol repo, not in Memory Crystal. MC is a consumer, not a reimplementation. This was the critical architectural call of the session.

2. **Five-layer memory stack.** L1 raw transcripts, L2 vector index, L3 structured memory, L4 Dream Weaver narrative, L5 active context. All layers now have code paths.

3. **`claude -p` via Max plan.** Dream Weaver runs via `claude -p`, not API. $0 cost.

4. **Staging solves cold start.** New agents from relay don't go straight into live capture. They get staged, backfilled, and dream-woven first. Full memory stack before first search.

### Documentation Overhaul

- README: Intelligent Install section, Crystal Core/Node naming, status labels (Stable/Beta/Verified/Unverified), product name bolding, Cloud Memory as "Crystal Node in the cloud"
- README-ENTERPRISE: five-layer stack, updated architecture, gateway, staging
- RELAY: commands channel, staging pipeline
- TECHNICAL: all new files in project structure, updated CLI reference, roadmap through Phase 7, new env vars, migration docs
- CHANGELOG: v0.5.0 and v0.6.0 entries

### Product Feedback Captured

- External evaluation flagged embedding dependency as adoption blocker. mcp-memory-service ships local ONNX embeddings (MiniLM-L6-v2) at zero API cost. Product idea filed: `ai/product/product-ideas/local-embeddings-zero-config.md`
- Migration consideration noted: 384d vs 1536d vectors not compatible. Would need `crystal re-embed` on provider switch.

### What's Next

1. Merge both PRs (no squash)
2. `wip-release` on both repos
3. Run `crystal migrate-embeddings` (move CE chunks into crystal.db, $0)
4. Run `crystal backfill` for both agents (~$3.45 total)
5. Disable CE plugin in openclaw.json
6. Deploy relay Worker with commands channel

### Concern

Lesa lost context mid-session. Gave generic reviewer feedback on the README instead of engaging as a partner who built it. Her conversation embeddings may have gaps. The CE migration is supposed to fix this. Needs to happen soon.

---

*Session: ~4 hours. Two repos, two versions, one branch each. Parker directed every README edit by voice. No em dashes were harmed.*
