MxChat Perplexity
Real-time web search for your MxChat chatbot, powered by the Perplexity AI API. Your bot can answer questions about current events, news, and other time-sensitive topics that fall outside its training data — and cite sources when you want it to.
Overview
MxChat Perplexity Integration is a Pro add-on for the MxChat AI Chatbot plugin. It adds a Perplexity-powered web search layer to your chatbot so visitors can ask about things that happened today, last week, or any time after the underlying model's training cutoff — and get up-to-date, factual answers back. Responses can include numbered source citations (so users can verify what they're reading) or flow as natural prose (so the chatbot sounds like it just knew the answer). Web search is triggered two ways: a toolbar toggle the user controls, or intent-based phrases ("search for...", "research...") that you train. Requires MxChat (mxchat-basic), an active MxChat Pro license, and a Perplexity API key.
Setup
- Upload the
mxchat-perplexityfolder to/wp-content/plugins/(or install the ZIP via Plugins → Add New → Upload). - Activate MxChat Perplexity Integration under Plugins → Installed Plugins.
- Go to MxChat → Perplexity in your WordPress admin menu.
- Paste your Perplexity API key (grab one at docs.perplexity.ai/guides/getting-started).
- Pick a model and a response mode, then Save.
- (Optional) Enable the Perplexity Research intent under the main MxChat → Intents settings if you want phrase-based triggering. Train it with examples like "Search for...", "Research...", "Find information about...".
- (Optional) Enable the chat toolbar under MxChat → Integrations → Toolbar Settings so the one-click web search button appears in the chatbot.
Settings
All settings live at MxChat → Perplexity in WordPress admin (or Network Admin → Settings → Perplexity on multisite).
API Key
Your Perplexity API key. The field includes a show/hide toggle so you can verify the key without copy-pasting it elsewhere. Required for the add-on to do anything.
Model
Pick the Perplexity Sonar model the chatbot should use:
- Sonar Pro — 200k context window, fast, best general-purpose choice.
- Sonar Reasoning — 128k context, multi-step logic for tougher questions.
- Sonar Reasoning Pro — 128k context, advanced reasoning for complex queries.
- Sonar Deep Research — 128k context, thorough multi-step research; can take several minutes per response.
Response Mode
Controls how search results are rendered in the chat:
- Conversational — Natural-sounding prose, no citation numbers. The bot answers like it already knew.
- Structured — Formatted content with numbered source citations and clickable links at the bottom.
Default: Conversational.
Show Perplexity Logo
Toggle the Perplexity search button on or off in the chatbot toolbar. Turn it off if you want web search available only through intent matching (no visible toggle in the UI). Default: shown.
Features
- Real-Time Web Search: The bot pulls live information from the web, so answers about news, current events, and time-sensitive topics stay accurate rather than capped at the model's training cutoff.
- Two Response Modes: Conversational delivers flowing prose with no citations; Structured returns formatted HTML with numbered source links so users can verify the answer themselves. You pick the default in settings.
- One-Click Web Search Toggle: A Perplexity button in the chat toolbar routes every message through web search until the user clicks it off again. The toggle state persists across page loads via localStorage.
- Intent-Based Triggering: Train the built-in "Perplexity Research" intent with phrases like "search for..." or "research..." and matching messages route to web search automatically — no toggle required.
- Four Perplexity Models: Sonar Pro for general use, Sonar Reasoning / Reasoning Pro for multi-step logic, Sonar Deep Research for thorough investigations. Switch models per site from the settings page.
- Smart Timeout Handling: Standard models get a 30-second timeout; Deep Research gets up to 5 minutes. Complex queries have time to finish without false failures.
- Chain-of-Thought Cleanup: Reasoning and Deep Research models often emit internal "thinking" steps. The plugin strips those out automatically so users only see the polished final answer.
- Show/Hide Perplexity Logo: Hide the toolbar button when you want web search to be intent-only and invisible to users.
- Multisite Compatible: Works on WordPress multisite, checking both network-wide and site-specific MxChat Pro license activation.
API & Integration
- Perplexity Sonar API — Outbound HTTPS calls to api.perplexity.ai with your API key. The plugin selects model + timeout based on your settings and sends a system prompt tuned to the chosen response mode.
- Callback registered: mxchat_handle_perplexity_search is added to mxchat_available_callbacks as a Pro-only intent labeled "Perplexity Research" under the "Search Features" group. Use it from MxChat's Intents tab to wire phrase-based triggering.
- Filters:
- mxchat_handle_perplexity_search — invoked when a message is routed to Perplexity (intent match or toggle on).
- mxchat_pre_process_message — the plugin hooks this to detect whether web search mode is active for the current message.
- mxchat_perplexity_should_show_logo — return false to hide the toolbar button programmatically.
- AJAX endpoints: wp_ajax_mxchat_perplexity_search and wp_ajax_nopriv_mxchat_perplexity_search power the toolbar toggle; calls are nonce-protected (mxchat_perplexity_nonce).
- Citation rendering — In Structured mode, source URLs are appended to the response as a numbered, clickable link list. In Conversational mode, markdown headings are flattened to bold and citations are stripped.
Requirements
- MxChat (mxchat-basic): Required and active. Plugin shows an admin notice if mxchat-basic isn't detected on the site (or network on multisite).
- MxChat Pro License: Required. Without an active Pro license the admin shows a warning notice and no Perplexity functionality loads. See mxchat.ai/pricing/.
- Perplexity API Key: Required. Sign up at docs.perplexity.ai/guides/getting-started.
- WordPress: 5.8 or newer.
- PHP: 7.4 or newer.
Troubleshooting
"API quota exceeded" or 429 errors from Perplexity
You've hit your Perplexity plan's rate limit or monthly credit cap. Check usage at perplexity.ai/settings/api. If you're on Deep Research and getting quota errors fast, switch to Sonar Pro — Deep Research consumes significantly more credits per query.
Web search isn't triggering
Three things to check:
1. Is your MxChat Pro license active? If the Perplexity admin page shows a yellow "Pro required" notice, license activation is the issue — visit MxChat → Activation.
2. Is the API key saved? Empty key = silent fallback to the normal chatbot response.
3. If you're relying on intent matching, confirm the "Perplexity Research" intent is enabled in MxChat → Intents and that you've trained it with at least 3-5 example phrases.
Citations don't render / show as raw text
You're probably in Conversational mode, which intentionally strips citations. Switch Response Mode to Structured in settings and save. If you're already in Structured mode and citations still look broken, clear any chatbot front-end caching plugin and hard-reload the page.
Deep Research requests time out
Deep Research can legitimately take up to 5 minutes for complex prompts. The plugin sets the timeout high enough, but your hosting environment's PHP max_execution_time or front-end proxy (Cloudflare, etc.) may cut the request short. Bump server timeouts or switch to a faster Sonar model.
Toolbar button doesn't appear
Make sure the MxChat chat toolbar is enabled under MxChat → Integrations → Toolbar Settings — the Perplexity button is a toolbar item. Also confirm the Show Perplexity Logo setting is on. If the button still doesn't show, the front-end JS may have failed to enqueue; check the browser console for mxchatPerplexity and verify your theme isn't blocking front-end scripts.
Last reviewed by Sage on 2026-05-21. Spotted an issue? Open a ticket and we'll patch the doc.