🤖 Cacbot
Cacbot is a WordPress plugin that enables direct interaction with AI agents on your WordPress site. “Cacbot” stands for the “Comments Are a ChatBot.” The plugin leverages WordPress’s built-in comment system to capture conversations with Large Language Models like ChatGPT, Gemini and Grok. Your AI conversations are stored as regular WordPress comments, making them fully manageable through standard WordPress functionality.
✨ Features and Capabilities
- 🤖 AI Agents: The Cacbot Assistant functions as a WordPress user on your site
- 🔗 Native WordPress Integration: Built in PHP and works on any WordPress installation
- 📝 Text Processing: Transform and generate text content
- 🎨 Image Generation: Create images using AI models
- ⚡ Function Execution: Execute custom functions and perform automated actions
- 💬 Comment System Storage: All conversation data is captured in WordPress comments
- 🔍 RAG Operations: Perform Retrieval-Augmented Generation on post content
- ⚙️ Flexible System Instructions: Configure AI behavior using post metadata
- 🌐 Multi-Provider Support: Compatible with any LLM provider, including local and Deepseek
- 🔧 Direct PHP Integration: Ask “direct questions” programmatically in PHP
- 📋 Shortcode Support: Use WordPress shortcodes as context or functions
- 📄 Content Context: Leverage any post content as context or instructions
👥 Who Is This For?
Developers and site administrators looking to build AI-powered WordPress applications with seamless integration into existing WordPress workflows.
🚀 Getting Started
1️⃣ Installation
- 📥 Download: Get the
cacbot.zip
file - 📤 Upload: In WordPress admin, go to Plugins → Add New → Upload Plugin
- ✅ Activate: Upload the zip file and activate the plugin
2️⃣ Create Your First Conversation
- 🏠 Go to WordPress Admin Area
- ➕ Create New Cacbot Conversation: Go to Cacbot Conversation → Add New
- 🏷️ Add Title: Give your conversation a name (e.g., “Test Conversation”)
- 🔒 Set Privacy: Change post visibility to Private
- 📝 Publish: Save your conversation post
3️⃣ Start Chatting
- 👁️ View Frontend: Navigate to your conversation on the frontend
- 💬 Type Message: Enter your message in the comment box
- 🚀 Submit: The Cacbot Assistant will automatically reply as a WordPress comment
4️⃣ API Configuration (Optional)
💡 Note: The first 10,000 tokens per month are free, so you can test Cacbot without an API key initially.
For extended usage, add your OpenAI API key to wp-config.php
:
define( 'CACBOT_OPENAI_API_KEY', 'sk-proj-your-api-key-here' );
Get your API key from OpenAI.
👤 Cacbot User Role
Cacbot introduces a new WordPress user role: Cacbot.
- 🔧 Default Capabilities: Cacbot users inherit Editor capabilities by default
- ⚙️ Customizable Permissions: You can manually adjust these capabilities as needed
- 🔄 Self-Modification: With Administrator permission, a Cacbot can modify its own capabilities
🏗️ Conversation Structure
Each Cacbot conversation involves two participants; the Interlocutor and the Respondent. Their respective user IDs are stored as post meta data on the conversation.
_cacbot_interlocutor_user_id
: The user ID of the first speaker (Interlocutor)_cacbot_respondent_user_id
: The user ID of the second speaker (Respondent)
When _cacbot_anchor_post
or _cacbot_conversation
is set to 1
, and a non-Cacbot user comments on the post, the Cacbot Assistant is automatically designated as the Respondent when the comment is made, if none is already set.
⚙️ Configuration
🔑 API Key Setup
Store your API key securely in your installation’s wp-config.php
:
define( 'CACBOT_OPENAI_API_KEY', 'sk-proj-your-actual-api-key-here' );
🔒 Security Note: Never commit API keys to version control. Obtain your key from OpenAI’s API platform.
🌐 Site Configuration Options
_cacbot_account_owner
- Type:
integer
- Default: The user who activates the plugin
- Description: The user ID of the account owner. Each domain requires an account owner who is responsible for the account.
_cacbot_mothership_url
- Type:
string
- Default:
"https://cacbot.com"
- Description: The URL of the default upstream node.
📋 Post Meta Field Reference
Configure Cacbot conversations using these custom post meta fields:
🎮 Action Controls
_cacbot_action_enabled_archive
- Type:
boolean
- Default:
false
- Description: When enabled, displays a 🗑️ trash-can icon after the first comment. Clicking archives the conversation.
- Use Case: Ideal for one-time AI generations (text/images) where you want to “retry” the conversation.
_cacbot_action_enabled_fetch_image
- Type:
boolean
- Default:
false
- Description: When enabled, displays an 🖼️ image icon before any comments. Clicking sends the comment text to DALL·E 3 for image generation.
⚙️ Setup Requirements:
- Install LH Add Media from URL plugin
- Set
_cacbot_action_enabled_fetch_image
to1
- Describe your desired image in the comment
- Click “Fetch Image” to generate and save to Media Library
🔢 Conversation Limits
_cacbot_max_replies
- Type:
integer
- Description: Maximum number of comments allowed before the conversation closes.
_cacbot_max_archives
- Type:
integer
- Description: Total number of times a user can click the “archive” button.
🤖 AI Configuration
_cacbot_system_instructions
- Type:
string
orinteger
- Default:
"You are a helpful assistant."
- String Value: Direct system instruction for the LLM
- Integer Value: Post ID containing instructions (with expanded shortcodes)
🚀 Advanced Usage:
- Use shortcodes for dynamic information
- Reference other posts for complex instruction sets
- Leverage PHP functions through WordPress shortcodes
_cacbot_anchor_post
- Type:
boolean
- Default:
false
- Description: When enabled, user comments automatically create new Cacbot conversations in the background.
- Use Case: Allows multiple users to chat with a specific Cacbot on any page/post.
🎨 Interface Customization
_cacbot_comment_form_placeholder_text
- Type:
string
- Description: Custom placeholder text for the comment form input field.
📡 Communication Strategy
_cacbot_reply_strategy
- Type:
string
- Default:
"sync_http_response"
- sync_http_response
- Holds HTTP connection open during processing
- async_application_password
- Closes connection immediately
- expects delayed response.
- CDAIP: Cross Domain Artificial Intelligence Process – You cannot tell how the response was generated, or by whom.
- Response is received as an HTTP Post to the WordPress API from the responding Cacbot.
📊 Strategy Details:
- Synchronous: Real-time responses but subject to PHP/WordPress timeouts
- Asynchronous: Message is posted to site imedietly. Subsequently, the Cacbot responds by making a comment. Enables long-running processes without timeout constraints. Works best with themes that have AJAX in the comments.
- Future: Email and SMS reply strategies planned
Leave a Reply
You must be logged in to post a comment.