Templates / Smarter RAG agents with enriched retrieval and modular workflows

Smarter RAG agents with enriched retrieval and modular workflows

Ready for 3.0

by Alejandro Scuncia ✓ · 3,141 views · created 2025-08-28 · 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 24 nodes and runs when a chat message arrives (plus 2 other triggers). Along the way it connects Supabase, Supabase Vector Store, Embeddings Google Gemini and Google Gemini and 3 more.

How it runs

Trigger: When a chat message arrives (plus 2 other triggers).

  1. Query Builder (Google Gemini): uses Google Gemini
  2. Extract from File: extracts data from a file (pdf)
  3. Get many rows (Supabase): get many
  4. RAG Agent (AI Agent): runs an AI agent, with model: Google Gemini 2.0 Flash; 1 tool (Supabase Vector Store); memory: Postgres Chat Memory
  5. Set File Data (Edit Fields (Set)): sets 4 fields: doc_id, doc_title, doc_type…
  6. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  7. Delete Old Doc Rows (Supabase): delete
  8. Merge: merges the data from its input branches
  9. Edit Fields (Edit Fields (Set)): sets 1 field: row_id
  10. Insert into Supabase Vectorstore (Supabase Vector Store): stores documents in the Supabase vector store, with embeddings: Embeddings Google Gemini; document loader: Default Data Loader

…plus 3 more steps. See the full node list below.

Services it uses

SupabaseSupabase Vector StoreEmbeddings Google GeminiGoogle GeminiReranker CohereGoogle Gemini Chat ModelPostgres Chat Memory

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 (18)

From the author

An extendable RAG template to build powerful, explainable AI assistants — with query understanding, semantic metadata, and support for free-tier tools like Gemini, Gemma and Supabase. Description This workflow helps you build smart, production-ready RAG…

Excerpt from Alejandro Scuncia'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.