Skip to main content
This guide details how to install, configure, and operate QMD (Query Markup Documents)—an on-device, hybrid search engine combining BM25 lexical search, semantic vector embeddings (via GGUF / node-llama-cpp), and LLM re-ranking without any cloud dependencies.

Prerequisites

  • Linux or WSL2 (Ubuntu / AlmaLinux) environment.
  • Node.js v22+ and npm.
  • crontab utility for automated background synchronization.

1. Clean Installation Without Root Conflicts

To prevent root permission issues during global NPM package installation, configure a user-scoped NPM directory (~/.npm-global).

2. Multi-Project Collection Registration

Register unique collection names for each project workspace to prevent index collisions in ~/.cache/qmd/index.sqlite.

3. Incremental Indexing Routines

QMD uses SHA-256 content hashes and file modification timestamps (mtime) to perform fast incremental scans. Unchanged files are skipped automatically during embedding calculations.

4. Automated Hourly Background Sync

To guarantee that on-device search indices remain updated without manual intervention, configure an automated hourly cron job.

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

Install Crontab Job


5. Model Context Protocol (MCP) Server Setup

Register QMD as an MCP tool server for AI agents in ~/.gemini/config/mcp_config.json or workspace mcp.json. Resolve the executable path dynamically via command -v qmd or fallback to $HOME/.npm-global/bin/qmd:
In mcp_config.json, configure the server command with the resolved path stored in $QMD_PATH (e.g. /home/user/.npm-global/bin/qmd or /usr/local/bin/qmd):
Set secure file permissions:

6. Verification and Querying

Execute verification queries to confirm proper indexation:

Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-10-09 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0