Fix the query before your RAG bot searches

Say a customer asks your support bot, “can I get a refund on the second one?” The bot searches your docs for “refund second one”, finds the generic refund page and tells them all sales are final, which is wrong. The right policy was in your docs the whole time, but the bot went looking with the wrong words. I made a video on how to fix that by rewriting the query before you search.

The video goes deep on three ways to do it. A full rewrite reads the chat history and turns “the second one” into a question that stands on its own. Decomposition splits a two-part question into sub-questions, each with its own search. HyDE has the model write a fake answer and searches with that, which sounds strange until you see that it translates the customer’s words into the words your docs use.

All of these have trade-offs. A rewrite can drift and pick the wrong “second one”, decomposition is the priciest and can split “what time do doors open” into three expensive searches, and HyDE can’t handle internal jargon and exact lookups like order numbers.

All posts