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
- Simple Memory
- Official n8n Documentation
- Default Data Loader
- Recursive Character Text Splitter
- Remove Duplicate Documentation Content
- Only Keep Doc Paths
- Clean Documentation
- Gemini 2.5 Flash
- Your Supabase Vector Store
- Get All n8n Documentation Links
- Extract Links from HTML
- Split Out Links
- Remove Duplicate Links
- Add Documentation Page to Vector Store
25 steps in total.
Similar automations
RAG & Knowledge BasesBuild a Documentation Expert Chatbot with a RAG Pipeline23 stepsRAG & Knowledge BasesBuild a Documentation Expert Chatbot with Gemini RAG23 stepsRAG & Knowledge BasesExtract API Schemas from Documentation with Gemini and Qdrant82 stepsCode, Git & Developer ToolsServe n8n Workflow Documentation with Docsify108 steps