Knowledge Bases are sources of information you provide to your bot.
Knowledge Base
You can use a Knowledge Base to make your bot reference a specific source when answering a user. For example, you might want to:
  • Provide your bot with specialized information (like company policies, pricing charts, or troubleshooting steps)
  • Scope your bot’s responses to specific topics
  • Let your bot reference data from tables in its responses

Create a Knowledge Base

To create a Knowledge Base:
  1. Navigate to the Knowledge Base menu in the studio.
  2. Select New Knowledge Base.

Add sources

Once you’ve created a Knowledge Base, you can add sources to it: Your bot will reference these sources when searching for an answer to a user’s question.

Search a Knowledge Base

Your bot searches Knowledge Bases differently depending on whether it’s executing an Autonomous Node or a Standard Node:

Using an Autonomous Node

The default Autonomous Node in a bot’s Main Workflow contains a Search Knowledge Card that searches all Knowledge Bases by default. This means that a newly created AI agent is already equipped to search your Knowledge Bases. You can scope which Knowledge Bases the Autonomous Node searches using the Search Knowledge Card’s configuration menu:
  1. Open the drop-down menu under Included Knowledge Bases.
  2. Select whichever Knowledge Bases you want to include in searches.
Since your bot only references Knowledge Bases when they’re needed, they’re useful for de-cluttering your Autonomous Node’s prompt.

Using a Standard Node

Since Standard Nodes don’t use AI to generate responses, they don’t consult your Knowledge Bases by default. To make your bot search your Knowledge Bases within a Standard Node, you can use:
Both of these Cards require the Knowledge Agent to work properly—make sure it’s enabled.
By default, neither of these Cards send their response to the user directly—instead, you can access the response by referencing turn.KnowledgeAgent.answer, then send it to the user manually.

Handle no answer found

If your Workflow has an Autonomous Node, your bot will generate an appropriate response when it doesn’t find an answer in the Knowledge Base. However, you can also program a custom response:
  1. In your Autonomous Node, add a Transition Card.
  2. In the Card’s Condition field, paste the following:
{{!event.state.agentVariables.KnowledgeAgent.turn.answer}}
  1. Add the following to your Autonomous Node’s prompt:
Transition when no answer is found in the Knowledge Base.
Now, your bot will activate the Transition Card whenever it doesn’t find an answer in the Knowledge Base. You can handle the transition however you want—for example, with a Node that sends a custom error message.

Storage limit

Information you store in Knowledge Bases counts towards your Vector DB Storage, which depends on your Botpress plan/add-ons.

Troubleshooting

If your bot isn’t returning the expected results, you can try troubleshooting it in a few different ways:

Check logs

Your bot’s logs display:
  • The exact query that was sent to the Knowledge Base
  • The results (including source name, content preview, amount of tokens used by the content, row metadata if the source is a table) if there are any matches
Using that information, you can try refining what’s sent to the Knowledge Base (or the sources themselves).

Inspect responses

If you’re using an Autonomous Node to search Knowledge Bases, you can use the Inspect window to analyze your bot’s process when searching Knowledge Bases.