Hybrid RAG/multi-vector RAG for improved retrieval
Hybrid RAG expands on the concept of naïve RAG by utilizing multiple vectors for the retrieval process, as opposed to relying on a single vector representation of queries and documents. We explored hybrid RAG in depth and in code in Chapter 8, not only utilizing the mechanism recommended within LangChain but by re-creating that mechanism ourselves so that we could see its inner workings. Also called multi-vector RAG, hybrid RAG can involve not just semantic and keyword search, as we saw in our code lab, but the mix of any different vector retrieval techniques that make sense for your RAG application.
Our hybrid RAG code lab introduced a keyword search, which expanded our search capabilities, leading to more effective retrieval, particularly when dealing with content that has a weaker context (such as names, codes, internal acronyms, and similar text). This multi-vector approach allows us to consider broader facets of the query...