Chat with internal documents using Ollama, Supabase Vector DB & Google Drive
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| 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
What it does
π 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, Google Docs, text files) - Automated file ingestion from Google Drive - Real-time document update handling - Embedding generation via Ollama for semantic search - Memory-enabled agent using PostgreSQL - Custom tools for document lookup with context-aware chat βοΈ How It Works π₯ Document Ingestion & Vectorization Watches a Google Drive folder for new or updated files. Deletes old vector entries for the file. Uses conditional logic to extract content from PDFs, Excel, Docs, or text Summarizes and preprocesses content. (if needed) Splits and embeds the text via Ollama. Stores embeddings in Supabase Vector DB π¬ RAG Chat Agent Chat is initiated via Webhook or built-in chat interface. User input is passed to the RAG Agent. Agent queries the Userdocuments tool (Supabase vector store) using the Ollama model to fetch relevant content. If context is found, it answers directly. Otherwise, it can call tools or request clarification. Responses are returned to the user, with memory stored in PostgreSQL for continuity. π Supabase Database Configuration 1. Create a Supabase project at https://supabase.com and go to the SQL editor. 2. Create a documents table with the following schema: - id - int8 - content - text - metadata - jsonb - embedding - vector 3. Generate an API Key