Description
Cardoza AI-Powered Chatbot adds a chat box to your site that answers visitors’ questions using your own content. You choose which posts and pages the chatbot may use, and it answers only from them. If the answer isn’t there, it says so instead of guessing.
The content you add is split into chunks, turned into vector embeddings by an embedding service you choose, and stored in your existing MySQL or MariaDB database as compact INT8 vectors next to a FULLTEXT keyword index. For each question, the plugin finds the most relevant passages with hybrid keyword and semantic search and sends them to a chat model of your choice, which writes the reply. No vector database or extra server software is needed, so it works on ordinary shared hosting.
Features
- Answers from your content: replies are based only on the posts and pages you add, in a short, direct answer.
- You choose the content: every post, page and public custom post type gets an Add to chatbot content switch in the editor. It is off by default, so nothing is shared with the chatbot until you switch it on.
- Hybrid retrieval: MySQL FULLTEXT keyword search and vector similarity, combined with weighted Reciprocal Rank Fusion. Follow-up questions keep the topic of the previous one.
- Bring your own provider: any OpenAI-compatible embeddings and chat completions API, such as OpenAI, OpenRouter, or a self-hosted Ollama or LM Studio server. Any embedding vector size is supported.
- Automatic indexing: content is indexed in the background when saved. Unchanged content is skipped. Unpublished and password-protected posts are left out until they are published again.
- Re-Index page: re-index all chatbot content in small, resumable batches with a progress view, or re-index a single post. A list shows every post’s status, chunk count and last indexed time.
- Customisable chat box: set the title, welcome message and screen corner (bottom right or bottom left). It uses your theme’s font, has a dark mode, and its colours can be changed by themes with CSS custom properties.
- Private conversations: the conversation is kept only in the visitor’s browser tab (sessionStorage), and nothing is stored on your server.
- Protected endpoint: the public chat REST endpoint is limited to 10 messages per visitor per minute.
- Graceful fallback: if the embedding service is unreachable, the chatbot falls back to keyword search.
Requirements
- An OpenAI-compatible embeddings API reachable from your server.
- An OpenAI-compatible chat completions API reachable from your server.
The chat box appears only when both are configured.
External services
This plugin does not contact any service until you configure one. It connects only to the endpoint URLs you enter on its Settings page. You choose the provider, and that provider’s terms of service and privacy policy apply.
Embedding service
Used to turn your content and visitors’ questions into vectors.
- What is sent: the title and text of the published posts you added to the chatbot content (when they are saved or re-indexed), and the questions visitors type in the chat box (when they send them). The model name and, if you entered one, your API key are sent with each request.
- When: when content is indexed, and on every chat message.
- Where: the embedding endpoint URL set on Chatbot Settings.
Chat model
Used to write the replies.
- What is sent: the visitor’s message, the last few messages of their conversation, the title and matching text of up to five passages of your chatbot content, and your site name inside the instructions. The model name and, if set, your API key are sent with each request.
- When: on every chat message for which matching content is found.
- Where: the chat endpoint URL set on Chatbot Settings.
If you use a hosted provider, see its terms and privacy policy. For example:
- OpenAI: Terms of use, Privacy policy
- OpenRouter: Terms of service, Privacy policy
A self-hosted server (such as Ollama or LM Studio) keeps all data on infrastructure you control.
Installation
- Upload the plugin to
/wp-content/plugins/cardoza-chatbot, or install it from Plugins Add New. - Activate it from the Plugins screen. This creates the plugin’s database tables.
- Go to Chatbot Settings and enter the endpoint URL, API key (if required) and model name for both the embedding service and the chat model. Optionally set the chat box title, welcome message and position. To try it locally for free, see “Local testing with Ollama” below.
- Open each post or page the chatbot should use, switch on Add to chatbot content in the Cardoza Chatbot panel of the editor sidebar (or the meta box in the classic editor), and save. It is indexed in the background.
- Check progress on Chatbot Re-Index, then open your site and try the chat box in the bottom corner.
Local testing with Ollama
Ollama runs both the embedding model and the chat model on your own computer, with no API key and no data leaving your machine.
- Install Ollama from ollama.com/download and start it (open the app, or run
ollama serve). It listens onhttp://127.0.0.1:11434. - Pull the models:
ollama pull all-minilm(embeddings, about 46 MB) andollama pull qwen3:4b(chat, about 2.5 GB). Other models work too, such asnomic-embed-textfor embeddings. - Choose the base URL:
http://127.0.0.1:11434if WordPress runs directly on your computer (Local, MAMP,wp server), orhttp://host.docker.internal:11434if WordPress runs in Docker. - On Chatbot Settings, set the embedding Endpoint URL to
<base URL>/v1/embeddingsand Model toall-minilm, and the chat Endpoint URL to<base URL>/v1/chat/completionsand Model toqwen3:4b. Leave both API keys empty. - Add some posts to the chatbot content, then click Re-index all on Chatbot Re-Index and keep the page open until it finishes.
Tips:
- Docker on Linux: add
extra_hosts: ["host.docker.internal:host-gateway"]to the WordPress service and start Ollama withOLLAMA_HOST=0.0.0.0 ollama serveso containers can reach it. - Indexing on save in Docker: WordPress often can’t reach its own URL from inside a container, so WP-Cron doesn’t run. Use the Re-Index page, or request
wp-cron.phpfrom your computer (for examplecurl http://localhost:8080/wp-cron.php, using your site’s port). - Speed: on a CPU, a reply can take tens of seconds (the plugin waits up to 120 seconds). Smaller models such as
qwen3:1.7borllama3.2:3bare faster. Reasoning output in<think>tags is removed from replies.
FAQ
-
Do I need a vector database or special hosting?
-
No. Vectors are stored in the plugin’s own tables in your existing MySQL or MariaDB database and compared in PHP.
-
Why doesn’t the chatbot know about my posts?
-
Posts are not added automatically. Switch on Add to chatbot content for each post or page you want it to use, and save. Only published posts without a password are used.
-
Which providers work?
-
Any service using the OpenAI-compatible embeddings format (
POST {"model": "...", "input": [...]}) and chat completions format, including OpenAI, OpenRouter, Ollama and LM Studio. -
Does it send my content to a third party?
-
Only to the endpoints you configure. See External services above. Using a self-hosted embedding and chat server keeps everything on your own infrastructure.
-
Are conversations stored?
-
No. The conversation lives in the visitor’s browser tab and is cleared when the tab is closed or New chat is clicked. Only the current message and the last few messages are sent with each request.
-
What happens when the answer isn’t in my content?
-
If no matching content is found, the chatbot says so without calling the chat model. Otherwise the model is instructed to answer only from your content and to say when it couldn’t find the answer.
-
I changed the embedding model. Do I need to re-index?
-
Yes. Vectors from different models can’t be compared, so run Re-index all on Chatbot Re-Index after changing the model.
-
New content is not being indexed.
-
Indexing runs in the background through WP-Cron. If your site disables WP-Cron or it can’t reach itself, set up a server cron job that requests
wp-cron.php. The Re-Index page always works, because it runs batches while it is open. -
Can I change the chat box colours?
-
Yes. The colours are CSS custom properties named
--cardoza-cb-chat-*on.cardoza-cb-chat, which your theme can override. -
Can I hide the chat box on some pages?
-
Yes. Return
falsefrom thecardoza_cb_show_chat_widgetfilter. -
What is removed when I delete the plugin?
-
Deleting the plugin from the Plugins screen drops its tables and removes its options, rate-limit counters and scheduled events. Deactivating it keeps everything.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Cardoza AI-Powered Chatbot” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Cardoza AI-Powered Chatbot” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- Initial release.