Query Expansion

Query Expansion in FlowHunt enhances chatbot understanding by finding synonyms and fixing spelling errors, ensuring accurate responses. It connects after chat input, using expanded queries for consistency and precision, even with complex or faulty inputs.

Categories:
Query Expansion

If someone doesn’t understand what you’re saying, they ask you to rephrase. You then try different ways to say it until you’re sure you’re on the same page. That’s precisely what the Query Expansion does but for the Chatbot.

What is the Query Expansion component?

The Query Expansion finds related words and synonyms to help AI understand your query and retrieve the correct information. The same method is why Google always understands what you’re looking for, no matter how you say it.

Query Expansion component in FlowHunt

How to connect the Query Expansion component to your Flow

The Query Expansion should be connected right after the chat input. Thanks to this, all the subsequent components use the expanded query.

Input

  • Input (required): This is the human query that gets expanded.
  • Chat history (optional): Let previous messages give more context to the expansion.
  • LLM (optional): Connect an LLM component to change the model used for Query Expansion. By default, the component uses ChatGPT-4o.

TIP: Query Expansion works just as well with older LLMs. Switching to a less advanced model cuts costs and makes the chatbot faster.

Number of Alternatives

This setting limits the number of alternative phrases and words generated. Feel free to adjust this based on your use case. Remember that a higher limit will cost more, and too many alternatives may lower relevancy.

Output

The output is an augmented version of the original query. This component’s output is suitable for any component asking for Input or Context.

The difference Query Expansion makes

You can safely assume that users will find many ways to phrase the same question and make all sorts of spelling mistakes. To demonstrate, we’ll put the Query Expansion through a stress test.

Let’s try a query using an unlikely term. We’ll take it a bit further by making some heavy typos. Lastly, let’s not forget to botch the product name.

This is our final test query:

“What the expendatur of urslab?”

Let’s see how the bot fares without the Query Expansion first:

Example of bot's answer without Query Expansion in FlowHunt

It figured out we were talking about expenditures but struggled to find suitable information. It then opted to send us to the contact page instead.

Now let’s try with Query Expansion:

Example of bot's answer with Query Expansion in FlowHunt

This time, it understands the query and retrieves the correct information from linked knowledge sources.

Note: Even without Query Expansion, the chatbot is bound to figure out most queries, but the result may vary. Query Expansion ensures consistency.

Discover how FlowHunt's GoogleSearch enhances chatbot accuracy by retrieving up-to-date info using Retrieval-Augmented Generation. Visit now!

GoogleSearch

Discover how FlowHunt's GoogleSearch enhances chatbot accuracy by retrieving up-to-date info using Retrieval-Augmented Generation. Visit now!

Effortlessly build AI flows with FlowHunt's no-code drag-and-drop editor. Create, test, and deploy chatbots visually. Start for free today!

Flow Editor

Effortlessly build AI flows with FlowHunt's no-code drag-and-drop editor. Create, test, and deploy chatbots visually. Start for free today!

Ensure accurate AI responses with FlowHunt's Document Retriever. Connect your data sources for reliable, up-to-date information. Try for free!

Document Retriever

Ensure accurate AI responses with FlowHunt's Document Retriever. Connect your data sources for reliable, up-to-date information. Try for free!

Discover seamless AI chatbot integrations with your favorite tools on FlowHunt. Enhance productivity and customer service effortlessly!

Integrations

Discover seamless AI chatbot integrations with your favorite tools on FlowHunt. Enhance productivity and customer service effortlessly!

Our website uses cookies. By continuing we assume your permission to deploy cookies as detailed in our privacy and cookies policy.