# AI personal assistant with RAG and Supabase: n8n workflow

> Started by another system calling it, and works across Postgres, Redis, Supabase and Supabase vectors.

Source: https://millionrounds.com/workflow/ai-personal-assistant-with-rag-and-supabase (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# AI personal assistant with RAG and Supabase

Started by another system calling it, and works across Postgres, Redis, Supabase and Supabase vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 64 steps, 5 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-personal-assistant-with-rag-and-supabase)

**64 steps** Large: read it before trusting it with anything live

**5** Branches: places the flow splits

**1** Loop or waits

**4** Services it connects to

## The flow

Starts it 1 Model 22 Logic 21 Service 16

The steps in the order they run, from what starts it. The first 60 of 64.

- 1 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 2 **Message Delay** Wait *Logic*
- 3 **Puxar as Mensagens** Redis *Service*
- 4 **Database** Redis *Service*
- 5 **setar_supabase_tabelas_vectoriais** Postgres *Service*
- 6 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 7 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 8 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 9 **OpenAI Chat Model2** Lm Chat Open Ai *Model*
- 10 **agendamentos** Tool Workflow *Model*
- 11 **criar_cerebro** Postgres *Service*
- 12 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 13 **Deletar_todas_as_mensagens1** Postgres *Service*
- 14 **base64** Set *Logic*
- 15 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 16 **Merge Database Data1** Aggregate *Logic*
- 17 **criar_rag_controle** Postgres *Service*
- 18 **Merge Database Data2** Aggregate *Logic*
- 19 **excluir_rag_arquivo** Tool Workflow *Model*
- 20 **emails** Tool Workflow *Model*
- 21 **adicionar_conhecimento** Tool Workflow *Model*
- 22 **buscar_conhecimento** Tool Workflow *Model*
- 23 **Webhook** Webhook *Starts it*
- 24 **Merge Database Data3** Aggregate *Logic*
- 25 **excluir_conhecimento** Tool Workflow *Model*
- 26 **mensagem_cliente** Set *Logic*
- 27 **deletar_arquivo** Postgres *Service*
- 28 **Postgres Chat Memory1** Memory Postgres Chat *Model*
- 29 **deletar_conhecimento** Postgres *Service*
- 30 **recepcionista** Agent *Model*
- 31 **classificador_de_intencao** Agent *Model*
- 32 **If1** If *Logic*
- 33 **supabase_vectorstore** Vector Store Supabase *Model*
- 34 **Default Data Loader** Document Default Data Loader *Model*
- 35 **Supabase Vector Store** Vector Store Supabase *Model*
- 36 **RAG** Tool Vector Store *Model*
- 37 **convert_to_file** Convert To File *Service*
- 38 **resumo** Chain Llm *Model*
- 39 **Merge** Merge *Logic*
- 40 **config** Set *Logic*
- 41 **puxar_prompt** Postgres *Service*
- 42 **rag_resumos** Postgres *Service*
- 43 **Switch** Switch *Logic*
- 44 **Edit Fields2** Set *Logic*
- 45 **tipo_arquivo** Switch *Logic*
- 46 **atualizar_lista_de_arquivos** Postgres *Service*
- 47 **auth** If *Logic*
- 48 **tratamento** Set *Logic*
- 49 **extrair_pdf** Extract From File *Service*
- 50 **mensagem_tipo** Switch *Logic*
- 51 **atualizar_prompt** Execute Workflow *Logic*
- 52 **exportar_texto** Set *Logic*
- 53 **arquivo_id** Set *Logic*
- 54 **Convert to File** Convert To File *Service*
- 55 **base** Set *Logic*
- 56 **edit2** Set *Logic*
- 57 **deletar_arquivos_antigos** Supabase *Service*
- 58 **OpenAI** Open Ai *Model*
- 59 **Convert to File1** Convert To File *Service*
- 60 **mensagem_cliente_inicial** Set *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 64, with 5 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Postgres, Redis, Supabase, Supabase vectors
- **Model:** OpenAI
- **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 Postgres, Redis, Supabase and Supabase vectors accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. 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 64 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 64 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-personal-assistant-with-rag-and-supabase)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Redis](https://millionrounds.com/workflows?service=Redis#library)[Supabase](https://millionrounds.com/workflows?service=Supabase#library)[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**Multi-agent personal assistant orchestration with OpenAI** 49 steps · calls a model · Redis, Supabase](https://millionrounds.com/workflow/multi-agent-personal-assistant-orchestration-with-openai)
- [**WordPress - AI chatbot to enhance user experience** 45 steps · calls a model · Postgres, Supabase](https://millionrounds.com/workflow/wordpress-ai-chatbot-to-enhance-user-experience)
- [**Spotify to YouTube playlist synchronization with Discord** 45 steps · Discord, Supabase](https://millionrounds.com/workflow/spotify-to-youtube-playlist-synchronization-with-discord)
- [**Interactive knowledge base chat with Supabase RAG** 43 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/interactive-knowledge-base-chat-with-supabase-rag)
- [**Collect student absence reasons with WhatsApp** 41 steps · calls a model · Google Sheets, Redis](https://millionrounds.com/workflow/collect-student-absence-reasons-with-whatsapp)
- [**Central AI agent of an IT company with Gemini and OpenRouter** 39 steps · calls a model · Google Drive, Pinecone](https://millionrounds.com/workflow/central-ai-agent-of-an-it-company-with-gemini-and-openrouter)
