Skip to main content

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.

Working on an FAQ for a hotel chain

To start working with the FAQ:

  1. Create an FAQ in your project.
  2. Add some questions and answers to them.
  1. Connect the FAQ to the script.

Create an FAQ

  1. Go to the necessary project.

  2. Select Knowledge base on the control panel.

  3. If the knowledge base already contains modules, click Add module on the tab bar.

  4. 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.

  5. 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:

  1. Click Add alternative phrases under the question name.

  2. In the expanded view, you can enter any number of additional question phrases.

    Filling out 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.

tip
In our article on How to train intents, you can find out more about the pros and cons of phrases compared to patterns, and how to prepare a good set of phrases.

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 typeData formatLimitationsDescription
TextPlain text, HTMLNoYou can use HTML markup when the Text formatting option is active.
ImageJPG, PNG, GIF, SVG, WEBP, and othersNoYou can upload them from your local device or insert a link.
AudioWAV, MP3No
FileAnyUp to 50 MB
caution
Not all channels support messages with images or audio files. Make sure the channels connected to the bot support the desired format.

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 JAICP interface

You can connect the knowledge base from the JAICP interface:

  1. Go to the Knowledge Base and add any module.
  2. 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.
  3. 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.

Connect the FAQ from the interface

Using intentGroup!

You can connect the knowledge base using the global intentGroup! trigger tag:

  1. Go to the code editor.
  2. Open the main.sc main script file.
  3. Add a special KnowledgeBase state to the end of this file for accessing the bot knowledge base.
  4. Add the intentGroup! tag to the state. It declares a group of nested intents that allow the dialog to switch to the state.
  5. Add a $faq.pushReplies method call after the script 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();