AutomationFlowsAI & RAG › Build a Customer Support RAG Agent with Gpt-5, Telegram & Pinecone

Build a Customer Support RAG Agent with Gpt-5, Telegram & Pinecone

ByAutomate With Marc @marconi on n8n.io

🧠 RAG-Based Customer Support Agent (GPT-5 + Telegram) Description:

Event trigger★★★☆☆ complexityAI-powered11 nodesTelegram TriggerOpenAI ChatMemory Buffer WindowPinecone Vector StoreOpenAI EmbeddingsTelegramAgent
AI & RAG Trigger: Event Nodes: 11 Complexity: ★★★☆☆ AI nodes: yes Added:

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

This workflow follows the Agent → OpenAI Embeddings 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
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "GPT-5 RAG Customer Support Agent",
  "tags": [],
  "nodes": [
    {
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -340,
        20
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -100,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        80,
        240
      ],
      "parameters": {
        "sessionKey": "={{ $json.message.chat.id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        200,
        220
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "awm-n8n"
        },
        "toolDescription": "Customer FAQ Data & Policies"
      },
      "typeVersion": 1.3
    },
    {
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        340,
        380
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        600,
        20
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -140
      ],
      "parameters": {
        "width": 320,
        "height": 700,
        "content": "Telegram Customer Support Trigger"
      },
      "typeVersion": 1
    },
    {
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -140
      ],
      "parameters": {
        "color": 5,
        "width": 660,
        "height": 700,
        "content": "GPT-5 AI RAG Agent with Vector Database (Pinecone) Tool"
      },
      "typeVersion": 1
    },
    {
      "name": "GPT-5 Customer Support Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        20,
        20
      ],
      "parameters": {
        "text": "={{ $json.message.text }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 700,
        "content": "Telegram Response Output"
      },
      "typeVersion": 1
    },
    {
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -140
      ],
      "parameters": {
        "color": 6,
        "width": 600,
        "height": 960,
        "content": "\ud83e\udde0 RAG-Based Customer Support Agent (GPT-5 + Telegram)\nDescription:\n\nThis workflow builds a powerful Retrieval-Augmented Generation (RAG) Customer Support Agent that interacts with users directly through Telegram using the GPT-5 model. It combines real-time conversational capabilities with context-aware responses by leveraging vector search via Pinecone, making it ideal for automated, intelligent support systems.\n\nWatch Video Tutorial Build on Workflows Like These:\nhttps://www.youtube.com/@Automatewithmarc\n\n\ud83d\udcac Key Features:\n\nTelegram Integration: Listens to customer queries via the Telegram Trigger node and sends back intelligent responses in the same chat.\nGPT-5 Agent (LangChain): A powerful AI agent node orchestrates the conversation using OpenAI's GPT-5 model.\nContextual Memory: A Memory Buffer stores the last 15 interactions per user to provide more personalized and coherent multi-turn conversations.\n\nRAG with Pinecone: Integrates with Pinecone to fetch relevant answers from your \u201cCustomer FAQ\u201d vector namespace, enabling grounded and accurate responses.\nEmbeddings Generation: Uses OpenAI\u2019s Embeddings node to process and vectorize documents for retrieval.\nEnd-to-End AI Pipeline: Connects all components from input to output, providing seamless and intelligent customer support.\n\n\ud83d\udd27 Tech Stack:\n\nGPT-5 via OpenAI API\nPinecone vector store (namespace: Customer FAQ)\nTelegram Bot API\nLangChain agent, memory, and embedding tools\nn8n self-hosted or cloud instance\n\n\ud83d\udccc Ideal Use Cases:\n\nAutomated customer support for e-commerce, SaaS, or community support\nFAQ bots with up-to-date product or policy documents\nMultilingual support agents (customizable via GPT-5)\n\n\ud83d\udee0\ufe0f Setup Instructions:\n\nSet up your Telegram bot and insert credentials.\nAdd your OpenAI and Pinecone API keys.\nUpload or index your support documents into the Customer FAQ namespace on Pinecone.\nDeploy and test your Telegram bot."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e5a5d5f7-38de-404d-a33d-4d341dec281b",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "GPT-5 Customer Support Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "GPT-5 Customer Support Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "GPT-5 Customer Support Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_tool": [
        [
          {
            "node": "GPT-5 Customer Support Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "GPT-5 Customer Support Agent": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

🧠 RAG-Based Customer Support Agent (GPT-5 + Telegram) Description:

Source: https://n8n.io/workflows/7172/ — 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

Parents smart bot. Uses telegramTrigger, agent, toolWorkflow, toolHttpRequest. Event-driven trigger; 27 nodes.

Telegram Trigger, Agent, Tool Workflow +11
AI & RAG

AI. Uses lmChatOpenAi, toolWorkflow, telegram, telegramTrigger. Event-driven trigger; 27 nodes.

OpenAI Chat, Tool Workflow, Telegram +7
AI & RAG

Chatbot. Uses googleDrive, vectorStoreSupabase, googleDriveTrigger, documentDefaultDataLoader. Event-driven trigger; 23 nodes.

Google Drive, Supabase Vector Store, Google Drive Trigger +12
AI & RAG

This workflow is built for e-commerce businesses, retail store owners, and entrepreneurs who want to provide intelligent customer support and seamless order taking through Telegram. If you're tired of

Telegram Trigger, Telegram, OpenAI +7
AI & RAG

Transform your email workflow with this intelligent automation that drafts professional emails through Telegram commands using AI and contact retrieval. Key Features

Pinecone Vector Store, OpenAI Embeddings, Document Default Data Loader +6