🤖 AI RAG Assistant Pro

AI-powered chat widget with Retrieval-Augmented Generation, Vector Embeddings, WooCommerce integration, PDF upload, voice input/output, lead capture, appointments, WhatsApp integration, Pinecone support, and license management for WordPress.

Introduction

AI RAG Assistant Pro adds an intelligent floating chat widget to your WordPress site. Unlike basic AI chatbots, it uses Retrieval-Augmented Generation (RAG) to answer questions based on your actual content — not hallucinations.

🧠 RAG Technology

Finds relevant content from your knowledge base before answering. Answers are grounded in your actual content.

🔍 Vector Embeddings

Semantic search using cosine similarity. Finds related content even when exact keywords don't match.

🛒 WooCommerce

Live product data, stock status, pricing, cart awareness, order lookup, and product recommendations.

📄 PDF Upload

Upload manuals, policies, and documents. AI reads and answers from PDF content automatically.

🎤 Voice I/O

Speak your questions, hear the answers. Uses browser's built-in Web Speech API — completely free.

🎯 Lead Capture

Collect visitor emails, phone numbers, and pages from chat leads. Export leads to CSV from the admin panel.

📅 Appointments

Enable booking support with Calendly integration, services, and scheduled time slots from the widget.

🛡️ Secure Chat

Built-in CAPTCHA, honeypot protection, rate limiting, and email alerts keep your chat safe from abuse.

Requirements

RequirementMinimumRecommended
WordPress6.06.4+
PHP8.18.2+
MySQL5.78.0+
Memory Limit128MB256MB+
WooCommerceOptional (7.0+ for WooCommerce features)
SSL/HTTPSRecommended (required for voice features)
AI API Key Required: You need an API key from OpenAI, Groq, Google Gemini, or any compatible provider. Groq offers a free API with no credit card required.

Installation

Method 1 — WordPress Admin Upload

1
Go to Plugins → Add New → Upload Plugin Click "Choose File" and select the ai-rag-assistant.zip file.
2
Click "Install Now" WordPress will upload and extract the plugin automatically.
3
Click "Activate Plugin" You will be redirected to the plugin dashboard.

Method 2 — FTP Upload

  1. Extract ai-rag-assistant.zip on your computer
  2. Upload the ai-rag-assistant folder to /wp-content/plugins/
  3. Go to WordPress Admin → Plugins → Installed Plugins
  4. Find "AI RAG Assistant Pro" and click "Activate"

Quick Start (5 Minutes)

1
Add API Key Go to AI Assistant → Settings → API & Model. Enter your API key and endpoint. Click Save.
2
Test Connection Click "Test Connection" button on the API tab to verify your key works.
3
Index Your Content Go to AI Assistant → Knowledge Base and click "Full Re-index".
4
Test the Widget Visit your website frontend. Click the chat bubble in the corner and ask a question!
That's it! Your AI assistant is now live and answering questions from your content.

API Setup

Go to AI Assistant → Settings → API & Model tab.

Settings Explained

SettingDescriptionRecommended
API KeyYour AI provider secret keyRequired
API EndpointProvider's API base URLSee table below
ModelAI model to usegpt-4o-mini or llama-3.3-70b
TemperatureResponse creativity (0–2)0.7
Max TokensMax response length1024
System PromptAI personality instructionsCustomize for your business

Free API Providers

Groq (Recommended Free Option)

100% free, no credit card required, very fast responses.

SettingValue
API KeyGet from console.groq.com (starts with gsk_)
API Endpointhttps://api.groq.com/openai/v1
Modelllama-3.3-70b-versatile

Google Gemini (Also Free)

SettingValue
API KeyGet from aistudio.google.com (starts with AIza)
API Endpointhttps://generativelanguage.googleapis.com/v1beta/openai
Modelgemini-1.5-flash

OpenAI (Paid — Best Quality)

SettingValue
API KeyGet from platform.openai.com (starts with sk-)
API Endpointhttps://api.openai.com/v1
Modelgpt-4o-mini (cheap) or gpt-4o (best)

OpenRouter (Free Models Available)

SettingValue
API KeyGet from openrouter.ai
API Endpointhttps://openrouter.ai/api/v1
Modelmeta-llama/llama-3.2-3b-instruct:free

Vector Embeddings

Go to Settings → Embeddings tab.

What are embeddings? Embeddings convert text into mathematical vectors. We compare vectors using cosine similarity to find semantically similar content — even when exact keywords don't match. This makes RAG much more accurate.

When to Enable Embeddings

SituationRecommendation
Using OpenAIEnable — Use text-embedding-3-small
Using Groq (free)Disable — Groq has no embedding API. Keyword search is used instead.
Using GeminiDisable — Use keyword search fallback
Using Ollama locallyEnable — Use nomic-embed-text model
Cost: OpenAI embeddings cost approximately $0.0005 per 1,000 pages indexed. Indexing your entire site typically costs less than $0.01.

