Skip to main content

AI study assistant with RAG - Google Gemini with Drive & Supabase vector search

Workflow preview

Workflow preview
100%
AI study assistant with RAG - Google Gemini with Drive & Supabase vector search preview
Open on n8n.io

Important notice

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

1. Workflow Overview

How it works A complete AI powered study assistant system that lets you chat naturally with your documents stored in Google Drive: The system has two connected workflows: 1. Document Indexing Pipel...

Best for

  • Personal Productivity automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.embeddingsgooglegemini, @n8n/n8n-nodes-langchain.vectorstoresupabase, @n8n/n8n-nodes-langchain.memorypostgreschat, @n8n/n8n-nodes-langchain.toolcalculator, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.toolworkflow, @n8n/n8n-nodes-langchain.agent

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
AI study assistant with RAG - Google Gemini with Drive & Supabase vector search
Workflow name
AI study assistant with RAG - Google Gemini with Drive & Supabase vector search

How it works

A complete AI-powered study assistant system that lets you chat naturally with your documents stored in Google Drive:

The system has two connected workflows:

1. Document Indexing Pipeline (Sub-workflow): • Accepts Google Drive folder URLs • Automatically fetches all files from the folder • Converts documents to plain text • Generates 768-dimensional embeddings using Google Gemini • Stores everything in Supabase vector database for semantic search

2. Study Chat Agent (Main workflow): • Provides a conversational chat interface • Automatically detects and processes Google Drive links shared in chat • Searches your indexed documents using semantic similarity • Maintains conversation history across sessions • Includes calculator for math problems • Responds naturally using Google Gemini 2.5 Pro

Use Cases: Students studying for exams, researchers managing papers, professionals building knowledge bases, anyone needing to query large document collections conversationally.

Set up steps

Prerequisites: • Google Drive OAuth2 credentials • Google Gemini API key (free tier available) • Supabase account with Postgres connection • ~15 minutes setup time

Complete Setup:

Part 1: Document Indexing Workflow

  1. Add Google Drive OAuth2 credentials to the Drive nodes
  2. Configure Supabase Postgres credentials in the SQL node
  3. Add Supabase API credentials to the Vector Store node
  4. Add Google Gemini API key to the Embeddings node

Part 2: Study Agent Workflow

  1. Import the Study Agent workflow
  2. Verify the "Folder all file to vector" tool links to the indexing workflow
  3. Add Google Gemini API credentials to both Gemini nodes
  4. Configure Supabase API credentials in the Vector Store node
  5. Add Postgres credentials for Chat Memory
  6. Deploy and access the chat via webhook URL

How to Use:

  1. Open the chat interface (webhook URL)
  2. Paste a Google Drive folder link in the chat
  3. Wait for indexing to complete (~1-2 minutes)
  4. Start asking questions about your documents
  5. The AI will search and answer from your materials

Note: The indexing workflow runs automatically when you share Drive links in chat, or you can run it manually to pre-load documents.

System Components:

  • Main Agent: Gemini 2.5 Pro with conversational AI
  • Vector Search: Supabase with pgvector (768-dim embeddings)
  • Memory: Postgres chat history (10-message context window)
  • Tools: Document retrieval, Drive indexing, calculator
  • Embedding Model: Google Gemini text-embedding-004

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 - Embeddings Google Gemini

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

Block 2 - Supabase Vector Store

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

Block 3 - Postgres Chat Memory

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

Block 4 - Calculator

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

Block 5 - When chat message received

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

Block 6 - Google Gemini Chat Model

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

Block 7 - Folder all file to vector

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.2

Block 8 - Study Agent

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

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 - Embeddings Google Gemini4

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

Block 14 - Default Data Loader2

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

Block 15 - Execute a SQL query

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 16 - Code in JavaScript

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 18 - Loop Over Items

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

Block 19 - Search files and folders

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

Block 20 - Insert into Supabase Vectorstore

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

Block 21 - Download File

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

Block 22 - Sticky Note4

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

Block 23 - Sticky Note5

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

Block 24 - Sticky Note6

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

Showing the first 24 of 28 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow AI study assistant with RAG - Google Gemini with Drive & Supabase vector search
Complexity advanced
Nodes 28
Categories Personal Productivity, AI RAG
Author Mantaka Mahir
Published 09 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10653/10653.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 AI study assistant with RAG - Google Gemini with Drive & Supabase vector search do?

How it works A complete AI powered study assistant system that lets you chat naturally with your documents stored in Google Drive: The system has two connected workflows: 1. Document Indexing Pipel...

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 Personal Productivity, AI RAG use case.