A knowledge base works when people find the right article. Most of the time they do not. They type two words into the search box, get ten articles that mention those words, give up and email you. An AI knowledge base changes the first step: the reader asks the whole question, in their own words, and gets a short answer written from your articles, with a link to the article it came from.
This guide shows how to do that on a WordPress site that already has a knowledge base, what it costs to run, and when it is not worth it. We make Wyregraf, the plugin used in the steps, so read it with that in mind.
What an AI knowledge base has to get right
Adding a chatbot is easy. Adding one you can trust with your customers is not. Before you pick a tool, check it does these four things:
- It answers only from your articles. A general chatbot fills gaps from what it learned on the open web. On a help site, that means a confident answer about a setting your product does not have.
- It shows its source. Every answer must link to the article it came from, so the reader can check it and keep reading.
- It says "I do not know". When your articles do not cover the question, the right answer is a polite fallback, not a guess.
- It shows you what people ask. The questions it could not answer are the articles you must write next.
Search box vs AI answers
| Keyword search | AI knowledge base | |
|---|---|---|
| What the reader types | A few words | A full question |
| What comes back | A list of articles that contain the words | A short answer, with links to the articles it used |
| Different words for the same thing | Misses ("cancel" vs "end my plan") | Finds it, because it matches meaning, not spelling |
| Questions with no article | An empty list | A fallback message, and a log entry for you |
| Cost to run | Nothing | A few cents per question in AI provider fees |
Keep the search box. Some readers know the article title and want to go straight to it. The AI answer is for everyone else.
How it works on a WordPress site
Wyregraf runs inside WordPress. There is no separate service to sign up for.
- It indexes your articles. Each article is split into short passages, and each passage is turned into an embedding: a list of numbers that stands for its meaning. The embeddings are stored in your own WordPress database, next to the articles. See Where are my embeddings and vectors stored?
- A reader asks a question. Wyregraf finds the passages closest in meaning, plus the ones that share exact keywords. See Hybrid Search & Reranking.
- The AI writes the answer from those passages only. The answer cites the articles it used. If nothing close enough was found, the reader gets your fallback message.
The AI model comes from your own OpenAI or Anthropic account. You add your API key once, and the provider bills you directly at its own rates. Wyregraf adds no charge per message. See Which AI providers does Wyregraf support?
Set it up
Most knowledge base plugins store each article as its own WordPress post type. BetterDocs, for example, stores them as Docs. Wyregraf can index any post type you turn on.
- Connect your AI provider. Go to Wyregraf → Setup. The setup creates an embeddings profile and a chat profile from your API key and tests each one. See Getting Started with Wyregraf.
- Turn on your articles' post type. In the embeddings profile, enable the post type your knowledge base uses. See How do I make a post type available for embeddings?
- Index the articles. Create an embedding with Posts as the source. The Index tab shows the token count and the estimated cost before you start. See Creating Embeddings.
- Add the PDFs too. Manuals, policies and old newsletters often only exist as PDFs. Upload each one as its own embedding. Scanned PDFs with no text layer cannot be indexed. See Indexing PDFs, URLs & Code.
- Create the chat. Write the fallback message and the welcome message, and add 3 or 4 sample questions people really ask. See Creating a Chat.
- Turn on citation checks. On the chat's Context tab, Citation Integrity makes every claim cite one of your passages. Answers that fail the check are replaced with a "could not verify" message. See Citations & Answer Verification.
- Put it on the page. Paste the shortcode at the top of your knowledge base home, or turn the chat into a floating launcher and put its shortcode on every help page. See Displaying the Chat.
Before you go live, try 20 real questions from your support inbox. The Retrieval Lab shows which passages each question found, so you can see why an answer is good or bad.
What it costs to run
There are two costs, and both go to your AI provider, not to us:
- Indexing, once per run. Embedding models are cheap, so indexing even a large knowledge base usually costs cents.
- Answers, every time someone asks. One question is one call to the chat model. A small model keeps this low, and most knowledge base questions do not need the biggest one.
To keep the bill predictable, set a message limit and a history limit on the chat, and a usage limit per role, guests included. Every chat also limits each person to 10 messages a minute by default. See What does indexing and chatting cost? and Usage and Rate Limits.
Wyregraf itself is $299 a year for the license, with a full refund within 30 days.
Make it better every week
The first week shows you what your knowledge base is missing. Wyregraf → Knowledge Gaps lists every question that found no good match, grouped so the most-asked one is at the top, and every answer a reader rated with a thumbs down. See Conversations, Analytics, and Knowledge Gaps.
Each entry on that list is an article to write or a paragraph to fix. Write it, reindex, and the next reader gets the answer.
When it is not worth it
- You have fewer than about 20 articles. A clear table of contents does the same job for free.
- Your answers change by the hour, such as stock levels or live prices. An index is a copy, and it is only as fresh as the last reindex.
- Your help content is mostly scanned PDFs or video. There is no text to index until someone writes it down.
- You do not have a WordPress site. Then a hosted service is the simpler choice.
If none of those apply, start with the articles you already have. See the Wyregraf docs for every setting, or get a license.