ScriptsJun 1, 2026·3 min read

qmd — Mini CLI Search Engine for Your Docs and Knowledge Bases

A fast local-first CLI search engine that indexes your documents, meeting notes, and knowledge bases for instant retrieval, tracking state-of-the-art approaches while keeping everything on your machine.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 29/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
CLI Tool
Install
Single
Trust
Trust: Established
Entrypoint
qmd Overview
Safe staging command
npx -y tokrepo@latest install f223049c-5df6-11f1-9bc6-00163e2b0d79 --target codex

Stages files first; activation requires review of the staged README and plan.

Introduction

qmd is a lightweight CLI search engine that indexes your local documents, meeting notes, knowledge bases, and other text files. It tracks current state-of-the-art retrieval approaches while being entirely local — no data leaves your machine.

What qmd Does

  • Indexes local directories of Markdown, text, PDF, and other document formats
  • Provides fast full-text and semantic search from the command line
  • Maintains an incremental index that updates as files change
  • Returns ranked results with contextual snippets
  • Works entirely offline with no cloud dependencies

Architecture Overview

qmd is a TypeScript application that builds a local search index over your documents. It combines traditional full-text indexing with modern embedding-based semantic search for high-quality retrieval. The index is stored locally and updated incrementally when files change. Search queries run against both indexes and results are merged using a hybrid ranking strategy. The CLI outputs results with highlighted snippets and relevance scores.

Self-Hosting & Configuration

  • Install globally via npm or download a standalone binary
  • Index any directory with qmd index <path>
  • Configure which file types to include/exclude in .qmdrc
  • Set the embedding model for semantic search (local or API-based)
  • Index auto-updates on subsequent runs — only changed files are reprocessed

Key Features

  • Hybrid search combining full-text and semantic retrieval
  • Fully local — no data sent to external services
  • Incremental indexing for fast updates on large document collections
  • Supports Markdown, plain text, PDF, and common document formats
  • Minimal setup with sensible defaults

Comparison with Similar Tools

  • grep/ripgrep — pattern matching on raw text; qmd provides ranked semantic search
  • Elasticsearch — enterprise search server; qmd is a lightweight local CLI tool
  • Obsidian Search — built into the Obsidian app; qmd works across any directory
  • RAGFlow — full RAG pipeline with LLM; qmd focuses on retrieval, not generation

FAQ

Q: How large a document collection can qmd handle? A: It is designed for personal and team-scale collections (thousands to tens of thousands of documents). It is not built for enterprise-scale corpora.

Q: Does it require a GPU for semantic search? A: No. It can use small local embedding models that run on CPU. Optionally, you can configure an API-based embedder for higher quality.

Q: Can I use it with AI coding agents? A: Yes. The JSON output mode makes it easy for agents to query your docs programmatically.

Q: Is it open source? A: Yes. qmd is fully open source and available on GitHub.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets