Skip to main content

🤖 Build a Documentation Expert Chatbot with Gemini RAG Pipeline

Workflow preview

Workflow preview
100%
🤖 Build a Documentation Expert Chatbot with Gemini RAG Pipeline preview
Open on n8n.io

Important notice

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

1. Workflow Overview

How it works This template is a complete, hands on tutorial for building a RAG (Retrieval Augmented Generation) pipeline. In simple terms, you'll teach an AI to become an expert on a specific topic...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.removeduplicates, n8n-nodes-base.filter, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.httprequest

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
🤖 Build a Documentation Expert Chatbot with Gemini RAG Pipeline
Workflow name
🤖 Build a Documentation Expert Chatbot with Gemini RAG Pipeline

How it works

This template is a complete, hands-on tutorial for building a RAG (Retrieval-Augmented Generation) pipeline. In simple terms, you'll teach an AI to become an expert on a specific topic—in this case, the official n8n documentation—and then build a chatbot to ask it questions.

Think of it like this: instead of a general-knowledge AI, you're building an expert librarian.

The workflow is split into two main parts:

  1. Part 1: Indexing the Knowledge (Building the Library) This is a one-time process you run manually. The workflow automatically scrapes all pages of the n8n documentation, breaks them down into small, digestible chunks, and uses an AI model to create a special numerical representation (an "embedding") for each chunk. These embeddings are then stored in n8n's built-in Simple Vector Store. This is like a librarian reading every book and creating a hyper-detailed index card for every paragraph.

    Important: This in-memory knowledge base is temporary. It will be erased if you restart your n8n instance, and you will need to run the indexing process again.

  2. Part 2: The AI Agent (The Expert Librarian) This is the chat interface. When you ask a question, the AI agent doesn't guess the answer. Instead, it uses your question to find the most relevant "index cards" (chunks) from the knowledge base it just built. It then feeds these specific, relevant chunks to a powerful language model (Gemini) with a strict instruction: "Answer the user's question using ONLY this information." This ensures the answers are accurate, factual, and grounded in your provided documents.

Set up steps

Setup time: ~2 minutes (plus ~15-20 minutes for indexing)

This template uses n8n's built-in tools, removing the need for an external database. Follow these simple steps to get started.

  1. Configure Google AI Credentials:

    • You will need a Google AI API key for the Gemini models.
    • In your n8n workflow, go to any of the three Gemini nodes (e.g., Gemini 2.5 Flash).
    • Click the Credential dropdown and select + Create New Credential.
    • Enter your Gemini API key and save.
  2. Apply Credentials to All Nodes:

    • Your new Google AI credential is now saved. Go to the other two Gemini nodes (Gemini Chunk Embedding and Gemini Query Embedding) and select your newly created credential from the dropdown list.
  3. Build the Knowledge Base:

    • Find the Start Indexing manual trigger node at the top-left of the workflow.
    • Click its "Execute workflow" button to start the indexing process.
    • ⚠️ Be Patient: This will take 15-20 minutes as it scrapes and processes the entire n8n documentation. You only need to do this once per n8n session. If you restart n8n, you must run this step again.
  4. Chat with Your Expert Agent:

    • Once the indexing is complete, Activate the entire workflow using the toggle at the top of the screen.
    • Open the RAG Chatbot chat trigger node (bottom-left) and copy its Public URL.
    • Open the URL in a new tab and start asking questions about n8n! For example: "How does the IF node work?" or "What is a sub-workflow?".

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 - Simple Memory

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

Block 2 - Default Data Loader

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

Block 3 - Recursive Character Text Splitter

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

Block 4 - Remove Duplicate Documentation Content

Type / Role
n8n-nodes-base.removeDuplicates - removeDuplicates
Config choices
Version 2

Block 5 - Only Keep Doc Paths

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 6 - Clean Documentation

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Gemini 2.5 Flash

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

Block 8 - Get All n8n Documentation Links

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Extract Links from HTML

Type / Role
n8n-nodes-base.html - html
Config choices
Version 1.2

Block 10 - Split Out Links

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

Block 11 - Remove Duplicate Links

Type / Role
n8n-nodes-base.removeDuplicates - removeDuplicates
Config choices
Version 2

Block 12 - Add Documentation Page to Vector Store

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.2

Block 13 - Get Documentation Page

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Extract Documentation Content

Type / Role
n8n-nodes-base.html - html
Config choices
Version 1.2

Block 15 - Gemini Query Embedding

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

Block 16 - Gemini Chunk Embedding

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

Block 17 - Sticky Note2

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

Block 18 - Loop Over Documentation Pages

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 19 - Sticky Note4

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

Block 20 - Sticky Note5

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

Block 21 - n8n Docs AI Agent

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

Block 22 - Sticky Note6

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

Block 23 - Sticky Note7

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

Block 24 - Sticky Note8

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

Showing the first 24 of 48 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow 🤖 Build a Documentation Expert Chatbot with Gemini RAG Pipeline
Complexity advanced
Nodes 48
Categories Internal Wiki, AI RAG
Author Lucas Peyrin
Published 18 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6137/6137.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 🤖 Build a Documentation Expert Chatbot with Gemini RAG Pipeline do?

How it works This template is a complete, hands on tutorial for building a RAG (Retrieval Augmented Generation) pipeline. In simple terms, you'll teach an AI to become an expert on a specific topic...

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 Internal Wiki, AI RAG use case.