Chai Chatbot
Chai - Wordpress Free Chat AI Plugin
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/bradleyfletcher/chai/archive/refs/heads/main.zipChai Chatbot - AI-Powered WordPress Chatbot Plugin
Transform your WordPress website with intelligent AI chatbot technology. Chai Chatbot seamlessly integrates OpenAI GPT-4 and Google Gemini AI models to provide instant, context-aware customer support and engagement on your WordPress site.
🚀 Why Choose Chai Chatbot?
Chai Chatbot is the most advanced AI chatbot solution for WordPress, designed to enhance user engagement, reduce support workload, and provide 24/7 intelligent assistance to your website visitors.
Key Benefits
- Instant Customer Support: Answer visitor questions instantly, 24/7
- Reduce Support Costs: Automate responses to common inquiries
- Increase Engagement: Keep visitors on your site longer with interactive chat
- Boost Conversions: Guide users through your sales funnel with AI assistance
- Multilingual Support: Communicate with global audiences in their language
- Privacy-Focused: Full control over your data with self-hosted analytics
✨ Core Features
🤖 Dual AI Provider Support
- OpenAI Integration: GPT-4o, GPT-4o-mini, GPT-3.5-turbo
- Google Gemini: Gemini 1.5 Pro, Gemini 1.5 Flash
- Switch between providers based on your needs and budget
🎨 Modern, Customizable Chat Widget
- Beautiful, responsive design that works on all devices
- Customizable greeting messages and bot personality
- Seamless integration with any WordPress theme
- Mobile-optimized chat interface
📊 Comprehensive Analytics Dashboard
- Real-time conversation tracking and monitoring
- Detailed metrics: total conversations, messages, response times
- Session-based analytics with browser and location data
- Full conversation history with searchable logs
- Performance insights and optimization recommendations
🧠 Context-Aware AI Responses
- Automatically learns from your website content
- Includes site metadata (name, tagline, URL)
- Prioritize specific pages (policies, FAQs, product info)
- Smart content selection for relevant, accurate responses
⚙️ Easy Setup & Configuration
- Intuitive 3-step setup wizard
- Visual model comparison and selection
- Real-time API connection testing
- Cost estimation for different models
🔒 Enterprise-Grade Security
- WordPress security best practices
- Secure API key storage
- AJAX nonce verification
- SQL injection protection
- XSS prevention
📋 Requirements
Minimum System Requirements
| Component | Requirement |
|---|---|
| WordPress | 6.0 or higher |
| PHP | 7.4 or higher (8.0+ recommended) |
| MySQL | 5.7+ or MariaDB 10.2+ |
| API Key | OpenAI API key OR Google Gemini API key |
| SSL | Recommended for production sites |
Recommended Server Specifications
- Memory: 256MB+ PHP memory limit
- Storage: 10MB+ available disk space
- Bandwidth: Sufficient for API calls (varies by usage)
🔧 Installation Guide
Method 1: WordPress Admin Panel (Recommended)
- Download the
chai-chatbot.zipfile - Navigate to WordPress Admin → Plugins → Add New
- Click Upload Plugin and select the zip file
- Click Install Now and then Activate
- Go to Chai Chatbot → Setup to configure
Method 2: Manual Installation
- Download and extract the plugin files
- Upload the
chai-chatbotfolder to/wp-content/plugins/ - Activate through the Plugins menu in WordPress
- Navigate to Chai Chatbot → Setup
Method 3: FTP Installation
- Extract the plugin archive
- Connect to your server via FTP
- Upload the
chai-chatbotfolder to/wp-content/plugins/ - Activate the plugin in WordPress admin
- Complete the setup wizard
🔑 Getting API Keys
OpenAI API Key Setup
- Visit OpenAI Platform: Go to platform.openai.com
- Create Account: Sign up or log in to your OpenAI account
- Navigate to API Keys: Click on your profile → "View API Keys"
- Generate Key: Click "Create new secret key"
- Copy & Save: Copy the key immediately (you won't see it again)
- Add Billing: Set up billing in your OpenAI account settings
Cost: Pay-as-you-go pricing. GPT-4o-mini starts at $0.15/1M input tokens.
Google Gemini API Key Setup
- Visit Google AI Studio: Go to aistudio.google.com
- Sign In: Use your Google account credentials
- Get API Key: Click "Get API Key" button
- Create Key: Select "Create API key in new project" or use existing
- Copy Key: Save your API key securely
Cost: Free tier available with generous limits. Gemini 1.5 Flash is free up to 15 requests/minute.
⚙️ Configuration & Setup
Step 1: Initial Setup Wizard
- Navigate to Setup: Go to Chai Chatbot → Setup in WordPress admin
- Choose AI Provider: Select between OpenAI or Google Gemini
- Enter API Key: Paste your API key from the provider
- Select Model: Choose from available models based on your needs:
- GPT-4o: Most capable, best for complex queries
- GPT-4o-mini: Fast and cost-effective
- Gemini 1.5 Pro: High intelligence, multimodal
- Gemini 1.5 Flash: Ultra-fast, free tier available
- Test Connection: Click "Test Connection" to verify setup
- Save Settings: Complete the wizard
Step 2: General Settings Configuration
Navigate to Chai Chatbot → Settings → General:
- Bot Name: Customize your chatbot's display name (default: "AI Assistant")
- Greeting Message: Set the initial message users see when opening chat
- Enable/Disable: Toggle chatbot visibility on your site
Example Greeting Messages:
- "Hi! How can I help you today?"
- "Welcome! Ask me anything about our products."
- "Hello! I'm here to assist with your questions."
Step 3: Behavior Customization
Navigate to Settings → Behavior:
System Prompt: Define your chatbot's personality and behavior
Examples:
You are a helpful customer support agent for an e-commerce store.
Be friendly, professional, and concise. Focus on helping customers
find products and answer questions about shipping and returns.
You are a knowledgeable technical support assistant. Provide clear,
step-by-step solutions. Ask clarifying questions when needed.
Step 4: Context Awareness Setup
Navigate to Settings → Context Awareness:
- Enable Context: Toggle "Include Website Content" ON
- Select Priority Content: Choose important pages/posts:
- About Us page
- FAQ page
- Product/Service pages
- Privacy Policy
- Terms of Service
- Contact information
Benefits:
- More accurate, relevant responses
- Chatbot learns from your specific content
- Reduces hallucinations and incorrect information
Note: More content = higher token usage. Select only essential pages.
Step 5: Advanced Settings
Navigate to Settings → Advanced:
- Remove Data on Uninstall: Choose whether to delete all data when uninstalling
- Default: Data is preserved for future reinstallation
📊 Analytics & Monitoring
Dashboard Overview
Access Chai Chatbot → Dashboard to view:
Key Metrics
- Total Conversations: Number of unique chat sessions
- Total Messages: Combined user + AI messages
- Average Response Time: AI response speed in milliseconds
Conversation Table
Click any conversation row to view:
- Full message history
- Session details (browser, location, timezone)
- Response times per message
- User engagement patterns
Search & Filter
- Search conversations by keywords
- Filter by date range
- Paginated results for easy navigation
Performance Monitoring
Response Time Indicators:
- 🟢 Green (Fast): < 1000ms
- 🟡 Yellow (Medium): 1000-2000ms
- 🔴 Red (Slow): > 2000ms
Optimization Tips:
- Use faster models (GPT-4o-mini, Gemini Flash) for better response times
- Reduce context content to minimize token processing
- Monitor peak usage times
🎯 Usage Guide
For Website Visitors
Once configured, the chat widget appears automatically on all frontend pages:
- Open Chat: Click the floating chat button (bottom-right corner)
- Type Message: Enter your question or message
- Receive Response: Get instant AI-powered answers
- Continue Conversation: Chat maintains context throughout the session
Chat Widget Features
- Persistent Sessions: Conversations continue across page navigation
- Mobile Responsive: Optimized for all screen sizes
- Typing Indicators: Shows when AI is generating response
- Error Handling: Clear error messages if issues occur
- Session Management: 30-day cookie-based session tracking
Best Practices for Users
Effective Questions:
- ✅ "What are your shipping options?"
- ✅ "How do I reset my password?"
- ✅ "Tell me about your return policy"
Less Effective:
- ❌ Single word queries
- ❌ Extremely complex multi-part questions
- ❌ Questions outside your site's scope
🔒 Privacy, Security & Compliance
Data Collection
Chai Chatbot collects and stores the following data:
Conversation Data:
- User messages and AI responses
- Timestamps for each message
- Response time metrics
Session Information:
- Session IDs (stored in cookies, 30-day expiry)
- IP addresses (for analytics)
- Browser metadata:
- User agent (browser type)
- Timezone
- Screen dimensions
- Language preferences
GDPR & Privacy Compliance
Important: Update your website's privacy policy to include:
- Data Collection Notice: Inform users about chatbot data collection
- Purpose: Explain data is used for chat functionality and analytics
- Storage Duration: Specify retention period (default: indefinite until manual deletion)
- User Rights: Provide contact for data access/deletion requests
- Third-Party Processing: Mention API providers (OpenAI/Google)
Sample Privacy Policy Text:
Our website uses an AI chatbot to provide customer support. When you use
the chatbot, we collect your messages, session information, and basic
browser data to improve our service. This data is processed by [OpenAI/Google]
and stored on our servers. You can request deletion of your chat data by
contacting [your email].
Data Security Measures
- ✅ Encrypted Storage: API keys stored securely in WordPress database
- ✅ HTTPS Required: SSL encryption for all API communications
- ✅ SQL Injection Protection: Prepared statements for all database queries
- ✅ XSS Prevention: Input sanitization and output escaping
- ✅ CSRF Protection: WordPress nonce verification
- ✅ Access Control: Admin-only access to settings and analytics
Data Retention & Deletion
Default Behavior:
- Chat logs and settings are preserved when deactivating/uninstalling
- Allows data recovery if plugin is reinstalled
Complete Data Removal:
- Navigate to Settings → Advanced
- Enable "Remove All Data on Uninstall"
- Save settings
- Deactivate and delete the plugin
What Gets Deleted:
- All chat conversation logs
- Plugin settings and configuration
- Database tables (
wp_chai_chat_logs) - Session cookies
🛠️ Troubleshooting & FAQ
Common Issues
Chat Widget Not Appearing
Possible Causes & Solutions:
-
Plugin Not Activated
- Go to Plugins → Installed Plugins
- Ensure Chai Chatbot is activated
-
Setup Not Complete
- Visit Chai Chatbot → Setup
- Complete all wizard steps
- Test API connection
-
JavaScript Conflicts
- Check browser console for errors (F12)
- Disable other plugins temporarily to identify conflicts
- Clear browser cache
-
Theme Compatibility
- Try switching to a default WordPress theme temporarily
- Contact support if issue persists
API Connection Errors
"Invalid API Key" Error:
- Verify API key is copied correctly (no extra spaces)
- Check API key is active in provider dashboard
- Ensure billing is set up (OpenAI requires payment method)
"Rate Limit Exceeded" Error:
- You've hit your API provider's rate limit
- Wait a few minutes and try again
- Upgrade your API plan for higher limits
"Network Error" or "Timeout":
- Check your server's internet connectivity
- Verify firewall allows outbound HTTPS requests
- Increase PHP
max_execution_timeif needed
Slow Response Times
Optimization Steps:
-
Switch to Faster Model:
- Use GPT-4o-mini instead of GPT-4o
- Use Gemini 1.5 Flash instead of Pro
-
Reduce Context Content:
- Limit priority content selection
- Disable context awareness if not needed
-
Server Performance:
- Check server resources (CPU, memory)
- Optimize database queries
- Use caching plugins
Frequently Asked Questions
Q: How much does it cost to run the chatbot?
A: Costs depend on your chosen AI provider and usage:
- OpenAI GPT-4o-mini: ~$0.15 per 1M input tokens, $0.60 per 1M output tokens
- OpenAI GPT-4o: ~$2.50 per 1M input tokens, $10 per 1M output tokens
- Google Gemini Flash: Free tier available (15 RPM), then $0.075 per 1M tokens
- Google Gemini Pro: $1.25 per 1M input tokens, $5 per 1M output tokens
Average conversation: 500-2000 tokens depending on context.
Q: Can I customize the chat widget appearance?
A: Currently, the widget uses a modern, responsive design. Custom styling options are planned for future releases. You can modify CSS directly if needed.
Q: Does the chatbot work in multiple languages?
A: Yes! Both OpenAI and Google models support 50+ languages. The chatbot automatically detects and responds in the user's language.
Q: Can I limit the chatbot to specific pages?
A: Not in the current version. The widget appears on all frontend pages. Page-specific controls are planned for future updates.
Q: How do I export conversation data?
A: Currently, you can view conversations in the dashboard. CSV export functionality is planned for a future release. For now, you can access data directly from the database table wp_chai_chat_logs.
Q: Is the chatbot GDPR compliant?
A: The plugin provides tools for GDPR compliance (data deletion, session management), but you must update your privacy policy and implement proper consent mechanisms as required by your jurisdiction.
Q: Can multiple admins access the dashboard?
A: Yes, any WordPress user with manage_options capability (typically Administrators) can access all plugin features.
🚀 Performance Optimization
Best Practices for Speed
-
Choose the Right Model:
- Development/Testing: Use faster, cheaper models
- Production: Balance speed vs. quality based on needs
-
Optimize Context Content:
- Select only essential pages (5-10 max)
- Keep content concise and focused
- Remove unnecessary formatting
-
Server Configuration:
- PHP 8.0+ for better performance
- Enable OPcache
- Use object caching (Redis/Memcached)
- CDN for static assets
-
Database Optimization:
- Regular database cleanup
- Index optimization
- Limit conversation history retention
Scaling Considerations
High-Traffic Sites:
- Monitor API usage and costs
- Implement rate limiting if needed
- Consider caching common responses
- Use faster models during peak hours
Cost Management:
- Set up billing alerts in API provider dashboard
- Monitor conversation analytics regularly
- Optimize system prompts to reduce token usage
- Use context awareness selectively
🔄 Updates & Maintenance
Keeping Your Plugin Updated
- Check for Updates: WordPress admin will notify you
- Backup First: Always backup before updating
- Test in Staging: Test updates in staging environment if possible
- Review Changelog: Check what's new before updating
Backup Recommendations
Before Major Changes:
- Backup WordPress database
- Export conversation data if needed
- Save plugin settings screenshot
Recommended Backup Plugins:
- UpdraftPlus
- BackupBuddy
- Duplicator
📞 Support & Resources
Getting Help
- Check Documentation: Review this README thoroughly
- Setup Wizard: Use built-in connection testing
- Analytics Dashboard: Review conversation logs for issues
- WordPress Debug Mode: Enable for detailed error logs
Debug Mode Setup
Add to wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Check logs at: /wp-content/debug.log
Useful Resources
- OpenAI Documentation: platform.openai.com/docs
- Google Gemini Docs: ai.google.dev/docs
- WordPress Codex: codex.wordpress.org
- Flowtide.ai: flowtide.ai/chai
🗂️ File Structure
chai-chatbot/
├── assets/
│ ├── css/
│ │ └── admin.css # Admin panel styles
│ ├── js/
│ │ ├── admin.js # Admin functionality
│ │ └── chat-widget.js # Frontend chat widget
│ └── images/
│ ├── chai-logo.png # Plugin logo
│ ├── openai.svg # OpenAI logo
│ └── gemini.svg # Gemini logo
├── includes/
│ ├── admin/
│ │ ├── class-chai-admin-base.php # Shared admin components
│ │ ├── class-chai-admin-dashboard.php # Dashboard page
│ │ ├── class-chai-admin-setup.php # Setup wizard
│ │ └── class-chai-admin-settings.php # Settings page
│ ├── class-chai-admin.php # Main admin controller
│ ├── class-chai-api.php # API integration
│ ├── class-chai-frontend.php # Frontend functionality
│ └── class-chai-database.php # Database operations
├── chai-chatbot.php # Main plugin file
└── README.md # This file
🔄 Uninstallation Guide
Standard Uninstallation (Preserve Data)
- Navigate to Plugins → Installed Plugins
- Deactivate Chai Chatbot
- Click Delete
- Confirm deletion
Result: Plugin files removed, data preserved in database
Complete Removal (Delete All Data)
- Go to Chai Chatbot → Settings → Advanced
- Enable "Remove All Data on Uninstall"
- Click Save Settings
- Navigate to Plugins → Installed Plugins
- Deactivate Chai Chatbot
- Click Delete
- Confirm deletion
Result: All plugin files, settings, and conversation data permanently deleted
📝 Changelog
Version 1.0.0 - December 2025
🎉 Initial Release
Core Features:
- ✅ OpenAI GPT integration (GPT-4o, GPT-4o-mini, GPT-3.5-turbo)
- ✅ Google Gemini integration (Gemini 1.5 Pro, Gemini 1.5 Flash)
- ✅ Intuitive 3-step setup wizard
- ✅ Real-time API connection testing
- ✅ Model comparison and selection tool
Analytics & Monitoring:
- ✅ Comprehensive analytics dashboard
- ✅ Conversation tracking and history
- ✅ Performance metrics (response times, message counts)
- ✅ Session-based analytics
- ✅ Browser and location tracking
- ✅ Searchable conversation logs
Chat Features:
- ✅ Modern, responsive chat widget
- ✅ Context-aware AI responses
- ✅ Website content integration
- ✅ Priority content selection
- ✅ Customizable bot personality
- ✅ Custom greeting messages
Admin Features:
- ✅ Modular admin architecture
- ✅ Separate Dashboard, Setup, and Settings pages
- ✅ Reusable header and footer components
- ✅ Minimal, slimline UI design
- ✅ Cost estimation calculator
Security & Privacy:
- ✅ WordPress security best practices
- ✅ Secure API key storage
- ✅ SQL injection protection
- ✅ XSS prevention
- ✅ CSRF protection
- ✅ Data deletion options
🏆 Credits & Acknowledgments
Developed by: Antigravity
Powered by:
- OpenAI GPT Models
- Google Gemini AI
- WordPress
Special Thanks:
- WordPress community for excellent documentation
- OpenAI and Google for powerful AI APIs
- All beta testers and early adopters
📄 License
This plugin is proprietary software. All rights reserved.
Copyright © 2025 Antigravity. All rights reserved.
License Terms
- ✅ Licensed for use on unlimited WordPress installations
- ✅ Includes updates and bug fixes
- ❌ Source code modification not permitted
- ❌ Redistribution not permitted
- ❌ Resale not permitted
For licensing inquiries, contact: flowtide.ai/chai
🌟 Keywords & SEO
WordPress AI Chatbot | OpenAI WordPress Plugin | GPT-4 Chatbot | Google Gemini WordPress | AI Customer Support | WordPress Chat Plugin | Conversational AI | Chatbot Analytics | Context-Aware Chatbot | WordPress Automation | AI Assistant Plugin | Live Chat Alternative | Customer Engagement | WordPress AI Integration | Intelligent Chatbot | 24/7 Support Bot
Made with ❤️ by Antigravity | Visit flowtide.ai/chai for more information