Using external events for better NLU

Hi, everyone!

We are trying to run Rasa in production. We often get situation when external events may improove our conversation.

For example we have several types of cards - debit or credit:

Client asked: I forget my PIN code. NLU understand intent “PIN change”

Rasa trying to figure out: What type of card do you mean?

If I can recive and add to training dataset information about existing clients cards I can build three types of dialogs.

Client has only credit card.

Client asked: I forget my PIN code. NLU understand intent “PIN change from credit card”

Rasa respond: I send youe new PIN via SMS. Can I help you with something else?

Client has only debit card.

Client asked: I forget my PIN code. NLU understand intent “PIN change from debit card”

Rasa respond: I send youe new PIN via SMS. Can I help you with something else?

Client has credit and debit card.

Client asked: I forget my PIN code. NLU understand intent “PIN change”

Rasa trying to figure out: What type of card do you mean?

Client asked: Credit

Rasa respond: I send youe new PIN via SMS. Can I help you with something else?

How I can implement somthing like that with Rasa?

Welcome Sultanov,

You would typically have slots that are set with information including the user profile. In some use cases, the user has logged into a UI already and this information is known by the UI and can then be passed as metadata via your channel. For example, you could capture the session_start event in your action code. Your action would read the metadata passed by your front end and set slots (such as the cards that the user has).

This card info could also be set via a custom action in your action code. As long as the user connects with the same sender_id the Rasa bot will retain the slot information unless you specifically reset the slots.

Greg