Integrate ChatBot with KnowledgeBase

Image of an author
Sylwia Kocur
4 min read
updated: Oct 29, 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. Fill in the form with the following details:

    1. Webhook name: KnowledgeBase

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

    3. Verification token: knowledgebase-verification

    4. Headers: 

    • key: X-Forwarded-License
    • value: **your 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 (1) to the bot flow. Add an attribute (2) to collect the user’s question - choose the Any Entity (3) to collect the whole user response, and choose an attribute from the list, or add your custom attribute (4).

  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 (1). Enter your response about not having an answer and select Add filter (2) button above the message. Choose an option to Add a custom attribute (3).

Fill in the form:

  1. Attribute name: kb_search_results

  2. Condition: = equals

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