Back to Catalog

AI chatbot that can search the web

n8n Teamn8n Team
88093 views
2/3/2026
Official Page

This workflow is designed for dynamic and intelligent conversational capabilities. It incorporates OpenAI's GPT-4o model for natural language understanding and generation. Additional tools include SerpAPI and Wikipedia for enriched, data-driven responses. The workflow is triggered manually, and utilizes a 'Window Buffer Memory' to maintain the context of the last 20 interactions for better conversational continuity. All these components are orchestrated through n8n nodes, ensuring seamless interconnectivity.

To use this template, you need to be on n8n version 1.50.0 or later.

AI Chatbot that can Search the Web

This n8n workflow creates a conversational AI chatbot that can answer questions by leveraging web search capabilities. It acts as an intelligent assistant, capable of understanding user queries and finding relevant information online to provide comprehensive responses.

What it does

This workflow automates the following steps:

  1. Listens for chat messages: It triggers when a new chat message is received from a user.
  2. Maintains conversational memory: It uses a simple memory buffer to keep track of the conversation history, allowing the AI to understand context.
  3. Utilizes an AI Chat Model: It employs an OpenAI Chat Model to process user input and generate responses.
  4. Integrates web search tools: It empowers the AI with two powerful tools:
    • SerpApi (Google Search): To perform real-time Google searches for up-to-date information.
    • Wikipedia: To retrieve information from Wikipedia for factual queries.
  5. Generates AI responses: The AI Agent orchestrates the use of the chat model and the search tools to formulate a relevant and informative answer to the user's query.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n instance: A running n8n instance (self-hosted or cloud).
  • OpenAI API Key: For the "OpenAI Chat Model" node. You can obtain one from the OpenAI platform.
  • SerpApi API Key: For the "SerpApi (Google Search)" node. You can get one from SerpApi.
  • Wikipedia: No API key is directly required for the Wikipedia tool, but it relies on external access.

Setup/Usage

  1. Import the workflow:
    • Download the provided JSON file.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the three-dot menu in the top right and select "Import from JSON".
    • Paste the workflow JSON or upload the file.
  2. Configure credentials:
    • Locate the "OpenAI Chat Model" node and configure your OpenAI API Key credential.
    • Locate the "SerpApi (Google Search)" node and configure your SerpApi API Key credential.
  3. Activate the workflow:
    • Click the "Activate" toggle in the top right corner of the workflow editor to enable it.
  4. Start chatting:
    • Send a message to the configured chat trigger (e.g., via a chat service connected to n8n if you've configured a specific chat platform with the "Chat Trigger" node, or directly through the n8n chat UI if available). The AI chatbot will process your query and respond.

Related Templates

Two way sync Pipedrive and MySQL

This workflow automates a two way sync of customer data between Pipedrive and MySQL. It will create new records in one source if it only exists in the other. Where matching records have different data for name, phone number or email address, it will sync the most recently updated version.

n8n TeamBy n8n Team
14459

Force AI to use a specific output format

This workflow is for anyone looking to automatically fetch, validate, and parse complex language-based queries into a structured format. Its unique capability lies in not only processing language but also fixing invalid outputs before structuring them. Note that to use this template, you need to be on n8n version 1.19.4 or later.

n8n TeamBy n8n Team
15889

Create Monday item on a new Mautic contact

This workflow creates a new item in a Monday.com board when a new contact is created in Mautic. Additional fields can be added to the workflow to send more data to Monday.com. Prerequisites Monday account and Monday credentials. Mautic account and Mautic credentials. How it works When a new contact is created in Mautic, the workflow creates a new item in the Monday.com board. By default the workflow will send the contact's email address to Monday.com and name the item after the contact's first and last name. Setup This workflow requires that you set up a Monday.com board. To do so, follow the steps below: In Monday.com, create a new item board. In the board, add the following columns: Email (with type "Email") Any other fields you require to the board. If more columns are created, you will need to find out what their ID's are by turning on developer mode as explained in this Monday article. With these new IDs, you can add them to the Create item Monday.com node, this is explained further in the workflow as a sticky note.

n8n TeamBy n8n Team
1289