Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAGPress

An AI-powered WordPress chatbot that answers visitor questions using your site's own content, powered by Retrieval-Augmented Generation (RAG).

How it works

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.

Requirements

  • WordPress 6.0+
  • PHP 8.0+
  • OpenAI API key

Local development

Requires Colima (or any Docker runtime) and Node.js.

git clone https://github.com/your-username/ragpress
cd ragpress
npm install
wp-env start

WP Admin available at http://localhost:8888/wp-admin (admin / password).

Configuration

Go to WP Admin → RAGPress → Settings, enter your OpenAI API key, then click Re-Index All Content to build the initial embeddings index.

Architecture

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)

Indexing pipeline

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)

File structure

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

Shortcode

[ragpress_chat]

License

GPL-2.0+

About

An AI-powered chatbot for WordPress

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages