Documentation — MxChat AI Search

Version 1.0.0 · Updated 5 days ago

MxChat AI Search

Turns your site's normal WordPress search into an AI-answering surface. When a visitor searches, MxChat AI Search answers the query from your MxChat knowledge base and links the pages the answer came from — either above your theme's usual results, as a full results page, or from a search box you drop anywhere on the site.

Overview

Your site search matches keywords. It does not answer questions. A visitor searching "how much does shipping cost" gets a list of pages that happen to contain those words, and has to open them and read until they find the number.

MxChat AI Search closes that gap using content you have already indexed. It reuses the same knowledge base, the same AI provider, and the same model settings as your chatbot — there is no second API key and no separate content import. The answer is generated only from your own knowledge base, and each answer lists the entries it drew from.

Two things are worth knowing before you turn it on. It is off by default — until you enable it, your search page behaves exactly like stock WordPress and loads with zero added scripts or styles. And it fails quietly rather than loudly: if the best knowledge-base match is below your confidence setting, if the visitor is rate-limited, or if the AI call fails, no answer is shown and the visitor simply sees your normal search results.

Setup

  1. Install and activate MxChat and activate your MxChat Pro license. AI Search will not run without both.
  2. Upload and activate MxChat AI Search from Plugins → Add New → Upload Plugin.
  3. Go to MxChat → AI Search.
  4. Turn on AI Search Overview — this is the master toggle and it starts off.
  5. Search your own site for something your knowledge base covers, and confirm the overview appears above your results.

If nothing appears, that usually means the knowledge base has no confident match for what you searched — see Troubleshooting below.

Settings

All settings live at MxChat → AI Search.

AI Search Overview

The master toggle. Off by default. While it is off, the plugin adds nothing to your search page — no scripts, no styles, and the REST route is not even registered.

Display mode

How the answer is presented on your search results page.

  • Overlay (default) — the AI answer renders above your theme's normal search results, which still appear underneath.
  • Full AI results page — replaces the theme's results with a two-column layout: the answer and its sources on the left, a rail of matching article cards on the right, and a "Show all results" link that reveals your theme's normal list underneath.

Confidence threshold

How strong the best knowledge-base match must be before an answer is generated. low, moderate (default), or high. Raise it if you are seeing answers on queries your content does not really cover; lower it if good queries are producing no overview.

Show sources

Whether the source list appears under the answer. On by default. Sources link back to the posts and pages the answer was drawn from.

Number of sources

How many source links to show. Default 4, maximum 10.

Cache duration

How long an answer for a given query is reused, in hours. Default 24, maximum 168 (one week). A repeated search inside this window is served from cache — instantly, and at no API cost. Use Save & clear cache now on the settings page after you change your knowledge base, so stale answers do not linger.

Rate limit

Maximum overview requests per visitor IP per minute. Default 10, maximum 120. This is the main protection for your API bill against a visitor (or a bot) hammering search.

Overview model

Which model generates search answers. Default is Inherit site chat model, which uses whatever your main MxChat chat model is. You can instead pick a lighter, cheaper model just for search: a search answer is a short summary, so a smaller model often reads about the same at a fraction of the cost. The setting applies to all three surfaces, and the page shows which model is currently in use.

Article cards / Show all results

Only used in Full AI results page mode. Article cards sets how many cards appear in the side rail (default 6). Show all results controls the escape-hatch link back to your theme's normal list (on by default).

Text overrides

The visitor-facing strings — overview heading, generating message, sources label, "show all" label, and the search-box placeholder — can each be overridden. Leave one blank to use the plugin's own translatable default. These exist so multilingual and custom-voice sites do not have to fight the defaults.

Features

  • AI Overview above your search results: Works with any theme's native search bar, with no theme edits. The search page renders first and the overview streams in afterward, so page load is never delayed.
  • Full AI results page: A Google-style two-column layout that takes over the results page — but only when there is a real answer to show. No confident answer, rate-limited, or a failed AI call all fall back to your theme's normal results.
  • Embeddable search box: The [mxchat_ai_search] shortcode or the MxChat AI Search block drops an AI-answering search input on any page, post, or widget area. The answer appears below the box without a page reload. It works even when the search overview is turned off, so you can add AI search without touching your theme's own search. Multiple boxes on one page each work independently.
  • Grounded answers with sources: Answers are generated only from your MxChat knowledge base and link the entries they used. Queries below the confidence threshold show nothing rather than a made-up answer.
  • Caching and rate limiting: Per-query caching makes repeat searches instant and free; per-IP rate limiting caps how often the AI is called. Both are configurable, with a one-click cache clear.
  • Separate model for search: Generate search answers with a cheaper model than your main chat model, or inherit the site model.
  • Theme-aware alignment: The overview and the full results page line up with your theme's own content column, so they match the width and position of your normal results instead of stretching across the window. This measures your theme rather than assuming a layout, so it works on classic themes as well as block themes, and it follows along on resize and on mobile.

