Custom Action to act as Control Center of Chat-flow based on user-data and past interactions

Hi all,

I am building chatbot as part of a CRM solution offered by our company. In this chatbot, I need to control the chat flow based on the past interactions and other data we have collected from the user.

Currently I have written a custom action called action_chat_manager which is a set of if-else conditions that starts a particular rasa story based on the user data from the database. But the problem is that now I have to add action_chat_manager as the final action in every story in the chatbot, eg. greet_user_story goes like:

  • intent: greet_user
  • action: action_greet
  • action: action_chat_manager

Now, since there are 30+ stories that I have defined in my chatbot, I’m afraid this affects the packaging and scalability of the chatbot for multiple clients.

I hope that someone here can suggest an alternative to this method where I can define this custom action and do something so that the control comes back to this action after the execution of each story and its associated actions.

N.B.: I would’ve liked to share more code, but please understand this is proprietary code. I’ll be to discuss and explain further if there are further questions

Warm regards,
Vinay