AGENT TOOLS FOR RAG TOOL TO ADD A GOOGLE DRIVE FILE TO VECTOR DB RAG AI AGENT WITH CHAT INTERFACE ASK YOUR OWN PDFS — GOOGLE DRIVE → SUPABASE → CHAT (GEMINI, FREE TIER) WHAT IT DOES Drop a PDF (or a Google Doc) into one Drive folder. n8n downloads it, pulls the text out, cuts it into chunks, turns each chunk into a Gemini embedding and stores it in Supabase. Then open the chat, ask a question in plain words, and the agent reads your own documents to answer. Update a file and its old chunks are replaced. YOU NEED (ALL ON FREE PLANS) n8n · a Google account (Drive) · a Supabase project (free tier) · a Gemini key from Google AI Studio (free tier, no card). BEFORE WIRING — RUN THIS ONCE IN SUPABASE → SQL EDITOR create extension if not exists vector; create table documents (id bigserial primary key, content text, metadata jsonb, embedding vector(3072)); create or replace function match_documents (query_embedding vector(3072), match_count int default null, filter jsonb default '{}') returns table (id bigint, content text, metadata jsonb, similarity float) language plpgsql as $$ begin return query select id, content, metadata, 1 - (documents.embedding <=> query_embedding) as similarity from documents where metadata @> filter order by documents.embedding <=> query_embedding limit match_count; end; $$; (3072 is the size of a gemini-embedding-001 vector. If you pick a different embedding model, change both numbers to its size.) WIRE IT (3 CREDENTIALS, 10 NODES) 1. File Created and File Updated → Credential → Google Drive OAuth2 → sign in, then pick the folder to watch in both. 2. Download File → the same Google Drive credential. 3. Delete Old Doc Rows → Supabase API → your project URL and the service_role key from Supabase → Project Settings → API. 4. Insert into Supabase and Supabase Vector Store → the same Supabase credential; table is documents, query name is match_documents. 5. Gemini Embeddings, Gemini Embeddings (insert), Gemini Chat Model and Gemini Chat Model (tool) → Google Gemini (PaLM) API → paste your key. Keep the embedding model the SAME in both embedding nodes.