This n8n workflow automates a Retrieval-Augmented Generation (RAG) pipeline that connects Google Drive, Supabase, Slack and OpenAI for document-aware AI chat and intelligent document indexing.
-
π§© Auto-ingestion pipeline
Detects new or updated files in Google Drive and indexes them into a Supabase vector database. -
π§ RAG chat interface
Retrieves relevant document embeddings for user queries and generates grounded responses using OpenAI or OpenRouter models. -
π Semantic search & reranking
Uses OpenAI embeddings and Cohere reranker to ensure precise document retrieval. -
π§° Memory persistence
Postgres-backed chat memory for contextual continuity across user sessions. -
π Slack alerts
Sends success or error notifications to a Slack channel (#ceren-news) for monitoring. -
π Error recovery
Automatic error detection and fallback models for continuous reliability.
| Component | Technology |
|---|---|
| Workflow Engine | n8n |
| Vector Database | Supabase |
| LLMs | OpenAI GPT-4.1, Anthropic Claude via OpenRouter |
| Embeddings | OpenAI text-embedding-3-large |
| Reranker | Cohere |
| File Source | Google Drive API |
| Notifications | Slack API |
| Memory | Postgres (Chat Memory Node) |
- Triggers when a new or updated document appears in Google Drive.
- Downloads and converts the document.
- Extracts text and generates vector embeddings via OpenAI.
- Inserts embeddings into the
drive_docstable in Supabase.
- When a user sends a message, the system retrieves semantically related content from the vector store, reranks, and generates a contextual AI answer.
- Scheduled system health checks and Slack alerts for failures.
- Import the workflow file into your n8n instance.
- Set up credentials for:
- OpenAI
- Supabase
- Google Drive
- Slack
- (Optional) OpenRouter & Postgres
- Adjust folder IDs and table names in the parameters.
- Activate the workflow.
- AI-powered internal knowledge assistant
- Auto-indexing system for Drive-based document archives
- Semantic document search bot for company data
Ceren Kaya AkgΓΌn
π§ AI & Automation Engineer | Berlin, Germany
π Portfolio β’ GitHub β’ Medium
MIT License β free to use and adapt for non-commercial or educational purposes.