Q&A Bot Using Lookio Knowledge Base and GPT - n8n Workflow

Create a powerful RAG Q&A agent using an n8n workflow. This n8n template integrates specialized n8n nodes for LangChain, OpenAI, and the Lookio knowledge base for intelligent, contextualized responses.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI developers and engineers needing a custom Retrieval-Augmented Generation (RAG) solution.
Businesses using Lookio for documentation and customer support looking for a low-code integration tool.
Users searching for advanced n8n templates focusing on conversational AI and complex data retrieval.
Automation specialists deploying bespoke chat agents using the n8n platform.

Overview

This powerful n8n workflow solution leverages specialized n8n nodes for LangChain to deploy a sophisticated conversational agent. The primary purpose is to provide highly accurate, contextual answers by utilizing data stored in your Lookio knowledge base. By orchestrating the flow, the agent saves on API costs; it is configured to handle simple greetings and small talk directly using the large language model (LLM), only engaging the expensive Lookio retrieval tool when a specific, knowledge-based question is detected. This robust n8n workflow is a perfect example of intelligent flow control, ensuring efficient, precise, and cost-effective knowledge delivery.

How it Works

The entire flow is managed by an AI Agent architecture within n8n.


  1. Initiation (n8n trigger): The process begins with the When chat message received n8n trigger. This acts as the entry point for a user's query into the n8n workflow.

  2. Agent Orchestration: The message is passed to the AI Knowledge Agent n8n node, which serves as the brain of the operation. This agent’s system prompt instructs it to prioritize using the knowledge base tool for informational questions.

  3. Context and Memory: The agent uses the Simple Memory n8n node to maintain conversational history, ensuring the responses are relevant to the preceding dialogue.

  4. Language Model Selection: The agent connects to the OpenAI Chat Model (configured for GPT-4.1-mini) for core reasoning, generating responses, and deciding whether to call a tool.

  5. Tool Decision: Based on the user query, the agent determines if external knowledge is required. If so, it calls the Query knowledge base tool.

  6. Knowledge Retrieval: The Query knowledge base n8n node executes an HTTP POST request to the Lookio API, sending the user's question, Assistant ID, and API key to retrieve relevant documents or answers.

  7. Final Response: The results from Lookio are returned to the AI Knowledge Agent. The agent synthesizes this information with the conversational context and delivers the final, informed response back to the user via the chat trigger, completing the n8n workflow execution cycle.

Installation Guide

To set up this advanced n8n workflow, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON data and paste it directly into your n8n instance using the 'Import from JSON' function.

  2. Lookio Setup: You must have an active assistant and documents uploaded in your Lookio account. Obtain your Lookio API key and the Assistant ID for the specific knowledge base you wish to query.

  3. Configure Credentials:

OpenAI Chat Model n8n node: Select or create your OpenAI credential, ensuring you have access to the specified model (GPT-4.1-mini or equivalent).

  1. Configure the Tool n8n node: Open the Query knowledge base n8n node.

In the Body Parameters, replace with the actual ID from Lookio.
* In the Header Parameters, replace with your Lookio API key.

  1. Activate: Save the n8n workflow and set it to 'Active' to start listening for chat messages. This robust n8n template is now ready for use.

Node Details

This n8n template utilizes several specialized nodes to function as an effective AI agent:

When chat message received (n8n trigger): This is the initiating n8n trigger for the automation. It listens for incoming chat messages and feeds the text into the LangChain Agent for processing.
AI Knowledge Agent: The core orchestration n8n node. It manages the flow, deciding whether to answer using its internal LLM reasoning or to call external tools (Lookio) based on the context provided in its system message.
OpenAI Chat Model: Provides the necessary reasoning capabilities (using GPT-4.1-mini) for the agent to understand context, synthesize retrieved knowledge, and generate human-like responses. Requires an active OpenAI API credential.
Simple Memory: A LangChain n8n node component that stores the recent conversation history, allowing the agent to maintain context across multiple turns.


  • Query knowledge base (n8n node - HTTP Request Tool): This is the custom tool that the agent calls. It’s configured as an HTTP POST request to the Lookio API, passing the user query and the required Lookio Assistant ID and API key to perform the RAG lookup.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

AI and automation expert

Featured*