Build a knowledge-based WhatsApp assistant with RAG, Gemini, Supabase & Google Docs
Workflow Execution Link: [Watch Execution Video](https://youtu.be/NUWeQywOMTw?si=7slubwmqYqs2m6sh) Workflow Pre-requisites Step 1: Supabase Setup First, replace the keys in the "Save the embedding in DB" & "Search Emb...
Template notes
Workflow Execution Link: [Watch Execution Video](https://youtu.be/NUWeQywOMTw?si=7slubwmqYqs2m6sh)
Workflow Pre-requisites
Step 1: Supabase Setup
First, replace the keys in the "Save the embedding in DB" & "Search Embeddings" nodes with your new Supabase keys. After that, run the following code snippets in your Supabase SQL editor:
1. Create the table to store chunks and embeddings: sql CREATE TABLE public."RAG" ( id bigserial PRIMARY KEY, chunk text NULL, embeddings vector(1024) NULL ) TABLESPACE pgdefault;
2. Create a function to match embeddings: sql DROP FUNCTION IF EXISTS public.matchembeddings1(integer, vector);
CREATE OR REPLACE FUNCTION public.matchembeddings1( matchcount integer, queryembedding vector ) RETURNS TABLE ( chunk text, similarity float ) LANGUAGE plpgsql AS $$ BEGIN RETURN QUERY SELECT R.chunk, 1 - (R.embeddings <=> queryembedding) AS similarity FROM public."RAG" AS R ORDER BY R.embeddings <=> queryembedding LIMIT matchcount; END; $$;
Step 2: Create Knowledge Base