RAG and Retrieval
Retrieval-augmented generation gives an LLM the facts it needs at answer time by fetching relevant text and putting it in the context window. It is how most teams ship knowledge-grounded AI, because it fixes the model's two biggest weaknesses — hallucination and stale knowledge — without retraining.
RAG is a search problem wearing an LLM hat. Most "RAG quality" issues are retrieval issues. Fix retrieval first.
Mental model
RAG is an information-retrieval system whose selected evidence becomes model input. Query construction, indexing, candidate generation, reranking, context assembly, and answer attribution are separate stages with separate recall, precision, latency, and failure budgets.
Roadmap: foundations to advanced retrieval
- Why RAG (and when not to)
- RAG first-pass design
- Chunking that respects structure
- Embeddings & embedding models
Retrieval quality
- Vector databases & ANN indexes
- Hybrid search: dense + keyword
- Reranking
- Query transformations (rewriting, HyDE, multi-query)
Generation & assessment
Beyond basic RAG
Connects to: Data for AI · Context Engineering · Evaluating RAG Systems
Core sources
- Anthropic — Contextual Retrieval (2024) — the single most useful applied-RAG write-up: technique, measured failure-rate reductions, costs, and the runnable cookbook.
- Lewis et al. 2020 — Retrieval-Augmented Generation (arXiv:2005.11401) — the original paper; the retriever-generator factorization that still defines the field.
- RAGAS docs — the standard vocabulary and tooling for RAG evaluation (faithfulness, context precision/recall).
- pgvector — the reference Postgres vector store; the README doubles as an ANN-tuning crash course.
- Pinecone Learning Center — consistently solid explainers on chunking, hybrid search, and reranking (vendor-hosted, technique-focused).