# Sync a Telegram RAG chatbot with Google Drive using OpenAI and Supabase

> Quick overview This workflow runs a Telegram RAG chatbot that answers questions using PDFs synced from Google Drive into a Supabase vector store, automatically re-indexing when files are added or updated and removing knowledge when files are moved to a trash folder. How it works 1. Triggers when a user sends a Telegram message and passes the text to a LangChain AI Agent. 2. The agent uses an OpenRouter chat model, Postgres chat memory, and a Supabase vector store tool (with OpenAI embeddings) to retrieve relevant context and generate an answer. 3. Sends the generated response back to the user in Telegram. 4. Triggers when a new file is created in a watched Google Drive folder, downloads the PDF, extracts its text, chunks it, generates OpenAI embeddings, and inserts the vectors into a Supabase table. 5. Triggers when a file is updated in another watched Google Drive folder, deletes existing Supabase vectors that match the file name, then re-downloads the PDF, re-extracts/chunks it, embe

- **Domain**: `n8n-workflow-19789.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/19789
- Page (HTML): https://agenstry.com/agents/n8n-workflow-19789.n8n.io
- Documentation: https://n8n.io/workflows/19789
