Integrate ChatBot with KnowledgeBase

Image of an author
Sylwia Kocur
4 min read
updated: Sep 4, 2024

KnowledgeBase is a customer support and effortless self-service software that helps you manage your customer education process. It encourages your customers’ self-service and helps your support teams decrease the total support time.ย 

By connecting ChatBot to KnowledgeBase, your customers can receive article suggestions during the chat with the bot.

The integration will return the top 3 articles, even though the search could yield more results.
The integration will return the top 3 articles, even though the search could yield more results.

The integration process has two parts:

  • creating a KnowledgeBase and ChatBot webhook

  • adding it to the bot flow to show possible articles in the chat

The suggested articles will be displayed as the Gallery bot response - each article will be displayed as a separate card.

You can also use the AI Knowledge module to enrich your AI bot knowledge pool. With this approach, the bot will provide answers from a trained KnowledgeBase article directly in the chat with the AI Assist block, but it will not suggest an article direct link. See our video tutorial to check how it works.
You can also use the AI Knowledge module to enrich your AI bot knowledge pool. With this approach, the bot will provide answers from a trained KnowledgeBase article directly in the chat with the AI Assist block, but it will not suggest an article direct link. See our video tutorial to check how it works.

How to create a webhook in ChatBotLink icon

You mustย create a webhook connection between ChatBot and KnowledgeBase products to suggest an article to your customers. You can do that directly in your bot.

  1. Go to your bot, open the Integrations panel, and choose the Webhook option from the list. Proceed with the Connect button.

  2. Proceed by clicking the Create new webhook button.

  3. Fill in the form with the following details:

    Webhook name: KnowledgeBase

    Webhook URL: https://api.knowledgebase.ai/api/chatbot/answers

    Verification token: knowledgebase-verification

    Headers:ย 

    • key: X-Forwarded-License
    • value: **your KnowledgeBase license ID

    **

To find your KnowledgeBase license number, go to “My Profile” in the left navigation of your account. When you click on the License ID element, your license number will be copied to the clipboard.
To find your KnowledgeBase license number, go to “My Profile” in the left navigation of your account. When you click on the License ID element, your license number will be copied to the clipboard.
  1. Add the integration. The new webhook will be displayed on the integrations list.

How to add the KnowledgeBase webhook to your bot flowLink icon

When the webhook is created and the integration is active, you must place it correctly in the bot flow. The bot will display the articles only when the block is triggered on the bot flow.

To start the searching process, you need to collect the user’s query. The best way to do it is with attributes.

  1. Add a User input block to the bot flow. Add an attribute to collect the user’s question - choose the Any Entity to collect the whole user response, and choose an attribute from the list, or add your custom Any attribute.

  2. Add the Webhook block right after the User input block. Click the Webhook block and choose KnowledgeBase webhook from the list.

You cannot change the article title or contents displayed in the integration, but you can pick the image with the card. To set the image,ย go to the Help Center section of the KnowledgeBase app and change the Preview image in the Appearance section.
You cannot change the article title or contents displayed in the integration, but you can pick the image with the card. To set the image,ย go to the Help Center section of the KnowledgeBase app and change the Preview image in the Appearance section.

What to do when no articles are foundLink icon

If the user’s query does not match any articles you have created in the KnowledgeBase, none will be returned to the bot. If you don’t cover such a case, the chat will be stuck.

To cover such cases, add a Bot response block after the Webhook’s Success block. Enter your response about not having an answer and select Add filter button above the message.
Choose an option to Add a custom attribute, and fill in the form:

Attribute name: kb_search_results

Condition: = equals

Value: 0

Apply the filter and close the block. The filter will be visible above your message.

Read more:

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

Weโ€™re happy to help.

Start a free ChatBot trial
and build your first chatbot today!

Free 14-day trial No credit card required

Discover our text| products