8 Advanced indexing
This chapter covers
- Using advanced RAG techniques
- Selecting optimal chunk splitting strategies
- Using multiple embeddings to enhance coarse chunk retrieval
- Expanding granular chunks to add context during retrieval
- Indexing strategies for semi-structured and multimodal content
In chapter 7, you explored the fundamentals of the Retrieval-Augmented Generation (RAG) architecture—a core pattern for building LLM-powered applications. To keep things simple, we worked with a stripped-down version. That minimal setup is useful for learning, but it often leads to disappointing results in practice: inaccurate answers, overlooked data, or weak use of context, even when the vector store contains exactly what you need. These issues usually stem from vague queries, suboptimal indexing, or failing to use metadata effectively.
This chapter focuses on how to overcome those challenges. Building robust LLM applications with LangChain is less about wiring components together and more about refining the design—iterating on retrieval strategies, experimenting with prompts, and applying advanced RAG techniques. True proficiency comes from mastering these refinements.
We’ll begin with advanced indexing strategies, such as creating multiple embeddings for larger text chunks in the vector database. This approach improves retrieval precision and ensures richer, more accurate context for response generation.