{"product_id":"telegram-rag-chatbot-sync-google-drive-to-supabase-n8n","title":"Telegram RAG Chatbot: Sync Google Drive to Supabase (n8n)","description":"\u003ch3\u003eTurn your Google Drive PDFs into a Telegram RAG chatbot—fully synced to Supabase\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow lets you chat in \u003cb\u003eTelegram\u003c\/b\u003e using Retrieval-Augmented Generation (RAG) over PDFs stored in \u003cb\u003eGoogle Drive\u003c\/b\u003e. It automatically indexes new and updated PDFs into a \u003cb\u003eSupabase\u003c\/b\u003e vector store—and removes knowledge when files move to a Drive “trash” folder.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cb\u003eTelegram → RAG answer:\u003c\/b\u003e When a user sends a Telegram message, n8n passes the text to a \u003cb\u003eLangChain AI Agent\u003c\/b\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cb\u003eContext retrieval from Supabase:\u003c\/b\u003e The agent uses a \u003cb\u003eSupabase vector store\u003c\/b\u003e (configured for vector search with OpenAI embeddings) to find relevant document chunks, then generates a response.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cb\u003eChat response back to Telegram:\u003c\/b\u003e The generated answer is sent to the user in Telegram.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cb\u003eGoogle Drive → Vector indexing:\u003c\/b\u003e When a new PDF is created in a watched Google Drive folder, the workflow downloads it, extracts text, chunks it, generates embeddings, and inserts vectors into the Supabase \u003cb\u003edocuments\u003c\/b\u003e table.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cb\u003ePDF updates → re-index:\u003c\/b\u003e When a PDF is updated in another watched Google Drive folder, the workflow deletes existing vectors that match the file name, then re-downloads, re-extracts, re-embeds, and re-inserts.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cb\u003eTrash handling → knowledge removal:\u003c\/b\u003e If a file appears in a designated Google Drive “trash” folder, the workflow deletes matching vectors from Supabase and deletes the file from Google Drive.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eLet teams ask questions about internal PDFs (policies, manuals, proposals) directly in Telegram.\u003c\/li\u003e\n  \u003cli\u003eKeep a SaaS support knowledge base continuously updated from Google Drive without manual reindexing.\u003c\/li\u003e\n  \u003cli\u003eMaintain accurate RAG results by automatically removing outdated documents when they’re moved to trash.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cb\u003en8n nodes:\u003c\/b\u003e \u003ccode\u003etelegram\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003esupabase\u003c\/code\u003e, \u003ccode\u003egoogle drive\u003c\/code\u003e, \u003ccode\u003esticky note\u003c\/code\u003e, and \u003ccode\u003en8n-nodes-langchainagent\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cb\u003eAI \u0026amp; data:\u003c\/b\u003e OpenRouter chat model, Postgres chat memory, and Supabase vector search (pgvector) using OpenAI embeddings.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46072079351987,"sku":"N8N-19789","price":69.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/i6tXbYT5LgjCsLFxfI-E1_T1WXDsz4.png?v=1790068282","url":"https:\/\/buyflowscripts.com\/products\/telegram-rag-chatbot-sync-google-drive-to-supabase-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}