AutomationMart
Home/Browse/Build a RAG knowledge base from PDFs with Gemini, Supabase and Google Sheets
n8n

Build a RAG knowledge base from PDFs with Gemini, Supabase and Google Sheets

n8nn8n27 modulesv1.0
Google SheetsGoogle DriveGemini

Quick Overview This workflow ingests educational PDF URLs from Google Sheets, extracts and chunks their text, generates embeddings with Google Gemini, and stores them in a Supabase pgvector table for retrieval, while also exposing a public chat webhook that answers questions using Gemini and the same Supabase knowledge base. How it works 1. Runs every hour on a schedule and reads rows from a Google Sheets document, keeping only entries where the status is empty. 2. Processes each queued URL one

At a glance

Build a RAG knowledge base from PDFs with Gemini, Supabase and Google Sheets is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Sheets, Google Drive, Gemini. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Google Sheets, Google Drive, Gemini
Modules
27
Price
Free
Version
v1.0
Build a RAG knowledge base from PDFs with Gemini, Supabase and Google Sheets workflow diagram

About this workflow

Quick Overview This workflow ingests educational PDF URLs from Google Sheets, extracts and chunks their text, generates embeddings with Google Gemini, and stores them in a Supabase pgvector table for retrieval, while also exposing a public chat webhook that answers questions using Gemini and the same Supabase knowledge base. How it works 1. Runs every hour on a schedule and reads rows from a Google Sheets document, keeping only entries where the status is empty. 2. Processes each queued URL one at a time and routes it based on whether it is a seraj-uae.com page or a direct Google Drive file link. 3. For seraj-uae.com URLs, fetches the HTML page to extract the PDF download link (or embedded Google Drive file ID) and the document title. 4. Downloads the PDF from either the source website via HTTP or from Google Drive, waits briefly, and extracts text from the PDF binary. 5. Cleans and validates the extracted text, then splits it into overlapping chunks and generates embeddings using Google Gemini. 6. Inserts the embedded chunks into a Supabase pgvector table with file/title/source metadata and updates the Google Sheets row to “Embedded” or “Not Text Based PDF” if no text is found. 7. Separately, exposes a public n8n Chat webhook that receives student questions and uses Gemini Flash with Supabase vector retrieval to return answers. Setup 1. Create a Supabase project with pgvector enabled, create the serajdocuments table, and add the matchserajdocuments function used for vector search. 2. Add Supabase API credentials in n8n and ensure the table name (serajdocuments) and query function name (matchserajdocuments) match your Supabase setup. 3. Add Google Sheets OAuth2 credentials and update the Google Sheet document ID/sheet reference, ensuring columns include sourceurl, status, and rownumber. 4. Add Google Drive OAuth2 credentials for downloading PDFs hosted in Drive. 5. Add a Google Gemini (PaLM) API credential for embeddings and Gemini Flash, then activate the workflow and copy the public chat webhook URL for your website chat widget.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Creates an Alert in Opsgenie and send information to Google Sheets

When you create a new Alert at Opsgenie, Make will automatically add information about Alert to your Google Sheets spreadsheet as a new row. The template uses this [example spreadsheet](https://docs.google.com/spreadsheets/d/120lz8lJfXMrsLgz9UNV9VBy2Ra1qf4LhInkbTiK-V1A/edit?usp=sharing).

Free

Create items and updates in Monday.com from filtered Google Sheets rows

Automatically create items and updates in Monday.com from specific Google Sheets rows. Streamline project management by syncing filtered data effortlessly.

Free

Create Viral Loops participants from new Google Sheets rows

Every time a new participant is added to your Google Sheets spreadsheet, Make will automatically add this participant to a selected Viral Loops campaign. The template uses this [example spreadsheet](https://docs.google.com/spreadsheets/d/1ez0iFI21bS4fC3gXSBgFQgmpZue2ZtlA6PA_o_lDT2M/edit?usp=sharing).

Free

Upload new files to Uniqode from new files in Google Drive

When you upload files to a specific folder in Google Drive, Make will automatically upload them to Uniqode.

Free

Add Crisp users from new Google Sheets rows

Every time a new row is added to your Google Sheets spreadsheet, Make will automatically create a new user in Crisp. The template uses this [examplle spreadsheet](https://docs.google.com/spreadsheets/d/1cpuMQI3coZGnQubt0uejAGItuaknJgYW__LEU9mofo4/edit?usp=sharing).

Free

Post new articles from feeds to Slack channel

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. 📄 Post New Articles from Feeds to Slack Channel 🧠 What This Workflow Does This workflow automates the discovery and sharing of fresh articles from a curated list of RSS feeds. It performs the following steps: 1. Reads a list of RSS feed URLs from a Google Sheet (Feeds tab). 2. Fetches the latest articles from each feed. 3. Checks for duplicates against previously published links stored in anothe

Free

Google Sheets duplication & enrichment automation

How it Works ## This workflow reads sheet details from a source Google Spreadsheet, creates a new spreadsheet, replicates the sheet structure, enriches the content by reading data, and writes it into the corresponding sheets in the new spreadsheet. The process is looped for every sheet, providing an automated way to duplicate and transform structured data. 🎯 Use Case ## - Automate duplication and data enrichment for multi-sheet Google Spreadsheets - Replicate templates across new documents with

Free

Dynamic AI model router for query optimization with OpenRouter

The Agent Decisioner is a dynamic, AI-powered routing system that automatically selects the most appropriate large language model (LLM) to respond to a user's query based on the query’s content and purpose. This workflow ensures dynamic, optimized AI responses by intelligently routing queries to the best-suited model. --- Advantages 🔁 Automatic Model Routing: Automatically selects the best model for the job, improving efficiency and relevance of responses. 🎯 Opti

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free