[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71FQHAR5FXGX2JP869CE8B9":3,"skill-same:01M71FQHAR5FXGX2JP869CE8B9":82},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":13,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":67,"install":68,"resources":81},"01M71FQHAR5FXGX2JP869CE8B9","qmd",null,"Search personal knowledge bases, notes, docs, and meeting transcripts locally using qmd — a hybrid retrieval engine with BM25, vector search, and LLM reranking. Supports CLI and MCP integration.","gjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6","gjbvsjjvgm-sketch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F278511911?v=4","01M71F3JXKZQ70H2KCHHTXKZDA","01M71F3JY8A79Z3NZBW08TF4JD",0,"MIT","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes-agent\u002Foptional-skills\u002Fresearch\u002Fqmd\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[5,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"integration","hybrid","meeting","transcripts","bm25","knowledge-base","local","engine","knowledge","MCP Integration","MCP","vector","search","rag","notes","obsidian","cli","macos","personal","2026-11-10 10:12:30",false,"---\nname: qmd\ndescription: Search personal knowledge bases, notes, docs, and meeting transcripts locally using qmd — a hybrid retrieval engine with BM25, vector search, and LLM reranking. Supports CLI and MCP integration.\nversion: 1.0.0\nauthor: YOUSEF SHTIWE + Teknium\nlicense: MIT\nplatforms: [macos, linux]\nmetadata:\n  hermes:\n    tags: [Search, Knowledge-Base, RAG, Notes, MCP, Local-AI]\n    related_skills: [obsidian, native-mcp, arxiv]\n---\n\n# QMD — Query Markup Documents\n\nLocal, on-device search engine for personal knowledge bases. Indexes markdown\nnotes, meeting transcripts, documentation, and any text-based files, then\nprovides hybrid search combining keyword matching, semantic understanding, and\nLLM-powered reranking — all running locally with no cloud dependencies.\n\nCreated by [Tobi Lütke](https:\u002F\u002Fgithub.com\u002Ftobi\u002Fqmd). MIT licensed.\n\n## When to Use\n\n- User asks to search their notes, docs, knowledge base, or meeting transcripts\n- User wants to find something across a large collection of markdown\u002Ftext files\n- User wants semantic search (\"find notes about X concept\") not just keyword grep\n- User has already set up qmd collections and wants to query them\n- User asks to set up a local knowledge base or document search system\n- Keywords: \"search my notes\", \"find in my docs\", \"knowledge base\", \"qmd\"\n\n## Prerequisites\n\n### Node.js >= 22 (required)\n\n```bash\n# Check version\nnode --version  # must be >= 22\n\n# macOS — install or upgrade via Homebrew\nbrew install node@22\n\n# Linux — use NodeSource or nvm\ncurl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_22.x | sudo -E bash -\nsudo apt-get install -y nodejs\n# or with nvm:\nnvm install 22 && nvm use 22\n```\n\n### SQLite with Extension Support (macOS only)\n\nmacOS system SQLite lacks extension loading. Install via Homebrew:\n\n```bash\nbrew install sqlite\n```\n\n### Install qmd\n\n```bash\nnpm install -g @tobilu\u002Fqmd\n# or with Bun:\nbun install -g @tobilu\u002Fqmd\n```\n\nFirst run auto-downloads 3 local GGUF models (~2GB total):\n\n| Model | Purpose | Size |\n|-------|---------|------|\n| embeddinggemma-300M-Q8_0 | Vector embeddings | ~300MB |\n| qwen3-reranker-0.6b-q8_0 | Result reranking | ~640MB |\n| qmd-query-expansion-1.7B | Query expansion | ~1.1GB |\n\n### Verify Installation\n\n```bash\nqmd --version\nqmd status\n```\n\n## Quick Reference\n\n| Command | What It Does | Speed |\n|---------|-------------|-------|\n| `qmd search \"query\"` | BM25 keyword search (no models) | ~0.2s |\n| `qmd vsearch \"query\"` | Semantic vector search (1 model) | ~3s |\n| `qmd query \"query\"` | Hybrid + reranking (all 3 models) | ~2-3s warm, ~19s cold |\n| `qmd get \u003Cdocid>` | Retrieve full document content | instant |\n| `qmd multi-get \"glob\"` | Retrieve multiple files | instant |\n| `qmd collection add \u003Cpath> --name \u003Cn>` | Add a directory as a collection | instant |\n| `qmd context add \u003Cpath> \"description\"` | Add context metadata to improve retrieval | instant |\n| `qmd embed` | Generate\u002Fupdate vector embeddings | varies |\n| `qmd status` | Show index health and collection info | instant |\n| `qmd mcp` | Start MCP server (stdio) | persistent |\n| `qmd mcp --http --daemon` | Start MCP server (HTTP, warm models) | persistent |\n\n## Setup Workflow\n\n### 1. Add Collections\n\nPoint qmd at directories containing your documents:\n\n```bash\n# Add a notes directory\nqmd collection add ~\u002Fnotes --name notes\n\n# Add project docs\nqmd collection add ~\u002Fprojects\u002Fmyproject\u002Fdocs --name project-docs\n\n# Add meeting transcripts\nqmd collection add ~\u002Fmeetings --name meetings\n\n# List all collections\nqmd collection list\n```\n\n### 2. Add Context Descriptions\n\nContext metadata helps the search engine understand what each collection\ncontains. This significantly improves retrieval quality:\n\n```bash\nqmd context add qmd:\u002F\u002Fnotes \"Personal notes, ideas, and journal entries\"\nqmd context add qmd:\u002F\u002Fproject-docs \"Technical documentation for the main project\"\nqmd context add qmd:\u002F\u002Fmeetings \"Meeting transcripts and action items from team syncs\"\n```\n\n### 3. Generate Embeddings\n\n```bash\nqmd embed\n```\n\nThis processes all documents in all collections and generates vector\nembeddings. Re-run after adding new documents or collections.\n\n### 4. Verify\n\n```bash\nqmd status   # shows index health, collection stats, model info\n```\n\n## Search Patterns\n\n### Fast Keyword Search (BM25)\n\nBest for: exact terms, code identifiers, names, known phrases.\nNo models loaded — near-instant results.\n\n```bash\nqmd search \"authentication middleware\"\nqmd search \"handleError async\"\n```\n\n### Semantic Vector Search\n\nBest for: natural language questions, conceptual queries.\nLoads embedding model (~3s first query).\n\n```bash\nqmd vsearch \"how does the rate limiter handle burst traffic\"\nqmd vsearch \"ideas for improving onboarding flow\"\n```\n\n### Hybrid Search with Reranking (Best Quality)\n\nBest for: important queries where quality matters most.\nUses all 3 models — query expansion, parallel BM25+vector, reranking.\n\n```bash\nqmd query \"what decisions were made about the database migration\"\n```\n\n### Structured Multi-Mode Queries\n\nCombine different search types in a single query for precision:\n\n```bash\n# BM25 for exact term + vector for concept\nqmd query $'lex: rate limiter\\nvec: how does throttling work under load'\n\n# With query expansion\nqmd query $'expand: database migration plan\\nlex: \"schema change\"'\n```\n\n### Query Syntax (lex\u002FBM25 mode)\n\n| Syntax | Effect | Example |\n|--------|--------|---------|\n| `term` | Prefix match | `perf` matches \"performance\" |\n| `\"phrase\"` | Exact phrase | `\"rate limiter\"` |\n| `-term` | Exclude term | `performance -sports` |\n\n### HyDE (Hypothetical Document Embeddings)\n\nFor complex topics, write what you expect the answer to look like:\n\n```bash\nqmd query $'hyde: The migration plan involves three phases. First, we add the new columns without dropping the old ones. Then we backfill data. Finally we cut over and remove legacy columns.'\n```\n\n### Scoping to Collections\n\n```bash\nqmd search \"query\" --collection notes\nqmd query \"query\" --collection project-docs\n```\n\n### Output Formats\n\n```bash\nqmd search \"query\" --json        # JSON output (best for parsing)\nqmd search \"query\" --limit 5     # Limit results\nqmd get \"#abc123\"                # Get by document ID\nqmd get \"path\u002Fto\u002Ffile.md\"       # Get by file path\nqmd get \"file.md:50\" -l 100     # Get specific line range\nqmd multi-get \"journals\u002F*.md\" --json  # Batch retrieve by glob\n```\n\n## MCP Integration (Recommended)\n\nqmd exposes an MCP server that provides search tools directly to\nYOUSEF SHTIWE via the native MCP client. This is the preferred\nintegration — once configured, the agent gets qmd tools automatically\nwithout needing to load this skill.\n\n### Option A: Stdio Mode (Simple)\n\nAdd to `~\u002F.yousef\u002Fconfig.yaml`:\n\n```yaml\nmcp_servers:\n  qmd:\n    command: \"qmd\"\n    args: [\"mcp\"]\n    timeout: 30\n    connect_timeout: 45\n```\n\nThis registers tools: `mcp_qmd_search`, `mcp_qmd_vsearch`,\n`mcp_qmd_deep_search`, `mcp_qmd_get`, `mcp_qmd_status`.\n\n**Tradeoff:** Models load on first search call (~19s cold start),\nthen stay warm for the session. Acceptable for occasional use.\n\n### Option B: HTTP Daemon Mode (Fast, Recommended for Heavy Use)\n\nStart the qmd daemon separately — it keeps models warm in memory:\n\n```bash\n# Start daemon (persists across agent restarts)\nqmd mcp --http --daemon\n\n# Runs on http:\u002F\u002Flocalhost:8181 by default\n```\n\nThen configure YOUSEF SHTIWE to connect via HTTP:\n\n```yaml\nmcp_servers:\n  qmd:\n    url: \"http:\u002F\u002Flocalhost:8181\u002Fmcp\"\n    timeout: 30\n```\n\n**Tradeoff:** Uses ~2GB RAM while running, but every query is fast\n(~2-3s). Best for users who search frequently.\n\n### Keeping the Daemon Running\n\n#### macOS (launchd)\n\n```bash\ncat > ~\u002FLibrary\u002FLaunchAgents\u002Fcom.qmd.daemon.plist \u003C\u003C 'EOF'\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\"\n  \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n  \u003Ckey>Label\u003C\u002Fkey>\n  \u003Cstring>com.qmd.daemon\u003C\u002Fstring>\n  \u003Ckey>ProgramArguments\u003C\u002Fkey>\n  \u003Carray>\n    \u003Cstring>qmd\u003C\u002Fstring>\n    \u003Cstring>mcp\u003C\u002Fstring>\n    \u003Cstring>--http\u003C\u002Fstring>\n    \u003Cstring>--daemon\u003C\u002Fstring>\n  \u003C\u002Farray>\n  \u003Ckey>RunAtLoad\u003C\u002Fkey>\n  \u003Ctrue\u002F>\n  \u003Ckey>KeepAlive\u003C\u002Fkey>\n  \u003Ctrue\u002F>\n  \u003Ckey>StandardOutPath\u003C\u002Fkey>\n  \u003Cstring>\u002Ftmp\u002Fqmd-daemon.log\u003C\u002Fstring>\n  \u003Ckey>StandardErrorPath\u003C\u002Fkey>\n  \u003Cstring>\u002Ftmp\u002Fqmd-daemon.log\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\nEOF\n\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.qmd.daemon.plist\n```\n\n#### Linux (systemd user service)\n\n```bash\nmkdir -p ~\u002F.config\u002Fsystemd\u002Fuser\n\ncat > ~\u002F.config\u002Fsystemd\u002Fuser\u002Fqmd-daemon.service \u003C\u003C 'EOF'\n[Unit]\nDescription=QMD MCP Daemon\nAfter=network.target\n\n[Service]\nExecStart=qmd mcp --http --daemon\nRestart=on-failure\nRestartSec=10\nEnvironment=PATH=\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fbin:\u002Fbin\n\n[Install]\nWantedBy=default.target\nEOF\n\nsystemctl --user daemon-reload\nsystemctl --user enable --now qmd-daemon\nsystemctl --user status qmd-daemon\n```\n\n### MCP Tools Reference\n\nOnce connected, these tools are available as `mcp_qmd_*`:\n\n| MCP Tool | Maps To | Description |\n|----------|---------|-------------|\n| `mcp_qmd_search` | `qmd search` | BM25 keyword search |\n| `mcp_qmd_vsearch` | `qmd vsearch` | Semantic vector search |\n| `mcp_qmd_deep_search` | `qmd query` | Hybrid search + reranking |\n| `mcp_qmd_get` | `qmd get` | Retrieve document by ID or path |\n| `mcp_qmd_status` | `qmd status` | Index health and stats |\n\nThe MCP tools accept structured JSON queries for multi-mode search:\n\n```json\n{\n  \"searches\": [\n    {\"type\": \"lex\", \"query\": \"authentication middleware\"},\n    {\"type\": \"vec\", \"query\": \"how user login is verified\"}\n  ],\n  \"collections\": [\"project-docs\"],\n  \"limit\": 10\n}\n```\n\n## CLI Usage (Without MCP)\n\nWhen MCP is not configured, use qmd directly via terminal:\n\n```\nterminal(command=\"qmd query 'what was decided about the API redesign' --json\", timeout=30)\n```\n\nFor setup and management tasks, always use terminal:\n\n```\nterminal(command=\"qmd collection add ~\u002FDocuments\u002Fnotes --name notes\")\nterminal(command=\"qmd context add qmd:\u002F\u002Fnotes 'Personal research notes and ideas'\")\nterminal(command=\"qmd embed\")\nterminal(command=\"qmd status\")\n```\n\n## How the Search Pipeline Works\n\nUnderstanding the internals helps choose the right search mode:\n\n1. **Query Expansion** — A fine-tuned 1.7B model generates 2 alternative\n   queries. The original gets 2x weight in fusion.\n2. **Parallel Retrieval** — BM25 (SQLite FTS5) and vector search run\n   simultaneously across all query variants.\n3. **RRF Fusion** — Reciprocal Rank Fusion (k=60) merges results.\n   Top-rank bonus: #1 gets +0.05, #2-3 get +0.02.\n4. **LLM Reranking** — qwen3-reranker scores top 30 candidates (0.0-1.0).\n5. **Position-Aware Blending** — Ranks 1-3: 75% retrieval \u002F 25% reranker.\n   Ranks 4-10: 60\u002F40. Ranks 11+: 40\u002F60 (trusts reranker more for long tail).\n\n**Smart Chunking:** Documents are split at natural break points (headings,\ncode blocks, blank lines) targeting ~900 tokens with 15% overlap. Code\nblocks are never split mid-block.\n\n## Best Practices\n\n1. **Always add context descriptions** — `qmd context add` dramatically\n   improves retrieval accuracy. Describe what each collection contains.\n2. **Re-embed after adding documents** — `qmd embed` must be re-run when\n   new files are added to collections.\n3. **Use `qmd search` for speed** — when you need fast keyword lookup\n   (code identifiers, exact names), BM25 is instant and needs no models.\n4. **Use `qmd query` for quality** — when the question is conceptual or\n   the user needs the best possible results, use hybrid search.\n5. **Prefer MCP integration** — once configured, the agent gets native\n   tools without needing to load this skill each time.\n6. **Daemon mode for frequent users** — if the user searches their\n   knowledge base regularly, recommend the HTTP daemon setup.\n7. **First query in structured search gets 2x weight** — put the most\n   important\u002Fcertain query first when combining lex and vec.\n\n## Troubleshooting\n\n### \"Models downloading on first run\"\nNormal — qmd auto-downloads ~2GB of GGUF models on first use.\nThis is a one-time operation.\n\n### Cold start latency (~19s)\nThis happens when models aren't loaded in memory. Solutions:\n- Use HTTP daemon mode (`qmd mcp --http --daemon`) to keep warm\n- Use `qmd search` (BM25 only) when models aren't needed\n- MCP stdio mode loads models on first search, stays warm for session\n\n### macOS: \"unable to load extension\"\nInstall Homebrew SQLite: `brew install sqlite`\nThen ensure it's on PATH before system SQLite.\n\n### \"No collections found\"\nRun `qmd collection add \u003Cpath> --name \u003Cname>` to add directories,\nthen `qmd embed` to index them.\n\n### Embedding model override (CJK\u002Fmultilingual)\nSet `QMD_EMBED_MODEL` environment variable for non-English content:\n```bash\nexport QMD_EMBED_MODEL=\"your-multilingual-model\"\n```\n\n## Data Storage\n\n- **Index & vectors:** `~\u002F.cache\u002Fqmd\u002Findex.sqlite`\n- **Models:** Auto-downloaded to local cache on first run\n- **No cloud dependencies** — everything runs locally\n\n## References\n\n- [GitHub: tobi\u002Fqmd](https:\u002F\u002Fgithub.com\u002Ftobi\u002Fqmd)\n- [QMD Changelog](https:\u002F\u002Fgithub.com\u002Ftobi\u002Fqmd\u002Fblob\u002Fmain\u002FCHANGELOG.md)\n","# QMD — Query Markup Documents\n\nLocal, on-device search engine for personal knowledge bases. Indexes markdown\nnotes, meeting transcripts, documentation, and any text-based files, then\nprovides hybrid search combining keyword matching, semantic understanding, and\nLLM-powered reranking — all running locally with no cloud dependencies.\n\nCreated by [Tobi Lütke](https:\u002F\u002Fgithub.com\u002Ftobi\u002Fqmd). MIT licensed.\n\n## When to Use\n\n- User asks to search their notes, docs, knowledge base, or meeting transcripts\n- User wants to find something across a large collection of markdown\u002Ftext files\n- User wants semantic search (\"find notes about X concept\") not just keyword grep\n- User has already set up qmd collections and wants to query them\n- User asks to set up a local knowledge base or document search system\n- Keywords: \"search my notes\", \"find in my docs\", \"knowledge base\", \"qmd\"\n\n## Prerequisites\n\n### Node.js >= 22 (required)\n\n```bash\n# Check version\nnode --version  # must be >= 22\n\n# macOS — install or upgrade via Homebrew\nbrew install node@22\n\n# Linux — use NodeSource or nvm\ncurl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_22.x | sudo -E bash -\nsudo apt-get install -y nodejs\n# or with nvm:\nnvm install 22 && nvm use 22\n```\n\n### SQLite with Extension Support (macOS only)\n\nmacOS system SQLite lacks extension loading. Install via Homebrew:\n\n```bash\nbrew install sqlite\n```\n\n### Install qmd\n\n```bash\nnpm install -g @tobilu\u002Fqmd\n# or with Bun:\nbun install -g @tobilu\u002Fqmd\n```\n\nFirst run auto-downloads 3 local GGUF models (~2GB total):\n\n| Model | Purpose | Size |\n|-------|---------|------|\n| embeddinggemma-300M-Q8_0 | Vector embeddings | ~300MB |\n| qwen3-reranker-0.6b-q8_0 | Result reranking | ~640MB |\n| qmd-query-expansion-1.7B | Query expansion | ~1.1GB |\n\n### Verify Installation\n\n```bash\nqmd --version\nqmd status\n```\n\n## Quick Reference\n\n| Command | What It Does | Speed |\n|---------|-------------|-------|\n| `qmd search \"query\"` | BM25 keyword search (no models) | ~0.2s |\n| `qmd vsearch \"query\"` | Semantic vector search (1 model) | ~3s |\n| `qmd query \"query\"` | Hybrid + reranking (all 3 models) | ~2-3s warm, ~19s cold |\n| `qmd get \u003Cdocid>` | Retrieve full document content | instant |\n| `qmd multi-get \"glob\"` | Retrieve multiple files | instant |\n| `qmd collection add \u003Cpath> --name \u003Cn>` | Add a directory as a collection | instant |\n| `qmd context add \u003Cpath> \"description\"` | Add context metadata to improve retrieval | instant |\n| `qmd embed` | Generate\u002Fupdate vector embeddings | varies |\n| `qmd status` | Show index health and collection info | instant |\n| `qmd mcp` | Start MCP server (stdio) | persistent |\n| `qmd mcp --http --daemon` | Start MCP server (HTTP, warm models) | persistent |\n\n## Setup Workflow\n\n### 1. Add Collections\n\nPoint qmd at directories containing your documents:\n\n```bash\n# Add a notes directory\nqmd collection add ~\u002Fnotes --name notes\n\n# Add project docs\nqmd collection add ~\u002Fprojects\u002Fmyproject\u002Fdocs --name project-docs\n\n# Add meeting transcripts\nqmd collection add ~\u002Fmeetings --name meetings\n\n# List all collections\nqmd collection list\n```\n\n### 2. Add Context Descriptions\n\nContext metadata helps the search engine understand what each collection\ncontains. This significantly improves retrieval quality:\n\n```bash\nqmd context add qmd:\u002F\u002Fnotes \"Personal notes, ideas, and journal entries\"\nqmd context add qmd:\u002F\u002Fproject-docs \"Technical documentation for the main project\"\nqmd context add qmd:\u002F\u002Fmeetings \"Meeting transcripts and action items from team syncs\"\n```\n\n### 3. Generate Embeddings\n\n```bash\nqmd embed\n```\n\nThis processes all documents in all collections and generates vector\nembeddings. Re-run after adding new documents or collections.\n\n### 4. Verify\n\n```bash\nqmd status   # shows index health, collection stats, model info\n```\n\n## Search Patterns\n\n### Fast Keyword Search (BM25)\n\nBest for: exact terms, code identifiers, names, known phrases.\nNo models loaded — near-instant results.\n\n```bash\nqmd search \"authentication middleware\"\nqmd search \"handleError async\"\n```\n\n### Semantic Vector Search\n\nBest for: natural language questions, conceptual queries.\nLoads embedding model (~3s first query).\n\n```bash\nqmd vsearch \"how does the rate limiter handle burst traffic\"\nqmd vsearch \"ideas for improving onboarding flow\"\n```\n\n### Hybrid Search with Reranking (Best Quality)\n\nBest for: important queries where quality matters most.\nUses all 3 models — query expansion, parallel BM25+vector, reranking.\n\n```bash\nqmd query \"what decisions were made about the database migration\"\n```\n\n### Structured Multi-Mode Queries\n\nCombine different search types in a single query for precision:\n\n```bash\n# BM25 for exact term + vector for concept\nqmd query $'lex: rate limiter\\nvec: how does throttling work under load'\n\n# With query expansion\nqmd query $'expand: database migration plan\\nlex: \"schema change\"'\n```\n\n### Query Syntax (lex\u002FBM25 mode)\n\n| Syntax | Effect | Example |\n|--------|--------|---------|\n| `term` | Prefix match | `perf` matches \"performance\" |\n| `\"phrase\"` | Exact phrase | `\"rate limiter\"` |\n| `-term` | Exclude term | `performance -sports` |\n\n### HyDE (Hypothetical Document Embeddings)\n\nFor complex topics, write what you expect the answer to look like:\n\n```bash\nqmd query $'hyde: The migration plan involves three phases. First, we add the new columns without dropping the old ones. Then we backfill data. Finally we cut over and remove legacy columns.'\n```\n\n### Scoping to Collections\n\n```bash\nqmd search \"query\" --collection notes\nqmd query \"query\" --collection project-docs\n```\n\n### Output Formats\n\n```bash\nqmd search \"query\" --json        # JSON output (best for parsing)\nqmd search \"query\" --limit 5     # Limit results\nqmd get \"#abc123\"                # Get by document ID\nqmd get \"path\u002Fto\u002Ffile.md\"       # Get by file path\nqmd get \"file.md:50\" -l 100     # Get specific line range\nqmd multi-get \"journals\u002F*.md\" --json  # Batch retrieve by glob\n```\n\n## MCP Integration (Recommended)\n\nqmd exposes an MCP server that provides search tools directly to\nYOUSEF SHTIWE via the native MCP client. This is the preferred\nintegration — once configured, the agent gets qmd tools automatically\nwithout needing to load this skill.\n\n### Option A: Stdio Mode (Simple)\n\nAdd to `~\u002F.yousef\u002Fconfig.yaml`:\n\n```yaml\nmcp_servers:\n  qmd:\n    command: \"qmd\"\n    args: [\"mcp\"]\n    timeout: 30\n    connect_timeout: 45\n```\n\nThis registers tools: `mcp_qmd_search`, `mcp_qmd_vsearch`,\n`mcp_qmd_deep_search`, `mcp_qmd_get`, `mcp_qmd_status`.\n\n**Tradeoff:** Models load on first search call (~19s cold start),\nthen stay warm for the session. Acceptable for occasional use.\n\n### Option B: HTTP Daemon Mode (Fast, Recommended for Heavy Use)\n\nStart the qmd daemon separately — it keeps models warm in memory:\n\n```bash\n# Start daemon (persists across agent restarts)\nqmd mcp --http --daemon\n\n# Runs on http:\u002F\u002Flocalhost:8181 by default\n```\n\nThen configure YOUSEF SHTIWE to connect via HTTP:\n\n```yaml\nmcp_servers:\n  qmd:\n    url: \"http:\u002F\u002Flocalhost:8181\u002Fmcp\"\n    timeout: 30\n```\n\n**Tradeoff:** Uses ~2GB RAM while running, but every query is fast\n(~2-3s). Best for users who search frequently.\n\n### Keeping the Daemon Running\n\n#### macOS (launchd)\n\n```bash\ncat > ~\u002FLibrary\u002FLaunchAgents\u002Fcom.qmd.daemon.plist \u003C\u003C 'EOF'\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\"\n  \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n  \u003Ckey>Label\u003C\u002Fkey>\n  \u003Cstring>com.qmd.daemon\u003C\u002Fstring>\n  \u003Ckey>ProgramArguments\u003C\u002Fkey>\n  \u003Carray>\n    \u003Cstring>qmd\u003C\u002Fstring>\n    \u003Cstring>mcp\u003C\u002Fstring>\n    \u003Cstring>--http\u003C\u002Fstring>\n    \u003Cstring>--daemon\u003C\u002Fstring>\n  \u003C\u002Farray>\n  \u003Ckey>RunAtLoad\u003C\u002Fkey>\n  \u003Ctrue\u002F>\n  \u003Ckey>KeepAlive\u003C\u002Fkey>\n  \u003Ctrue\u002F>\n  \u003Ckey>StandardOutPath\u003C\u002Fkey>\n  \u003Cstring>\u002Ftmp\u002Fqmd-daemon.log\u003C\u002Fstring>\n  \u003Ckey>StandardErrorPath\u003C\u002Fkey>\n  \u003Cstring>\u002Ftmp\u002Fqmd-daemon.log\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\nEOF\n\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.qmd.daemon.plist\n```\n\n#### Linux (systemd user service)\n\n```bash\nmkdir -p ~\u002F.config\u002Fsystemd\u002Fuser\n\ncat > ~\u002F.config\u002Fsystemd\u002Fuser\u002Fqmd-daemon.service \u003C\u003C 'EOF'\n[Unit]\nDescription=QMD MCP Daemon\nAfter=network.target\n\n[Service]\nExecStart=qmd mcp --http --daemon\nRestart=on-failure\nRestartSec=10\nEnvironment=PATH=\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fbin:\u002Fbin\n\n[Install]\nWantedBy=default.target\nEOF\n\nsystemctl --user daemon-reload\nsystemctl --user enable --now qmd-daemon\nsystemctl --user status qmd-daemon\n```\n\n### MCP Tools Reference\n\nOnce connected, these tools are available as `mcp_qmd_*`:\n\n| MCP Tool | Maps To | Description |\n|----------|---------|-------------|\n| `mcp_qmd_search` | `qmd search` | BM25 keyword search |\n| `mcp_qmd_vsearch` | `qmd vsearch` | Semantic vector search |\n| `mcp_qmd_deep_search` | `qmd query` | Hybrid search + reranking |\n| `mcp_qmd_get` | `qmd get` | Retrieve document by ID or path |\n| `mcp_qmd_status` | `qmd status` | Index health and stats |\n\nThe MCP tools accept structured JSON queries for multi-mode search:\n\n```json\n{\n  \"searches\": [\n    {\"type\": \"lex\", \"query\": \"authentication middleware\"},\n    {\"type\": \"vec\", \"query\": \"how user login is verified\"}\n  ],\n  \"collections\": [\"project-docs\"],\n  \"limit\": 10\n}\n```\n\n## CLI Usage (Without MCP)\n\nWhen MCP is not configured, use qmd directly via terminal:\n\n```\nterminal(command=\"qmd query 'what was decided about the API redesign' --json\", timeout=30)\n```\n\nFor setup and management tasks, always use terminal:\n\n```\nterminal(command=\"qmd collection add ~\u002FDocuments\u002Fnotes --name notes\")\nterminal(command=\"qmd context add qmd:\u002F\u002Fnotes 'Personal research notes and ideas'\")\nterminal(command=\"qmd embed\")\nterminal(command=\"qmd status\")\n```\n\n## How the Search Pipeline Works\n\nUnderstanding the internals helps choose the right search mode:\n\n1. **Query Expansion** — A fine-tuned 1.7B model generates 2 alternative\n   queries. The original gets 2x weight in fusion.\n2. **Parallel Retrieval** — BM25 (SQLite FTS5) and vector search run\n   simultaneously across all query variants.\n3. **RRF Fusion** — Reciprocal Rank Fusion (k=60) merges results.\n   Top-rank bonus: #1 gets +0.05, #2-3 get +0.02.\n4. **LLM Reranking** — qwen3-reranker scores top 30 candidates (0.0-1.0).\n5. **Position-Aware Blending** — Ranks 1-3: 75% retrieval \u002F 25% reranker.\n   Ranks 4-10: 60\u002F40. Ranks 11+: 40\u002F60 (trusts reranker more for long tail).\n\n**Smart Chunking:** Documents are split at natural break points (headings,\ncode blocks, blank lines) targeting ~900 tokens with 15% overlap. Code\nblocks are never split mid-block.\n\n## Best Practices\n\n1. **Always add context descriptions** — `qmd context add` dramatically\n   improves retrieval accuracy. Describe what each collection contains.\n2. **Re-embed after adding documents** — `qmd embed` must be re-run when\n   new files are added to collections.\n3. **Use `qmd search` for speed** — when you need fast keyword lookup\n   (code identifiers, exact names), BM25 is instant and needs no models.\n4. **Use `qmd query` for quality** — when the question is conceptual or\n   the user needs the best possible results, use hybrid search.\n5. **Prefer MCP integration** — once configured, the agent gets native\n   tools without needing to load this skill each time.\n6. **Daemon mode for frequent users** — if the user searches their\n   knowledge base regularly, recommend the HTTP daemon setup.\n7. **First query in structured search gets 2x weight** — put the most\n   important\u002Fcertain query first when combining lex and vec.\n\n## Troubleshooting\n\n### \"Models downloading on first run\"\nNormal — qmd auto-downloads ~2GB of GGUF models on first use.\nThis is a one-time operation.\n\n### Cold start latency (~19s)\nThis happens when models aren't loaded in memory. Solutions:\n- Use HTTP daemon mode (`qmd mcp --http --daemon`) to keep warm\n- Use `qmd search` (BM25 only) when models aren't needed\n- MCP stdio mode loads models on first search, stays warm for session\n\n### macOS: \"unable to load extension\"\nInstall Homebrew SQLite: `brew install sqlite`\nThen ensure it's on PATH before system SQLite.\n\n### \"No collections found\"\nRun `qmd collection add \u003Cpath> --name \u003Cname>` to add directories,\nthen `qmd embed` to index them.\n\n### Embedding model override (CJK\u002Fmultilingual)\nSet `QMD_EMBED_MODEL` environment variable for non-English content:\n```bash\nexport QMD_EMBED_MODEL=\"your-multilingual-model\"\n```\n\n## Data Storage\n\n- **Index & vectors:** `~\u002F.cache\u002Fqmd\u002Findex.sqlite`\n- **Models:** Auto-downloaded to local cache on first run\n- **No cloud dependencies** — everything runs locally\n\n## References\n\n- [GitHub: tobi\u002Fqmd](https:\u002F\u002Fgithub.com\u002Ftobi\u002Fqmd)\n- [QMD Changelog](https:\u002F\u002Fgithub.com\u002Ftobi\u002Fqmd\u002Fblob\u002Fmain\u002FCHANGELOG.md)\n",{"name":5,"author":47,"license":14,"version":48,"metadata":49,"platforms":60,"description":7},"YOUSEF SHTIWE + Teknium","1.0.0",{"hermes":50},{"tags":51,"related_skills":57},[52,53,54,55,33,56],"Search","Knowledge-Base","RAG","Notes","Local-AI",[38,58,59],"native-mcp","arxiv",[40,61],"linux","main","93bbc269671fbb340afa15b36a8766f15dc30df2","hermes-agent\u002Foptional-skills\u002Fresearch\u002Fqmd","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch","2026-04-27 02:51:28",{"source":8,"skillName":5,"commands":69,"prompt":79,"zipAvailable":80},[70,73,76],{"tool":71,"command":72},"npx","npx skills add gjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6 --skill qmd",{"tool":74,"command":75},"bunx","bunx skills add gjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6 --skill qmd",{"tool":77,"command":78},"pnpm","pnpm dlx skills add gjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6 --skill qmd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes-agent\u002Foptional-skills\u002Fresearch\u002Fqmd\u002FSKILL.md",true,[],[83,91,132,160,176,195],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":90},"01M72P39X9AV4XW6C283JHRCBQ","stable-diffusion-image-generation","State-of-the-art text-to-image generation with Stable Diffusion models via HuggingFace Diffusers. Use when generating images from text prompts, performing image-to-image translation, inpainting, or building custom diffusion pipelines.","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes_sovereign_data\u002Fskills\u002Fmlops\u002Fmodels\u002Fstable-diffusion\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":111,"publishedAt":42},"01M71G6TJ2RAQ1J0PV3K6D9GQA","writing-plans","Use when you have a spec or requirements for a multi-step task. Creates comprehensive implementation plans with bite-sized tasks, exact file paths, and complete code examples.","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes_sovereign_data\u002Fskills\u002Fsoftware-development\u002Fwriting-plans\u002FSKILL.md",[97,100,103,108],{"categoryNo":98,"categoryName":99,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":101,"categoryName":102,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":104,"categoryName":105,"taxonomyType":106,"taxonomyTypeDesc":107},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",{"categoryNo":109,"categoryName":110,"taxonomyType":106,"taxonomyTypeDesc":107},"01JBSEEDCAT000000000000036","内容创作者",[112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131],"writing","writing plans","plans","paths","planning","development","for","code-review","when","design","superpowers","test-driven-development","you","code","tasks","subagent","test-driven","workflow","review","documentation",{"skillNo":133,"name":123,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":145,"publishedAt":42},"01M71G6R81013R3T7W5VP56GCB","Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle with test-first approach.","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes_sovereign_data\u002Fskills\u002Fsoftware-development\u002Ftest-driven-development\u002FSKILL.md",[137,140,143,144],{"categoryNo":138,"categoryName":139,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":141,"categoryName":142,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":101,"categoryName":102,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":109,"categoryName":110,"taxonomyType":106,"taxonomyTypeDesc":107},[146,117,147,148,149,112,122,150,151,152,153,154,155,156,157,158,159,127,125,120],"test driven development","test","driven","green","implementing","testing","red-green-refactor","cycle","debugging","test-first","systematic-debugging","refactor","bugfix","systematic",{"skillNo":161,"name":156,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":166,"publishedAt":42},"01M71G6N0Y546JZEDF25E2PMCE","Use when encountering any bug, test failure, or unexpected behavior. 4-phase root cause investigation — NO fixes without understanding the problem first.","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes_sovereign_data\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[165],{"categoryNo":141,"categoryName":142,"taxonomyType":20,"taxonomyTypeDesc":21},[159,154,167,147,168,169,114,170,171,117,172,173,127,120,112,122,123,174,175,128],"systematic debugging","root-cause","use","problem","fixes","bug","phase","problem-solving","root cause",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":188,"publishedAt":42},"01M71G6J0DXEGY48GH4KVW2SJH","subagent-driven-development","Use when executing implementation plans with independent tasks. Dispatches fresh delegate_task per task with two-stage review (spec compliance then code quality).","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes_sovereign_data\u002Fskills\u002Fsoftware-development\u002Fsubagent-driven-development\u002FSKILL.md",[182,183,184,185],{"categoryNo":101,"categoryName":102,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":104,"categoryName":105,"taxonomyType":106,"taxonomyTypeDesc":107},{"categoryNo":109,"categoryName":110,"taxonomyType":106,"taxonomyTypeDesc":107},{"categoryNo":186,"categoryName":187,"taxonomyType":106,"taxonomyTypeDesc":107},"01JBSEEDCAT000000000000037","律师与法务",[148,117,127,189,112,122,190,191,123,128,120,114,192,193,194,130,119,126,125,129],"subagent driven development","delegation","delegate","code quality","parallel","fresh",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":203,"publishedAt":42},"01M71G6EFFBQX6634E6XHB09Y1","requesting-code-review","Pre-commit verification pipeline — static security scan, baseline-aware quality gates, independent reviewer subagent, and auto-fix loop. Use after code changes and before committing, pushing, or opening a PR.","https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002Fhermes-sovereign-unified-v13.6\u002Fblob\u002Fmain\u002Fhermes_sovereign_data\u002Fskills\u002Fsoftware-development\u002Frequesting-code-review\u002FSKILL.md",[201,202],{"categoryNo":138,"categoryName":139,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":104,"categoryName":105,"taxonomyType":106,"taxonomyTypeDesc":107},[204,125,130,205,206,207,208,119,127,209,210,112,211,122,212,213,123,214,215,128],"requesting code review","code review","security scan","verification","reviewer","commit","loop","auto","auto-fix","fix","static","pipeline"]