=== MxChat Multi-Bot Manager ===
Contributors: mxchat
Author: [MxChat](https://mxchat.ai)
Tags: AI, Chatbot, Multi-Bot, Knowledge Base, Pinecone
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 1.0.2
License: Commercial
Create and manage multiple specialized AI chatbots with dedicated knowledge bases for different purposes (support, sales, technical, etc.).

== Description ==

[Documentation](https://mxchat.ai/documentation/) | [MxChat Pro](https://mxchat.ai/)

### 🤖 Transform Your Website with Multiple Specialized Chatbots

The **MxChat Multi-Bot Manager** is a premium add-on for MxChat that allows you to create unlimited specialized chatbots, each with its own knowledge base, personality, and configuration. Perfect for businesses that need different bots for support, sales, technical help, or department-specific assistance.

## 🚀 Core Features

### ✅ **Unlimited Bot Creation**
- Create as many specialized chatbots as you need
- Each bot maintains its own configuration and settings
- Intuitive admin interface for easy management

### ✅ **Dedicated Knowledge Bases**
- Connect each bot to its own Pinecone index
- Completely separate knowledge retrieval for each bot
- Configure similarity thresholds per bot for precise responses

### ✅ **Individual Bot Customization**
- **Custom System Prompts**: Define unique AI behavior and personality for each bot
- **Welcome Messages**: Set personalized greetings for different use cases
- **Quick Questions**: Configure bot-specific suggested questions

### ✅ **Flexible Deployment**
- Simple shortcode implementation: `[mxchat_chatbot bot_id="support" floating="yes"]`
- Deploy different bots on different pages or sections
- Mix and match bots based on content context

### ✅ **Professional Management Interface**
- Clean, intuitive bot listing with status indicators
- One-click bot duplication for rapid deployment
- Easy editing and configuration management
- Copy shortcodes directly from the admin panel

### ✅ **Integrated Knowledge Base Management**
- Bot dropdown selector in the Knowledge Base section
- Easily view, add, delete, or search records for each specific bot
- Streamlined content management across multiple bot databases

### ✅ **Per-Bot Action Controls**
- Enable or disable specific actions for each bot individually
- Fine-tune bot capabilities based on their intended purpose
- Granular control over bot functionality from the Actions page

### ✅ **Page-Specific Bot Assignment**
- MxChat Settings meta box on every page and post editor
- Select which bot displays on each specific page
- Override global settings with page-level bot selection
- Choose between floating or embedded display per page

## 🚀 Quick Start Guide

### **Step 1: Installation**
1. Ensure MxChat core plugin is installed and activated
2. Verify your MxChat Pro license is active
3. Upload and activate the Multi-Bot Manager add-on
4. Navigate to **MxChat → Multi-Bot Manager** in your WordPress admin

### **Step 2: Create Your First Specialized Bot**
1. Click **"Add New Bot"** in the Multi-Bot Manager
2. Enter a unique **Bot ID** (e.g., "support", "sales", "technical")
3. Set a descriptive **Bot Name** (e.g., "Customer Support Assistant")
4. Configure the **Pinecone Host** for this bot's knowledge base
5. Customize the **Welcome Message** and **System Prompt** for the bot's personality
6. Add **Quick Questions** relevant to this bot's purpose
7. Save your bot configuration

### **Step 3: Configure Bot Knowledge Base**
1. Navigate to **MxChat → Knowledge Base**
2. Use the bot dropdown to select your newly created bot
3. Add, edit, or import knowledge base content specific to this bot
4. Repeat for each bot with different knowledge bases

### **Step 4: Deploy Your Bot**
1. Copy the shortcode from the bot's configuration page
2. Paste it on any page, post, or widget where you want this specific bot
3. Example: `[mxchat_chatbot floating="yes" bot_id="support"]`
4. **Alternative**: Use the MxChat Settings meta box when editing pages to select bots directly

### **Step 5: Create Additional Bots (Optional)**
Repeat the process for different departments or use cases:
- Sales bot with product-focused knowledge
- Technical bot with documentation and APIs
- HR bot with company policies and procedures

## 📖 Detailed Configuration

### **Bot ID Guidelines**
- Use lowercase letters, numbers, and underscores only
- Keep it descriptive but concise (e.g., "customer_support", "sales_team")
- Cannot be changed after creation

### **Knowledge Base Setup**
- Each bot can connect to its own Pinecone index
- Use different namespaces or completely separate indexes
- Configure similarity thresholds based on your knowledge base quality

### **System Prompts**
Customize each bot's personality and behavior:

You are a helpful customer support assistant for [Company Name]. 
Focus on solving customer problems quickly and escalating complex 
issues when necessary. Always be friendly and professional.

### **Quick Questions**
Set up to 3 primary quick questions plus unlimited additional ones:
- Support Bot: "How do I reset my password?", "Check order status", "Report a bug"
- Sales Bot: "View pricing plans", "Schedule a demo", "Compare features"

## 🔧 Advanced Features

### **Bot Duplication**
- Quickly create similar bots with the duplicate feature
- Perfect for creating variations (e.g., "Support - English", "Support - Spanish")
- Saves time when setting up multiple similar configurations

### **Status Monitoring**
- Visual indicators show which bots are active (have knowledge bases connected)
- Easy identification of bots that need configuration
- Quick overview of your entire bot ecosystem

### **Shortcode Flexibility**
Deploy bots in various ways:
- **Floating**: `[mxchat_chatbot floating="yes" bot_id="support"]`
- **Embedded**: `[mxchat_chatbot floating="no" bot_id="sales"]`
- **Mixed**: Use different bots on different pages based on content

## 🔍 Troubleshooting

### **Common Issues**

**Bot Not Responding Correctly**
- Check Pinecone host configuration
- Verify knowledge base has content
- Adjust similarity threshold settings
- Review system prompt instructions

**Shortcode Not Working**
- Ensure bot ID exists and is spelled correctly
- Verify MxChat core plugin is active
- Check that Pro license is activated
- Confirm bot has been saved properly

**License Issues**
- Multi-Bot Manager requires an active MxChat Pro license
- Check license status in MxChat → License Activation
- Contact support if license verification fails

## ❓ Frequently Asked Questions

### **Q: How do I manage knowledge base content for different bots?**
A: Navigate to MxChat → Knowledge Base and use the bot dropdown selector at the top. This allows you to switch between bots and manage each one's knowledge base independently. You can add, edit, delete, or search records specific to the selected bot.

### **Q: Can I enable different actions for different bots?**
A: Yes! Go to MxChat → Actions and you'll find options to enable or disable specific actions for each bot individually. This allows you to customize what each bot can do based on its intended purpose.

### **Q: How do I set different bots for different pages?**
A: When editing any page or post, look for the "MxChat Settings" meta box in the editor. Here you can select which specific bot should display on that page, and choose whether it should be floating or embedded. This overrides any global settings.

### **Q: Can I disable the global floating bot and use page-specific bots instead?**
A: Absolutely! You can disable the global "append to body" setting in your main MxChat settings, then use either the MxChat Settings meta box on individual pages or shortcodes to control exactly where and which bots appear.

### **Q: Do I need separate Pinecone accounts for each bot?**
A: No, you can use the same Pinecone account with different indexes, or use namespaces within the same index. However, separate indexes provide complete isolation between bots' knowledge bases.

### **Q: Can I copy settings from one bot to another?**
A: Yes, use the "Duplicate" feature in the bot list. This creates an exact copy with a new ID and name, which you can then modify as needed.

### **Stay Updated**
- **YouTube Channel**: [@MxChat](https://www.youtube.com/@MxChat/videos) for tutorials and updates
- **Website**: [https://mxchat.ai/](https://mxchat.ai/) for latest features and announcements

## 🎉 Take Your AI Strategy to the Next Level

The **MxChat Multi-Bot Manager** transforms your website from having a single chatbot to managing a complete AI assistant ecosystem. Whether you're a growing business with different departments or an enterprise with complex customer journeys, Multi-Bot Manager gives you the flexibility and power to create the perfect AI experience for every use case.

**Ready to get started?** Ensure your MxChat Pro license is active and install the Multi-Bot Manager add-on today!

*Multi-Bot Manager is a premium add-on for MxChat and requires an active Pro license. *

== Changelog ==

= 1.0.2 - September 26, 2025 =
- New: You can now select a chat model for each individual bot.
- New: Each bot can now have different rate limits.


mxchat-multi-bot/
├── mxchat-multi-bot.php              # ✅ Simplified main file
├── includes/
│   ├── class-multi-bot-manager.php   # ✅ Core manager class
│   ├── class-admin-interface.php     # ✅ Admin UI handling  
│   └── class-database.php            # ✅ Database operations
├── admin/
│   ├── css/
│   │   └── admin-styles.css          # ✅  CSS
│   ├── js/
│   │   └── admin-scripts.js          # ✅ Already created
│   └── views/
│       ├── bot-list.php              # ✅ Bot management page
│       ├── bot-edit.php              # ✅ Individual bot settings
│       └── bot-create.php            # ✅ New bot creation