Skip to content
AgenticAIWiki
  1. Learn
  2. Part 4. RAG architectures
  3. Chapter 23

Advanced RAG

7 lessons · 30 min

Upgrading a naive RAG pipeline

Full screen
Upgrades to slot inDocumentsIndexfixed-size chunksQuestionSearchvectors, top 20Prompt + model20 loose chunksQuery rewritingHybrid BM25RerankingContextual chunks

Swipe to change step

Step 1 of 8. Here is the naive pipeline from chapter 21: fixed-size chunks, one vector search, and twenty loosely related chunks in the prompt. It works, but misses often. We will improve it one upgrade at a time. Documents. Index (fixed-size chunks). Question. Search (vectors, top 20). Prompt + model (20 loose chunks). Query rewriting. Hybrid BM25. Reranking. Contextual chunks. arrow from Documents to Index. arrow from Index to Search. arrow from Question to Search. arrow from Search to Prompt + model. a question moving along e-qs, then e-sl.

In this chapter

  1. 23.1Chunking strategies4 min read
  2. 23.2Hybrid search: BM25 plus embeddings4 min read
  3. 23.3Reranking4 min read
  4. 23.4Query rewriting and expansion4 min read
  5. 23.5Contextual retrieval4 min read
  6. 23.6HyDE and multi-query retrieval5 min read
  7. 23.7Reciprocal rank fusion step by step5 min read

Chapter check

Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.

Loading check…