Skip to main content

Build a RAG-powered AI assistant with OpenAI, Google Drive & Supabase Vector DB

Workflow preview

Workflow preview
100%
Build a RAG-powered AI assistant with OpenAI, Google Drive & Supabase Vector DB preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Target Audience This guide is designed for developers, data scientists, and AI enthusiasts who want to create intelligent chatbots capable of understanding and using custom data. Whether you are bu...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.embeddingsopenai, n8n-nodes-base.googledrive, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Zakaria Ben.

Original n8n.io source

1.1 Workflow description

Title
Build a RAG-powered AI assistant with OpenAI, Google Drive & Supabase Vector DB
Workflow name
Build a RAG-powered AI assistant with OpenAI, Google Drive & Supabase Vector DB

Target Audience

This guide is designed for developers, data scientists, and AI enthusiasts who want to create intelligent chatbots capable of understanding and using custom data. Whether you are building a research assistant, a customer support bot, or an internal knowledge base tool, this workflow helps you integrate your own documents into an AI chat system.

What Is RAG and Why Use It?

Retrieval-Augmented Generation (RAG) is an AI architecture that combines information retrieval with text generation. Instead of relying solely on a model’s built-in knowledge, RAG retrieves relevant data from external sources—such as your uploaded documents—and feeds it into the AI’s reasoning process. This approach solves a major limitation of traditional language models: their inability to access or recall up-to-date or proprietary information. By using RAG, your chatbot can deliver accurate, context-aware answers drawn directly from your specific data.

Use Case Example

Consider a scenario where your organization has a collection of internal reports, manuals, or research documents. With RAG, your AI chatbot can answer detailed questions about these materials without exposing sensitive data externally. This setup is ideal for teams working in customer support, technical documentation, education, or data analysis.

Workflow Overview

Step 1: Upload Your Document

Add your document to the Supabase Vector Store using the "Add Document" feature after downloading or linking it via Google Drive.

Step 2: Data Retrieval

The workflow retrieves and embeds your document’s content into the vector database for efficient search and retrieval.

Step 3: AI Query Processing

When you ask a question, the AI retrieves the most relevant context from the Supabase Vector Store based on semantic similarity.

Step 4: Response Generation

The AI combines the retrieved context with its generative capabilities to produce accurate, data-driven responses tailored to your input.

Prerequisites

Before setting up the workflow, ensure you have the following:

A GitHub account

A Supabase account

A Google Drive document containing your data

Basic understanding of APIs and environment configuration

Setup Instructions

Step 1: Create Accounts

Create a GitHub account and clone the repository containing the workflow. Then, create a Supabase account and a new project to generate your API keys.

Step 2: Prepare Your Data

Upload your data to Google Drive and make it downloadable. Add the document to the Supabase Vector Store using the “Add Document” feature.

Step 3: Configure the Environment

Set your Supabase keys as environment variables in your workflow configuration.

Step 4: Run the Workflow

Execute the workflow to connect your document with the AI agent. Once configured, you can start chatting with the AI agent—your responses will now be powered by your own data.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 2 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 4 - Google Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 5 - Embeddings OpenAI1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 6 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 7 - Recursive Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 8 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - RAG AI Assistant

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 14 - Retrieve and push documents

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1

Block 15 - Storing documents

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1

Block 16 - Your Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.3

3. Summary Table

Workflow Build a RAG-powered AI assistant with OpenAI, Google Drive & Supabase Vector DB
Complexity advanced
Nodes 16
Categories Internal Wiki, AI RAG
Author Zakaria Ben
Published 20 Mar 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3250/3250.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Build a RAG-powered AI assistant with OpenAI, Google Drive & Supabase Vector DB do?

Target Audience This guide is designed for developers, data scientists, and AI enthusiasts who want to create intelligent chatbots capable of understanding and using custom data. Whether you are bu...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.