FindPrompts
n8nAI AgentsAdvanced5 steps

AI FAQ Chatbot (Vector-Backed)

Exposes a chat endpoint backed by a retrieval agent that pulls relevant chunks from a vector store of your documentation and answers grounded questions. Drop it behind a website widget for instant support.

WebhookOpenAIPinecone

How it works

  1. 1Trigger: webhook receives a user question
  2. 2Agent retrieves relevant docs from a vector store
  3. 3Chat model answers using the retrieved context
  4. 4Format the grounded answer
  5. 5Return the answer in the response

Setup

  • Index your docs into a Pinecone index named 'docs' first.
  • Add OpenAI and Pinecone credentials.
  • POST { question: '...' } to the webhook.
  • Swap Pinecone for Qdrant/Supabase vector store if preferred.

Workflow JSON

{
  "name": "AI FAQ Chatbot",
  "nodes": [
    {
      "id": "fq01aa",
      "name": "Chat Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        200,
        300
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "faq-chat",
        "responseMode": "responseNode"
      }
    },
    {
      "id": "fq02bb",
      "name": "QA Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        440,
        300
      ],
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.body.question }}",
        "options": {
          "systemMessage": "Answer only from the retrieved documentation. If unsure, say you don't know."
        }
      }
    },
    {
      "id": "fq03cc",
      "name": "Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        380,
        480
      ],
      "parameters": {
        "model": "gpt-4o"
      }
    },
    {
      "id": "fq04dd",
      "name": "Docs Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1,
      "position": [
        540,
        480
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "documentation",
        "pineconeIndex": "docs"
      }
    },
    {
      "id": "fq05ee",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        700,
        300
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"answer\": $json.output } }}"
      }
    }
  ],
  "connections": {
    "Chat Webhook": {
      "main": [
        [
          {
            "node": "QA Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "QA Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Docs Vector Store": {
      "ai_tool": [
        [
          {
            "node": "QA Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "QA Agent": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "meta": {}
}

Command Palette

Search for a command to run...