# QMD - Quick Markdown Search Use Bun instead of Node.js (`bun` not `node`, `bun install` not `npm install`). ## Commands ```sh qmd add . # Index markdown files in current directory qmd status # Show index status and collections qmd update-all # Re-index all collections qmd embed # Generate vector embeddings (requires Ollama) qmd search # BM25 full-text search qmd vsearch # Vector similarity search qmd query # Hybrid search with reranking (best quality) qmd get # Get document content (fuzzy matches if not found) qmd multi-get # Get multiple docs by glob or comma-separated list ``` ## Options ```sh # Search & retrieval -c, --collection # Restrict search to a collection (matches pwd suffix) -n # Number of results --all # Return all matches --min-score # Minimum score threshold --full # Show full document content # Multi-get specific -l # Maximum lines per file --max-bytes # Skip files larger than this (default 10KB) # Output formats (search and multi-get) --json, --csv, --md, --xml, --files ``` ## Development ```sh bun qmd.ts # Run from source bun link # Install globally as 'qmd' ``` ## Architecture - SQLite FTS5 for full-text search (BM25) - sqlite-vec for vector similarity search - Ollama for embeddings (embeddinggemma) and reranking (qwen3-reranker) - Reciprocal Rank Fusion (RRF) for combining results ## Important: Do NOT run automatically - Never run `qmd add`, `qmd add-context`, `qmd embed`, or `qmd update-all` automatically - Never modify the SQLite database directly - Write out example commands for the user to run manually - Index is stored at `~/.cache/qmd/index.sqlite` ## Do NOT compile - Never run `bun build --compile` - it overwrites the shell wrapper and breaks sqlite-vec - The `qmd` file is a shell script that runs `bun qmd.ts` - do not replace it