Skip to main content

🤖 Create a Documentation Expert Bot with RAG, Gemini, and Supabase

Workflow preview

Workflow preview
100%
🤖 Create a Documentation Expert Bot with RAG, Gemini, and Supabase 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-nodes-base.stickynote, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.vectorstoresupabase, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.removeduplicates, n8n-nodes-base.filter, n8n-nodes-base.set

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
🤖 Create a Documentation Expert Bot with RAG, Gemini, and Supabase
Workflow name
🤖 Create a Documentation Expert Bot with RAG, Gemini, and Supabase

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 the 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 your own private knowledge base (a Supabase vector store). This is like a librarian reading every book and creating a hyper-detailed index card for every paragraph.

  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 (like 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: ~15-20 minutes

This is an advanced workflow that requires setting up a free external database. Follow these steps carefully.

  1. Set up Supabase (Your Knowledge Base):

    • You need a free Supabase account.
    • Follow the detailed instructions in the large Workflow Setup sticky notes in the top-right of the workflow to:
      1. Create a new Supabase project.
      2. Run the provided SQL query in the SQL Editor to prepare your database.
      3. Get your Project URL and Service Role Key.
  2. Configure n8n Credentials:

    • In your n8n instance, create a new Supabase credential using the Project URL and Service Role Key from the previous step.
    • Create a new Google AI credential with your Gemini API key.
  3. Configure the Workflow Nodes:

    • Select your new Supabase credential in the three Supabase nodes: Your Supabase Vector Store, Official n8n Documentation and Keep Supabase Instance Alive.
    • Select your new Google AI credential in the three Gemini nodes: Gemini Chunk Embedding, Gemini Query Embedding and Gemini 2.5 Flash.
  4. Build the Knowledge Base:

    • Find the Start Indexing manual trigger node at the top-left.
    • Click its "Execute workflow" button to start the indexing process. This will take several minutes as it scrapes and processes the entire n8n documentation. You only need to do this once.
  5. Chat with Your Expert Agent:

    • Once the indexing is complete, Activate the entire workflow.
    • Open the RAG Chatbot chat trigger node 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 - Sticky Note3

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

Block 2 - Simple Memory

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

Block 3 - Official n8n Documentation

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

Block 4 - Default Data Loader

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

Block 5 - Recursive Character Text Splitter

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

Block 6 - Remove Duplicate Documentation Content

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

Block 7 - Only Keep Doc Paths

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

Block 8 - Clean Documentation

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

Block 9 - Gemini 2.5 Flash

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

Block 10 - Your Supabase Vector Store

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

Block 11 - Get All n8n Documentation Links

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

Block 12 - Extract Links from HTML

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

Block 13 - Split Out Links

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

Block 14 - Remove Duplicate Links

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

Block 15 - Add Documentation Page to Vector Store

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

Block 16 - Get Documentation Page

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

Block 17 - Extract Documentation Content

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

Block 18 - Sticky Note

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

Block 19 - Gemini Query Embedding

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

Block 20 - Gemini Chunk Embedding

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

Block 21 - Keep Supabase Instance Alive

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

Block 22 - Every 6 Days

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

Block 23 - Sticky Note2

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

Block 24 - Loop Over Documentation Pages

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

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

3. Summary Table

Workflow 🤖 Create a Documentation Expert Bot with RAG, Gemini, and Supabase
Complexity advanced
Nodes 55
Categories Internal Wiki, AI RAG
Author Lucas Peyrin
Published 14 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5993/5993.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 🤖 Create a Documentation Expert Bot with RAG, Gemini, and Supabase 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.