Skip to content

Commit

Permalink
Merge pull request #254 from botpress/bassamtantawi-KB-NoAnswer
Browse files Browse the repository at this point in the history
Update knowledge-base.mdx when there is no answer
  • Loading branch information
ptrckbp authored Mar 21, 2024
2 parents 99e295d + dcf4d29 commit 5a4e1ec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pages/cloud/studio/knowledge-base.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ You can scope the Knowledge Base by folders to limit the search to specific fold

Learn more about [Scoping the Knowledge Base with Folders](./studio/explorer/knowledge-base/)

## Handle No Answer in KB

If no answer is found in the KB, you want to add a default message to handle that case. You can add a transition/expression card and add the following:
```javascript
!event.state.agentVariables.KnowledgeAgent.turn.answer
```
This will make the bot check if there is a value in the "answer" field; if not, then this transition/expression card will be fired.
Connect this card to a node with the message you want to show.


## Debugging

If your bot is not returning the expected results you can try debugging it in a few different ways:
Expand Down

0 comments on commit 5a4e1ec

Please sign in to comment.