API & Integration

Shortcode

[mxchat_ai_search] renders the embeddable AI search box. It returns nothing if the Pro license is inactive.

Attributes:

  • resultsoverview (default) or full. The results style shown under the box.
  • sourceson, off, or inherit (default). inherit follows the global Show sources setting.
  • alignnarrow (default), wide, or full. Box width.
  • placeholder — placeholder text. Blank uses the settings default.
  • button_text — button label. Blank gives an icon-only send button.
  • accent_color — a hex color. Blank uses the brand default.

Example:

[mxchat_ai_search results="full" align="wide" button_text="Ask" accent_color="#7873f5"]

Block

The MxChat AI Search block (mxchat/ai-search) is the same surface as the shortcode, available from the block inserter with a live preview in the editor. Results style, sources, width, placeholder, button text, and accent color are all set from the block settings panel. The block and the shortcode render the same box, so they stay in step.

REST endpoint

GET /wp-json/mxchat-search/v1/overview?q=<query>

Returns the generated answer and its sources for a query. Two things to note:

  • The route only exists when AI Search is enabled. A disabled site exposes no route at all.
  • The route is public, but requests are protected in the handler by a same-origin nonce and the per-IP rate limit. It is intended for the plugin's own front-end surfaces, not as a general-purpose API.

Requirements

  • MxChat (mxchat-basic): Required. Declared as Requires Plugins: mxchat-basic — the add-on will not run without it.
  • MxChat Pro License: Required. AI Search checks MxChat's license status and shows an admin notice if it is not active. See pricing.
  • A populated MxChat knowledge base: Required in practice. AI Search answers only from your knowledge base — with nothing indexed, every query falls below the confidence threshold and no overview appears.
  • WordPress: 5.8 or newer.
  • PHP: 7.4 or newer.
  • Third-party: None beyond what MxChat already uses. AI Search reuses your existing MxChat provider, model, and API key — there is no separate API setup.

Troubleshooting

No overview appears on the search results page

Check these in order:

  1. AI Search Overview is off. It is off by default — turn it on at MxChat → AI Search.
  2. The Pro license is not active. Check for the admin notice on the settings page.
  3. The knowledge base has no confident match. This is the most common cause and it is the plugin working as designed — it shows nothing rather than inventing an answer. Search for something your content covers well, or lower the Confidence threshold.
  4. You are rate-limited. Repeated testing from one IP can hit the per-minute limit. Wait a minute or raise Rate limit.

The answer is stale after I updated my content

Answers are cached per query for the Cache duration (24 hours by default). Use Save & clear cache now on the settings page to flush cached overviews immediately. Note this is separate from re-importing content — if the knowledge base entry itself changed, re-import it in MxChat first, then clear the search cache.

The overview or results page is wider than my normal search results

This was fixed in 1.0.0 — the overview and full results page measure your theme's content column and match it, on classic and block themes alike. If you still see it, the likely cause is a caching layer serving an older copy of the plugin's CSS or JS: clear your full-page cache (W3 Total Cache, WP Rocket, LiteSpeed, your host's cache, Cloudflare) and hard-refresh.

The search box shortcode renders nothing

[mxchat_ai_search] deliberately returns an empty string when the MxChat Pro license is inactive, so an unlicensed site does not show a broken box to visitors. Activate the license and it renders. This is independent of the AI Search Overview toggle — the box works even with the overview off.

Answers cost more than I expected

Set Overview model to a lighter model rather than inheriting your main chat model — search answers are short summaries and rarely need your best model. Then check Cache duration (longer cache means more repeat queries served free) and Rate limit (lower means fewer AI calls per visitor).


Last reviewed by Sage on 2026-07-16. Spotted an issue? Open a ticket and we'll patch the doc.