FAQ modules
The FAQ is a database of questions which customers may frequently ask the bot. Using the FAQ, you can easily train the bot to answer them.
To start working with the FAQ:
Create an FAQ
-
Go to the necessary project.
-
Select Knowledge base on the control panel.
-
If the knowledge base already contains modules, click Add module on the tab bar.
-
Select one of the options to add a new module:
-
Blank FAQ template — the project will have an empty FAQ without any questions and answers.
-
From file — the FAQ will be generated from a spreadsheet you need to upload.
-
FAQ.<topic> — the FAQ will be created from a template which already contains questions on a certain topic.
-
-
Select Add module.
Add questions and answers
Click on the side panel to create a new question. Use the right side of the screen to fill out the question phrases and the answer to it, as well as disable the question if necessary.
Question phrases
After you have added the question, fill out its primary phrase in the Question field. You will be able to find the question by this phrase on the side panel.
In most cases a single phrase is not enough, because users can express the same meaning in many different ways. If a user’s request differs too much from this phrase, the bot may misunderstand the user or fail to understand them at all. To increase the quality of question recognition:
-
Click Add alternative phrases under the question name.
-
In the expanded view, you can enter any number of additional question phrases.
Instead of text phrases similar in meaning to the primary one, you can also use patterns — formal rules for matching requests against special templates. These rules may be useful when the number of regular text phrases is not high enough.
Click to switch to pattern input mode or to convert an existing text phrase into a pattern. Click to switch back to text input.
Answer to the question
In the Answer field, enter text or upload an image, audio file, or file. Your answer can include up to 20 messages with text and media of various formats. When responding to a user, the bot will send these messages in the order you arranged them.
Message type | Data format | Limitations | Description |
---|---|---|---|
Text | Plain text, HTML | No | You can use HTML markup when the Text formatting option is active. |
Image | JPG, PNG, GIF, SVG, WEBP, and others | No | You can upload them from your local device or insert a link. |
Audio | WAV, MP3 | No | |
File | Any | Up to 50 MB |
Group questions together
Click on the side panel to create a new group. Use groups to aggregate several questions sharing a common topic and structure your module better. Grouping doesn’t affect the way questions are actually recognized.
- Select multiple questions at once by clicking them with the left mouse button while holding down Ctrl or Shift (for individual or batch selection).
- Select one or several questions, then drag and drop them to a group or another question to group them all together.
- Open the question or group context menu using the right mouse button. In this menu, you can do things like deleting a question or renaming a group.
Connect the FAQ to the script
From Tovie Platform interface
You can connect the knowledge base from the Tovie Platform interface:
- Go to the Knowledge Base and add any module.
- If there is no state in the
main.sc
script file that accesses the knowledge base, you will see a message about this at the top of the screen. - Select Connect to add a special
KnowledgeBase
state to the script. This state allows the bot to send answers from the knowledge base to the user.
Using intentGroup!
You can connect the knowledge base using the global intentGroup!
trigger tag:
- Go to the code editor.
- Open the
main.sc
main script file. - Add a special
KnowledgeBase
state to the end of this file for accessing the bot knowledge base. - Add the
intentGroup!
tag to the state. It declares a group of nested intents that allow the dialog to switch to the state. - Add a
$faq.pushReplies
method call after thescript
tag so that the bot can use the answer retrieved from the knowledge base interface.
state: KnowledgeBase
intentGroup!: /KnowledgeBase
script: $faq.pushReplies();
If you want to specify different logic for processing answers to questions from different FAQs, create separate states for them in the script:
state: Education
intentGroup!: /KnowledgeBase/FAQ.Education
a: You seem to be interested in our educational courses. Here’s the answer to your question:
script: $faq.pushReplies();
state: EducationBilling
intent!: /KnowledgeBase/FAQ.Education/Root/How can I pay for the course?
script:
# The bot searches for a user in a database.
# If there is a debt, the bot generates an invoice.
a: Here’s a payment link: https://example.com
Using intentGroup
You can connect the knowledge base using the local intentGroup
trigger tag.
This is especially useful when the bot can switch from the context of one FAQ to another FAQ.
state: MobileAppMortgageManagement
intent!: /KnowledgeBase/FAQ.Mobile app/Root/Mortgage management
a: Through our app, you can make early repayments, view the payment schedule, and much more.
a: If you have other questions about our mortgage programs, I can answer them!
state: Mortgage
intentGroup: /KnowledgeBase/FAQ.Mortgage || fromState = "/MobileAppMortgageManagement"
a: You seem to be interested in our mortgage programs. Here’s the answer to your question:
script: $faq.pushReplies();