An AI-powered WordPress chatbot that answers visitor questions using your site's own content, powered by Retrieval-Augmented Generation (RAG).
When a visitor asks a question, RAGPress searches your site's indexed content using cosine similarity, retrieves the most relevant chunks, and passes them as context to GPT-4o — which generates a grounded answer with links back to the source posts.
- WordPress 6.0+
- PHP 8.0+
- OpenAI API key
Requires Colima (or any Docker runtime) and Node.js.
git clone https://github.com/your-username/ragpress
cd ragpress
npm install
wp-env startWP Admin available at http://localhost:8888/wp-admin (admin / password).
Go to WP Admin → RAGPress → Settings, enter your OpenAI API key, then click Re-Index All Content to build the initial embeddings index.
Visitor question
↓
REST endpoint (POST /wp-json/ragpress/v1/chat)
↓
Retriever (embeds question → cosine similarity over wp_ragpress_embeddings)
↓
Chat Engine (builds context block → GPT-4o → answer + source citations)
↓
Chat Widget (renders response, logs exchange to wp_ragpress_logs)
Post published / updated
↓
Content Chunker (~300-word chunks, HTML stripped, title prepended)
↓
OpenAI Client (text-embedding-3-small → float[] vector)
↓
wp_ragpress_embeddings (stored as JSON in MySQL)
ragpress/
├── ragpress.php
├── includes/
│ ├── class-ragpress-loader.php
│ ├── class-ragpress-activator.php
│ ├── class-ragpress-deactivator.php
│ ├── class-ragpress-openai-client.php
│ ├── class-ragpress-content-chunker.php
│ ├── class-ragpress-indexer.php
│ ├── class-ragpress-retriever.php
│ └── class-ragpress-chat-engine.php
├── admin/
│ ├── class-ragpress-admin.php
│ └── class-ragpress-logs-list-table.php
├── public/
│ └── class-ragpress-widget.php
├── assets/
│ ├── css/ragpress-chat.css
│ └── js/ragpress-chat.js
└── templates/
└── chat-widget.php
[ragpress_chat]
GPL-2.0+