AgentSkillsCN

qmd

使用 qmd 从本地知识库中搜索并检索 Markdown 文档。支持 BM25 关键词搜索、向量语义搜索,以及结合 LLM 重排序的混合搜索。可用于查询已索引的笔记、文档、会议记录,以及任何基于 Markdown 的知识内容。需先安装 qmd CLI(bun install -g https://github.com/tobi/qmd)。

SKILL.md
--- frontmatter
name: qmd
description: 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).

QMD - Local Markdown Search

Search and retrieve documents from locally indexed markdown knowledge bases.

Installation

bash
bun install -g https://github.com/tobi/qmd

Setup

bash
# Add a collection
qmd collection add ~/notes --name notes

# Generate embeddings (required for vsearch/query)
qmd embed

Usage Rules

Always use --json flag for structured output when invoking qmd commands.

Search Commands

search (BM25 keyword search - fast)

bash
qmd search "authentication flow" --json
qmd search "error handling" --json -n 10
qmd search "config" --json -c notes

vsearch (vector semantic search)

bash
qmd vsearch "how does login work" --json
qmd vsearch "authentication best practices" --json -n 20

query (hybrid with LLM re-ranking - best quality)

bash
qmd query "implementing user auth" --json
qmd query "deployment process" --json --min-score 0.5

Search Options

OptionDescription
-n NUMNumber of results (default: 5, or 20 with --json)
-c, --collection NAMERestrict to specific collection
--min-score NUMMinimum score threshold
--allReturn all matches

Retrieval Commands

get (single document)

bash
qmd get docs/guide.md --json
qmd get "#a1b2c3" --json
qmd get notes/meeting.md:50 -l 100 --json

multi-get (multiple documents)

bash
qmd multi-get "docs/*.md" --json
qmd multi-get "api.md, guide.md, #abc123" --json
qmd multi-get "notes/**/*.md" --json --max-bytes 20480

Info Commands

bash
qmd status
qmd collection list

Search Mode Selection

ModeSpeedQualityBest For
searchFastGoodExact keywords, known terms
vsearchMediumBetterConceptual queries, synonyms
querySlowBestComplex questions, uncertain terms

MCP Server

qmd can run as an MCP server for direct integration:

bash
qmd mcp

Exposes tools: qmd_search, qmd_vsearch, qmd_query, qmd_get, qmd_multi_get, qmd_status