๐Ÿ’ฌ WhatsApp RAG chatbot with Supabase, Gemini 2.5 Flash, and OpenAI embeddings

โšก 7,818 views ยท ๐Ÿ’ฌ Support Chatbots

Description

WhatsApp RAG Chatbot with Supabase, Gemini 2.5 Flash, and OpenAI Embeddings

This n8n template demonstrates how to build a WhatsApp-based AI chatbot that answers user questions using document retrieval (RAG) powered by Supabase for storage, OpenAI embeddings for semantic search, and Gemini 2.5 Flash LLM for generating high-quality responses.

Use cases are many: Turn your WhatsApp into a knowledge assistant for FAQs, customer support, or internal company documents โ€” all without coding.


Good to know


How it works

  1. Trigger: A new WhatsApp message triggers the workflow via webhook.
  2. Message Check: Determines if the message is a query or a document upload.
  3. Document Handling:
    • Fetch file URL from WhatsApp.
    • Convert binary to text.
    • Generate embeddings with OpenAI and store them in Supabase.
  4. Query Handling:
    • Generate query embeddings with OpenAI.
    • Retrieve relevant context from Supabase.
    • Pass context to Gemini 2.5 Flash LLM to compose a response.
  5. Response: Send the answer back to the user on WhatsApp.

Optional: Add Gmail node to forward chat logs or daily summaries.


How to use


Requirements


Customising this workflow

๐Ÿ”— Nodes Used

HTTP Request, WhatsApp Business Cloud, AI Agent, Embeddings OpenAI, Supabase Vector Store, Default Data Loader

๐Ÿ“ฅ Import

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

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