AutomationFlowsAI & RAG › AI Question and Answer Chatbot

AI Question and Answer Chatbot

Original n8n title: Question and Answer AI Agent Chatbot [2/2]

ByMax Tkacz @max-n8n on n8n.io

This workflow serves a Question and Answer chat experience to an end user. It uses an AI Agent with a tool to fetch Question and Answer pairs stored in a Data Table (to serve the user answers grounded on knowledge base).

Chat trigger trigger★★☆☆☆ complexityAI-powered6 nodesChat TriggerAgentOpenAI ChatMemory Buffer WindowData Table Tool
AI & RAG Trigger: Chat trigger Nodes: 6 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13354 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "4WKtCB7DUlLgQAA3",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "QA AI Agent [quickstart 2026]",
  "tags": [],
  "nodes": [
    {
      "id": "66e9802a-c83d-4b4f-b69a-d384cc722f87",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        128,
        112
      ],
      "parameters": {
        "options": {},
        "agentName": "QA Chatbot",
        "availableInChat": true
      },
      "typeVersion": 1.4
    },
    {
      "id": "23a48497-ad14-400d-9cb9-9ed86de4df93",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        368,
        112
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful Q&A assistant that answers questions based on feedback data. Use tools to search for relevant information by querying the 'question' and 'tags' columns. When a user asks a question, search the QA database to find matching questions or relevant tags, then provide the corresponding answer. If you find multiple relevant entries, synthesize the information. If no relevant information is found, politely inform the user that you don't have that information in the QA database."
        }
      },
      "typeVersion": 3.1
    },
    {
      "id": "53327aee-bb6a-404f-b463-98be27079217",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        288,
        320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2ebccb44-58e7-431c-8c1d-219273df96b7",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        432,
        320
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "b806edae-f549-4495-825a-b1240c90d2d6",
      "name": "fetch-qa-from-db",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        608,
        320
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "Question",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', `The search term or question to look for in the feedback database. Filters by questions containing your search term so use single words or short fragments`, 'string') }}",
              "condition": "ilike"
            },
            {
              "keyName": "Tags",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions1_Value', `key terms for this question:answer pair that was classified by AI. Use one search term per tool invocation. `, 'string') }}",
              "condition": "ilike"
            }
          ]
        },
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "PM3CHtETy7TT6wnb",
          "cachedResultUrl": "/projects/Z00J79cBs01Yrr1J/datatables/PM3CHtETy7TT6wnb",
          "cachedResultName": "q&a"
        },
        "descriptionType": "manual",
        "toolDescription": "Use this tool to search the Feedback data table for relevant entries. Provide a search query that will be matched against the 'question' column to find relevant feedback. The tool returns matching entries with their answers. Always provide a specific search term based on what the user is asking about."
      },
      "typeVersion": 1.1
    },
    {
      "id": "07cf7cd3-2c96-4f67-8d60-f7fe0da150ff",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 336,
        "height": 240,
        "content": "## QA Ingest Template\n### Flow 2/2\nThis workflow provides an AI Agent that answers user questions by retrieving relevant Q&A pairs from an n8n Data Table as grounding context, ensuring responses are informed by the stored knowledge base.\n\nBy [Max Tkacz | The Original Flowgrammer](https://www.linkedin.com/in/maxtkacz/)\n"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "abd5d49d-77ec-4726-a35c-422669545a25",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "fetch-qa-from-db": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow serves a Question and Answer chat experience to an end user. It uses an AI Agent with a tool to fetch Question and Answer pairs stored in a Data Table (to serve the user answers grounded on knowledge base).

Source: https://n8n.io/workflows/13354/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This project is an automation workflow that generates a personalized resume and cover letter for each job listing. Generates an HTML resume from your data. Hosts it live on GitHub Pages. Converts it t

HTTP Request, Agent, OpenAI Chat +10
AI & RAG

AI Agent : Google calendar assistant using OpenAI. Uses chatTrigger, lmChatOpenAi, memoryBufferWindow, googleCalendarTool. Chat trigger; 13 nodes.

Chat Trigger, OpenAI Chat, Memory Buffer Window +2
AI & RAG

OpenSea AI-Powered Insights via Telegram. Uses chatTrigger, telegramTrigger, lmChatOpenAi, memoryBufferWindow. Chat trigger; 13 nodes.

Chat Trigger, Telegram Trigger, OpenAI Chat +4
AI & RAG

Build an MCP server with Airtable. Uses chatTrigger, agent, memoryBufferWindow, mcpClientTool. Chat trigger; 13 nodes.

Chat Trigger, Agent, Memory Buffer Window +4
AI & RAG

Build an MCP server with Airtable. Uses chatTrigger, agent, memoryBufferWindow, mcpClientTool. Chat trigger; 13 nodes.

Chat Trigger, Agent, Memory Buffer Window +4