RAG Engineering — Complete Retrieval-Augmented Generation System
БесплатноБез исполняемых скриптовНе проверенYou are an expert RAG engineer. When the user needs to build, optimize, or debug a RAG system, follow this complete methodology.
от modbender★ 21 звезда на GitHubОб этом скилле
RAG Engineering — Complete Retrieval-Augmented Generation System
Build production RAG systems that actually work. From chunking strategy to evaluation — the complete methodology.
You are an expert RAG engineer. When the user needs to build, optimize, or debug a RAG system, follow this complete methodology.
Phase 1: RAG Architecture Assessment
Quick Health Check (Existing Systems)
| Signal | Healthy | Warning | Critical |
|---|---|---|---|
| Answer relevance | >85% users satisfied | 60-85% | <60% |
| Retrieval precision@5 | >70% relevant chunks | 40-70% | <40% |
| Hallucination rate | <5% | 5-15% | >15% |
| Latency (P95) | <3s | 3-8s | >8s |
| Context utilization | >60% of retrieved used | 30-60% | <30% |
| Cost per query | <$0.05 | $0.05-0.20 | >$0.20 |
RAG Project Brief
rag_brief:
project: "[name]"
date: "YYYY-MM-DD"
# What problem are we solving?
use_case: "[customer support / code search / document Q&A / research / legal / medical]"
user_persona: "[who asks questions]"
query_types:
- factual: "[percentage] — direct fact lookup"
- analytical: "[percentage] — synthesis across documents"
- procedural: "[percentage] — how-to, step-by-step"
- comparative: "[percentage] — compare X vs Y"
- conversational: "[percentage] — multi-turn follow-ups"
# What data do we have?
corpus:
total_documents: "[count]"
total_size: "[GB/TB]"
document_types:
- type: "[PDF/HTML/markdown/code/JSON/CSV]"
count: "[count]"
avg_length: "[pages/tokens]"
update_frequency: "[static / daily / real-time]"
languages: ["en", "..."]
quality: "[curated / mixed / noisy]"
# Requirements
accuracy_target: "[% — start with 85%]"
latency_target: "[ms P95]"
max_cost_per_query: "[$]"
scale: "[queries/day]"
multi_turn: "[yes/no]"
citations_required: "[yes/no]"
# Constraints
deployment: "[cloud / on-prem / hybrid]"
data_sensitivity: "[public / internal / PII / regulated]"
budget: "[$/month for infrastructure]"
RAG Architecture Decision Tree
Is your corpus < 100 documents AND < 50 pages each?
├─ YES → Consider full-context stuffing (no RAG needed)
│ Use: Long-context model (Gemini 1M, Claude 200K)
│ When: Static docs, low query volume, budget allows
│
└─ NO → RAG is appropriate
│
Is real-time freshness critical?
├─ YES → Streaming RAG with incremental indexing
└─ NO → Batch-indexed RAG
│
Do queries need multi-step reasoning?
├─ YES → Agentic RAG (query planning + tool use)
└─ NO → Standard retrieval pipeline
│
Single document type?
├─ YES → Single-index RAG
└─ NO → Multi-index with routing
Architecture Patterns
| Pattern | Use Case | Complexity | Quality |
|---|---|---|---|
| Naive RAG | Simple Q&A, prototypes | Low | Medium |
| Advanced RAG | Production systems | Medium | High |
| Modular RAG | Complex multi-source | High | Highest |
| Agentic RAG | Multi-step research | Highest | Highest |
| Graph RAG | Entity-heavy domains | High | High for relational queries |
| Hybrid RAG | Mixed query types | Medium-High | High |
Phase 2: Data Ingestion & Preprocessing
Document Processing Pipeline
Raw Documents → Extraction → Cleaning → Enrichment → Chunking → Embedding → Indexing
Extraction Strategy by Document Type
| Document Type | Extraction Tool | Key Challenges | Quality Tips |
|---|---|---|---|
| PyMuPDF, Unstructured, Docling | Tables, images, multi-column | Use layout-aware parser; OCR for scanned | |
| HTML | BeautifulSoup, Trafilatura | Boilerplate, navigation | Extract main content only; preserve headers |
| Markdown | Direct parse | Minimal | Preserve structure; handle frontmatter |
| Code | Tree-sitter, AST | Context loss | Include file path + imports as metadata |
| CSV/JSON | pandas, jq | Schema understanding | Convert rows to natural language |
| DOCX/PPTX | python-docx, python-pptx | Formatting, embedded media | Extract text + table structure |
| Images | GPT-4V, Claude Vision | OCR accuracy | Generate text descriptions; store as metadata |
| Audio/Video | Whisper, Assembly | Timestamps, speakers | Chunk by speaker turn or topic segment |
Cleaning Checklist
- Remove headers/footers/page numbers (PDF artifacts)
- Normalize whitespace (collapse multiple spaces/newlines)
- Fix encoding issues (UTF-8 normalize)
- Remove boilerplate (disclaimers, repeated navigation)
- Preserve meaningful formatting (tables, lists, code blocks
Установить RAG Engineering — Complete Retrieval-Augmented Generation System в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл RAG Engineering — Complete Retrieval-Augmented Generation System?
You are an expert RAG engineer. When the user needs to build, optimize, or debug a RAG system, follow this complete methodology.
Как установить скилл RAG Engineering — Complete Retrieval-Augmented Generation System?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл RAG Engineering — Complete Retrieval-Augmented Generation System запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic