WordPress RAG & GenAI Chatbot

October 6, 2025

Aladuddin Aladin

This workflow integrates WordPress content with a Retrieval-Augmented Generation (RAG) pipeline to create an intelligent chatbot powered by OpenAI and Supabase. It fetches posts and pages from your WordPress site, converts them into embeddings, stores them in a vector database, and enables real-time chat functionality where users can ask questions and receive context-aware answers directly on your website.

✨ Features

  • WordPress Content Integration
    • Automatically fetches and updates posts and pages.
    • Filters only published and unprotected content.
  • RAG with Supabase Vector Store
    • Converts content into embeddings using OpenAI’s text-embedding-3-small model.
    • Stores embeddings in Supabase for semantic search.
    • Supports upserts (insert new or update existing documents).
  • Smart Content Processing
    • HTML → Markdown conversion.
    • Token splitting for optimized embedding generation.
    • Metadata tagging (title, URL, content type, publication & modification dates).
  • Chatbot Functionality
    • Webhook-based chat trigger for real-time user queries.
    • Retrieves matching documents from the vector store.
    • AI agent (OpenAI gpt-4o-mini) generates natural language answers.
    • Forces metadata citation (URL, content type, publication & modification dates) in answers.
    • Supports multilingual responses (answers in the visitor’s language).
  • Memory & History Tracking
    • Stores conversation history in Postgres for continuity.
    • Logs embedding creation and workflow executions.
  • Scalable & Automated Updates
    • Scheduled checks for new/modified WordPress content.
    • Automatically re-embeds and updates documents in Supabase.

About the author

Alauddin Aladin is an AI Automation expert helping businesses streamline operations, boost productivity, and scale effortlessly using tools like Make.com and n8n. With over a decade of experience in digital systems and automation strategy, Alauddin empowers entrepreneurs to save time and grow smarter through intelligent workflows and AI-driven solutions.

Leave a Comment