{"id":"98c142f4-32a7-4a62-bc38-2538ca6f5bb8","slug":"n8n-6281-n8n-documentation-expert-chatbot-with-openai-rag-pipel","name":"N8N Documentation Expert Chatbot with OpenAI RAG Pipeline","description":"How It Works\n\nThis 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.\n\nThink of it like this: instead of a general-knowledge AI, you're building an expert librarian.\n\n🔧 Workflow Overview\n\nThe workflow is split into two main parts:\n\nPart 1: Indexing the Knowledge (📚 Building the Library)\n\nThis is a one-time process you run manually. The workflow will:\n\nAutomatically scrape all pages of the n8n documentation.\nBreak them down into small, digestible chunks.\nUse an AI model to create a numerical representation (an embedding) for each chunk.\nStore these embeddings in n8n's built-in Simple Vector Store.\n\n&gt; This is like a librarian reading every book and creating a hyper-detailed index card for every paragraph.\n\n&gt; ⚠️ Important: This in-memory knowledge base is temporary. It will be erased if you restart your n8n instance. You'll need to run the indexing process again in that case.\n\nPart 2: The AI Agent (🧠 The Expert Librarian)\n\nThis is the chat interface.\n\nWhen you ask a question:\n\nThe AI agent doesn't guess the answer.\nIt searches the knowledge base to find the most relevant “index cards” (chunks).\nIt feeds those chunks to a language model (Gemini) with strict instructions:\n   &gt; “Answer the user's question using ONLY this information.”\n\nThis ensures answers are accurate, factual, and grounded in your documents.\n\n🚀 Setup Steps\n\n&gt; Total setup time: ~2 minutes  \n&gt; Indexing time: ~15–20 minutes\n\nThis template uses n8n’s built-in tools, so no external database is needed.\n\n1. Configure OpenAI Credentials\n\nYou’ll need an OpenAI API key (for GPT models).\nIn your n8n workflow:\n  Go to any of the three OpenAI nodes (e.g., OpenAI Chat Model).\n  Click the Credential dropdown → + Create New Credential.\n  Enter your OpenAI API key and save.\n\n2. Apply Credentials to All Nodes\n\nYour new credential is now saved.\nGo to the other two OpenAI nodes (e.g., OpenAI Embeddings) and select the newly created credential from the dropdown.\n\n3. Build the Knowledge Base\n\nFind the Start Indexing manual trigger node (top-left of the workflow).\nClick the Execute Workflow button to start indexing.\n\n&gt; ⚠️ Be patient: This takes 15–20 minutes to scrape and process the full documentation.  \n&gt; You only need to do this once per n8n session.\n\n4. Chat With Your Expert Agent\n\nAfter indexing completes, activate the entire workflow (toggle at the top).\nOpen the RAG Chatbot chat trigger node (bottom-left).\nCopy its Public URL.\nOpen it in a new tab and ask questions about n8n!\n\nExample questions:\n\n\"How does the IF node work?\"\n\"What is a sub-workflow?\"\n\n👤 Credits\n\nAll credits go to Lucas Peyrin  \n🔗 lucaspeyrin on n8n.io\n","capabilities":["workflow","automation","ai agent","chatbot","documents","HTTP Request","httpRequest","Development","Core Nodes","HTML","agent","AI","Langchain","Embeddings OpenAI","embeddingsOpenAi","OpenAI Chat Model","lmChatOpenAi","Simple Memory"],"protocols":[],"safetyScore":80,"overallRank":73.4,"trustScore":null,"trust":null,"source":"N8N_TEMPLATES","updatedAt":"2026-05-26T06:45:45.284Z"}