Templates / Answer questions from documents with RAG using Supabase, OpenAI & Cohere reranker

Answer questions from documents with RAG using Supabase, OpenAI & Cohere reranker

Ready for 3.0

by Luan Correia ✓ · 1,672 views · created 2025-07-23 · Internal Wiki, AI RAG

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What 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).

  1. RAG Agent (AI Agent): runs an AI agent, with model: GPT 4.1-mini; 1 tool (Supabase Vector Store)
  2. Download File (Google Drive): download
  3. Extract from File: extracts data from a file (pdf)
  4. Code: runs custom JavaScript code
  5. Upload to Supabase (Supabase Vector Store): stores documents in the Supabase vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
  6. Metadata Agent (AI Agent): runs an AI agent, with model: GPT 4.1-mini
  7. RAG Agent (AI Agent): runs an AI agent, with model: GPT 4.1-mini; 1 tool (Supabase Vector Store)

Services it uses

Google DriveOpenRouter Chat ModelReranker CohereSupabase Vector StoreEmbeddings OpenAI

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)

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…

Excerpt from Luan Correia's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.