# Chat with Ollama and Supabase Vector DB: n8n workflow template

> Started by someone opening a chat with it, and works across Google Drive, Supabase and Supabase vectors.

Source: https://millionrounds.com/workflow/chat-with-ollama-and-supabase-vector-db (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# Chat with Ollama and Supabase Vector DB

Started by someone opening a chat with it, and works across Google Drive, Supabase and Supabase vectors. It puts a local model behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 26 steps, 1 branch: large, and worth reading before you trust it with anything live.

Large Calls a model: a local model Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fchat-with-ollama-and-supabase-vector-db)

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

**1** Branch: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 5 Model 11 Logic 4 Service 6

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

- 1 **File Created** Google Drive trigger *Starts it*
- 2 **File Updated** Google Drive trigger *Starts it*
- 3 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 4 **When chat message received** Chat trigger *Starts it*
- 5 **Webhook** Webhook *Starts it*
- 6 **Character Text Splitter** Text Splitter Character Text Splitter *Model*
- 7 **Embeddings Ollama** Embeddings Ollama *Model*
- 8 **Embeddings Ollama1** Embeddings Ollama *Model*
- 9 **Ollama Model** Lm Ollama *Model*
- 10 **Ollama Chat Model** Lm Chat Ollama *Model*
- 11 **Set File ID** Set *Logic*
- 12 **RAG AI Agent** Agent *Model*
- 13 **Edit Fields** Set *Logic*
- 14 **Default Data Loader** Document Default Data Loader *Model*
- 15 **Insert into Supabase Vectorstore** Vector Store Supabase *Model*
- 16 **Supabase Vector Store** Vector Store Supabase *Model*
- 17 **User_documents** Tool Vector Store *Model*
- 18 **Delete Old Doc Rows** Supabase *Service*
- 19 **Respond to Webhook** Respond To Webhook *Starts it*
- 20 **Download File** Google Drive *Service*
- 21 **Switch** Switch *Logic*
- 22 **Extract PDF Text** Extract From File *Service*
- 23 **Extract from Excel** Extract From File *Service*
- 24 **Extract Document Text** Extract From File *Service*
- 25 **Aggregate** Aggregate *Logic*
- 26 **Summarize** Summarize *Service*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 26, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Supabase, Supabase vectors
- **Model:** a local model
- **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 Google Drive, Supabase and Supabase vectors accounts, and a key for a local model. 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 a local model. 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 26 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 26 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%2Fchat-with-ollama-and-supabase-vector-db)
- **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.

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

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Crawl documentation sites and build an AI knowledge base** 26 steps · calls a model · Google Docs, Google Drive](https://millionrounds.com/workflow/crawl-documentation-sites-and-build-an-ai-knowledge-base)
- [**Index Google Drive files into a Supabase vector store** 26 steps · calls a model · Google Drive, Postgres](https://millionrounds.com/workflow/index-google-drive-files-into-a-supabase-vector-store)
- [**Archive HR and legal documents with UploadToURL** 26 steps · Airtable, Gmail](https://millionrounds.com/workflow/archive-hr-and-legal-documents-with-uploadtourl)
- [**AI-Powered RAG Document Processing & Chatbot with Google Drive** 27 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/ai-powered-rag-document-processing-and-chatbot-with-google-d)
- [**Document RAG & chat agent: Google Drive to Qdrant with Mistral** 25 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/document-rag-and-chat-agent-google-drive-to-qdrant-with-mist)
- [**Review contract risk and rewrite clauses with Groq** 25 steps · calls a model · Google Drive, Notion](https://millionrounds.com/workflow/review-contract-risk-and-rewrite-clauses-with-groq)
