Customize response for each user in Rasa

Hello,

I’m trying to use Rasa for my hobby project and I’ve some basic queries.

Let us say the bot is being used by 100 users. Can I use Rasa to send a custom responses to each user? I know how to customize responses in terms of NLU, but my question is handling the flow. For example if John sends 'Hi' to the bot, it should respond with 'Hi John', for Ram it should be 'Hi Ram'. I expect conversation with each user to be personalized.

One way I could think of is I will detect user inside **Custom Actions** by **sender_id** and respond accordingly through a function. But this approach will direct every conversation through custom actions rendering intents wasted as all logic resides in Custom Actions.

  1. Is Rasa only meant for those bots that give same response to every user irrespective of user?
  2. If someone designed a bot that gives personalized responses, could you please throw some light on how to approach this?

Thanks

Yes, Rasa is designed with this type of natural conversation in mind. In your example, you would save the users name in a slot which can be used in responses throughout the conversation. There’s a blog post on forms which also discuss this and the Rasa Masterclass videos.

1 Like

Hi Stephens,

Thanks for the response!

Yes, as you pointed out, I could get user name through a slot and greet the user by name. I feel slot-filling serves the purpose to some extent. Going beyond the slots, if I wanted to make responses personalized to each user based on historical conversations, how can I achieve this in Rasa?

Let’s say one user wants to chat about Biology(which is her/his interest) and other user want to chat about physics.

So when Physics user pings the bot, bot should dig up historical conversations of this user and respond accordingly(not through slot filling). Same should happen when when Biology user pings.

As far as I know, sender_id is the only way to detect which user pinged. So, based on sender_id, I should respond to user. This is where I'm not sure how the flow should work.

Since multiple users will be chatting with the bot anytime, I need to check 'sender_id' for every message to personalize the response to each user, is my assumption correct? Is there a better way to do this, where I'll know the user identity only once at the beginning of conversation and bot responds through personalized messages for rest of the conversation, without checking 'sender_id' for very message?

Thanks

Yes, the sender_id would typically be used for this along with a data store to persist user information.