AI · Automation 2025 Completed

WordPress RAG Chatbot — AI Q&A over Website Content

A retrieval-augmented generation system in n8n that indexes WordPress posts and pages into a Supabase pgvector store and answers visitor questions with sourced, context-aware replies.

Built by Redoan Uzzaman, Full-Stack Developer & AI Engineer.

WordPress RAG Chatbot — AI Q&A over Website Content

Overview

This project turns a WordPress website into a conversational knowledge base. Visitors ask questions in natural language and receive answers grounded in the site's own posts and pages, along with source metadata such as URL, publication date and content type.

How it works

The system is split into three cooperating n8n workflows:

  1. Initial indexing — fetches all published posts and pages through the WordPress API, filters out protected or unpublished content, converts HTML to Markdown, splits text with a token splitter and stores OpenAI text-embedding-3-small embeddings in a Supabase pgvector store.
  2. Incremental upsert — runs on a schedule, reads the timestamp of the last execution from PostgreSQL, and fetches only content modified since then. Changed documents have their old vectors removed and fresh embeddings inserted, keeping the index current without full re-indexing.
  3. Chat — a webhook/chat trigger feeds an AI agent that uses the vector store as a retrieval tool and PostgreSQL-backed chat memory for multi-turn context, returning answers through a respond-to-webhook node so the chat can be embedded on any site.

The architecture demonstrates a complete production RAG loop — ingestion, change tracking, embedding, retrieval and conversational generation — built entirely from n8n's LangChain nodes.

Key Features

  • Full and incremental WordPress content indexing
  • HTML-to-Markdown conversion and token-based chunking
  • OpenAI embeddings stored in Supabase pgvector
  • Change tracking to re-embed only modified content
  • AI agent with vector-store retrieval tool
  • PostgreSQL-backed conversation memory
  • Embeddable webhook chat interface

Tech Stack

  • n8n
  • OpenAI
  • Supabase
  • pgvector
  • PostgreSQL
  • WordPress REST API
  • LangChain

Want something like this built?

Redoan Uzzaman takes on AI, automation and full-stack projects for clients worldwide.