{
  "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
          }
        ]
      ]
    }
  }
}