You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,11 @@
8
8
9
9
### Fixes
10
10
11
+
- Skill: expand the packaged QMD skill with retrieval-first workflows, structured query examples, wiki/source collection guidance, and safe fallbacks when model-backed search is unavailable.
12
+
- Tests: make `bun run test` execute the local unit suite under both Node/Vitest and Bun (`test:node` + `test:bun`) so runtime-specific regressions are caught before CI.
13
+
- Model config: centralize embedding/rerank/generation model resolution so `qmd embed`, `status`, `query`, `vsearch`, `pull`, SDK vector search, and `bench` use the same active `.qmd/index.yaml` model hints and environment fallbacks.
14
+
- GPU/status: `qmd status` now uses the same embedding model identity as `qmd embed` when computing pending embeddings, so URI-backed embeddings are not incorrectly reported as pending under the legacy `embeddinggemma` alias.
15
+
- GPU status: `qmd status` now always shows GPU mode/configuration without unsafe native probing, and CPU-fallback warnings point to `QMD_STATUS_DEVICE_PROBE=1 qmd status` for an actual backend probe. The no-GPU warning is emitted once per process instead of once per LLM instance during benchmarks.
11
16
- GPU: add `QMD_FORCE_CPU=1` / `--no-gpu` to bypass CUDA/Vulkan/Metal probing entirely, and route native llama.cpp stdout noise to stderr so JSON output stays parseable during search/query commands.
12
17
- Snippet line numbers: `qmd_query` (MCP), HTTP `/query`, and `qmd query`
13
18
(CLI JSON output and snippet headers) now return absolute source-file
description: Search markdown knowledge bases, notes, and documentation using QMD. Use when users ask to search notes, find documents, or look up information.
3
+
description: Search local markdown knowledge bases, notes, docs, and wikis with QMD. Use when users ask to find notes, retrieve documents, inspect a wiki, answer from indexed markdown, or set up QMD access.
4
4
license: MIT
5
5
compatibility: Requires qmd CLI or MCP server. Install via `npm install -g @tobilu/qmd`.
6
6
metadata:
7
7
author: tobi
8
-
version: "2.0.0"
8
+
version: "2.1.0"
9
9
allowed-tools: Bash(qmd:*), mcp__qmd__*
10
10
---
11
11
12
-
# QMD - Quick Markdown Search
12
+
# QMD - Query Markdown Documents
13
13
14
-
Local search engine for markdown content.
14
+
QMD is a local search and retrieval engine for markdown collections: notes, docs,
15
+
wikis, transcripts, and project knowledge bases. Use it before generic web search
16
+
when the user is asking about something that may already live in their indexed
1.**Discover collections** with `qmd collection list` or `qmd ls`.
43
+
2.**Search first**, usually with a small result count.
44
+
3.**Retrieve source documents** with `qmd get` or `qmd multi-get`.
45
+
4.**Answer from the retrieved text**, citing file paths or docids.
46
+
5.**If results are weak**, rewrite the query using a different search mode.
48
47
49
-
**vec (semantic)**
50
-
- Full natural language question
51
-
- Be specific: `"how does the rate limiter handle burst traffic"`
52
-
- Include context: `"in the payment service, how are refunds processed"`
48
+
Do not answer from search-result snippets alone when the user needs substance.
49
+
Fetch the document.
53
50
54
-
**hyde (hypothetical document)**
55
-
- Write 50-100 words of what the *answer* looks like
56
-
- Use the vocabulary you expect in the result
51
+
## Search Modes
57
52
58
-
**expand (auto-expand)**
59
-
- Use a single-line query (implicit) or `expand: question` on its own line
60
-
- Lets the local LLM generate lex/vec/hyde variations
61
-
- Do not mix `expand:` with other typed lines — it's either a standalone expand query or a full query document
53
+
### Fast lexical search
62
54
63
-
### Intent (Disambiguation)
55
+
Use BM25 when you know names, exact terms, titles, identifiers, or code symbols:
64
56
65
-
When a query term is ambiguous, add `intent` to steer results:
57
+
```bash
58
+
qmd search "cockpit OKR Goodhart" -n 10
59
+
qmd search '"AI Before Headcount"' -c concepts -n 5
60
+
```
66
61
67
-
```json
68
-
{
69
-
"searches": [
70
-
{ "type": "lex", "query": "performance" }
71
-
],
72
-
"intent": "web page load times and Core Web Vitals"
73
-
}
62
+
Good `lex` queries are short: 2-6 discriminative terms, quoted phrases when exact,
63
+
and no filler words.
64
+
65
+
### Hybrid query search
66
+
67
+
Use `qmd query` when semantic recall, query expansion, vector search, or reranking
68
+
matters more than speed:
69
+
70
+
```bash
71
+
qmd query "decision quality depends on surfacing assumptions and context" -n 10
72
+
qmd query --json --explain "metrics as cockpit instruments but not OKRs"
74
73
```
75
74
76
-
Intent affects expansion, reranking, chunk selection, and snippet extraction. It does not search on its own — it's a steering signal that disambiguates queries like "performance" (web-perf vs team health vs fitness).
75
+
`qmd query` may initialize local models. If models/GPU are unavailable, slow, or
76
+
crashing, fall back to `qmd search` and use better lexical terms.
77
+
78
+
### Structured queries
77
79
78
-
### Combining Types
80
+
For subtle wiki/doc searches, structured queries are usually strongest:
79
81
80
-
| Goal | Approach |
81
-
|------|----------|
82
-
| Know exact terms |`lex` only |
83
-
| Don't know vocabulary | Use a single-line query (implicit `expand:`) or `vec`|
84
-
| Best recall |`lex` + `vec`|
85
-
| Complex topic |`lex` + `vec` + `hyde`|
86
-
| Ambiguous query | Add `intent` to any combination above |
82
+
```bash
83
+
qmd query $'intent: Find the concept note about metrics as instruments without letting OKRs replace judgment.\nlex: cockpit instruments OKR Goodhart metrics judgment\nvec: data informed not metric driven product judgment\nhyde: A concept note says metrics are useful like cockpit instruments, but leaders should remain data-informed rather than metric-driven because OKRs and dashboards can Goodhart product judgment.'
84
+
```
87
85
88
-
First query gets 2x weight in fusion — put your best guess first.
86
+
Use this pattern when the user's wording is indirect:
89
87
90
-
### Lex Query Syntax
88
+
-`intent:` disambiguates the target.
89
+
-`lex:` anchors exact names, phrases, aliases, and rare terms.
90
+
-`vec:` adds the semantic paraphrase.
91
+
-`hyde:` describes the document that would answer the query.
91
92
92
-
| Syntax | Meaning | Example |
93
-
|--------|---------|---------|
94
-
|`term`| Prefix match |`perf` matches "performance" |
95
-
|`"phrase"`| Exact phrase |`"rate limiter"`|
96
-
|`-term`| Exclude |`performance -sports`|
93
+
Put the best query first; early searches receive more weight in fusion.
97
94
98
-
Note: `-term` only works in lex queries, not vec/hyde.
95
+
## MCP Tool: `query`
99
96
100
-
### Collection Filtering
97
+
When using the MCP server, prefer structured searches:
{ "type": "hyde", "query": "A concept note explains that metrics are useful as instruments, but leaders should not let OKRs or dashboards replace judgment." }
105
+
],
106
+
"intent": "Find the concept note about using metrics as instruments without becoming metric-driven.",
107
+
"collections": ["concepts"],
108
+
"limit": 10
109
+
}
105
110
```
106
111
107
-
Omit to search all collections.
112
+
### Query Types
113
+
114
+
-`lex` — BM25 keyword search. Best for exact terms, names, titles, and code.
115
+
-`vec` — vector semantic search. Best for natural-language concepts.
116
+
-`hyde` — vector search using a hypothetical answer/document passage.
117
+
118
+
## Retrieval Commands
108
119
109
-
## Other MCP Tools
120
+
```bash
121
+
qmd get "#abc123"# retrieve by docid
122
+
qmd get qmd://concepts/ai-before-headcount.md --full
qmd search '"arm the rebels" merchants tools big companies' -c concepts
153
+
154
+
# Semantic concept lookup
155
+
qmd query $'intent: Find the customer proximity concept, not generic customer delight.\nlex: support pseudonymous merchant customer interviews\nvec: founder stays close to merchant reality through support and product use'
0 commit comments