AutomationFlowsAI & RAG › RAG Chat Bot

RAG Chat Bot

rag_chat_bot. Uses lmChatOpenAi, chainLlm, retrieverVectorStore, vectorStorePinecone. Chat trigger; 8 nodes.

Chat trigger trigger★★★☆☆ complexityAI-powered8 nodesOpenAI ChatChain LlmRetriever Vector StorePinecone Vector StoreOpenAI EmbeddingsChat TriggerChat
AI & RAG Trigger: Chat trigger Nodes: 8 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow follows the Chainllm → 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
{
  "name": "rag_chat_bot",
  "nodes": [
    {
      "parameters": {
        "options": {
          "maxTokens": 500,
          "temperature": 0.2
        }
      },
      "id": "87d2d520-0cba-414d-91c7-c57d89202f9a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        96,
        80
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Tu es un assistant sp\u00e9cialis\u00e9 dans les produits TAG Heuer Connected.\n\nContexte des documents FAQ (les 3 r\u00e9ponses les plus pertinentes):\n{{ $json.context }}\n\nQuestion de l'utilisateur: {{ $('Extraire question').item.json.question }}\n\nInstructions:\n- R\u00e9ponds UNIQUEMENT en te basant sur le contexte fourni ci-dessus\n- Si la r\u00e9ponse n'est pas dans le contexte, dis \"Je n'ai pas trouv\u00e9 cette information dans notre FAQ TAG Heuer Connected\"\n- Sois pr\u00e9cis, clair et concis\n- Structure ta r\u00e9ponse avec des points si n\u00e9cessaire\n- Si tu mentionnes une URL, inclus-la dans ta r\u00e9ponse\n\nR\u00e9ponse:"
      },
      "id": "cc8fa226-923e-4f4c-b9b0-92bc4b8c7c01",
      "name": "LLM Chain - G\u00e9n\u00e9rer r\u00e9ponse",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.4,
      "position": [
        96,
        -112
      ]
    },
    {
      "parameters": {
        "topK": 3
      },
      "id": "023f1281-bd19-4b55-bca3-a8440105c5b4",
      "name": "Vector Store Retriever",
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "typeVersion": 1,
      "position": [
        -240,
        -96
      ]
    },
    {
      "parameters": {
        "pineconeIndex": "faq-tagheuer",
        "options": {}
      },
      "id": "c55b1153-5b49-4158-9a92-3bb7cd5fe835",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1,
      "position": [
        -320,
        80
      ],
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "text-embedding-3-small",
        "options": {}
      },
      "id": "29053c9a-afb6-487d-b90f-085328ba2eaa",
      "name": "OpenAI Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1,
      "position": [
        -320,
        240
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "user_question",
              "name": "question",
              "value": "={{ $json.body.question }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "14ca16ee-6790-4399-9635-91cad93b025d",
      "name": "Extraire question",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.3,
      "position": [
        -464,
        -96
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.4,
      "position": [
        -704,
        -96
      ],
      "id": "4c0d03bc-0938-4bb3-ba57-28391683a89a",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "message": "={{ $json }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chat",
      "typeVersion": 1,
      "position": [
        448,
        -112
      ],
      "id": "3eccfd44-6125-4a48-b0f9-767ee35bd4b4",
      "name": "Respond to Chat"
    }
  ],
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "LLM Chain - G\u00e9n\u00e9rer r\u00e9ponse",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "LLM Chain - G\u00e9n\u00e9rer r\u00e9ponse": {
      "main": [
        [
          {
            "node": "Respond to Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Retriever",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Extraire question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "f4914c24-c86c-42d7-acd4-acfffae0f403",
  "id": "wojpNo1RDtvjiOVk",
  "tags": []
}

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

rag_chat_bot. Uses lmChatOpenAi, chainLlm, retrieverVectorStore, vectorStorePinecone. Chat trigger; 8 nodes.

Source: https://github.com/akira-dev/n8n-workflows/blob/0eee4a91e47b04c32b24277ce2d7fbaedc7f2c72/workflows/rag_chat_bot.json — 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

Manual Stickynote. Uses googleDrive, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi, stickyNote. Chat trigger; 16 nodes.

Google Drive, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +6
AI & RAG

Advanced Ai Demo Presented At Ai Developers 14 Meetup. Uses slack, stickyNote, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

Advanced Ai Demo (Presented At Ai Developers #14 Meetup). Uses slack, stickyNote, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

Workflow 2358. Uses slack, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi, documentDefaultDataLoader. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

2358. Uses slack, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi, documentDefaultDataLoader. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14