Chat with internal documents using Ollama, Supabase Vector DB & Google Drive
Needs changesWhat this workflow does
This AI workflow has 26 nodes and runs when a chat message arrives (plus 3 other triggers). Along the way it connects Google Drive, Postgres Chat Memory, Supabase and Supabase Vector Store and 4 more.
How it runs
Trigger: When a chat message arrives (plus 3 other triggers).
- Edit Fields (Edit Fields (Set)): sets 2 fields: chatInput, sessionId
- Set File ID (Edit Fields (Set)): sets 2 fields: file_id, file_type
- RAG AI Agent (AI Agent): runs an AI agent, with model: Ollama Chat Model; 1 tool (User_documents); memory: Postgres Chat Memory
- Delete Old Doc Rows (Supabase): delete
- Respond to Webhook: sends the response back to the webhook caller
- Download File (Google Drive): download
- Switch: routes items into 3 branches
- Extract PDF Text (Extract from File): extracts data from a file (pdf)
- Extract from Excel (Extract from File): extracts data from a file (xlsx)
- Extract Document Text (Extract from File): extracts data from a file (text)
…plus 3 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in RAG AI Agent (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) RAG AI Agent (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (20)
- Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Google Drive
n8n-nodes-base.googleDrive - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Extract from File
n8n-nodes-base.extractFromFile - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat - Supabase
n8n-nodes-base.supabase - Edit Fields (Set)
n8n-nodes-base.set - Respond to Webhook
n8n-nodes-base.respondToWebhook - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Webhook
n8n-nodes-base.webhook - Aggregate
n8n-nodes-base.aggregate - Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter - Summarize
n8n-nodes-base.summarize - AI Agent
@n8n/n8n-nodes-langchain.agent - Switch
n8n-nodes-base.switch - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Embeddings Ollama
@n8n/n8n-nodes-langchain.embeddingsOllama - Ollama Model
@n8n/n8n-nodes-langchain.lmOllama - Ollama Chat Model
@n8n/n8n-nodes-langchain.lmChatOllama - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore
From the author
📚 Chat with Internal Documents (RAG AI Agent) ✅ Features - Answers should given only within provided text. - Chat interface powered by LLM (Ollama) - Retrieval-Augmented Generation (RAG) using Supabase Vector DB - Multi-format file support (PDF, Excel,…