Automation library · Lead generation

Smarter RAG agents with Gemini and Supabase

Started by someone opening a chat with it, and works across Supabase and Supabase vectors. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 24 steps, 2 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: GeminiRetrieval

24 stepsLarge: read it before trusting it with anything live
0Branches: places the flow splits
2Loops or waits
2Services it connects to

The flow

Starts it 3Model 12Logic 5Service 4

The steps in the order they run, from what starts it.

  1. 1Recursive Character Text SplitterText Splitter Recursive Character Text SplitterModel
  2. 2When chat message receivedChat triggerStarts it
  3. 3Embeddings Google Gemini1Embeddings Google GeminiModel
  4. 4On form submissionForm triggerStarts it
  5. 5Schedule TriggerSchedule triggerStarts it
  6. 6RerankerReranker CohereModel
  7. 7Google Gemini 2.0 FlashLm Chat Google GeminiModel
  8. 8Postgres Chat MemoryMemory Postgres ChatModel
  9. 9Embeddings Google GeminiEmbeddings Google GeminiModel
  10. 10Default Data LoaderDocument Default Data LoaderModel
  11. 11Query BuilderGoogle GeminiModel
  12. 12Insert into Supabase VectorstoreVector Store SupabaseModel
  13. 13Extract from FileExtract From FileService
  14. 14Get many rowsSupabaseService
  15. 15Supabase Vector StoreVector Store SupabaseModel
  16. 16RAG AgentAgentModel
  17. 17Set File DataSetLogic
  18. 18Loop Over ItemsSplit In BatchesLogic
  19. 19Delete Old Doc RowsSupabaseService
  20. 20MergeMergeLogic
  21. 21Edit FieldsSetLogic
  22. 22Metadata ObtentionGoogle GeminiModel
  23. 23Update a rowSupabaseService
  24. 24WaitWaitLogic

How it's built

Starts on
Someone opening a chat with it
Steps
24, 2 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Supabase, Supabase vectors
Model
Gemini
Retrieval
Answers are drawn from documents you supply, not from the model alone

Questions

What does it need to run?

An n8n account, plus your own Supabase and Supabase vectors accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 24 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 24 steps before you point it at anything that matters.