Provides score interpretation (< 0.3 good, > 0.5 skip), query optimization, and source naming for query_documents, ingest_file, ingest_data tools. Use this skill when working with RAG, searching documents, ingesting files, saving web content, or handling PDF, HTML, DOCX, TXT, Markdown.
Add this skill
npx mdskills install shinpr/mcp-local-ragComprehensive RAG guidance with score thresholds, query strategies, and ingestion patterns
1---2name: mcp-local-rag3description: Provides score interpretation (< 0.3 good, > 0.5 skip), query optimization, and source naming for query_documents, ingest_file, ingest_data tools. Use this skill when working with RAG, searching documents, ingesting files, saving web content, or handling PDF, HTML, DOCX, TXT, Markdown.4---56# MCP Local RAG Skills78## Tools910| Tool | Use When |11|------|----------|12| `ingest_file` | Local files (PDF, DOCX, TXT, MD) |13| `ingest_data` | Raw content (HTML, text) with source URL |14| `query_documents` | Semantic + keyword hybrid search |15| `delete_file` / `list_files` / `status` | Management |1617## Search: Core Rules1819Hybrid search combines vector (semantic) and keyword (BM25).2021### Score Interpretation2223Lower = better match. Use this to filter noise.2425| Score | Action |26|-------|--------|27| < 0.3 | Use directly |28| 0.3-0.5 | Include if mentions same concept/entity |29| > 0.5 | Skip unless no better results |3031### Limit Selection3233| Intent | Limit |34|--------|-------|35| Specific answer (function, error) | 5 |36| General understanding | 10 |37| Comprehensive survey | 20 |3839### Query Formulation4041| Situation | Why Transform | Action |42|-----------|---------------|--------|43| Specific term mentioned | Keyword search needs exact match | KEEP term |44| Vague query | Vector search needs semantic signal | ADD context |45| Error stack or code block | Long text dilutes relevance | EXTRACT core keywords |46| Multiple distinct topics | Single query conflates results | SPLIT queries |47| Few/poor results | Term mismatch | EXPAND (see below) |4849### Query Expansion5051When results are few or all score > 0.5, expand query terms:5253- Keep original term first, add 2-4 variants54- Types: synonyms, abbreviations, related terms, word forms55- Example: `"config"` → `"config configuration settings configure"`5657Avoid over-expansion (causes topic drift).5859### Result Selection6061When to include vs skip—based on answer quality, not just score.6263**INCLUDE** if:64- Directly answers the question65- Provides necessary context66- Score < 0.56768**SKIP** if:69- Same keyword, unrelated context70- Score > 0.771- Mentions term without explanation7273### fileTitle7475Each result includes `fileTitle` (document title extracted from content). Null when extraction fails.7677| Use | How |78|-----|-----|79| Disambiguate chunks | Use fileTitle to identify which document the chunk belongs to |80| Group related chunks | Same fileTitle = same document context |81| Deprioritize mismatches | fileTitle unrelated to query AND score > 0.5 → rank lower |8283## Ingestion8485### ingest_file86```87ingest_file({ filePath: "/absolute/path/to/document.pdf" })88```8990### ingest_data91```92ingest_data({93 content: "<html>...</html>",94 metadata: { source: "https://example.com/page", format: "html" }95})96```9798**Format selection** — match the data you have:99- HTML string → `format: "html"`100- Markdown string → `format: "markdown"`101- Other → `format: "text"`102103**Source format:**104- Web page → Use URL: `https://example.com/page`105- Other content → Use scheme: `{type}://{date}` or `{type}://{date}/{detail}`106 - Examples: `clipboard://2024-12-30`, `chat://2024-12-30/project-discussion`107108**HTML source options:**109- Static page → LLM fetch110- SPA/JS-rendered → Browser MCP111- Auth required → Manual paste112113Re-ingest same source to update. Use same source in `delete_file` to remove.114115## References116117For edge cases and examples:118- [html-ingestion.md](references/html-ingestion.md) - URL normalization, SPA handling119- [query-optimization.md](references/query-optimization.md) - Query patterns by intent120- [result-refinement.md](references/result-refinement.md) - Contradiction resolution, chunking121
Full transparency — inspect the skill content before installing.