Overview & Scope
This skill governs setting up, managing document collections, executing incremental updates, and querying local markdown documents using the QMD (Query Markup Documents) search engine. QMD combines lexical BM25 search, semantic vector search, and LLM re-ranking completely on-device without cloud dependencies.1. Multi-Project Collection Registration
Always register unique, project-scoped collection names to prevent collisions in~/.cache/qmd/index.sqlite:
2. Targeted Querying & Collection Scoping (Latency Optimization)
Utilize QMDβs-c <collection> scoping by default in local search scripts to minimize SQLite FTS5 query latency and eliminate cross-project search noise on large workspaces:
3. Incremental Indexing (Add, Modify, Delete Only)
QMD uses SHA-256 content hashes and mtime comparisons. It does NOT re-index or re-embed unchanged files:4. Hourly Cron Sync Setup
To keep on-device indices continuously updated across projects, configure a cron task runningqmd update and qmd embed:
Sync Script (~/.local/bin/qmd-sync-hourly.sh)
Register Crontab Job
5. Model Context Protocol (MCP) & FastMCP Integration
QMD provides two integration pathways for AI IDEs (Cursor / Claude Code / Gemini):A. Direct FastMCP Tool Integration (tools/mcp/server.py)
The DSOM FastMCP server exposes qmd_search directly to AI IDEs for seamless, on-device hybrid search across project collections (callers must explicitly specify the target collection parameter, e.g. collection="oss-docs", as scoping is not automatic):
B. Native QMD Stdio MCP Server
Configure~/.gemini/config/mcp_config.json or workspace mcp.json using the resolved binary path:
6. Turnkey AI Master Prompt
For immediate turnkey integration into new projects with AI agents, copy the prompt below:- IF ALREADY INSTALLED:
- Record the version (
qmd --version). - Ensure symbolic link exists for Antigravity agent:
- Skip to PHASE 3.
- Record the version (
PHASE 2: CLEAN INSTALLATION (IF NOT INSTALLED)
- IF NOT INSTALLED:
- Verify Node.js version is v22+ (
node -v). - Prepare root-conflict-free user directory:
- Download local quantized GGUF models:
- Create symbolic link for agent:
- Verify Node.js version is v22+ (
PHASE 3: COLLECTION SETTING
- Identify documentation and rule folders (
docs/,.agents/,notes/). - Register collections:
- Add human context summary:
- Generate embeddings:
PHASE 4: MCP PROTOCOL REGISTRATION
Add theqmd server to ~/.gemini/config/mcp_config.json using the executable path resolved during setup (e.g. qmd or $HOME/.npm-global/bin/qmd):
PHASE 5: VERIFICATION QUERY
- Test BM25 keyword query:
- Test semantic vector query: