๐Ÿ“– Build a RAG document chatbot with Supabase vector search and OpenRouter

โšก 208 views ยท ๐Ÿ“– Internal Wiki & Knowledge Base

Description

What this workflow does

This workflow builds a Retrieval-Augmented Generation (RAG) document chat assistant inside n8n using Supabase Vector Store and AI models.

The workflow allows users to upload documents, convert them into embeddings, store them inside Supabase pgvector, and query them through an AI chat interface using semantic search.

When a user sends a question through the webhook endpoint, the workflow retrieves the most relevant document chunks from Supabase and uses an AI model to generate a grounded response based on the uploaded documents.

This template includes:

How it works

The workflow is split into two main parts:

  1. Document ingestion pipeline
  1. RAG chat pipeline

Requirements

Setup

  1. Create a Supabase project and enable pgvector
  2. Create the required documents table and match_documents function
  3. Connect your Supabase credentials in n8n
  4. Connect your AI model credentials
  5. Add your Google Drive credentials
  6. Upload your documents and run the ingestion workflow
  7. Use the webhook endpoint to connect your frontend application

Setup typically takes around 15โ€“30 minutes.

How to customize

You can customize this workflow by:

This workflow is designed as a practical starting point for building AI-powered document assistants and RAG applications inside n8n.

๐Ÿ”— Nodes Used

Webhook, Google Drive, AI Agent, Recursive Character Text Splitter, Supabase Vector Store, Default Data Loader

๐Ÿ“ฅ Import

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

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup