ChatGPTCreativeWritingAI score · 81/100AI-assisted edit · no obvious prompt-injection riskn8n.io

Build a Knowledge-Base Support Chatbot with n8n and OpenAI

Chat message triggers RAG retrieval → GPT-4o-mini generates replies; manual flow fetches FAQ text, chunks, embeds, and stores into an in-memory vector store

Some experienceStepsWorkflowPrompt
Who
Teams needing a quick customer-support Q&A bot in n8n with an existing OpenAI API key
You get
When a user sends a message, the AI retrieves relevant snippets from an in-memory vector knowledge base first, then generates a concise, cited answer; manual ingestion updates the knowledge base
You need
n8n

Constraints

Prerequisites: accessible n8n instance; OpenAI API key (for chat completions and embeddings). After importing the template, replace the example URL in the HTTP Request node with a real FAQ endpoint, run the manual ingestion flow once to populate the vector store, then enable the Chat Trigger for conversational testing. The in-memory vector store is volatile and will be lost on n8n restart, requiring re-ingestion.

What they did

Template author takato-door built a two-branch n8n workflow: one branch starts from a Chat Trigger and answers support questions via an AI Agent using OpenAI GPT-4o-mini, conversation memory, and an in-memory vector knowledge base; the other branch starts from a Manual Trigger, fetches external FAQ text via HTTP Request, splits it into chunks, embeds it, and writes it to the same in-memory vector store.

How it went

Author report (template): the workflow powers a support chat experience that answers questions from a knowledge base, with the AI retrieving internal docs, FAQs, and policies before responding.

Worth knowing

The in-memory vector store is volatile and will be lost on n8n restart; production use should migrate to a persistent vector database. The HTTP URL in the template is an example and must be replaced with a real content source. OpenAI API calls incur costs for both embeddings and chat completions. When no answer is found, the system prompt instructs the AI to offer human escalation and avoid fabricating information.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • After import, connect your own credentials on auth-required nodes; author secrets are not included.

Configuration to replace

  • Source template is n8n public workflow #16336 (~18 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Import workflow and configure OpenAI credentials

    Import the template into n8n. Open the workflow settings and add your OpenAI API key credentials for both the OpenAI Chat Model node and the Embeddings OpenAI node.

  2. Configure chat trigger and AI support assistant system prompt

    Ensure the 'When Chat Message Received' node is active. In the 'AI Support Assistant' node, go to Options → System Message and enter the following system prompt to constrain answer style and retrieval behavior.

    Execution prompt · Source text。AI Support Assistant node Options → System Message field

    You are a friendly, accurate customer-support assistant.
    ALWAYS search the knowledge base before answering.
    If the answer is not found, say you are not sure and offer to escalate to a human. Never invent policies, prices or facts.
    Answer concisely and cite the source title when possible.
  3. Set knowledge base retrieval parameters

    In the 'Load Knowledge Base Data' node, confirm mode is retrieve-as-tool, topK is 4, memoryKey is support-kb, and toolName is company_knowledge_base. This node converts the user query into a vector and retrieves the most relevant knowledge snippets from memory.

  4. Change the document fetch source URL

    In the 'Fetch FAQ Documents' node, replace the default URL https://example.com/help-center/faq.txt with an actual, accessible FAQ or knowledge base text endpoint. Ensure the returned content is plain text or otherwise parsable.

  5. Run manual ingestion to populate the knowledge base

    Click the execute button on the 'Manual Document Ingestion' node to trigger the full flow: HTTP fetch → text splitting (chunkSize=1000, chunkOverlap=100) → OpenAI embedding generation → insert into the in-memory vector store. After successful execution, the vector store contains searchable FAQ content.

  6. Test the chat trigger

    Activate the workflow, open the Chat Trigger test chat window, and send a question related to the FAQ. Verify that the AI searches the knowledge base before answering and that the response includes a source citation.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are assisting with reproducing an n8n customer-support RAG bot template. Proceed in this order: 1) Confirm the n8n instance is available and the workflow is imported; 2) Verify OpenAI credentials are configured; 3) Replace the URL in 'Fetch FAQ Documents' with a real endpoint; 4) Run manual ingestion; 5) Test the chat trigger and verify answers cite the knowledge base. If you encounter credential errors or disconnected nodes, first check that connections in workflow.json are intact.

Before starting, prepare your OpenAI API key and a publicly accessible FAQ text URL.

Source

Answer support questions from a knowledge base with OpenAI GPT-4o-mini · takato-door · n8n.io · 2026-06-13

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related