πŸ“– Build a RAG knowledge chatbot with OpenAI, Google Drive, and Supabase

⚑ 1,182 views Β· πŸ“– Internal Wiki & Knowledge Base

Description

πŸš€ 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

Step 2: Supabase Setup

-- 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 match_documents (
  query_embedding vector(1536),
  match_count int default null,
  filter jsonb DEFAULT '{}'
) returns table (
  id bigint,
  content text,
  metadata jsonb,
  similarity float
)
language plpgsql
as $$
#variable_conflict use_column
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;
$$;

Step 3: Import & Configure n8n Workflow

Step 4: Test & Use

⚑ Features

πŸ“ Troubleshooting

Tags: RAG, Chatbot, Google Drive, Supabase, OpenAI, n8n Setup Time: ~20 minutes

πŸ”— Nodes Used

Google Drive, Google Drive Trigger, Supabase, AI Agent, Embeddings OpenAI, OpenAI Chat Model

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup