What This Workflow Does
This n8n workflow creates an AI-powered knowledge base assistant that combines OpenAI, Supabase, and Google Drive. It automatically syncs documents from Google Drive, extracts their content, converts text to vector embeddings, and stores them in a vector database. Users can then chat with the knowledge base through Telegram, receiving AI-generated answers based on the stored documents using Retrieval-Augmented Generation (RAG) technology.
How It Works
The workflow operates through three main processes:
- File Upload Process: When new files are added to Google Drive, the workflow automatically extracts text content, splits it into manageable chunks, generates vector embeddings using OpenAI, and stores them in Supabase for fast retrieval.
- File Update Process: When documents are modified, the workflow detects changes, removes outdated vector entries, and re-indexes the updated content to keep the knowledge base current.
- RAG Chatbot Process: When users send messages via Telegram, the system retrieves relevant document chunks from the vector database, passes them to OpenAI’s language model with the user’s question, and returns contextually accurate responses.
Use Cases
- Customer Support Automation: Store product documentation and FAQs in Google Drive, then let customers ask questions through Telegram and receive instant, accurate answers powered by your knowledge base.
- Internal Knowledge Management: Maintain company policies, procedures, and training materials in Google Drive while enabling employees to query information through a conversational interface.
- Research Assistant: Upload research papers, articles, and reference materials to automatically create a searchable knowledge base that can answer questions about the content.
- Educational Tutoring System: Load course materials and textbooks to create an AI tutor that answers student questions based on the uploaded educational content.
- Legal Document Analysis: Index contracts, regulations, and legal documents to enable quick searches and summaries of relevant clauses and information through conversational queries.
Nodes Used
- Google Drive Trigger and Google Drive nodes for file monitoring and management
- Document Default Data Loader for extracting text from files
- Text Splitter Recursive Character Text Splitter for breaking content into chunks
- OpenAI Embeddings node for converting text to vector representations
- Supabase Vector Store for storing and retrieving embeddings
- OpenAI Chat model for generating responses
- Agent and Memory Buffer Window nodes for maintaining conversation context
- Tool Vector Store for querying the knowledge base
- Telegram Trigger and Telegram nodes for user interaction
- Set, Switch, Limit, Extract From File, and Sticky Note nodes for data processing and control flow
Prerequisites
- An OpenAI API key for embeddings and language model access
- A Supabase project with vector database capabilities enabled
- A Google Drive account with documents ready to be indexed
- A Telegram bot token and chat setup for user interactions
- Basic understanding of n8n workflow concepts and node configuration
- Proper authentication credentials configured in n8n for all integrated services
Difficulty Level
This workflow is suitable for intermediate to advanced n8n users. It requires familiarity with multiple third-party services including OpenAI, Supabase, Google Drive, and Telegram. Users should understand concepts like vector embeddings, RAG systems, and workflow branching logic. While the template provides a complete solution, customizing it for specific use cases may require adjustments to prompt engineering, chunk sizing, and system instructions.
This workflow template is shared under the n8n fair-code license. Free to use and modify.
Leave a Reply