Skip to main content

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 (Avoiding Cross-Project Clutter)

Target queries using -c <collection> when working within a specific project:

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 running qmd update and qmd embed:

Sync Script (~/.local/bin/qmd-sync-hourly.sh)

Register Crontab Job


5. Model Context Protocol (MCP) Integration

Configure ~/.gemini/config/mcp_config.json or project mcp.json using the executable path resolved during setup (e.g. qmd on PATH or $HOME/.npm-global/bin/qmd):

6. Turnkey AI Master Prompt

For immediate turnkey integration into new projects with AI agents, copy the prompt below:
  1. IF ALREADY INSTALLED:
    • Record the version (qmd --version).
    • Ensure symbolic link exists for Antigravity agent:
    • Skip to PHASE 3.

PHASE 2: CLEAN INSTALLATION (IF NOT INSTALLED)

  1. 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:

PHASE 3: COLLECTION SETTING

  1. Identify documentation and rule folders (docs/, .agents/, notes/).
  2. Register collections:
  3. Add human context summary:
  4. Generate embeddings:

PHASE 4: MCP PROTOCOL REGISTRATION

Add the qmd 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

  1. Test BM25 keyword query:
  2. Test semantic vector query: