Telesphorus leads βš• Aβš•clepiuβš• into the City

Carl Jung leads the Emperor into the City – by Dall.E3



 

## πŸ€– Cacbot

![WordPress](https://img.shields.io/badge/WordPress-21759B?style=for-the-badge&logo=wordpress&logoColor=white)
![PHP](https://img.shields.io/badge/PHP-777BB4?style=for-the-badge&logo=php&logoColor=white)
![AI](https://img.shields.io/badge/AI_Powered-FF6B35?style=for-the-badge&logo=openai&logoColor=white)

**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

1. **πŸ“₯ Download**: Get the [`cacbot.zip`](https://cacbot.com/wp-content/uploads/cacbot.zip) file
2. **πŸ“€ Upload**: In WordPress admin, go to **Plugins** β†’ **Add New** β†’ **Upload Plugin**
3. **βœ… Activate**: Upload the zip file and activate the plugin

### 2️⃣ Create Your First Conversation

1. **🏠 Go to WordPress Admin Area**
2. **βž• Create New Cacbot Conversation**: Go to **Cacbot Conversation** β†’ **Add New**
3. **🏷️ Add Title**: Give your conversation a name (e.g., “Test Conversation”)
4. **πŸ”’ Set Privacy**: Change post visibility to **Private**
5. **πŸ“ Publish**: Save your conversation post

### 3️⃣ Start Chatting

1. **πŸ‘οΈ View Frontend**: Navigate to your conversation on the frontend
2. **πŸ’¬ Type Message**: Enter your message in the comment box
3. **πŸš€ 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`:

“`php
define( ‘CACBOT_OPENAI_API_KEY’, ‘sk-proj-your-api-key-here’ );
“`

Get your API key from [OpenAI](https://openai.com/index/openai-api/).

## πŸ‘€ 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.

## 🌐 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:

– **Type**: `boolean`
– **Default**: `false`
– **Description**: When enabled, displays an πŸ–ΌοΈ image icon after the comment form. Clicking sends the comment text to DALLΒ·E 3 for image generation.

#### `_cacbot_action_enabled_create_image`

– **Type**: `boolean`
– **Default**: `false`
– **Description**: When enabled, displays an πŸ–ΌοΈ image icon after the comment form. Clicking sends the comment text to DALLΒ·E 3 for image generation.

**βš™οΈ Setup Requirements:**
1. Install [LH Add Media from URL](https://wordpress.org/plugins/lh-add-media-from-url/) plugin
2. Set `_cacbot_action_enabled_fetch_image` to `1`
3. Describe your desired image in the comment
4. Click “Fetch Image” to generate and save to Media Library

#### `_cacbot_max_replies`

– **Type**: `integer`
– **Description**: Maximum number of comments allowed before the comments are closed.

#### `_cacbot_system_instructions`

– **Type**: `string` or `integer`
– **Default**: `”You are a helpful assistant.”`
– **String Value**: Direct system instruction for the LLM
– **Integer Value**: Post ID containing instructions

**πŸš€ Advanced Usage:**
– Use shortcodes in the system instructions post 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.

#### `_cacbot_action_enabled_create_new_linked_post`
– **Type**: `boolean`
– **Description**: If this field is true on an anchor post or a linked post, the user will be able to create a new linked post that points to the anchor. This enables the user to create a “new” conversation.

#### `_cacbot_comment_form_placeholder_text`

– **Type**: `string`
– **Description**: Custom placeholder text for the comment form input field.

#### `_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.

**Reply Strategy Details:**
– **Synchronous**: Real-time responses but subject to PHP/WordPress timeouts
– **Asynchronous**: Message is posted to site remote node immediately. 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.