workflows.fit
Back to n8n workflows
n8n templateFreeBy iamvaar

Build a knowledge base chatbot with Jotform, RAG Supabase, Together AI & Gemini

Youtube Video: [https://youtu.be/dEtV7OYuMFQ?si=fOAlZWz4aDuFFovH](https://youtu.be/dEtV7OYuMFQ?si=fOAlZWz4aDuFFovH) Workflow Pre-requisites Step 1: Supabase Setup First, replace the keys in the "Save the embedding in ...

DevelopmentCore NodesData & StorageAILangchainCommunicationCodeHttp Request
Loading interactive preview...

Template notes

Youtube Video: [https://youtu.be/dEtV7OYuMFQ?si=fOAlZWz4aDuFFovH](https://youtu.be/dEtV7OYuMFQ?si=fOAlZWz4aDuFFovH)

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 Jotform with these fields 1. Your full name 2. email address 3. Upload PDF Document [field where you upload the knowledgebase in PDF]