简介
基于 qmd CLI 的本地知识库搜索工具,支持 BM25、语义及混合检索模式,助您秒速定位笔记与文档。
原始描述
Search and retrieve markdown documents from local knowledge bases using qmd. Supports BM25 keyword search, vector semantic search, and hybrid search with LLM re-ranking. Use for querying indexed notes, documentation, meeting transcripts, and any markdown-based knowledge. Requires qmd CLI installed (bun install -g https://github.com/tobi/qmd).
通过你的 Agent 添加
安装目录:qmd/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: qmd
description: Local hybrid search for markdown notes and docs. Use when searching notes, finding related content, or retrieving documents from indexed collections.
qmd - Quick Markdown Search
Local search engine for Markdown notes, docs, and knowledge bases. Index once, search fast.
When to use (trigger phrases)
- "search my notes / docs / knowledge base"
- "find related notes"
- "retrieve a markdown document from my collection"
- "search local markdown files"
Default behavior (important)
- Prefer
qmd search (BM25). It's typically instant and should be the default.
- Use
qmd vsearch only when keyword search fails and you need semantic similarity (can be very slow on a cold start).
- Avoid
qmd query unless the user explicitly wants the highest quality hybrid results and can tolerate long runtimes/timeouts.
Search modes
Mode
Command
Speed
Use case
BM25 (default)
qmd search
Instant
Keyword matching
Vector
qmd vsearch
~1 min cold
Semantic similarity
Hybrid
qmd query
Slowest
LLM reranking (skip unless requested)
Common commands
qmd search "query" # default - fast keyword search
qmd search "query" -c notes # search specific collection
qmd search "query" -n 10 # more results
qmd search "query" --json # JSON output
qmd search "query" --all --files --min-score 0.3
Useful options
-n <num>: number of results
-c, --collection <name>: restrict to a collection
--all --min-score <num>: return all matches above a threshold
--json / --files: agent-friendly output formats
--full: return full document content
Retrieve documents
qmd get "path/to/file.md" # Full document
qmd get "#docid" # By ID from search results
qmd multi-get "journals/2025-05*.md"
qmd multi-get "doc1.md, doc2.md, #abc123" --json
Maintenance
qmd status # Index health
qmd update # Re-index changed files
qmd embed # Update embeddings
Setup (if not installed)
# Install
bun install -g https://github.com/tobi/qmd
# Create collection
qmd collection add /path/to/notes --name notes --mask "**/*.md"
qmd context add qmd://notes "Description of this collection" # optional
qmd embed # one-time to enable vector + hybrid search
Performance notes
qmd search is typically instant
qmd vsearch can be ~1 minute on cold start (loads local LLM for query expansion)
qmd query adds LLM reranking on top of vsearch, even slower
Common Pitfalls
Search query too vague (irrelevant results)
- Prefer
qmd search(BM25). It's typically instant and should be the default. - Use
qmd vsearchonly when keyword search fails and you need semantic similarity (can be very slow on a cold start). - Avoid
qmd queryunless the user explicitly wants the highest quality hybrid results and can tolerate long runtimes/timeouts.
Search modes
Mode
Command
Speed
Use case
BM25 (default)
qmd search
Instant
Keyword matching
Vector
qmd vsearch
~1 min cold
Semantic similarity
Hybrid
qmd query
Slowest
LLM reranking (skip unless requested)
Common commands
qmd search "query" # default - fast keyword search
qmd search "query" -c notes # search specific collection
qmd search "query" -n 10 # more results
qmd search "query" --json # JSON output
qmd search "query" --all --files --min-score 0.3
Useful options
-n <num>: number of results
-c, --collection <name>: restrict to a collection
--all --min-score <num>: return all matches above a threshold
--json / --files: agent-friendly output formats
--full: return full document content
Retrieve documents
qmd get "path/to/file.md" # Full document
qmd get "#docid" # By ID from search results
qmd multi-get "journals/2025-05*.md"
qmd multi-get "doc1.md, doc2.md, #abc123" --json
Maintenance
qmd status # Index health
qmd update # Re-index changed files
qmd embed # Update embeddings
Setup (if not installed)
# Install
bun install -g https://github.com/tobi/qmd
# Create collection
qmd collection add /path/to/notes --name notes --mask "**/*.md"
qmd context add qmd://notes "Description of this collection" # optional
qmd embed # one-time to enable vector + hybrid search
Performance notes
qmd search is typically instant
qmd vsearch can be ~1 minute on cold start (loads local LLM for query expansion)
qmd query adds LLM reranking on top of vsearch, even slower
Common Pitfalls
Search query too vague (irrelevant results)
| Mode | Command | Speed | Use case |
|---|---|---|---|
| BM25 (default) | qmd search |
Instant | Keyword matching |
| Vector | qmd vsearch |
~1 min cold | Semantic similarity |
| Hybrid | qmd query |
Slowest | LLM reranking (skip unless requested) |
qmd search "query" # default - fast keyword search
qmd search "query" -c notes # search specific collection
qmd search "query" -n 10 # more results
qmd search "query" --json # JSON output
qmd search "query" --all --files --min-score 0.3
Useful options
-n <num>: number of results
-c, --collection <name>: restrict to a collection
--all --min-score <num>: return all matches above a threshold
--json / --files: agent-friendly output formats
--full: return full document content
Retrieve documents
qmd get "path/to/file.md" # Full document
qmd get "#docid" # By ID from search results
qmd multi-get "journals/2025-05*.md"
qmd multi-get "doc1.md, doc2.md, #abc123" --json
Maintenance
qmd status # Index health
qmd update # Re-index changed files
qmd embed # Update embeddings
Setup (if not installed)
# Install
bun install -g https://github.com/tobi/qmd
# Create collection
qmd collection add /path/to/notes --name notes --mask "**/*.md"
qmd context add qmd://notes "Description of this collection" # optional
qmd embed # one-time to enable vector + hybrid search
Performance notes
qmd search is typically instant
qmd vsearch can be ~1 minute on cold start (loads local LLM for query expansion)
qmd query adds LLM reranking on top of vsearch, even slower
Common Pitfalls
Search query too vague (irrelevant results)
-n <num>: number of results-c, --collection <name>: restrict to a collection--all --min-score <num>: return all matches above a threshold--json / --files: agent-friendly output formats--full: return full document contentqmd get "path/to/file.md" # Full document
qmd get "#docid" # By ID from search results
qmd multi-get "journals/2025-05*.md"
qmd multi-get "doc1.md, doc2.md, #abc123" --json
Maintenance
qmd status # Index health
qmd update # Re-index changed files
qmd embed # Update embeddings
Setup (if not installed)
# Install
bun install -g https://github.com/tobi/qmd
# Create collection
qmd collection add /path/to/notes --name notes --mask "**/*.md"
qmd context add qmd://notes "Description of this collection" # optional
qmd embed # one-time to enable vector + hybrid search
Performance notes
qmd search is typically instant
qmd vsearch can be ~1 minute on cold start (loads local LLM for query expansion)
qmd query adds LLM reranking on top of vsearch, even slower
Common Pitfalls
Search query too vague (irrelevant results)
qmd status # Index health
qmd update # Re-index changed files
qmd embed # Update embeddings
# Install
bun install -g https://github.com/tobi/qmd
# Create collection
qmd collection add /path/to/notes --name notes --mask "**/*.md"
qmd context add qmd://notes "Description of this collection" # optional
qmd embed # one-time to enable vector + hybrid search
Performance notes
qmd search is typically instant
qmd vsearch can be ~1 minute on cold start (loads local LLM for query expansion)
qmd query adds LLM reranking on top of vsearch, even slower
Common Pitfalls
Search query too vague (irrelevant results)
qmd search is typically instantqmd vsearch can be ~1 minute on cold start (loads local LLM for query expansion)qmd query adds LLM reranking on top of vsearch, even slowerSearch query too vague (irrelevant results)
Problem: Broad queries like "notes" or "project" return hundreds of low-relevance matches.
Solution:
- Use specific keywords:
qmd search "Python async context managers"notqmd search "Python" - Combine keywords:
qmd search "deadline March quarterly review" - Use quotes for exact phrases:
qmd search "exact phrase match" - Check result scores:
qmd search "query" --all --min-score 0.5to filter low-confidence matches
Index not updated (missing recent files)
Problem: Newly created or recently modified files don't appear in search results.
Solution:
# Check index status
qmd status
# Re-index all changed files
qmd update
# Full re-index if update doesn't help
qmd collection remove <name>
qmd collection add /path/to/notes --name <name> --mask "**/*.md"
qmd embed # if vector search enabled
Path filters wrong (excluding relevant directories)
Problem: Search doesn't find files because the collection mask is too narrow or collection path is wrong.
Solution:
# List current collections
qmd status
# Verify collection path matches your notes location
# If path changed, re-add collection:
qmd collection remove <old-name>
qmd collection add /path/to/notes --name <name> --mask "**/*.md"
# Common issue: subdirectories excluded by mask
# If notes are in journals/2025/*, use: --mask "**/*.md"
# Not: --mask "*.md" (which only matches top level)
Search timeout on large vaults (performance issues)
Problem: qmd query or qmd vsearch hangs or times out on large knowledge bases (1000+ files).
Solution:
- Avoid
qmd queryon large vaults (LLM reranking is too slow) - Use
qmd searchinstead (BM25 is fast even on huge collections) - If semantic search needed, use
qmd vsearchwith-n 5to limit results - Restrict search scope with
-c <collection>to search one collection instead of all:qmd search "query" -c notes -n 5 # faster than searching all collections - If vault exceeds 5000 files, consider splitting into multiple collections
Missing configuration (qmd not initialized)
Problem: qmd status shows "No collections" or qmd search returns no results.
Solution:
# Install qmd if missing
bun install -g https://github.com/tobi/qmd
# Set up a collection
qmd collection add /path/to/notes --name notes --mask "**/*.md"
# Enable vector search (optional but recommended)
qmd embed
# Verify setup
qmd status # Should show your collection with file count
Semantic search returns irrelevant results (vsearch/query)
Problem: Vector search matches by topic but misses what you actually wanted.
Solution:
- Fall back to
qmd search(BM25 keyword matching is more precise for specific terms) - Rephrase query to include actual keywords: not "What are my goals?" but "goals quarterly review objectives"
- Use
qmd queryif available (adds LLM reranking), but only if you can tolerate slow runtime - Use
-n 3to get fewer, higher-confidence matches from vector search