Cacbot
Cacbot is a WordPress plugin that lets you interact with AI agents directly on your WordPress site, using the native comment system to record the chats. Written entirely in PHP, this plugin works on any WordPress site.
Features and Capabilities:
- Transform and generate text
- Create images
- Execute functions and perform actions
- Capture all conversation data in the WordPress comment system
You can give system instructions that remain hidden from users, create multi-step conversations, and keep all data within your WordPress environment.
Who is it for?
Developers and site admins looking to build AI-powered WordPress applications. Try it for free!
Getting Started
-
Download the ZIP File
Downloadcacbot.zip
. -
Upload and Activate
In your WordPress admin, navigate to Plugins > Add New, then uploadcacbot.zip
and activate it. -
Create a Cacbot Conversation
- Go to Cacbot Conversations in the WordPress admin.
- Click Add New.
- Name your conversation (for example, "Test").
- Set the conversation visibility to Private and click Publish.
-
Use Cacbot
- View the conversation on the frontend.
- Type your message in the comment box.
- Once you submit, the Cacbot Assistant will reply, and its response is saved as a WordPress comment.
Cacbot User Role
Cacbot introduces a new WordPress user role: Cacbot.
- By default, users with the Cacbot role also have editor capabilities.
- Cacbots can perform all actions an editor can, though you can adjust these capabilities manually.
- With an Administrator’s permission, a Cacbot can even modify its own capabilities.
Cacbot Conversation Custom Post Type
Cacbot Conversations are stored as a custom post type (cacbot-conversation
). Comments on these posts are interpreted as a conversation with a Large Language Model (LLM).
- The plugin uses WordPress’s default comment system.
- A conversation consists of two participants: the Interlocutor (first speaker) and the Respondent (second speaker).
- One or both participants must have the Cacbot role.
- If a human user comments on a
cacbot-conversation
, the Cacbot Assistant is automatically assigned as the Respondent.
Conversation Structure
- _cacbot_interlocutor_user_id: The user ID of the first speaker (Interlocutor).
- _cacbot_respondent_user_id: The user ID of the second speaker (Respondent).
If a non-Cacbot user leaves a comment, the Cacbot Assistant is automatically designated as the Respondent.
Special Post Meta Fields
Below are several custom fields that can be used to adjust Cacbot Conversations:
_cacbot_action_enabled_archive
- Type: bool
- Default:
false
- When set to
true
, a trash-can icon appears if there is at least one comment. Clicking it archives the conversation.
This can be useful when you only need a single result from the AI (for example, a one-time generated text or image), and you want to archive or "retry" that conversation.
_cacbot_action_enabled_fetch_image
- Type: bool
- Default:
false
- When set to
true
, an image icon appears if there are no comments yet. Clicking it sends the user’s comment text to the DALL·E 3 model, which generates an image.
How to Use:
- Install the free plugin LH Add Media from URL from the wordpress.org repo.
- Create a new Cacbot Conversation.
- Add a custom field
_cacbot_action_enabled_fetch_image
and set it totrue
. - Describe your desired image.
- Click the “Fetch Image” icon to generate and save it to the WordPress Media Library.
_cacbot_max_replies
- Type: integer
- Description: The maximum number of comments allowed before the conversation is closed.
_cacbot_max_archives
- Type: integer
- Description: The total number of times a user can click the “archive” button.
_cacbot_system_instructions
- Type: string or integer
- Default:
"You are a helpful assistant."
- If you provide a string, it becomes the system instruction passed to the LLM.
- If you provide an integer, the post with that ID is used (including expanded shortcodes in that post).
Usage Ideas:
- Insert pages or shortcodes to pass dynamic information to the LLM.
- Combine multiple instructions in one place.
- Use WordPress shortcodes in the content of the post to use PHP functions to send custom messages to the AI!
_cacbot_anchor_post
- Type: bool
- Default:
false
How it works:
- When a user comments on an anchor post, a new Cacbot Conversation is automatically created in the background.
- The comment thread is displayed on the anchor post’s frontend.
- This setup allows multiple users to chat with a specific Cacbot on a specific page, post or URL.
_cacbot_comment_form_placeholder_text
- Type: string
- Description: The placeholder text shown in the comment form.