Real-Time Domain-Specific RAG Chatbot

A real-time chatbot that uses Google Search restricted to your own domain, retrieves relevant web content, and leverages OpenAI LLM to answer user queries with up-to-date information. Ideal for providing accurate, domain-specific responses in customer support or information portals.

How the AI Flow works - Real-Time Domain-Specific RAG Chatbot

Flows

How the AI Flow works

User Query Input.
Captures user questions via chat input or pre-defined buttons.
Query Expansion.
Paraphrases and expands the user query to improve retrieval accuracy.
Domain-Specific Google Search.
Performs a Google Search limited to the specified domain using the expanded queries.
Web Content Retrieval.
Fetches the content from the top relevant URLs returned by the search.
LLM Response Generation.
Uses OpenAI LLM to generate a final, context-enriched answer displayed to the user.

Prompts used in this flow

Below is a complete list of all prompts used in this flow to achieve its functionality. Prompts are the instructions given to the AI model to generate responses or perform actions. They guide the AI in understanding user intent and generating relevant outputs.

Components used in this flow

Below is a complete list of all components used in this flow to achieve its functionality. Components are the building blocks of every AI Flow. They allow you to create complex interactions and automate tasks by connecting various functionalities. Each component serves a specific purpose, such as handling user input, processing data, or integrating with external services.

ChatInput

The Chat Input component in FlowHunt initiates user interactions by capturing messages from the Playground. It serves as the starting point for flows, enabling the workflow to process both text and file-based inputs.

Chat Output

Discover the Chat Output component in FlowHunt—finalize chatbot responses with flexible, multi-part outputs. Essential for seamless flow completion and creating advanced, interactive AI chatbots.

Button Widget

The Button Widget component in FlowHunt transforms text or input into interactive, clickable buttons within your workflow. Perfect for creating dynamic user interfaces, collecting user choices, and improving engagement in AI-driven chatbots or automated processes.

Chat Opened Trigger

The Chat Opened Trigger component detects when a chat session starts, enabling workflows to respond instantly as soon as a user opens the chat. It initiates flows with the initial chat message, making it essential for building responsive, interactive chatbots.

Chat History Component

The Chat History component in FlowHunt enables chatbots to remember previous messages, ensuring coherent conversations and improved customer experience while optimizing memory and token usage.

Prompt Component in FlowHunt

Learn how FlowHunt's Prompt component lets you define your AI bot’s role and behavior, ensuring relevant, personalized responses. Customize prompts and templates for effective, context-aware chatbot flows.

Generator

Explore the Generator component in FlowHunt—powerful AI-driven text generation using your chosen LLM model. Effortlessly create dynamic chatbot responses by combining prompts, optional system instructions, and even images as input, making it a core tool for building intelligent, conversational workflows.

LLM OpenAI

FlowHunt supports dozens of text generation models, including models by OpenAI. Here's how to use ChatGPT in your AI tools and chatbots.

Query Expansion

Query Expansion in FlowHunt enhances chatbot understanding by finding synonyms, fixing spelling errors, and ensuring consistent, accurate responses for user queries.

GoogleSearch Component

FlowHunt's GoogleSearch component enhances chatbot accuracy using Retrieval-Augmented Generation (RAG) to access up-to-date knowledge from Google. Control results with options like language, country, and query prefixes for precise and relevant outputs.

URL Retriever

Unlock web content in your workflows with the URL Retriever component. Effortlessly extract and process the text and metadata from any list of URLs—including web articles, documents, and more. Supports advanced options like OCR for images, selective metadata extraction, and customizable caching, making it ideal for building knowledge-rich AI flows and automations.

Flow description

Purpose and benefits

Overview

This workflow implements a simple Retrieval-Augmented Generation (RAG) chatbot that leverages real-time Google Search to retrieve up-to-date information from the internet—specifically, it can be customized to restrict all searches to a particular domain. The main goal is to create a chatbot that can answer user queries using the most relevant and recent content found online, making it highly valuable for scenarios where static knowledge bases are insufficient.

Key Components and Flow

The workflow is composed of several modular blocks, each representing a specific capability. Below is a breakdown of the workflow’s structure and functionality:

