QMD: Local semantic search saves coding agents up to 55% of search tokens
ievkz · reddit · 2026-11-16
A Reddit user observed that coding agents burn lots of tokens running find, rg --files, and grep before every task, and tested whether local semantic search could replace that — cutting token usage by up to 55%.
The setup uses the open-source QMD (Query Markup Documents) CLI, which indexes documents and offers three search modes: fast keyword search, semantic search, and hybrid + reranking (best quality). The hybrid mode uses three small local models:
- embeddinggemma-300M: computes embedding vectors for indexing (300MB)
- qwen3-reranker-0.6b: reranks results by semantic similarity (640MB)
- qmd-query-expansion-1.7B: expands one query into several (1.1GB)
Workflow: add source files via qmd collection add (you can show the example to your agent and let it pick folders/extensions), build the index with qmd update && qmd embed, then add rules to AGENTS.md: read files directly when the path is known, use rg/LSP for known identifiers, and use qmd query only when only the behavior is known.
Key rules: QMD replaces the initial broad search rather than adding a step; use specific English technical queries; read only relevant sections of the top 3–5 files; refine the query or raise -n to 60 before falling back to rg/LSP.
More from coding & agent
- ICL alone may enable substantial continual learning, plot shows agents improve by Month 3 — xennygrimmato_ · 2026-11-16
- Solo dev ships products daily with a Claude + Codex pipeline, 35k users — cneuralnetwork · 2026-11-16
- Kids Build Games and Make Robots Sing at AGNTCon Kids Day with goose AI — steveonjava · 2026-11-16
- Anthropic Academy offers 13 free Claude courses, all with certificates — nikola_mr64990 · 2026-11-16
- Apple's Xcode 27.3 beta adds GitHub Copilot support and in-app Siri AI testing — iamfakhrealam · 2026-11-16
- macOS 27.3 renders Markdown natively in Quick Look; Siri AI skills use SKILL.md — iamfakhrealam · 2026-11-16