X Bookmarks — 2023 KW33: MultiQueryRetriever and the RAG wording problem

August 17, 2023

|bookmarks

by Florian Narr

X Bookmarks — 2023 KW33: MultiQueryRetriever and the RAG wording problem

@rsrohan99 — MultiQueryRetriever in LangChain

One issue of using embeddings to retrieve relevant documents is that the results might vary with the slightest change in the wording of the query.

@langchain MultiQueryRetriever tries to address this issue with the help of LLMs.

Let's see how to use it 👇🧵

That's a real pain point — embedding similarity is sensitive to phrasing in ways that feel arbitrary. Ask "how do I authenticate?" vs "what's the login flow?" and you might get completely different retrieved chunks even though the intent is identical. MultiQueryRetriever addresses this by generating several rephrasings of your original query, running each retrieval independently, and then deduplicating the union of results. More coverage for the same semantic intent, at the cost of more LLM calls. Worth knowing about before you assume your RAG pipeline's recall problems are a chunking issue.