tobi / qmd
git clone https://github.com/tobi/qmd.git
v2.8.3 · 2mo ago
mini cli search engine for your docs, knowledge bases, meeting notes, whatever. Tracking current sota approaches while being all local
+7
stars, 24h · #2,092
+~49
stars, 7 days · #2,607
+~210
stars, 30 days · #2,549
31k
★ total · +0% this week
1.9k
forks · 231 open issues
Star history (as recorded here)
LanguageTypeScript
LicenseMIT
Created2025-12-08 (10mo ago)
Last push8d ago
Watchers107
OwnerUser
Links
- GitHub: github.com/tobi/qmd
- Releases · Issues · Hacker News mentions
README excerpt
# QMD - Query Markup Documents An on-device search engine for everything you need to remember. Index your markdown notes, meeting transcripts, documentation, and knowledge bases. Search with keywords or natural language. Ideal for your agentic flows. QMD combines BM25 full-text search, vector semantic search, and LLM re-ranking—all running locally via node-llama-cpp with GGUF models. [code] Typed expansions are routed exclusively: `lex` → BM25/FTS, `vec` and `hyde` → vector search. The original query is sent to both backends, then fused with RRF and reranked. You can read more about QMD's progress in the CHANGELOG. ## Quick Start [code] ### Using with AI Agents QMD's `--json` and `--files` output formats are designed for agentic workflows: [code] ### MCP Server Although the tool works perfectly fine when you just tell your agent to use it on the command line, it also exposes an MCP (Model Context Protocol) server for tighter integration. **Tools exposed:** - `query` — Search with typed sub-queries (`lex`/`vec`/`hyde`), combined via RRF + reranking - `get` — Retrieve a document by path or docid (with fuzzy matching suggestions) - `multi_get` — Batch retrieve by glob pattern, comma-separated list, or docids - `status` — Index health and collection info, including each collection's top metadata keys - `metadata` — Discover metadata keys, types, and value counts to filter on **Claude Desktop configuration** (`~/Library/Application Support/Claude/claude_desktop_config.json`): [code] **Claude Code** — Install the plugin (recommended): [code] Or configure MCP manually in `~/.claude/settings.json`: [code] #### HTTP Transport By default, QMD's MCP server uses stdio (launched as a subprocess by each client). For a shared, long-lived server that avoids repeated model loading, use the HTTP transport: [code] The server binds to `localhost` by default. Pass `--host` (or set the `QMD_HOST` environment variable) to override — `--host 0.0.0.0` is useful when the server runs in a container and a liveness probe connects from a non-loopback address. The HTTP server exposes two endpoints: - `POST /mcp` — MCP Streamable HTTP (JSON responses, stateless) - `POST /query` (alias `/search`) — structured search without the MCP protocol. Accepts the same optional `filter` object as the `query` tool (invalid filters return `400`); see Metadata Filtering - `POST /metadata` — metadata discovery without the MCP protocol. Same body as the `metadata` tool (invalid filters return `400`); see Metadata Discovery - `GET /health` — liveness check with uptime ##### Origin and Host validation Every request is screened before routing: a request carrying an `Origin` header that does not name a loopback address is rejected with `403`, as is a `Host` header naming something other than the address the server is bound to. This is what stops a web page you visit from reading your index through DNS rebinding — loopback binding alone does not, since the browser makes the request fro