Let AI Answer from Your Knowledge Base
An AI assistant can answer questions from your own help articles instead of from what a model learned in general. It looks up the passages of your articles that match each question (this is called retrieval, or RAG), answers from them, and lists the articles it used, with links. This page sets it up from start to finish.
| Menu | Search > Indexes; Artificial Intelligence > Data Sources; Artificial Intelligence > Profiles; Design > Widgets; Access Control > Roles |
| Permission | Manage Indexes; Manage AI data sources; Manage AI profiles; Manage layers; Manage Roles |
| Feature | Knowledge Base, Elasticsearch, AI Data Sources - Elasticsearch, AI Chat, Widgets, Layers |
What you see depends on your role. If the menu, a button or a setting on this page is missing, ask your administrator to give you the permission listed above or to turn on the feature. Only administrators can turn features on and change site settings.
Here is how the pieces fit together:
- A content index holds your published articles in Elasticsearch.
- An AI knowledge base index holds the same articles split into passages, with their meaning (embeddings), so the AI can find the passages that answer a question.
- An AI data source copies the articles from the first index into the second one and keeps them in step when articles change.
- An AI profile answers from that data source.
- A chat widget on your website, or the admin chat, lets people ask the profile questions.
The AI knowledge base leaves out every article restricted with Which roles can see this content: only articles with no role picked (Any role) are copied into it. An article you restrict later is removed from it at its next sync. So a public assistant never answers from an article meant for your staff. Keep articles for staff out of public answers by restricting them; there is nothing else to set.
Before you start
You need:
| What | Who sets it up |
|---|---|
| An Elasticsearch server. The AI knowledge base needs Elasticsearch or Azure AI Search; this page uses Elasticsearch. A local development host can run one for you. | IT; see the Technical Manual |
| An AI connection with a chat deployment (the model that writes answers) and an embedding deployment (the model that turns text into meaning). | Your administrator; see AI connections |
| The Knowledge Base with published articles. | See Write articles |
Turn on these features under Tools > Features:
| Feature | Why |
|---|---|
| Knowledge Base | Your articles |
| AI Data Sources - Elasticsearch | The AI knowledge base index and the data source. It turns on Elasticsearch (the content index of your articles), AI Data Sources and Indexing too. |
| AI Chat | Chatting with the profile, in the admin and in the website widget |
| Widgets and Layers | The chat widget on your website. The Knowledge Base recipe already turns them on. |
1. Choose what the articles' text holds
The AI reads the full text of each article. By default that is the title and the body. Add the summary too, so short questions find the right article:
- Go to Design > Content Definition > Content Types and edit Knowledge Article.
- Leave Include display text and Include body parts ticked.
- Tick Use custom full-text and enter
{{ Model.Content.KnowledgeArticlePart.Summary }}in its box. - Click Save.
2. Create the content index of your articles
- Go to Search > Indexes and click Add index.
- On Content in Elasticsearch, click Add.
- Enter an Index Name, such as knowledgearticles, and a Name, such as Knowledge articles.
- Under Content types, tick only Knowledge Article.
- Leave Index Latest version unticked, so drafts stay out.
- Tick Store Source Data. The data source reads the articles from the index, and can't without it.
- Click Save.
The new index shows in the list, and the site adds your published articles to it in the background. To fill it again at any time, open its Actions menu and choose Rebuild.
3. Create the AI knowledge base index
- Go to Search > Indexes and click Add index.
- On AI Knowledge Base Index (Elasticsearch), click Add.
- Enter an Index Name, such as helpcenterknowledge, and a Name, such as Help center knowledge.
- Choose the Embedding deployment of your AI connection. It can't be changed once the index is created.
- Click Save.
4. Create the AI data source
- Go to Artificial Intelligence > Data Sources and click Add Data Source.
- On Search Index Profile, click Add.
- Enter a Name, such as Help center articles.
- Under Source, choose the Source index Knowledge articles from step 2.
- Choose the Destination index Help center knowledge from step 3. It can't be changed once you save.
- Under Field Mapping, keep the values filled in for you: Content field
Content.ContentItem.FullText, Title fieldContent.ContentItem.DisplayText.Keyword(or another display text field), and Key field left as the content item id. The key is what links each answer's sources to the articles, so don't change it. - Click Save.
The data source copies your articles into the knowledge base in the background. To run it again by hand, open the data source's Actions menu and choose Sync index.
Give it a minute, then go on to step 5 and ask the profile a question one of your articles answers: an answer with sources shows the knowledge base is filled.
5. Create the AI profile
-
Go to Artificial Intelligence > Profiles and create a profile of type Chat, such as Help center assistant. The Website assistant starting point is made for a public assistant. See AI profiles.
-
Choose your chat connection and deployment.
-
Write its instructions, for example:
You are the help center assistant of our website. Answer only from the help articles you are given. Keep answers short and in plain words, and point to the article each answer comes from. When the articles don't answer the question, say so and suggest contacting support.
-
Open the Knowledge tab and choose the Data source Help center articles.
-
Tick Restrict answers to retrieved data only, so the assistant answers only from your articles and says so when it can't find the answer. Leave it unticked if it may also answer from general knowledge.
-
Leave Strictness and Retrieved documents empty to use the site's defaults, or see Knowledge.
-
Click Save.
To try it, open the profile's Actions menu and click New chat. Ask a question one of your articles answers. The answer carries small numbers, and a numbered list of sources under it names the articles. Each source links to the article's page.
6A. Let anyone ask on your website
- Go to Design > Widgets. In the zone where the chat button should live, such as Footer, click Add Widget and choose Artificial Intelligence Chat.
- Choose The layer that decides where it shows:
- Help center, made by the Knowledge Base recipe, shows it on
/helpand on every article; - a layer whose rule is a Boolean condition set to true, often named Always, shows it on every page.
- Help center, made by the Knowledge Base recipe, shows it on
- Choose the Profile Help center assistant and publish the widget.
- Go to Access Control > Roles and edit Anonymous. Tick only Query AI profile - Help center assistant and save. Never tick Query any AI profile: it would open every profile of the site to visitors.
- To let signed-in readers use it too, give the same permission to Authenticated.
Check it as a visitor: open /help in a private browser window, where you are signed out. The round chat button shows in the corner; ask a question and check the sources under the answer.
More about the widget, what visitors see, and how a public assistant is protected (limits on messages, blocked prompt tricks) is in Chat widgets.
6B. Let staff ask in the admin
Staff can chat with the profile without a widget:
- Open Artificial Intelligence > Profiles, then New chat in the profile's Actions menu.
- Or tick Show on admin menu on the profile, so it shows by its name under Artificial Intelligence.
Give the staff roles Query AI profile - Help center assistant under Access Control > Roles. See Chat with an AI assistant. The admin chat answers from the same knowledge base, so staff get the articles for everyone too.
Keep it up to date
- Publishing, changing or deleting an article updates the content index, and the data source updates the knowledge base soon after. Restricting an article removes it from the knowledge base.
- Rebuilding the content index under Search > Indexes syncs the data source again.
- Sync index in the data source's Actions menu rebuilds it by hand.
- Every night the site also repairs any difference between the two indexes.
When it doesn't work
| What you see | What to check |
|---|---|
| The assistant says it can't find an answer that is in an article | The article is published and has no role picked. Run Sync index on the data source (step 4) and ask again. If the question is worded quite differently from the article, try Strictness 2. |
| No answer ever has sources | Store Source Data is ticked on the content index (step 2); after ticking it, Rebuild the content index. The Embedding deployment of the knowledge base index works: an embedding error is in the site's logs. |
| Visitors don't see the chat button | Anonymous has Query AI profile - profile name (step 6A), and the widget's layer is active on that page. |
| Visitors get an error or "access denied" when they chat | The same permission, on the role of the visitor. |
| Sources have no links | The data source's Key field must stay the content item id. |
| An article for staff appears in answers | It has no role picked. Pick the staff roles in Which roles can see this content and publish it; it leaves the knowledge base at the next sync. |