Knowledge base AI (experimental)
Chatlayer's AI knowledge base tool allows your bot to generate concise answers after scraping your content. Build an FAQ flow to your bot was never easier!
How is the Chatlayer knowledge base AI working? First, you add the content that your bot will scrape to retrieve the answer to the customer's question. The AI engine behind it will generate an answer based on this content. Second, you design a flow to display that answer.
A bot that uses knowledge base AI browses content to retrieve an answer and displays it in a conversational flow .
Learn how to set up your own knowledge base AI in the steps below 👇
A knowledge base is a store of information or data that is available to draw on. It can be constituted of different pieces of content (e.g. URLs, files).
In this section, you'll learn how to select then add content to create your knowledge base.
In order to get the best possible results from your knowledge base AI, it's important to keep a few guidelines in mind when selecting content:
- Only include data that is relevant to the questions from users. If you have a PDF with 100 pages, of which only 1 is relevant for customers, extract that page, and upload it separately.
- In PDFs and URLs, complicated layouts might decrease the quality of the results
- The knowledge base AI isn't good at understanding data from a table. Don't use knowledge base to upload database files.
- Currently, knowledge base AI isn't able to process any images, video's or other media types
- If the URL has scraping protection activated, such as Incapsula, the webpage won't be able to be added to your knowledge base AI
Now, you know better what content your bot would scrape. Let's see how to add it to your bot.
First of all, your bot needs to access your content. To do this, you need to add content to your bot which will constitute your knowledge base.
To add content to your bot:
- 1.Navigate to the
Knowledge basesection inside of your bot.
The Knowledge Base section of your bot.
- 2.Click the
Add contentbutton at the top right corner of the screen. A window pops up from where you can add your content.
Add content to your knowledge base.
There are 2 types of content you can add for your bot to scrape:
- Documents, uploaded from your computer. These can be:
- CSV files: (support coming soon).
- PDF files: (e.g. product descriptions, FAQ documents, training documentation, ...).
- URLs from publicly available websites. There are two options when you add URLs:
- Only this page: only use the exact page that the URL links to.
- Entire domain: use the page the URL links to and all linked pages.
- 4.Once it's done, the content will show up in the
Contentstable. This table shows the name of your content, its type, its status, when it was added and when it was last synced. A status can be a green check mark for active, or a red cross when something went wrong.
- 5.Repeat this until you've added all the content that you would like your bot to know.
- 6.If you click on the three dots at the end of the row, you can:
- Open your URL in a new tab (or preview your document if the content fits this type) .
Syncyour URL (i.e. update it with the latest changes).
- Delete your content.
Now, your knowledge base displays your content and is ready to be used inside conversations. Let's see how to build a flow that displays the answer.
Once your bot has access to all relevant content, it's time to build a flow where your bot will know when to browse this knowledge base to provide an answer to your customer's question.
Since Chatlayer's knowledge base is using AI to generate an answer based on the content, making a knowledge base flow will happen in 2 steps:
To generate an answer from the knowledge base:
Many customers will preferably have their knowledge base flow happening after the bot did not understand what was asked, as a fallback option. To do this, go to your
Not Understooddialog, change its dialog type to
Action, and continue by following the steps below.
- 2.Click on
Add a Knowledge base action dialog to generate an answer.
- 3.Fill in the fields accordingly. You can configure:
No results:if the question that the user asks cannot be answered by the knowledge base AI, a bot dialog will be triggered. You can select which bot dialog in this dropdown.
Failure: if there is a problem with the knowledge base AI, and it returns an error, you can select a bot dialog which the user will be led to. By default, users will be routed to the Error Occurred bot dialog.
- 3.Save your changes
You bot can now scrape the knowledge base and generate an answer based on it. But it cannot yet display that answer. Let's see how to change that.
To display the AI-generated answer from the knowledge base:
- 1.Open the Action dialog that you've just created.
- 2.At the bottom of the dialog, add a Go To that goes to a bot dialog that you can create from within the dropdown. In this example, we will call this dialog "KB result".
Add dialog that displays the generated answer.
- 4.Save your changes.
- 5.Open the newly created "KB result" dialog
- 6.Add a text message that contains the variable you chose to save the knowledge base AI answer into. By default, this is
- 4.Save your changes.
All done! Your knowledge base AI bot is now ready to be used 👏
When your bot retrieves an answer from your knowledge base, this answer exists within a variable that also contains a link to the source of this answer. This source is either a PDF name or link to an URL. In the case of an URL source, this URL link can typically be used as a button within the bot conversation.
Example of a knowledge base source URL used within a conversation as a button.
To find your knowledge base session data:
Test your botby asking something for which the bot can retrieve a result.
- 4.In the
Test your botwindow, click on the
- 5.Scroll down the
Debuggertab until you find the session data called
Find the knowledge base session data inside your Debugger tab.
knowledgebaseobject contains a few fields:
answer: the answer that can be used in a text message in your bot
retrieved: an array of all the content that was used to formulate the answer. For each array item, the following data is stored:
type: type of the source: "URL" or "DOC"
name: filename of the document or link of the URL
content: snippet of the content that was used to generate the answer
You can use the URL of a knowledge base answer in a button, so that the user can learn more about a specific answer.
To use the knowledge base URL within an answer:
- 1.Create your text message.
- 2.Add a button that displays the following variable:
knowledgebase.retrieved.name. In this variable,
namemeans that we're capturing the URL,
means that we're doing this for the first item of the
retrievedarray. Your bot message should look similar to this one:
Use the knowledge base content URL within a button
Your final result should be similar to this:
Example of a knowledge base source URL used as a button.
Bots can become really powerful if you use a mix of intents (answers designed by your team) and knowledge base (AI-driven answers). In this sense, your bot will be hybrid because it uses answers generated both by humans and machine.
- If you connect your
Knowledge base AIAction dialog to your
Not Understooddialog and add no other content to your bot, all questions from users will be answered directly by your knowledge base AI.
- If you have other intents in your bot, the intents will be triggered whenever there is a match with the expression from a user. Only when something is said by the user that isn't a match with any intent, the
Not Understooddialog and thus knowledge base AI will be triggered.