Handbook · 26 chapters · ~54 min
RAG Handbook
A complete, practical guide to Retrieval-Augmented Generation — from first principles to production: chunking, embeddings, retrieval, reranking, GraphRAG, evaluation, security and observability.
Start reading →Foundations
The core pipeline
04 · 2 minLoading & ingestionGetting raw content out of its source and into clean, usable text.05 · 3 minChunking strategiesHow you split documents quietly decides whether retrieval works.06 · 2 minEmbeddingsTurning text into vectors so meaning becomes measurable.07 · 2 minVector databasesWhere vectors live, and how they're searched at scale.08 · 2 minRetrievalFinding the right passages — dense, sparse, and hybrid search.09 · 2 minAugmentation & promptingAssembling retrieved context into a prompt the model can use well.10 · 2 minGenerationThe final step: turning grounded context into a trustworthy answer.
Advanced RAG
11 · 2 minQuery transformationsRewriting the question before searching to retrieve far better.12 · 2 minRerankingA precise second pass that reorders candidates for relevance.13 · 2 minRoutingSending each query to the right source, index, or strategy.14 · 2 minSelf-correcting & agentic RAGArchitectures that check their own work and act in loops.15 · 2 minGraphRAGRetrieval over a knowledge graph for connected, global questions.16 · 2 minContextual retrievalGiving each chunk the context it lost when it was split.17 · 2 minMultimodal RAGRetrieving over images, tables, and other non-text content.
Evaluation & production
18 · 2 minEvaluationYou can't improve what you don't measure — how to score RAG.19 · 2 minProduction & scalingLatency, cost, caching, and keeping the index fresh.20 · 2 minSecurity & governancePrompt injection, access control, PII, and tenant isolation.21 · 2 minObservability & monitoringSeeing inside the pipeline and catching quality drift.
Building & reference
22 · 2 minFrameworks & toolsLangChain, LlamaIndex, Haystack — and when to skip them.23 · 2 minReference implementationA minimal, framework-free RAG pipeline you can read end to end.24 · 2 minProduction checklistA pre-launch pass across the whole pipeline.25 · 2 minGlossaryKey RAG terms in one place.26 · 2 minFurther resourcesWhere to go deeper.