Why use index-based RAG?
Index-based search takes advanced RAG-driven generative AI to another level. It increases the speed of retrieval when faced with large volumes of data, taking us from raw chunks of data to organized, indexed nodes that we can trace from the output back to the source of a document and its location.
Let’s understand the differences between a vector-based similarity search and an index-based search by analyzing the architecture of an index-based RAG.
Architecture
Index-based search is faster than vector-based search in RAG because it directly accesses relevant data using indices, while vector-based search sequentially compares embeddings across all records. We implemented a vector-based similarity search program in Chapter 2, RAG Embedding Vector Stores with Deep Lake and OpenAI, as shown in Figure 3.1:
- We collected and prepared data in Pipeline #1: Data Collection and Preparation
- We embedded the data and stored the prepared...