Answer questions from documents with RAG using Supabase, OpenAI & Cohere reranker
Ready for 3.0What this workflow does
This AI workflow has 19 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Google Drive, OpenRouter Chat Model, Reranker Cohere and Supabase Vector Store and 1 more.
How it runs
Trigger: When a chat message arrives (plus 1 other trigger).
- RAG Agent (AI Agent): runs an AI agent, with model: GPT 4.1-mini; 1 tool (Supabase Vector Store)
- Download File (Google Drive): download
- Extract from File: extracts data from a file (pdf)
- Code: runs custom JavaScript code
- Upload to Supabase (Supabase Vector Store): stores documents in the Supabase vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
- Metadata Agent (AI Agent): runs an AI agent, with model: GPT 4.1-mini
- RAG Agent (AI Agent): runs an AI agent, with model: GPT 4.1-mini; 1 tool (Supabase Vector Store)
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Google Drive
n8n-nodes-base.googleDrive - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Extract from File
n8n-nodes-base.extractFromFile - Code
n8n-nodes-base.code - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - Reranker Cohere
@n8n/n8n-nodes-langchain.rerankerCohere - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Manual Trigger
n8n-nodes-base.manualTrigger
From the author
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This comprehensive RAG workflow enables your AI agents to answer user questions with contextual knowledge pulled from your own documents — using metadata-rich…