RAG Configuration

Go to Settings → RAG tab.

SettingDescriptionRecommended
Enable RAGToggle retrieval system on/offOn
Source URLExternal URL to index (optional)Leave blank for WP content
Chunk SizeTokens per content chunk500
Index Blog PostsIndex all published postsOn
Index PagesIndex all published pagesOn
Index ProductsIndex WooCommerce productsOn (if using WooCommerce)
Index Custom Post TypesSelect custom post types to indexSelect relevant CPTs

Chat Widget

Go to Settings → Widget tab.

SettingDescription
Show on PagesSelect specific pages. Leave all unchecked to show everywhere.
PositionCorner where widget appears (bottom-right recommended)
Accent ColorColor of chat button and header
Widget TitleName shown in chat header
Welcome MessageFirst message when widget opens (supports emoji)
Suggested QuestionsClickable question buttons shown on first open
Block Themes (Twenty Twenty-Five etc.): The plugin automatically handles page detection for block themes using get_queried_object_id(). If the widget doesn't appear, try leaving all pages unchecked to show everywhere.

Voice Features

Go to Settings → Widget tab → Voice Settings section.

Voice Input (Microphone)

Users click the mic button and speak their question. Speech is converted to text and sent automatically.

Browser Support: Chrome ✅ Edge ✅ Safari ✅ Firefox ❌
Cost: Free — uses browser's built-in Web Speech API. No external API calls.

Voice Output (Text-to-Speech)

AI responses are read aloud. Users can toggle this via the speaker icon in the widget header.

Requirements for Voice

Integrations

These optional integrations extend the assistant with external services and advanced data handling.

WhatsApp Button

Enable a WhatsApp button inside the chat widget and configure the phone number and button text. Visitors can continue conversations in WhatsApp directly.

Pinecone Vector Store

Use Pinecone for external vector storage when your knowledge base grows large. Configure the API key, host, index, and namespace to improve search performance.

Protection & Alerts

The plugin supports honeypot traps, optional CAPTCHA protection, and email alerts for lead capture and critical events.

Knowledge Base

Go to AI Assistant → Knowledge Base.

Full Re-index

Click "Full Re-index" to index all your WordPress content. This:

  1. Indexes all published posts (if enabled)
  2. Indexes all published pages (if enabled)
  3. Indexes selected custom post types
  4. Indexes WooCommerce products (if enabled)
  5. Generates vector embeddings (if enabled)
When to Re-index: After adding new content, after changing RAG settings, or after uploading new PDFs. Individual posts/pages are auto-indexed when published or updated.

Embedding Coverage

The progress bar shows what percentage of chunks have vector embeddings. 100% means semantic search is fully active.

PDF Library

Go to AI Assistant → PDF Library.

Uploading a PDF

  1. Drag and drop a PDF onto the upload zone, or click to browse
  2. Optionally add a display title and category
  3. Click "Upload & Index PDF"
  4. Wait for processing to complete
  5. AI can now answer questions from the PDF

PDF Requirements

SupportedNot Supported
Text-based PDFsScanned/image PDFs
Digital documentsPassword-protected PDFs
Up to 20MBPDFs with only charts/images
Any languageEncrypted PDFs
Scanned PDFs: If your PDF was created by scanning paper documents, the plugin cannot read it. You need OCR software first. For best results, use digitally-created PDFs.

Best PDF Types

Custom Post Types

Go to Settings → RAG tab → Index Custom Post Types.

The plugin automatically detects all registered public custom post types. Check the ones you want to include in the knowledge base.

Supported Plugins

Custom Field Support

The following ACF field types are extracted automatically:

WooCommerce Integration

Go to Settings → WooCommerce tab. Requires WooCommerce 7.0+.

WooCommerce features require a Pro or Agency license.
FeatureDescription
Show PricesAI includes live pricing in responses
Show Stock StatusAI reports in-stock/out-of-stock status
Show VariationsAI lists product variations (sizes, colors)
Cart AssistanceAI knows what's in the customer's cart
Order LookupLogged-in customers can ask about their orders
Product RecommendationsAI recommends products with visual cards

Lead Capture

Go to AI Assistant → Leads.

Collect contact details and page context from visitors who submit their email or phone number in the chat. Leads are stored in WordPress and can be exported to CSV.

Features

Appointments

Go to Settings → Appointments via the main Settings page.

Enable appointment booking to let visitors request meetings directly from the chat widget. Configure available services, working hours, slot duration, and notification email.

Appointment Settings

Conversations

Go to AI Assistant → Conversations.

View all chat conversations between users and your AI assistant. Features include:

License Management

Go to AI Assistant → License.

License Tiers

FeatureFreeStarterProAgency
Messages/Day50500
RAG Knowledge Base
Vector Embeddings
WooCommerce
CSV Export
Unlimited Sites

