Chapter 7. Retrieval
Improving the retriever step is the most effective way to increase the accuracy and relevance of a RAG system. You need a solid toolkit to build customized, highly efficient systems. This chapter introduces advanced retrieval techniques that go beyond a basic vector search. Figure 7-1 provides an overview of techniques for optimizing the pre-retrieval and retrieval steps.
Figure 7-1. Techniques to enhance the retrieval process
Real-world RAG workflows typically combine several of these techniques, depending on the use case. Figure 7-2 shows an example workflow that combines multiple steps and advanced retrieval techniques. The workflow illustrates three key stages: (1) breaking a complex query into focused subqueries, (2) routing each subquery to the appropriate tool or data source to retrieve relevant information, and (3) reasoning across the answers to synthesize a comprehensive response.
Figure 7-2. A multistep retrieval process
Think of the recipes in this chapter as building blocks that you can combine to improve your workflow and achieve better search results. You need a toolkit of advanced retrieval techniques that you can apply in the way that best fits your use case.
Table 7-1 summarizes seven techniques discussed in this chapter. You should understand ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access