--- name: semantic-search description: MUST use before reading or grepping code whenever the exact symbol, file, or string is not already known - concept questions, unfamiliar areas, "where/how is X done", and bug reports that describe behavior. Use rg only for known identifiers, paths, or exact strings. --- # Semantic Search Search the current Git repository, plus the user's registered QMD collections, by meaning. QMD runs locally with Qwen3-Embedding-0.6B, Qwen3-Reranker-0.6B, and QMD Query Expansion 1.7B; a background daemon keeps them loaded. ## Rule Run this search first whenever you do not already know the exact identifier, path, or string. Do not start with `rg` guesses for a concept. `rg` comes after the search, for callers and tests of verified hits. ## Run The same command works in Bash and PowerShell: node "$HOME/.my-ai-configuration/qmd/qmd-search.mjs" --query "" --top-k 5 Output: JSON list of `{path, line, score, snippet}`, best first. Repository paths are relative to the repository root; hits from other collections are `qmd:///`. ## Use the results 1. Phrase the query as a full question about behavior, not a keyword list. 2. Open the top hits and verify them against the current files before acting. 3. Follow verified hits with `rg` for their symbols to find callers and tests. 4. If no hit is relevant, run one rephrased search before switching to `rg`. ## Failure If the command exits non-zero, continue with `rg` and state the limitation in one sentence.