{
  "name": "Document Q&A chatbot with Gemini AI and Supabase vector search for Telegram",
  "nodes": [
    {
      "id": "0213dfab-a1b2-42c9-9ab1-8a0f1de4c4c0",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        480,
        40
      ]
    },
    {
      "id": "9c166f83-8ea4-4dc7-8ea2-92ec186c9f32",
      "name": "OpenWeatherMap",
      "type": "n8n-nodes-base.openWeatherMapTool",
      "position": [
        740,
        -100
      ]
    },
    {
      "id": "aa0abeff-b5e9-497b-9d9c-8f79721a5c11",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        480,
        -320
      ]
    },
    {
      "id": "72b85aff-4fe7-4705-a07c-463f381cb806",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -20,
        100
      ]
    },
    {
      "id": "ea716dba-2856-40a8-ad73-86132f52dda8",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1540,
        -320
      ]
    },
    {
      "id": "59a22620-0d26-4e19-940a-5c07efccbdfa",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        640,
        -100
      ]
    },
    {
      "id": "7bb66887-c9c6-4057-bbc0-306d1e20ea12",
      "name": "Embeddings Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        840,
        340
      ]
    },
    {
      "id": "668db8fd-3d5f-433a-8ccb-4bea237107ce",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1220,
        460
      ]
    },
    {
      "id": "d1495354-bfc0-4ef1-9102-dc3577580d5b",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1440,
        620
      ]
    },
    {
      "id": "6a8e5ce6-4c52-4ca0-962f-045ea42dac7c",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1020,
        480
      ]
    },
    {
      "id": "3f4a9da9-0364-4861-a6f3-33b1d5c501e0",
      "name": "Answer questions with a vector store",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        860,
        -60
      ]
    },
    {
      "id": "933a93c7-9401-4bac-9b9c-395866b46d61",
      "name": "Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        760,
        80
      ]
    },
    {
      "id": "5f37c202-a1ca-4ee0-9de0-267349adffbd",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        200
      ],
      "parameters": {
        "width": 1625,
        "height": 779,
        "content": "✅ Scenario 2 – Document Upload and Embedding\n\nFlow for downloading a document sent via Telegram, extracting its text, generating embeddings, and inserting them into Supabase Vector Store."
      }
    },
    {
      "id": "6e9c1070-90bc-4ab7-a8a0-62461bede708",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -420
      ],
      "parameters": {
        "width": 1625,
        "height": 599,
        "content": "✅ Scenario 1 – Chatbot Interaction\n\nFlow for handling user messages sent to the bot. Includes accessing weather data, answering questions based on user-uploaded documents, and running code using a cod"
      }
    },
    {
      "id": "3b211a14-6813-459f-8d23-b40fc0eb4bd6",
      "name": "Telegram - Embedding Complete",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1760,
        320
      ]
    },
    {
      "id": "05703266-aaed-491d-87a6-ed7f96a9c49a",
      "name": "Supabase - Save Embeddings",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        1200,
        320
      ]
    },
    {
      "id": "3b7db0e6-b551-4698-921a-306e837ceffc",
      "name": "Command Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        160,
        100
      ]
    },
    {
      "id": "fa06fc6c-3661-4065-81fc-09f93d6a4a25",
      "name": "Telegram - Download file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        600,
        540
      ]
    },
    {
      "id": "756a36aa-187d-48ca-894c-f8c9a79a4794",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1580,
        320
      ]
    },
    {
      "id": "3b49f357-5d21-4710-bd32-3218d23b1bd9",
      "name": "Fallback- No formatting",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1740,
        -260
      ]
    },
    {
      "id": "eafdbacb-17e5-4de6-a4e9-b986140353e5",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1120,
        -320
      ]
    },
    {
      "id": "538be3ed-4bd6-4295-ac11-e4d46b943f5a",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        540,
        -100
      ]
    },
    {
      "id": "0afca77d-0e08-4f04-a6d3-b107c1dd54f9",
      "name": "Handle formatting and split",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        -320
      ]
    },
    {
      "id": "dbea9e13-6ad4-4eb3-8da1-9db9e2116283",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        -420
      ],
      "parameters": {
        "width": 1960,
        "height": 3520,
        "content": "# 🤖 Telegram AI Assistant for Your Documents (n8n + Supabase + Gemini)\n\nThis project transforms a standard **Telegram bot** into your dedicated AI assistant – designed to understand and answer questio"
      }
    },
    {
      "id": "965ba2bd-747d-4718-a76e-9f7d685dcea4",
      "name": "Manual Mapping",
      "type": "n8n-nodes-base.set",
      "position": [
        1320,
        -320
      ]
    },
    {
      "id": "c6a315f1-6f0b-4127-b377-b7b12975929f",
      "name": "Unsupported message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        500,
        760
      ]
    },
    {
      "id": "375bd185-3836-4f25-8708-d6dcd79b2675",
      "name": "Send processing document message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        920,
        720
      ]
    },
    {
      "id": "d01f8b15-e495-46cf-bfdf-20b4399c23d7",
      "name": "Send embedding Started message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1220,
        660
      ]
    }
  ],
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Handle formatting and split",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram": {
      "main": [
        [],
        [
          {
            "node": "Fallback- No formatting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Telegram - Embedding Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Manual Mapping",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Command Router": {
      "main": [
        [
          {
            "node": "Telegram - Download file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Unsupported message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Mapping": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenWeatherMap": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Command Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Supabase - Save Embeddings",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send embedding Started message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Supabase - Save Embeddings",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Supabase - Save Embeddings",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Answer questions with a vector store",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - Download file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send processing document message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase - Save Embeddings": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle formatting and split": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send embedding Started message": {
      "main": [
        []
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Answer questions with a vector store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}