rag-and-agentslisted
Install: claude install-skill adammatthewsteinberger/vibey-skills
# RAG & AI Agent Development — Production Reference
## The Decision Framework
**Start naive → add complexity only when evaluation shows a quality ceiling.**
Progression:
1. Naive RAG (embed-retrieve-stuff)
2. Hybrid search + semantic reranking
3. Parent-child chunking + better parsing
4. Contextual retrieval (Anthropic)
5. Advanced RAG (query transforms, multi-query, decomposition)
6. GraphRAG or agents — only when steps above have hit their ceiling
**Each step adds cost. Advance only when a 50–200 QA golden set proves it.**
---
## RAG Fundamentals
**Four problems RAG solves:**
1. Hallucination (grounds answers in retrieved documents)
2. Knowledge cutoff (retrieves current private data)
3. Private-data access (indexes your corpus)
4. Verifiable sourcing (enables citations)
**The full pipeline:** ingestion → chunking → embedding → indexing → query processing → retrieval → reranking → context assembly → generation
**RAG vs Fine-tuning vs Long-context:**
- **RAG**: dynamic/proprietary knowledge needing citations; audit trail
- **Fine-tuning**: changing behavior, format, tone, domain style
- **Long-context stuffing**: single-document deep reasoning where the whole doc fits; no extra infra
They combine — fine-tune for domain language, RAG for facts.
**"Lost in the middle" (Liu et al., TACL 2024):** performance degrades significantly when relevant information is in the middle of long contexts, even for explicitly long-context models. Critical info should be first or last