RAG
Retrieval-Augmented Generation: grounding models in real information.
- What is RAG?Beginner
RAG retrieves relevant external information and gives it to a language model as context before it answers.
- RAG ArchitectureIntermediate
RAG has two phases — offline ingestion (chunk, embed, store) and per-query answering (retrieve, rerank, generate) — connected by a vector store.
- What is Chunking?Intermediate
Chunking splits documents into smaller passages so they can be embedded and retrieved precisely; chunk size and overlap are key tuning knobs for RAG quality.
- What is Query Transformation?Intermediate
Query transformation rewrites, expands, or reframes the user's question before retrieval so the search finds better chunks.
- Reranking & Cross-EncodersIntermediate
A reranker re-scores the shortlist of retrieved chunks by reading each query-document pair closely, pushing the most relevant results to the top.
- What is Contextual Retrieval?Intermediate
Contextual retrieval prepends a short context blurb to each chunk before embedding, so ambiguous passages become self-explanatory and retrieve accurately.
- Agentic RAG & Advanced PatternsAdvanced
Agentic RAG turns the one-shot pipeline into a self-correcting loop that judges its own retrieval and answers, plus patterns like Graph RAG and multi-hop.
- How to Evaluate RAGAdvanced
RAG evaluation measures retrieval quality (context precision/recall) and generation quality (faithfulness, answer relevance) separately to find and fix failures.
- RAG vs Fine-tuning vs Long ContextIntermediate
RAG adds knowledge at answer time, fine-tuning bakes behavior into weights, and long context pastes everything into the prompt — each fits different problems.