Visitors rarely phrase a question the way an article title does. They type “how do I get my money back” and your article is called “Refund policy”. Keyword search misses it, and they open a support ticket instead.
Ask the docs in Knowledge Base Pro closes that gap. A visitor asks a question in plain language. Knowledge Base Pro finds the most relevant published articles, sends them to the AI provider you have connected to WordPress, and shows a short answer with links to the articles it used. When your articles don’t cover the question, it says so and points to the search results.
Turn on Record questions for Content gaps and every unanswered question is logged, so you can see where your documentation falls short.
Ask the docs is in beta.
Requirements
- Knowledge Base Pro 3.2.0 or later.
- WordPress 7.0 or later. Ask the docs uses the AI Client built into WordPress 7.0. On older versions the feature does not load and the rest of the plugin works as before.
- An AI provider connected under Settings → Connectors, such as the official Anthropic, OpenAI or Google provider plugins.
Knowledge Base Pro never sees or stores API keys. It asks WordPress for a text answer, and WordPress sends the request through the provider you have connected. With more than one provider connected, choose which one answers under AI provider.
Set up Ask the docs
- Connect a provider under Settings → Connectors.
- Go to Knowledge Base → Settings → AI (Beta) and turn on Enable Ask the docs. If the tab shows a notice that no AI provider is configured, the provider you connected does not support the structured answers Ask the docs needs, or isn’t set up yet. The tab checks the provider in the background when it hasn’t been checked recently.
- Ask the docs now answers questions in these places. Each is on by default; turn off any you don’t want on the same tab:
- Use in knowledge base search boxes: every knowledge base search box answers questions: the Knowledge Base Search block, the
[kbsearch]shortcode and the knowledge base templates. Live search suggestions still appear while typing, so visitors can jump straight to an article. Pressing Enter asks the question. - Use in the Help widget: the floating Help widget answers questions on every page it appears on. Typing still shows matching articles. Pressing Enter or the search button also shows an answer above them. The Help widget must be enabled.
- Use in knowledge base search boxes: every knowledge base search box answers questions: the Knowledge Base Search block, the
The search box stays a normal search form. Without JavaScript, or if the provider isn’t available, it submits to your knowledge base search results, so visitors always get somewhere useful.
What visitors see
The answer appears below the search box in a card that follows the colors of your chosen Knowledge Base Style. In the Help widget, it uses the widget’s colors.
- Based on this article (or these articles): links to the articles the answer came from.
- Related articles: up to three other published articles from the same section, or with the same tags, as the main source. These appear whenever there is an answer.
- See all search results: a link to the full knowledge base search results for the question. It is hidden when the visitor is already on those results.
- A note that the answer was generated by AI and may contain mistakes.
When there is no answer, visitors see the Fallback message and a link to the search results.
On the knowledge base search results page, the first search box answers the search automatically, above the list of results. Later pages of results don’t ask again.
How it answers
Answers come only from your published articles. Knowledge Base Pro does not let the model use general knowledge.
For each question:
- Each keyword in the question is searched against your published, non-password-protected articles, using the same WordPress search the knowledge base uses. Articles are ranked by the keywords they match, and rare keywords such as “refund” count for more than common ones such as “WordPress”. For long questions, only the rarest keywords are searched.
- The best matches are converted to plain text, trimmed to the Maximum characters per article setting, and sent to the provider with instructions to answer only from them.
- The provider replies with whether it answered, the answer text, and the IDs of the articles it used.
- Knowledge Base Pro checks that reply. Source IDs that were not sent are discarded, and an answer with no valid sources is treated as unanswered. Source links are built from your articles, never from the model’s output, and the answer is shown as plain text. A malformed reply is shown as unanswered but not cached, so the next visitor gets a fresh attempt.
If no articles match at all, no request is sent to the provider.
Settings
All settings are under Knowledge Base → Settings → AI (Beta).
- Enable Ask the docs: turns the feature on. Default: Off.
- AI provider: which connected provider answers questions. Automatic, the default, lets WordPress choose. Choose one when more than one provider is connected, for example to control cost. If the chosen provider’s plugin is deactivated, Automatic is used.
- Articles sent as context: how many matching articles go with each question. More articles improve coverage and cost more per request. Default: 4. Range: 1–8.
- Maximum characters per article: each article is trimmed to this length before it is sent. Default: 3,000. Range: 500–10,000.
- Answer length: Short (two or three sentences) or Medium (one or two paragraphs). Default: Short.
- Show sources: list links to the articles the answer is based on. Default: On.
- Fallback message: shown with a link to the search results when there is no answer. Leave it blank to use the default.
- Use in knowledge base search boxes: let knowledge base search boxes answer questions. Every uncached question costs a provider request. Default: On.
- Use in the Help widget: show an answer above the article results when a visitor presses Enter or the search button in the Help widget. Default: On.
- Daily request cap: maximum provider requests per day across the site. Default: 200. Range: 1–100,000.
- Questions per visitor per hour: Default: 10. Range: 1–1,000.
- Record questions for Content gaps: store the text of each question for the Content gaps report. Nothing is stored while it is off. Default: Off.
- Log retention (days): how long recorded questions are kept. Default: 90. Range: 1–3,650.
Costs and limits
Your provider bills you per request, and the endpoint is public, so Ask the docs has several controls to keep the bill predictable.
Answers are cached. The same question, ignoring case, spacing and trailing punctuation, gets the cached answer for a day. Publishing, updating or deleting any knowledge base article invalidates the cache, so answers never outlive the content they came from. Changing the provider, answer length, context articles or maximum characters also misses the cache. Cached answers do not count toward either limit.
Each visitor gets a fixed number of questions per hour. The count resets at the start of each hour. Visitors are identified by a salted hash of their IP address, which is deleted after the hour ends, the next time anyone asks a question. Once visitors reach the limit, Ask the docs behaves like a plain search for them: the question goes to the search results and no error is shown.
The daily cap switches Ask the docs off once it is reached, until the next day in your site’s time zone. Search boxes work as plain search forms and questions go to the search results, so visitors are never shown an error. No provider requests are made.
Requests must come from your site and a browser. The endpoint checks the browser’s Origin (or Referer) header against your site address. It refuses requests with no user agent, or with one that looks like a crawler, script or HTTP library, before any provider request is made. A determined script can fake both, so the daily cap remains the limit on cost.
With Use in knowledge base search boxes turned on, every uncached knowledge base search costs a provider request, including searches that land on the results page. If your knowledge base gets a lot of searches, keep an eye on the daily cap.
Clear cached answers
Go to Knowledge Base → Tools and click Clear Cache. This clears the knowledge base output cache, the REST API cache and all cached Ask the docs answers, and rechecks the AI provider the next time it is needed. You rarely need to do this, because editing an article already invalidates cached answers.
Privacy
The visitor’s question and excerpts from your articles are sent to your AI provider. Knowledge Base Pro stores the text of questions only when Record questions for Content gaps is on, and never the IP address or the user account. The hashed IP used for rate limiting is deleted after the hour ends, the next time anyone asks a question.
Knowledge Base Pro adds suggested text to Settings → Privacy → Policy Guide. Add your provider’s name and a link to its privacy policy before you use it.
Uninstalling Knowledge Base Pro deletes the question log, cached answers and usage counters.
Content gaps
Turn on Record questions for Content gaps in the AI tab to use this report. Knowledge Base → Content gaps then lists the questions your knowledge base could not answer, grouped so that “How do I export?” and “how do i export” count as one. A visitor who asks the same question again within an hour is only counted once. For the selected dates you also see how many questions were asked, how many were answered, the answer rate and how many came from the cache.
Each row links to a new article with the question as its title, and to the knowledge base search for that question. Export CSV downloads the list for the selected dates.
Questions are deleted automatically after the Log retention period.
To delete the log immediately, click Empty log on the Content gaps page and confirm. This deletes every recorded question, answered and unanswered, across all dates. The button appears only when the log contains questions. This cannot be undone.
Troubleshooting
The AI tab says no provider is configured. Check Settings → Connectors. The provider must support text generation with structured JSON output. A working provider is remembered for a week, and a failed check for 10 minutes. A failed provider request, or activating or deactivating a plugin, makes Knowledge Base Pro check again. Click Check again in the notice to recheck straight away.
Search boxes don’t answer questions. Ask the docs is enabled but no provider is available, so search boxes work as plain search forms.
Search boxes stopped answering questions partway through the day. The daily request cap was reached. Ask the docs comes back the next day, or raise the cap.
Every answer says it could not find an answer. Your articles may not cover the questions. Turn on Record questions for Content gaps and check Knowledge Base → Content gaps.
Visitors behind a proxy all share one limit. Your server sees the proxy’s IP address. Use the wzkb_ai_visitor_ip filter to return the client IP from the header your proxy sets. See the Ask the docs developer reference.
Two lists of suggestions appear under the search box. Knowledge Base turns off Better Search’s live search on its own search forms when Enable live search is on. If you still see two lists, update Better SearchOpens in a new window to 4.5.0 or later.
See also
- Ask the docs developer reference: REST endpoint, ability, filters and actions.
- Knowledge Base Pro Help Widget
- Live Search
