What It Does
It lets you build searchable collections from local directories — including filtered subsets by glob mask — and query them from the command line or expose them via an MCP server. Embeddings and reranking are powered by a local Ollama instance, keeping everything on-device.
`qmd` is a local file indexing and search CLI that combines BM25 keyword search, vector (semantic) search, and hybrid reranking into a single tool.
Key Features
- Multiple Search Modes — Supports BM25 keyword search (`qmd search`), pure vector/semantic search (`qmd vsearch`), and hybrid search with reranking (`qmd query`) so you can choose the right retrieval strategy for your use case.
- Named Collections with Glob Filtering — Add any local directory as a named collection and optionally restrict which files are indexed using a glob mask (e.g. `**/*.md`). Manage multiple independent indexes side by side.
- MCP Server Mode — Run `qmd mcp` to expose your local search index as an MCP (Model Context Protocol) server, allowing AI agents and compatible tools to query your local knowledge base programmatically.
- Local-Only, Privacy-First — All indexing and embeddings are computed locally. The search index is stored under `~/.cache/qmd` by default, and embeddings/reranking use a locally running Ollama instance — no data leaves your machine.
- Targeted Document Retrieval — Fetch a specific range of lines from an indexed document with `qmd get <path>:<line> -l <count>`, useful for retrieving precise context from large files.
Requirements
- **Ollama** *(required for vector search and reranking)* — Must be running locally. Configure the endpoint via `OLLAMA_URL` (default: `http://localhost:11434`).
Use Cases
- Personal knowledge base search — Index a local Obsidian vault or notes folder and run hybrid queries to surface the most relevant notes by both keyword and semantic meaning, entirely offline.
- AI agent local context retrieval — Start `qmd mcp` and connect an AI agent to your local document index via MCP, giving it the ability to retrieve relevant file excerpts as context without external API calls.
- Project documentation search — Add a project's `docs/` directory as a collection with a `**/*.md` mask and use `qmd query` to quickly find the most relevant documentation pages during development.