=== AskAny – AI Chatbot with RAG, Live Agent & WooCommerce Order Tracking ===
Contributors: wpazleen, sambyte
Tags: rag, live agent, order tracking, semantic search, openai
Requires at least: 5.9
Tested up to: 7.0
Stable tag: 1.14.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Free WordPress AI chatbot with RAG, live agent handoff, and WooCommerce order tracking. Real-time SSE streaming, 6 AI providers, no monthly fees.

== Description ==

AskAny is a WordPress AI chatbot built on RAG (Retrieval-Augmented Generation). Before it answers anything, it retrieves the most relevant sections of your actual site content using semantic search, then generates a grounded, cited answer from that content — not from general AI knowledge.

Most WordPress chatbot plugins send the visitor's question straight to an AI API and display whatever comes back. AskAny works differently. It indexes your posts, pages, products, PDFs, and external sources first, then retrieves the right content for each question before the AI generates a response. Every answer includes a source citation.

It also includes real-time live agent handoff, native WooCommerce order tracking by email or order ID, and SSE-based streaming that uses 90% less server load than polling-based chatbots — all without a monthly SaaS subscription.

[AskAny Website](https://wpazleen.com/askany/) | [Documentation](https://wpazleen.com/docs/) | [Pro Support](https://wpazleen.com/support/)

== How RAG Works in AskAny ==

1. **Index** - AskAny crawls your posts, pages, products, PDFs, Q&A pairs, and external URLs into a semantic search index automatically.
2. **Retrieve** - When a visitor asks a question, AskAny finds the most relevant content chunks using hybrid semantic and keyword search.
3. **Respond** - The AI generates a cited answer using only your indexed content. It cannot answer from general knowledge, so responses stay specific to your business.

== Semantic Search and Content Indexing ==

The RAG and semantic search system is what makes AskAny different from keyword-triggered chatbots. It understands meaning and context, so it can find the right answer even when a visitor's question doesn't exactly match the wording in your content.

Content types indexed: posts, pages, custom post types, WooCommerce products and categories, custom fields, comments, menus, PDF documents, external URLs, Q&A pairs, and FAQs.

Indexing is designed to keep API costs low. Content hash caching reuses embeddings whenever content has not changed, cutting API usage by up to 90%. Batch embedding processes multiple texts in a single API call. Smart update detection only re-embeds content that has actually been modified.

Hybrid search runs both semantic understanding and keyword matching together. This covers the cases where exact phrase matching is needed alongside conceptual retrieval.

== Live Agent Handoff ==

Agents manage conversations from the WordPress admin chat panel. When a visitor needs a human, the agent takes over in one click. Full conversation history carries over instantly with no visible interruption for the visitor.

The live agent system includes role-based access, online/offline status tracking, an unread message badge, and Slack integration so agents get notified and can reply without opening the WordPress admin. A Mobile App Push Bridge lets agents respond from Android.

== WooCommerce Order Tracking in Chat ==

Customers can check their order status directly inside the chat widget. They can look up by email address, order ID, or transaction ID — no need to visit a separate order tracking page.

The WooCommerce integration also handles product information queries, real-time stock checks, smart product recommendations based on the conversation, and direct add-to-cart from chat. Product data is indexed automatically for RAG retrieval.

== Six AI Providers, No Lock-In ==

Switch between providers at any time without losing your indexed content or chat history.

- **OpenAI** - GPT-4o, GPT-4o-mini, GPT-4.1, O4-mini
- **DeepSeek** - Cost-effective with strong reasoning
- **Google Gemini** - Gemini 2.0 Flash, Gemini 2.5 Flash-Lite
- **Anthropic Claude** - Advanced reasoning, safety-focused
- **X.AI Grok** - Real-time knowledge
- **OpenRouter** - 100+ models through a single API

== Fallback Mode ==

When your AI provider API is unavailable, AskAny keeps the chatbot running using indexed content and pattern matching. Visitors never see an error or a broken widget.

== Knowledge Base and Content Sources ==

- **PDF Import** - Upload PDFs and the plugin extracts and indexes every page automatically. Works for product manuals, documentation, policies, and specs.
- **External Sources** - Index any external URL, REST API endpoint, JSON feed, or XML source as an additional knowledge base.
- **Q&A Management** - Add custom question-answer pairs with Markdown support. Bulk import and export included.
- **Automatic Site Indexing** - WordPress content is indexed automatically on publish and on update.

== Analytics and Performance ==

Track API request counts, success rates, token usage, and estimated costs per provider. Response time and popular question data helps you spot content gaps. Database tools include table size overview, one-click clean, optimize, and export, with date-range filtering.

== Customization Options ==

The widget can be placed as a floating button (bottom-left or bottom-right) or embedded anywhere using the `[askany_chat]` shortcode.

Configurable options include: custom avatar, logo, header text, welcome message, suggested messages with predefined Q&A responses, typing animation speed (Regular, Fast, Faster, Instant), and response tone (Human, Professional, Friendly, Robotic). A homepage FAQ section and custom links support Markdown. Full RTL and WCAG 2.1 AA accessibility compliance is included.

== Multi-Language Support ==

The chatbot detects the visitor's language and responds accordingly. Supported languages include English, Bengali, Spanish, French, German, Italian, Portuguese, Russian, Japanese, Chinese, Arabic, Hindi, and more.

== Privacy and Security ==

All chat data is stored in your own WordPress database. The only external connection is the AI provider API you choose to use. Built-in GDPR controls cover data export, anonymization, and retention. Session security and XSS protection are included.

AI provider endpoints:
- https://api.openai.com/v1/ (OpenAI)
- https://api.deepseek.com/v1/ (DeepSeek)
- https://generativelanguage.googleapis.com/ (Google Gemini)
- https://api.anthropic.com/ (Anthropic Claude)
- https://api.x.ai/ (X.AI Grok)
- https://openrouter.ai/api/ (OpenRouter)

Full terms of service and privacy policy links for each provider are in the plugin's Privacy section.

== External Services ==
= WPAzleen Settings API =
Loads display settings for the Pro upgrade modal in the plugin admin area.
No personal data or form submission data is sent or collected.
Privacy: https://wpazleen.com/privacy-policy

== Source Code ==

The source files for all compiled/minified JavaScript and CSS in this plugin are publicly available at:

https://github.com/wpazleen/askany

Build instructions:

1. Clone the repository.
2. Run `npm install` in the root to install dependencies.
3. Run `npm run build` to compile the JavaScript and CSS assets.
4. The compiled files are output to `dist/`.


== Compatible With ==

E-commerce: WooCommerce, Easy Digital Downloads
Forms: Contact Form 7, WPForms, Gravity Forms, Ninja Forms, Formidable Forms
Page builders: Elementor, Beaver Builder, Divi, Gutenberg
Caching: WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache
Messaging: Slack, Android push notifications via Mobile App Bridge

[Facebook Community](https://www.facebook.com/wpazleens) | [YouTube Channel](https://www.youtube.com/channel/UCqR5SPvn6N2ZBq7AyYKfEnA) | [Twitter / X](https://x.com/wpazleen)

== Installation ==

= Automatic =
1. Go to Plugins > Add New in your WordPress admin
2. Search for "AskAny"
3. Click Install Now, then Activate

= Manual =
1. Download the plugin zip from WordPress.org
2. Go to Plugins > Add New > Upload Plugin
3. Upload the zip and activate

= Requirements =
* WordPress 5.9 or higher
* PHP 7.4 or higher
* An API key from any supported AI provider

= Initial Setup (5 minutes) =
1. Go to AskAny AI > Settings, select your AI provider, and enter your API key
2. Go to AskAny AI > Content Index and click Index Now to scan your site
3. (Optional) Upload PDFs via AskAny AI > PDF Files
4. (Optional) Add custom question-answer pairs via AskAny AI > Q&A Management
5. Enable the floating widget in Settings, or place `[askany_chat]` on any page

== Frequently Asked Questions ==

= How is AskAny different from other AI chatbot plugins? =

Most WordPress chatbot plugins take the visitor's question and send it directly to an AI API. Whatever the AI returns is displayed. AskAny uses RAG: it retrieves the most relevant sections of your indexed content first, then generates the answer from that. Responses are grounded in your specific site content and include source citations. General AI knowledge is not used.

Other differences: SSE streaming uses 90% less server load than polling-based chatbots; Fallback Mode keeps the chatbot working when your AI API is down; six AI providers are supported and you can switch between them without data loss; and the live agent handoff preserves full conversation context on transition.

= What is RAG and why does it matter for a chatbot? =

RAG stands for Retrieval-Augmented Generation. It is the architecture that prevents AI chatbots from generating inaccurate or made-up responses. Instead of letting the AI answer from its general training, RAG retrieves the most relevant sections of your own content and uses those as the basis for the answer. The chatbot then cites those sources. The result is accurate answers about your specific products, services, documentation, or policies — not generic responses about the topic in general.

= How does WooCommerce order tracking work in the chat? =

Customers type their question about an order into the chat widget. AskAny checks their order status against WooCommerce using their email address, order ID, or transaction ID, then responds with the current status. No redirect to a separate page is needed.

= Does AskAny support live agent handoff? =

Yes. Agents monitor conversations from the WordPress admin chat panel. When a visitor needs human support, the agent takes over in one click. The full conversation history carries over with no visible gap for the visitor. Slack integration notifies agents in real time. The Mobile App Push Bridge lets agents respond from Android.

= Can AskAny index and search PDF documents? =

Yes. Upload PDFs through AskAny AI > PDF Files. The plugin extracts and indexes the full text automatically, making every page searchable through the chat. Product manuals, documentation, policies, and technical specs all work.

= What happens when my AI API is unavailable? =

Fallback Mode keeps the chatbot running using indexed content and pattern matching even when your AI provider is down. Visitors get answers and never see an error.

= Which AI providers does AskAny support? =

OpenAI (GPT-4o, GPT-4.1, O4-mini), DeepSeek, Google Gemini (2.0 Flash, 2.5 Flash-Lite), Anthropic Claude, X.AI Grok, and OpenRouter (100+ models). You can switch between them at any time without losing your content index or chat history.

= Will the chat widget slow down my site? =

No. The widget scripts load lazily — only when the chat widget is opened. Assets are minified. SSE streaming avoids the repeated HTTP requests that polling generates. Content hash caching reduces API calls by up to 90% on re-indexes.

= Is there a Pro version? =

Yes. The free version includes the AI chatbot, RAG indexing, WooCommerce integration, PDF import, limited live agent seats, limited Q&A pairs, and limited analytics. Pro adds unlimited agent management, unlimited external sources, unlimited Q&A pairs, and priority support. Current pricing is at the plugin website.

= Where can I get support? =

Free support is available through the WordPress.org support forum. Documentation is at https://wpazleen.com/docs/. Pro users get priority support at https://wpazleen.com/support/.

== Screenshots ==

1. Chat widget showing streamed AI responses with source citations and Markdown formatting.
2. Admin chat panel with one-click live agent takeover, unread badges, and full conversation history.
3. Homepage settings panel: welcome message, agent avatar, FAQ section, and custom link configuration.
4. AI provider setup showing API key input and model selection for all six supported providers.
5. Content index panel showing indexed posts, pages, products, PDFs, and external sources with health status.
6. Admin panel showing character-by-character AI response streaming with Markdown rendering.
7. In-chat contact form support for Contact Form 7, WPForms, Gravity Forms, and custom shortcodes.
8. RAG pipeline diagram from visitor query to cited response.
9. WooCommerce and Slack integrations panel with connection status.
10. Q&A editor with Markdown support, bulk import and export, and active/inactive toggle.
11. External sources manager for indexing URLs, REST APIs, and JSON feeds.
12. Database management panel with table size overview and one-click clean, optimize, and export.
13. Typing animation speed control with adjustable settings and cursor preview.
14. API statistics dashboard showing token usage, estimated costs, response times, and provider comparison.
15. Customer checking WooCommerce order status by email inside the chat widget.

== Changelog ==

= 1.14.1 - 2026-06-16 =
Improved: AI response accuracy using context indexing.

= 1.14.0 - 2026-06-08 =
New: Chat Widget Settings added under Homepage Settings.
New: Option to enable or disable suggested messages.
New: Customizable suggested messages.
New: Customizable chat welcome message.
New: Q&A Management integration for predefined responses to suggested questions.
Improved: AI response accuracy using Homepage FAQ and Q&A data.

= 1.13.0 - 2026-05-31 =
New: User Information panel in Live Chat Management for visitor and user insights.
New: Attachments section in conversation details for viewing files shared in a conversation.
Improved: Content Index Management with detailed indexing logs and activity tracking.
Improved: RAG Management interface for easier knowledge base administration.
Improved: Retrieval performance and content processing within the RAG system.

= 1.12.0 - 2026-04-22 =
New: Token and rate limiting per user role within configurable timeframes.

= 1.11.0 - 2026-03-27 =
New: Web Search mode for answering beyond indexed content (Fallback and Always Enhance modes).
New: Response Tone Control with Human, Professional, Friendly, and Robotic options.
New: Typing animation speed settings: Regular, Fast, Faster, Instant.
New: Mobile App Push Bridge for real-time push notifications and Android chat.
Improved: Performance and frontend chat panel UI.

= 1.10.0 - 2026-01-06 =
New: Full RAG architecture with semantic search and source citations.
New: Support for Anthropic Claude, X.AI Grok, OpenRouter (100+ models), DeepSeek, and expanded Gemini and OpenAI models.
New: Hybrid search combining RAG retrieval with keyword matching.
New: RAG Management Panel with embedding stats, error logs, and retry controls.
New: Content Hash Caching and Batch API processing for up to 90% API quota savings.
Improved: Markdown formatting in live chat and Q&A management.

For the full changelog, see https://headwayapp.co/askany/ or changelog.txt in the plugin SVN repository.