=== Guru ChatBot ===
Contributors: guruseoservices, niendoo2
Tags: chatbot, ai, rag, openai, gemini
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 0.1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Self-hosted AI RAG chatbot for WordPress using OpenAI/Gemini. Built-in native PHP vector search & automated real-time CPT content crawling.

== Description ==

Guru ChatBot is a next-generation, self-hosted AI chatbot that trains itself directly on your WordPress content. By utilizing Retrieval-Augmented Generation (RAG) and vector search, it provides exceptionally accurate responses to customer queries without relying on expensive external platforms.

The plugin features a fully dynamic client-side vector database powered by standard MySQL, avoiding complex external API database setup. It embeds your custom posts, terms, pages, and products using OpenAI or Google Gemini, automatically crawling the content and indexing it in real time.

= Key Features =
* **State-of-the-Art RAG Pipeline**: Combines dynamic vector embeddings with a sophisticated prompt architecture.
* **OpenAI & Google Gemini Integration**: Support for the latest GPT-4o, Gemini 1.5 Pro, and Gemini 1.5 Flash models.
* **Deterministic Temporal Intent Parser**: Dynamically parses queries for relative times like "this weekend" or "next month" and filters events with calendar-relative precision.
* **Auto CPT Crawler**: Automatically indexes custom post types (like EventON, Tribe Events Calendar, WooCommerce, etc.) in real time.
* **Built-in Analytics**: Track chat sessions, user message latency, token usage, and user ratings from a unified dashboard.
* **Beautiful Premium Widget**: Sleek, customizable floating chat bubble with customizable colors, icons, position, greeting messages, and quick starter questions.

== Installation ==

1. Upload the `guru-chatbot` folder to the `/wp-content/plugins/` directory, or install it directly via the WordPress admin panel.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to the new 'Guru ChatBot' menu in your WordPress dashboard.
4. Set up your OpenAI or Google Gemini API keys in the AI Settings tab.
5. Head to the Indexing tab, choose what post types to index, and run the initial crawl to build your vector database.
6. Customize the Chat Widget appearance, and you're ready to go!

== Frequently Asked Questions ==

= Does this plugin require an external vector database? =
No! Guru ChatBot stores all embeddings directly inside your WordPress MySQL database using a high-performance custom table and handles similarity search using highly optimized native PHP vector math operations.

= Which AI providers are supported? =
We natively support OpenAI (using text-embedding-3-small/large and models like GPT-4o/GPT-3.5) and Google Gemini (using text-embedding-004 and Gemini 1.5 Pro/Flash).

= Will it index my WooCommerce products? =
Yes! It has full support for custom post types, custom tax terms, and WooCommerce products out of the box.

== External Services ==

This plugin relies on external third-party services to perform vector embeddings, chatbot content generation, and frontend widget security challenges. Users should review and agree to their terms and privacy policies.

1. **OpenAI API**
   * **Use Case**: Generates vector embeddings for your WordPress content during the indexing pipeline and computes chat completions to answer user queries in the chatbot widget.
   * **Data Transmitted**: Text extracts of your indexed post types and terms, and user-submitted chat messages/history.
   * **Terms of Service**: https://openai.com/policies/terms-of-use
   * **Privacy Policy**: https://openai.com/policies/privacy-policy

2. **Google Gemini API**
   * **Use Case**: Generates vector embeddings for your WordPress content during the indexing pipeline and computes chat completions to answer user queries in the chatbot widget.
   * **Data Transmitted**: Text extracts of your indexed post types and terms, and user-submitted chat messages/history.
   * **Terms of Service**: https://policies.google.com/terms
   * **Privacy Policy**: https://policies.google.com/privacy

3. **Cloudflare Turnstile**
   * **Use Case**: Anti-spam bot protection to secure the public frontend chat widget from malicious automated requests.
   * **Data Transmitted**: User browser's Turnstile interaction token and visitor's IP address.
   * **Terms of Service**: https://www.cloudflare.com/website-terms/
   * **Privacy Policy**: https://www.cloudflare.com/privacypolicy/

== Screenshots ==

1. The Admin Dashboard displaying real-time indexing status and system health.
2. Chat Widget Settings showing color pickers, positioning, and avatar uploads.
3. The premium customer-facing chat bubble running live on the frontend.
