Suggested replies with Rasa
Prerequisites
This guide assumes that you completed the Rasa Chat assistant guide, which means you have:
- a running Airy Core instance
- a Rasa setup connected to that instance with a custom channel (see the demo repository)
#
How it works
Chatbots can serve a wide variety of use cases like answering frequently asked questions or booking flows. Customer support however often requires a human agent to serve user questions with a high degree of quality. With Airy Core you can get the best of both worlds by using NLP frameworks like Rasa to suggest a set of replies to the agent. This way agents can handle the vast majority of use cases with the click of a button (see screenshot).
#
Configuring Rasa- Step 1: Add a custom response type
- Step 2: Update the user stories
- Step 3: Extend the Airy connector
- Step 4: Retrain and restart
#
Step 1: Add a custom response typeThe easiest way to instruct Rasa to suggest replies for user messages is by adding them as a custom response type. To do this we add the following block to the responses
section in our domain.yaml
:
#
Step 2: Update the user storiesNow we can use this new response type in our stories.yaml
to let the bot know when to suggest replies:
#
Step 3: Extend the Airy connectorNow we need to update our custom Rasa connector for Airy Core to this response type. For this we extend the send_response method in the Airy connector so that it calls the suggest replies API whenever it encounters a custom response payload:
#
Step 4: Retrain and restartNow we need to stop the server and retrain the model:
Finally, we start the Rasa server, open the Airy Inbox (at http://localhost
for local deployments), where we should
see the suggested replies whenever a contact greets us (see gif above).