Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / RAG & Knowledge Bases

RAG & Knowledge Bases

n8n Documentation Expert Bot with Gemini RAG and Supabase

On a schedule or when you run it, this loads the official n8n documentation into Supabase with Gemini embeddings so a Gemini agent can answer questions about it.

What it does

-- Enable the pgvector extension to work with embedding vectors (REMOVE THIS LINE IF ALREADY ENABLED) 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(768) -- 768 works for Gemini embeddings, CHANGE IF OPENAI EMBEDDINGS ); -- 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; $$;

The steps

  1. Simple Memory
  2. Official n8n Documentation
  3. Default Data Loader
  4. Recursive Character Text Splitter
  5. Remove Duplicate Documentation Content
  6. Only Keep Doc Paths
  7. Clean Documentation
  8. Gemini 2.5 Flash
  9. Your Supabase Vector Store
  10. Get All n8n Documentation Links
  11. Extract Links from HTML
  12. Split Out Links
  13. Remove Duplicate Links
  14. Add Documentation Page to Vector Store

25 steps in total.

Similar automations