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