ComponentRole
Chat InputReceives user queries and chat messages.
Chat HistoryMaintains conversation history for context-aware responses.
Query ExpansionParaphrases user input into multiple alternative queries to improve search coverage.
Google SearchExecutes searches on Google, restricted by a customizable domain prefix.
URL RetrieverExtracts content from the URLs returned by Google Search.
Prompt TemplateStructures context, user input, and history for the language model.
OpenAI LLMGenerates responses using a language model (e.g., GPT-3/4).
GeneratorInvokes the LLM with the prompt and context to produce the answer.
Chat OutputDisplays chatbot responses to the user.
Button WidgetsProvides quick example queries for users to try with a single click.
Chat Opened TriggerInitializes the conversation and populates quick-start buttons.

How the Workflow Operates

When a user opens the chat, the Chat Opened Trigger activates. This initializes the chat interface and presents several Button Widgets with example queries (e.g., “what dinosaur has 500 teeth?”). When a user clicks a button or enters a custom message via Chat Input, the workflow proceeds as follows:

  1. Query Expansion: The user’s input is paraphrased into multiple versions to maximize the likelihood of retrieving relevant search results.

  2. Google Search: The expanded queries are sent to Google Search. By default, the search is limited to a specific domain (set by the query_prefix field, e.g., site: www.YOURDOMAIN.com), allowing you to focus the chatbot’s knowledge on your own website or any trusted source.

  3. URL Retriever: The workflow retrieves the content of the top search results (URLs) as full documents.

  4. Prompt Assembly: The retrieved content, user input, and chat history are combined using the Prompt Template component to provide rich context for the answer.

  5. Language Model Generation: The prompt is sent to the OpenAI LLM, which generates a coherent and contextually relevant response.

  6. Response Output: The generated answer is displayed to the user via the Chat Output.

Example Use Case Flow

  • User opens chat: Welcome message and three example question buttons appear.
  • User clicks “when is mother’s day 2024?”: The question is immediately shown in the chat output (for instant feedback).
  • The workflow runs the query through expansion, search, retrieval, prompt assembly, and LLM generation, then displays the answer.

Why This Workflow is Useful

  • Real-time Knowledge: The chatbot can answer questions using the latest information available on the internet or your chosen domain.
  • Domain Restriction: By customizing the query_prefix, you can ensure the chatbot sources information only from your trusted website or knowledge base, improving the reliability of answers.
  • Context Awareness: By including chat history and retrieved content in the prompt, responses can be tailored and contextually relevant for multi-turn conversations.
  • Scalability and Automation: The modular design allows the workflow to be easily extended or adapted for various domains, supporting large-scale deployment across different topics or websites.
  • User Experience: Quick-start buttons and instant feedback make the chatbot approachable for end-users.

Workflow Summary Table

StepDescription
User InputUser types a question or clicks a quick-start button
Query ExpansionInput is paraphrased for broader search coverage
Google SearchSearches are performed on Google, restricted to a given domain
URL Content RetrievalTop search result contents are fetched
Prompt ConstructionUser input, search results, and chat history are compiled into a prompt
LLM GenerationOpenAI LLM generates a response using the full context
OutputResponse is shown to the user

Customization

  • To focus the chatbot on your own domain, modify the query_prefix field in the Google Search component (e.g., site: www.YOURDOMAIN.com).
  • Add or change example queries using the Button Widget components for a more tailored user experience.

Ideal Use Cases

  • Customer support bots that always give answers based on your up-to-date documentation or web content.
  • Internal knowledge assistants limited to your company’s intranet or support portal.
  • Any chatbot that must always cite or rely on external, authoritative sources (e.g., for compliance or accuracy).

By automating the search, retrieval, and answer generation process, this workflow saves manual research time and ensures users always get the most current and relevant information available.

Let us build your own AI Team

We help companies like yours to develop smart chatbots, MCP Servers, AI tools or other types of AI automation to replace human in repetitive tasks in your organization.

Learn more

ChatGPT Knowledge Base Assistant
ChatGPT Knowledge Base Assistant

ChatGPT Knowledge Base Assistant

AI chatbot assistant powered by OpenAI GPT-4o that automatically searches and leverages internal company documents to answer user questions. Delivers context-aw...

3 min read
AI Chatbot with Real-Time Web & Knowledge Search
AI Chatbot with Real-Time Web & Knowledge Search

AI Chatbot with Real-Time Web & Knowledge Search

A powerful AI chatbot that answers user questions in real-time by retrieving and synthesizing information from Google, Reddit, Wikipedia, Arxiv, Stack Exchange,...

3 min read
LiveAgent AI Chatbot Support
LiveAgent AI Chatbot Support

LiveAgent AI Chatbot Support

Automate customer support in LiveAgent with an AI chatbot that answers questions using your internal knowledge base, retrieves relevant documents, and seamlessl...

4 min read