Dynamic RAG AI Agent with Supabase, PostgreSQL, Google Drive in n8n
This quick tutorial shows how to build a dynamic Retrieval-Augmented Generation (RAG) AI agent in n8n that keeps your website product details and organization information always up to date. It uses PostgreSQL and Supabase for vector storage, and Google Drive for managing documents dynamically—add, update, or delete files to instantly refresh your knowledge base.
Project Objective
The goal is to create a smart RAG agent that pulls accurate, real-time context from your dynamic knowledge base. It updates product and company details automatically whenever files change in Google Drive—no manual updates needed.
Workflow Overview
Connect Supabase and PostgreSQL to store and manage vector embeddings
Use n8n to monitor Google Drive for new, updated, or deleted documents
Automatically generate, update, or remove embeddings to sync with changes
Perform vector search to retrieve the latest context for product and organization queries
Use OpenAI to generate accurate answers using up-to-date context
Maintain conversation memory for better user interactions
Key Features
Dynamic vector storage with PostgreSQL + Supabase
Google Drive integration for real-time file intake and removal
Automatic update and delete logic for embeddings
OpenAI for high-quality generation with current context
Session memory for continuous conversations
Fully no-code orchestration using n8n
Use Cases
Dynamic website content agents for product updates
Knowledge base bots for internal teams
Customer support with real-time product and company info
Results
With Supabase, PostgreSQL, Google Drive, and OpenAI running in n8n, this agent can update your website knowledge base automatically—add new product details, modify existing info, or remove outdated data without any backend code changes.
2022 All Rights Reserved. Design by Muhammad Bilal Manzoor