workflows.fit
Back to n8n workflows
n8n templateFreeBy Babish Shrestha

Build a RAG knowledge chatbot with OpenAI, Google Drive, and Supabase

🚀 Build Your Own Knowledge Chatbot Using Google Drive Create a smart chatbot that answers questions using your Google Drive PDFs—perfect for support, internal docs, education, or research. 🛠️ Quick Setup Guide Step ...

Data & StorageAILangchainCore NodesSticky NoteGoogle Drive TriggerSetExtract From File
Loading interactive preview...

Template notes

🚀 Build Your Own Knowledge Chatbot Using Google Drive

Create a smart chatbot that answers questions using your Google Drive PDFs—perfect for support, internal docs, education, or research.

🛠️ Quick Setup Guide Step 1: Prerequisites

- n8n instance (cloud or self-hosted) - Google Drive account (with PDFs) - Supabase account (vector database) - OpenAI API key - PostgreSQL database (for chat memory) else remove the node

Step 2: Supabase Setup - Create supabase account (its free) - Create a project - Copy the sql and paste it in supabase sql editor

SQL -- Enable the pgvector extension to work with embedding vectors create extension vector;

-- Create a table to store your documents create table documents ( id bigserial primary key, content text, -- corresponds to Document.pageContent metadata jsonb, -- corresponds to Document.metadata embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed );

-- Create a function to search for documents create function matchdocuments ( queryembedding vector(1536), matchcount int default null, filter jsonb DEFAULT '{}' ) returns table ( id bigint, content text, metadata jsonb, similarity float ) language plpgsql as $$ variableconflict usecolumn begin return query select id, content, metadata, 1 - (documents.embedding <=> queryembedding) as similarity from documents where metadata @> filter order by documents.embedding <=> queryembedding limit matchcount; end; $$;