Skip to main content

AI Assistant which answers questions with a RAG MCP and a Search Engine MCP

Workflow preview

Workflow preview
100%
AI Assistant which answers questions with a RAG MCP and a Search Engine MCP preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Build an AI Agent which accesses two MCP Servers: a RAG MCP Server and a Search Engine API MCP Server. This workflow contains community nodes that are only compatible with the self hosted version o...

Best for

  • Support Chatbot automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-mcp.mcpclienttool, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.mcpclienttool

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Thomas Janssen.

Original n8n.io source

1.1 Workflow description

Title
AI Assistant which answers questions with a RAG MCP and a Search Engine MCP
Workflow name
AI Assistant which answers questions with a RAG MCP and a Search Engine MCP

Build an AI Agent which accesses two MCP Servers: a RAG MCP Server and a Search Engine API MCP Server.

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Tutorial

Click here to watch the full tutorial on YouTube!

How it works

We build an AI Agent which has access to two MCP servers:

  • An MCP Server with a RAG database (click here for the RAG MCP Server
  • An MCP Server which can access a Search Engine, so the AI Agent also has access to data about more current events

Installation

  1. In order to use the MCP Client, you also have to use MCP Server Template.

  2. Open the MCP Client "MCP Client: RAG" node and update the SSE Endpoint to the MCP Server workflow

  3. Install the "n8n-nodes-mcp" community node via settings > community nodes

  4. ONLY FOR SELF-HOSTING: In Docker, click on your n8n container. Navigate to "Exec" and execute the below command to allow community nodes:

N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true

  1. Navigate to Bright Data and create a new "Web Unlocker API" with the name "mcp_unlocker".

  2. Open the "MCP Client" and add the following credentials:

How to use it

  1. Run the Chat node and start asking questions

More detailed instructions

Missed a step? Find more detailed instructions here: Personal Newsfeed With Bright Data and n8n

What is Retrievel Augmented Generation (RAG)?

Large Language Models (LLM's) are trained on data until a specific cutoff date. Imagine a model is trained in December 2023 based data until September 2023. This means the model doesn't have any knowledge about events which happened in 2024. So if you ask the LLM who was the Formula 1 World Champion of 2024, it doesn't know the answer.

The solution? Retrieval Augmented Generation. When using Retrieval Augmented Generation, a user's question is being sent to a semantic database. The LLM will use the information retrieved from the semantic database to answer the user's question.

What is Model Context Protocol (MCP)?

MCP is a communication protocol which is used by AI agents to call tools hosted on external servers.

When an MCP client communicates with an MCP server, the server will provide an overview of all its tools, prompts and resources. The MCP server can then choose which tools to execute (based on the user's request) and execute the tools.

An MCP client can communicate with multiple MCP servers, which can all host multiple tools.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 3 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 4 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 5 - MCP_Search_List_Tools

Type / Role
n8n-nodes-mcp.mcpClientTool - mcpClientTool
Config choices
Version 1

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - MCP_Search_Search_Engine

Type / Role
n8n-nodes-mcp.mcpClientTool - mcpClientTool
Config choices
Version 1

Block 9 - RAG MCP Server

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1

Block 10 - MCP Client

Type / Role
n8n-nodes-mcp.mcpClientTool - mcpClientTool
Config choices
Version 1

3. Summary Table

Workflow AI Assistant which answers questions with a RAG MCP and a Search Engine MCP
Complexity intermediate
Nodes 10
Categories Support Chatbot, AI RAG
Author Thomas Janssen
Published 27 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5398/5398.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI Assistant which answers questions with a RAG MCP and a Search Engine MCP do?

Build an AI Agent which accesses two MCP Servers: a RAG MCP Server and a Search Engine API MCP Server. This workflow contains community nodes that are only compatible with the self hosted version o...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI RAG use case.