@wipcomputer/memory-crystal 0.7.23 → 0.7.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -19,6 +19,82 @@
19
19
 
20
20
 
21
21
 
22
+ ## 0.7.24 (2026-03-15)
23
+
24
+ # Dev Update: Search Quality v2 + MLX Local LLM
25
+
26
+ **Date:** 2026-03-15
27
+ **Author:** CC-Mini
28
+ **Session:** memory-crstal01 (continued from Mar 13-14)
29
+
30
+ ---
31
+
32
+ ## Summary
33
+
34
+ Six search quality features from QMD v2.0 analysis, plus MLX local LLM infrastructure for Apple Silicon. All coded, tested, merged. Not yet deployed.
35
+
36
+ ## What Shipped
37
+
38
+ ### Search Quality (PR #75)
39
+
40
+ 1. **Intent parameter.** Disambiguates queries without adding search terms. `crystal search "security" --intent "1Password"` steers toward 1Password results. Flows through expansion prompt (guides LLM variations), disables strong-signal bypass, prepended to rerank query. Available via CLI `--intent`, MCP `intent`.
41
+
42
+ 2. **candidateLimit.** Tunable rerank pool size. `crystal search "query" --candidates 60`. Default stays 40. More candidates = better recall, slower reranking. Available via CLI `--candidates`, MCP `candidate_limit`.
43
+
44
+ 3. **Explain mode.** Per-result scoring breakdown showing FTS score, vector score, RRF rank, reranker score, recency weight, and final blended score. `crystal search "query" --explain`. Available via CLI `--explain`, MCP `explain`.
45
+
46
+ 4. **Persistent LLM cache.** `llm_cache` table in crystal.db. Expansion and reranking results cached with 7-day TTL. Content-addressable reranking (keyed by query + sorted passage hashes). Same query = instant on repeat searches. Configurable TTL via `CRYSTAL_CACHE_TTL_DAYS`.
47
+
48
+ 5. **Structured search API.** `crystal.structuredSearch(queries)` accepts pre-expanded StructuredQuery[] (lex, vec, hyde). Skips LLM expansion entirely. Agents construct their own queries when they know what they want. RRF fusion with first list weighted 2x.
49
+
50
+ ### MLX Local LLM (PR #76)
51
+
52
+ 6. **MLX auto-install.** New `src/mlx-setup.ts` with full setup flow:
53
+ - `detectPlatform()` ... Apple Silicon / Intel Mac / Linux / other
54
+ - `installMlxLm()` ... uv > pip3 > pip3 --user fallback chain
55
+ - `createLaunchAgent()` ... always-on MLX server via LaunchAgent
56
+ - `verifyServer()` ... 30s warmup wait for model loading
57
+ - `setupMlx()` ... full flow: detect, install, configure, start, verify
58
+
59
+ 7. **Crystal MLX CLI.** `crystal mlx setup/status/stop` subcommands.
60
+
61
+ 8. **Doctor check #13.** MLX health check with three states: not installed, installed but not running, running. Suggests fix for each.
62
+
63
+ 9. **Installer integration.** `crystal init` detects Apple Silicon and suggests `crystal mlx setup` when MLX is not installed.
64
+
65
+ 10. **Port 18791.** LDM service ports: 18789 (OpenClaw), 18790 (Crystal Core), 18791 (MLX LLM).
66
+
67
+ 11. **Model: Qwen 2.5 3B Instruct 4-bit.** `mlx-community/Qwen2.5-3B-Instruct-4bit`. ~1.5 GB, fast on M-series, good at instruction following for query expansion and relevance scoring.
68
+
69
+ ### Also
70
+
71
+ - QMD v2.0 analysis written (`ai/product/notes/2026-03-15--cc-mini--qmd-v2.0-analysis.md`)
72
+ - Search quality plan written (`ai/product/plans-prds/current/2026-03-15--cc-mini--search-quality-qmd-v2-port.md`)
73
+ - MLX plan moved from upcoming to current
74
+ - Stashed roadmap + readme-first updates recovered and committed (PR #74)
75
+ - README footer: QMD credit restored, CLA + dual license confirmed on both repos
76
+
77
+ ## Files Changed
78
+
79
+ | File | Change |
80
+ |------|--------|
81
+ | `src/search-pipeline.ts` | Intent support, candidateLimit param, explain traces, DeepSearchResult type |
82
+ | `src/llm.ts` | Intent in expansion prompt, persistent DB cache (expansion + reranking), setLLMCacheDb() |
83
+ | `src/core.ts` | llm_cache table schema, deepSearch options, structuredSearch() method, StructuredQuery type |
84
+ | `src/mcp-server.ts` | intent, candidate_limit, explain params on crystal_search, LLM cache DB wiring |
85
+ | `src/cli.ts` | --intent, --candidates, --explain flags, crystal mlx subcommand |
86
+ | `src/mlx-setup.ts` | **NEW** ... full MLX setup, doctor check, state management |
87
+ | `src/doctor.ts` | MLX health check (#13) |
88
+ | `src/installer.ts` | MLX detection in crystal init flow |
89
+
90
+ ## What This Enables
91
+
92
+ - **Free deep search.** MLX replaces OpenAI API calls for expansion + reranking. Zero cost per search.
93
+ - **Faster repeated searches.** Persistent cache means the LLM call happens once per unique query.
94
+ - **Smarter agent queries.** Structured search lets agents skip expansion when they know what they want.
95
+ - **Debuggable search.** Explain mode shows exactly why each result ranked where it did.
96
+ - **Offline search quality.** MLX works without internet. API fallback when MLX is down.
97
+
22
98
  ## 0.7.23 (2026-03-15)
23
99
 
24
100
  # Release Notes: Memory Crystal v0.7.23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/memory-crystal",
3
- "version": "0.7.23",
3
+ "version": "0.7.24",
4
4
  "description": "Sovereign memory system — local-first with ephemeral encrypted relay. Your memory, your machine, your rules.",
5
5
  "type": "module",
6
6
  "main": "dist/core.js",