8 Advanced indexing
This chapter covers
- Advanced RAG techniques for more effective retrieval
- Selecting the optimal chunk splitting strategy for your use case
- Using multiple embeddings to enhance coarse chunk retrieval
- Expanding granular chunks to add context during retrieval
- Indexing strategies for semi-structured and multi-modal content
In chapter 7, you learned about the basics of the RAG (Retrieval-Augmented Generation) architecture, a common pattern for building LLM-based applications. To simplify things, I introduced a stripped-down version. While this was useful for learning, using this basic version in a real-world scenario will often produce poor results. You might notice inaccurate answers, even when your content store (usually a vector store) has relevant data. These issues often arise from poorly phrased queries, inefficient text indexing, or ineffective use of metadata attached to text chunks.
In this chapter, I’ll show you how to avoid these issues and use advanced methods to improve accuracy. When working with LLM applications using LangChain, most of your time will be spent refining your design to get the best results. This involves selecting advanced RAG techniques, experimenting, and refining prompts. You can call yourself proficient only when you understand and apply these techniques effectively.