Templates / Build an advanced multi-query RAG system with Supabase and GPT-5

Build an advanced multi-query RAG system with Supabase and GPT-5

Ready for 3.0

by Guillaume Duvernay ✓ · 2,515 views · created 2025-08-23 · AI RAG, Multimodal AI

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 18 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects OpenAI Chat Model, Supabase Vector Store and Embeddings OpenAI.

How it runs

Trigger: When a chat message arrives (plus 1 other trigger).

  1. AI Agent: runs an AI agent, with model: OpenAI Chat Model; 2 tools (Think, Query knowledge base); memory: Simple Memory
  2. Split Out: splits a list into separate items
  3. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  4. Aggregate: combines items into one
  5. Supabase Vector Store: searches the Supabase vector store, with embeddings: Embeddings OpenAI
  6. Clean RAG output (Edit Fields (Set)): sets 1 field: Chunk content
  7. Keep score over 0. (Filter): keeps only the items that match a condition
  8. Any chunk? (If): checks a condition and branches into true / false
  9. Aggregate: combines items into one
  10. Say no chunk match (Edit Fields (Set)): sets 1 field: Retrieval output

…plus 1 more step. See the full node list below.

Services it uses

OpenAI Chat ModelSupabase 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 (15)

From the author

Go beyond basic Retrieval-Augmented Generation (RAG) with this advanced template. While a simple RAG setup can answer straightforward questions, it often fails when faced with complex queries and can be polluted by irrelevant information. This workflow…

Excerpt from Guillaume Duvernay'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.