Build a specialized, hallucination-free AI documentation expert using RAG (Retrieval-Augmented Generation) in an advanced n8n workflow. This template indexes the n8n docs using Gemini embeddings.
Download this n8n workflow template and start using it instantly.



















The ability to query proprietary or vast document sets accurately is essential for modern AI applications. This advanced n8n workflow provides a complete, production-ready blueprint for implementing a sophisticated RAG pipeline. It elegantly solves the 'hallucination' problem by forcing the AI (Gemini 2.5 Flash) to answer questions based only on the provided, indexed content—in this case, the official n8n documentation. The entire n8n workflow template is divided into two distinct parts: a memory-efficient indexing pipeline that scrapes, chunks, and stores documentation content, and a live, low-latency chatbot powered by an n8n trigger and an AI agent. This powerful n8n workflow demonstrates best practices for managing large-scale data ingestion and retrieval using specialized n8n node types.
This n8n workflow operates in two phases: Indexing and Chat.
Start Indexing manual n8n trigger node.Get All n8n Documentation Links n8n node performs an HTTP Request to the main documentation page, and the Extract Links from HTML node extracts all links.Remove Duplicate Links and Only Keep Doc Paths filter the scraped data, ensuring only valid n8n documentation paths are processed.Loop Over Documentation Pages n8n node splits the paths into batches, utilizing the Execute Workflow n8n node (Add Documentation Page to Vector Store) to call the bottom section as a sub-workflow for each page. This approach is crucial for optimizing memory usage across the thousands of pages.Get Documentation Page n8n node fetches the content, which is then extracted and cleaned by the Extract Documentation Content and Clean Documentation n8n nodes.Recursive Character Text Splitter node to create small, overlapping document chunks. The Gemini Chunk Embedding n8n node converts these chunks into numerical vectors (embeddings).Simple Vector Store n8n node (set to 'insert' mode with the key n8ndocumentationvectorstore) saves the text and their corresponding vectors into the in-memory knowledge base, completing the setup for the RAG n8n workflow.RAG Chatbot n8n trigger (Chat Trigger node).n8n Docs AI Agent n8n node, which acts as the 'brain' of the operation.Simple Memory n8n node provides conversational history, allowing the Agent to understand follow-up questions.Official n8n Documentation (a Vector Store configured as a tool).Gemini Query Embedding n8n node.n8ndocumentationvectorstore) to retrieve the top 10 most contextually relevant documentation chunks.Gemini 2.5 Flash n8n node to synthesize a final, highly accurate answer based exclusively on the provided context, which is then returned to the user via the n8n trigger interface.To deploy and use this powerful RAG n8n workflow template, follow these steps:
Gemini 2.5 Flash n8n node.+ Create New Credential.Gemini Chunk Embedding, Gemini Query Embedding) are updated to use this new credential.Start Indexing n8n trigger node at the top-left of the canvas.RAG Chatbot n8n trigger node and use its Public URL or 'Open Chat' button to start asking questions of your new n8n documentation expert. Start Indexing (Manual Trigger): The initial n8n trigger point for manually running the documentation ingestion process.
RAG Chatbot (Chat Trigger): The public-facing n8n trigger that captures user input for the live chatbot. It provides the user interface for this n8n workflow.
Get All n8n Documentation Links (HTTP Request): Scrapes the main n8n documentation page to find all available links to process.
Extract Links from HTML (HTML n8n node): Parses the HTML response to extract all href attributes, which are the source paths for the RAG pipeline.
Remove Duplicate Documentation Content (Remove Duplicates n8n node): Crucially configured to 'Remove items seen in previous executions,' ensuring that the expensive embedding process is only run on new or updated documentation pages across multiple runs of the n8n workflow.
Recursive Character Text Splitter (Langchain n8n node): Breaks down large documentation articles into smaller, manageable chunks (1500 characters with 200 character overlap) suitable for high-quality embedding and retrieval.
Gemini Chunk Embedding / Gemini Query Embedding (Langchain Embeddings n8n node): Uses the Gemini model to convert text chunks (for storage) and user queries (for retrieval) into numerical vectors, which is the core of the RAG mechanism.
Simple Vector Store (Langchain Vector Store n8n node): Used in two modes:
insert: To store the newly created documentation chunks and vectors.
retrieve-as-tool: To allow the AI Agent to search the vector database for relevant documents during a chat query.
n8n Docs AI Agent (Langchain Agent n8n node): The control layer that interprets the user's question, manages the conversation flow, and decides when to use the Vector Store tool to retrieve context before generating an answer with the LLM.
Gemini 2.5 Flash (Langchain LLM n8n node): The Large Language Model used by the Agent for synthesizing the final answer based on the retrieved documentation context.
Implement a powerful RAG system using this n8n workflow. Automatically index Google Drive PDFs using Cohere embeddings and Milvus, then query documents instantly via an OpenAI-powered n8n agent.

Build an automatic RAG system with this n8n workflow. Integrate Google Drive, OpenAI embeddings, and Pinecone vector database for real-time, context-aware document QA.

Build and deploy an intelligent RAG customer support agent using this powerful n8n workflow. Leverage the GPT-5 model, Pinecone vector database, and LangChain nodes for contextual and accurate responses via Telegram.

Deploy a robust, dual-path AI customer support system using this n8n workflow. It combines Google Sheets for static FAQ retrieval (RAG) and Google Gemini for intelligent fallback responses. Use this n8n template to ensure accurate, boundary-aware AI support.

Use this powerful n8n workflow to build a custom RAG (Retrieval-Augmented Generation) agent powered by Google Gemini and private knowledge stored in PostgreSQL vector databases (GLPI, Confluence).

Innovative builder with a passion for crafting automation solutions that solve real-world challenges. From streamlining workflows to driving efficiency, my work empowers teams and individuals to achieve more with less effort. Experienced in developing scalable tools and strategies that deliver results with n8n, supabase and cline.







































