{
  "name": "Customer support & lead collection chatbot with RAG, GPT-4o, Sheets & Telegram",
  "nodes": [
    {
      "id": "0cd4236d-fa91-405f-bbd9-a816098202f5",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "da8b3e29-20c2-4f16-a01e-b7ae45bb0efa",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        384,
        0
      ]
    },
    {
      "id": "33f3d156-d41d-44e2-af46-d29cb9fe7832",
      "name": "Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        368,
        224
      ]
    },
    {
      "id": "d205da7f-7acc-4709-9878-331a70218ce7",
      "name": "Company Q&A",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        432,
        400
      ]
    },
    {
      "id": "ab524ffa-cce1-4dee-938e-fbdee31b353c",
      "name": "Pinecone Vector Store (Company KB)",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        384,
        560
      ]
    },
    {
      "id": "28bd6bd0-bedc-47a0-b345-a18f7d2e7831",
      "name": "Generate Embeddings (OpenAI)",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        464,
        704
      ]
    },
    {
      "id": "98dcb3ff-693a-47d3-9031-502dfe49becf",
      "name": "Trigger – How to Publish",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -144
      ],
      "parameters": {
        "width": 256,
        "height": 304,
        "content": "## Trigger\n\nYou can switch to Publicly Available to be able to share this chatbot interface with a link. \n"
      }
    },
    {
      "id": "55791e26-65d8-4af8-ad8b-d321044583de",
      "name": "AI Agent – Flow",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -240
      ],
      "parameters": {
        "width": 736,
        "height": 608,
        "content": "## AI Agent\n\nPowered with OpenAI API (GPT-4o) -- you can replace it with your favourite LLM.\n\nThe agent, after providing information requested by the user, asks for contact information and stores it i"
      }
    },
    {
      "id": "d71bbe39-776a-465d-a463-84d6fcaa6f70",
      "name": "RAG Database – Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        384
      ],
      "parameters": {
        "width": 656,
        "height": 592,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## RAG Database\n\nConnect a Pinecone RAG database with knowledge about your company. An OpenAI text-embedding-3-small model handles data retrieval.\n"
      }
    },
    {
      "id": "f9e798e4-771f-47f6-8fc6-87379e5c388c",
      "name": "Send Lead to Telegram",
      "type": "n8n-nodes-base.telegramTool",
      "position": [
        624,
        224
      ]
    },
    {
      "id": "f045418b-84c6-4476-8a06-0538fe7eb191",
      "name": "Save Lead to Google Sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        768,
        224
      ]
    },
    {
      "id": "c08fa915-6a60-453b-a663-058c92c1355f",
      "name": "Company Answering Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        672,
        608
      ]
    },
    {
      "id": "54007e6f-bf76-4811-950e-b2bd316d75c1",
      "name": "Main Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        224,
        224
      ]
    },
    {
      "id": "guide-sticky-001",
      "name": "Template Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        -160
      ],
      "parameters": {
        "width": 736,
        "height": 736,
        "content": "## Template Guide (Overview, Prerequisites & Customization)\n\n**What it does:** This workflow delivers a production-ready customer support and lead collection chatbot.\nIt answers company questions usin"
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        []
      ]
    },
    "Company Q&A": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Main Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Send Lead to Telegram": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Company Answering Model": {
      "ai_languageModel": [
        [
          {
            "node": "Company Q&A",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save Lead to Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Embeddings (OpenAI)": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store (Company KB)",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store (Company KB)": {
      "ai_vectorStore": [
        [
          {
            "node": "Company Q&A",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    }
  }
}