feat(memory): add experimental qmd search backend

This commit is contained in:
William Valentin
2026-02-15 19:33:43 -08:00
parent c6e3d09ecc
commit 81c97a9df1
14 changed files with 340 additions and 29 deletions
@@ -123,7 +123,7 @@ Flynn has **6 of ~15 channels** (Telegram, WhatsApp, Discord, Slack, WebChat, TU
| `memory.write` tool | Write memory files | Full (write/append to namespace) | **MATCH** |
| Vector embeddings | OpenAI/Gemini/local | Full (OpenAI, Gemini, Ollama, LlamaCpp providers) | **MATCH** |
| Hybrid search (BM25 + vector) | Full | Full (keyword + vector with configurable hybrid weight) | **MATCH** |
| QMD backend | Experimental | -- | **MISSING** |
| QMD backend | Experimental | Full (experimental markdown-native backend configurable via `memory.qmd`) | **MATCH** |
---
@@ -313,7 +313,6 @@ All five Tier 3 items implemented: Lane Queue (per-session FIFO in gateway), cre
- Elevated mode — sandbox escape hatch
- ~~Onboard wizard — guided setup~~ (DONE — `flynn setup` + first-run auto-trigger, 2026-02-10)
- ClawHub/skill registry — community marketplace
- QMD backend — experimental memory search
---
@@ -39,9 +39,9 @@ A gap item is considered implemented when:
- Canvas / A2UI (agent-driven visual workspace)
### Memory (MISSING)
### Memory
- QMD backend (experimental)
- QMD backend (experimental) — completed on 2026-02-16
### Security (MISSING)
@@ -0,0 +1,39 @@
# QMD Backend Checklist
Date: 2026-02-16
Status: completed
## Scope
- Add an experimental QMD (query markdown database) backend for `memory.search`.
- Enable config-driven backend selection between hybrid embeddings, QMD, and keyword fallback.
- Update docs and plan state.
## Completed
- Added `memory.qmd` config schema in `src/config/schema.ts`:
- `enabled` (default `false`)
- `top_k` (default `8`)
- `min_score` (default `0.15`)
- Implemented `QmdSearch` backend in `src/memory/qmd-search.ts`:
- heading-aware scoring
- token overlap + phrase bonus ranking
- session namespace recency boost
- Wired backend selection in `src/daemon/memory.ts`:
- embedding enabled -> hybrid backend
- else if qmd enabled -> QMD backend
- else keyword-only search
- Generalized memory search tool wiring:
- introduced shared backend interface for `memory.search`
- updated memory tool factory to accept any backend implementing `search(query, topK?)`
- Updated docs:
- README memory section now documents QMD config and backend precedence.
- OpenClaw gap docs updated to mark QMD backend as implemented.
- Added tests:
- `src/memory/qmd-search.test.ts`
- `src/config/schema.test.ts` coverage for `memory.qmd`
## Verification
- `pnpm test:run src/config/schema.test.ts src/memory/qmd-search.test.ts`
- `pnpm typecheck`
+27 -2
View File
@@ -223,6 +223,31 @@
],
"test_status": "pnpm test:run src/channels/registry.test.ts src/gateway/handlers/handlers.test.ts + pnpm typecheck passing"
},
"qmd-backend": {
"file": "2026-02-16-qmd-backend-checklist.md",
"status": "completed",
"date": "2026-02-16",
"updated": "2026-02-16",
"summary": "Added an experimental markdown-native QMD backend for memory.search with config-driven backend selection (hybrid embeddings -> QMD -> keyword fallback), tests, and docs updates.",
"files_created": [
"docs/plans/2026-02-16-qmd-backend-checklist.md",
"src/memory/qmd-search.ts",
"src/memory/qmd-search.test.ts"
],
"files_modified": [
"src/config/schema.ts",
"src/config/schema.test.ts",
"src/daemon/memory.ts",
"src/memory/hybrid-search.ts",
"src/memory/index.ts",
"src/tools/builtin/index.ts",
"src/tools/builtin/memory-search.ts",
"README.md",
"docs/plans/2026-02-06-openclaw-feature-gap-analysis.md",
"docs/plans/2026-02-15-openclaw-gap-roadmap.md"
],
"test_status": "pnpm test:run src/config/schema.test.ts src/memory/qmd-search.test.ts + pnpm typecheck passing"
},
"skill-safety-scanner": {
"file": "2026-02-15-skill-safety-scanner-checklist.md",
"status": "completed",
@@ -2267,12 +2292,12 @@
"tier2_completion": "4/4 (100%) — inbound webhooks, vector memory search, Dockerfile, heartbeat monitor",
"tier3_completion": "5/5 (100%) — lane queue, credential redaction, web UI token dashboard, xAI (Grok) provider, Voyage AI embeddings",
"tier4_completion": "4/4 (100%) — gateway lock, shell completion, Tailscale Serve/Funnel, DM pairing codes",
"feature_gap_scorecard": "107/128 match (84%), 0 partial (0%), 21 missing (16%)",
"feature_gap_scorecard": "108/128 match (84%), 0 partial (0%), 20 missing (16%)",
"operator_dx_milestone": "Phase 3 (Live Ops Dashboard): 2/2 plans complete — milestone done",
"gmail_auth_cli": "flynn gmail-auth command implemented with OAuth2 flow, doctor check, config routed to Telegram",
"native_audio_support": "completed — smart routing for native audio (Gemini/OpenAI/GitHub) vs Whisper transcription fallback",
"remaining_phases_completion": "Phase 1: 3/3 (100%) — context levels, command registry, memory structure. Phase 2: 3/3 (100%) — component registry, confidence routing, history index. Phase 3: 2/2 (100%) — adaptive memory/compaction, truthfulness/autonomy hardening",
"next_up": "Pick the next OpenClaw gap milestone and create a scoped checklist (candidates: QMD backend, ClawHub registry, Bonjour/mDNS discovery)"
"next_up": "Pick the next OpenClaw gap milestone and create a scoped checklist (candidates: ClawHub registry, Bonjour/mDNS discovery, synthetic provider)"
},
"soul_md_and_cron_create": {
"date": "2026-02-11",