Activating Your License

  1. Go to AI Assistant → License
  2. Enter your license key in the input field
  3. Click "Activate"
  4. Features unlock immediately

Security Settings

Go to Settings → Security tab.

SettingDescriptionRecommended
Rate Limit MessagesMax messages per time window per session20
Rate Limit WindowTime window in seconds3600 (1 hour)
Allowed RolesRestrict chat to specific user rolesLeave all unchecked for everyone
HoneypotInvisible spam trap to block botsEnabled
CAPTCHAOptional anti-spam challenge for visitorsOptional
Email AlertsReceive alerts by email for lead capture and critical eventsOptional
API Key Security: Your API key is stored in the WordPress database and never exposed in HTML source code. The settings page displays only the last 4 characters for verification.
Retention: Use Developer settings to configure how many days conversation history is retained on the server.

Hooks & Filters

Developers can extend plugin behavior using WordPress hooks.

Filters

// Add custom AI models to dropdown
add_filter( 'ai_rag_allowed_models', function( $models ) {
    $models['my-custom-model'] = 'My Custom Model';
    return $models;
});

// Modify messages before sending to AI
add_filter( 'ai_rag_messages', function( $messages, $user_msg ) {
    // Add custom context
    return $messages;
}, 10, 2 );

// Change context chunk count
add_filter( 'ai_rag_context_chunks', fn() => 5 );

// Change chunk overlap
add_filter( 'ai_rag_chunk_overlap', fn() => 100 );

// Modify embedding model
add_filter( 'ai_rag_embedding_model', fn() => 'text-embedding-3-large' );

// Customize welcome message per page
add_filter( 'ai_rag_welcome_message', function( $msg ) {
    if ( is_shop() ) return '🛍️ How can I help you shop?';
    return $msg;
});

// Add suggested questions per page
add_filter( 'ai_rag_suggested_questions', function( $questions ) {
    if ( is_product() ) {
        return [
            'What sizes are available?',
            'What is your return policy?',
            'How long does shipping take?',
        ];
    }
    return $questions;
});

// Change rate limits
add_filter( 'ai_rag_rate_limit',  fn() => 50 );
add_filter( 'ai_rag_rate_window', fn() => 3600 );

// Change indexable post types
add_filter( 'ai_rag_indexable_post_types', function( $types ) {
    $types[] = 'my_custom_type';
    return $types;
});

// Change "Powered by" text
add_filter( 'ai_rag_powered_by', fn() => 'Powered by My Brand' );

// Change data retention days
add_filter( 'ai_rag_conversation_retention_days', fn() => 180 );

Actions

// After plugin activates
add_action( 'ai_rag_assistant_activated', function() {
    // Custom setup code
});

// Daily cleanup hook
add_action( 'ai_rag_cleanup', function() {
    // Custom cleanup logic
});

Troubleshooting

Chat Widget Not Showing

AI Not Answering From My Content

API Connection Failed

PDF Not Being Indexed

Settings Not Saving

Frequently Asked Questions

Which AI providers are free?

Groq (best free option — fast, no credit card), Google Gemini (1,500 free requests/day), and OpenRouter (has free models). OpenAI requires a paid account but offers the best quality.

Does it work without an API key?

No. An AI API key is required for the chat to work. However, Groq provides a completely free API key with generous limits.

Will it slow down my website?

No. The chat widget loads asynchronously and does not affect page load time. JavaScript is only loaded on pages where the widget is enabled.

Does it work with caching plugins?

Yes. All AI requests use AJAX (admin-ajax.php) which is excluded from caching by all major caching plugins (WP Rocket, LiteSpeed, W3 Total Cache, etc.).

Can I use it on multiple sites?

The regular license covers 1 site. The Agency license covers unlimited sites.

Is my data sent to third parties?

Chat messages are sent to your chosen AI API provider (OpenAI, Groq, etc.) to generate responses. All conversation data is stored on your own server. We do not collect any data.

Can the AI answer in multiple languages?

Yes! The AI responds in whatever language the user writes in. Configure the voice language in Settings → Widget for voice features.

What happens if the AI API is down?

The plugin handles API errors gracefully and shows a friendly error message to the user. Your site continues to work normally.

Changelog

Version 2.0.0

Version 1.0.0

Support

Before contacting support: Please check the Troubleshooting section and FAQ above. Most common issues are covered there.

How to Get Support

  1. Activate a valid license to unlock the support page
  2. Purchase a license for priority support
  3. Leave a comment on the Codester item page
  4. Include your WordPress version, PHP version, and error description
  5. Enable Debug Mode and share relevant log entries
Support Page: The support admin page will be locked until your license key is activated.

Response Time

LicenseResponse Time
FreeCommunity support only
StarterWithin 48 hours
ProWithin 24 hours
AgencyWithin 12 hours (priority)
Thank you for purchasing AI RAG Assistant Pro!
Please leave a review on Codester if you find this plugin useful. It helps other users discover the plugin.