Is it possible for a single bot to have different responses for different users


I am developing a chatbot, but have run into an road block. I am fairly new to Rasa, so if it a really simple solution, I apologize!

The issue I am facing is if the Rasa bot is able to answer questions differently based on how where the bot is being used.

This can be better explained using an example. If the chatbot is for a university, the university is broken down into different colleges. Each college may have its own website, but the questions that the bot answered are the same for each college. Lets say that the bot can help answer the question, “what building is the dean’s office located in?” Is it possible to have the bot know that it is answering this question for a certain college. Such as, if the bot is on the journalism college’s website, would it be able to tell that it is answering for the journalism college. Compared to the same question being asked on the Science and Arts college website.

My overall question here, is if more than a single bot is needed, since there are multiple colleges, or if there is a way to distinguish from where the bot is being talked to and changing the answers based on that.

If there is anything that is unclear, please let me know and I will try to clarify!

Thanks for any help,


1 Like

The answer is yes, you can do that, but there as usual different options and different variants thereof. Here is one of them:

  1. You can set a slot depending on website the chatbot is contacted from within ActionSessionStart.
  2. Either teach the bot to pick the right answer depending on the college, so you have answers like utter_deansoffice_journalism, utter_deansoffice_science, etc. Or you have custom actions like utter_deansoffice and the text is drawn from some database, depeding on the slot stored within the tracker

One other options is to set the slot about the college asking the user:

For example:

  1. User: “Where is the dean’s office?”
  2. Bot: “What college do you belong to?” + List of all the Option
  3. User chooses “Journalism”
  4. Bot: utter_deansoffice_journalism

And so on.

That makes sense. When you say that you can do ActionSessionStart, do you mean the a custom action can be created and then add the action to the front of all stories. Like how would I go about implementing that feature. I think that is more efficient than doing the various different utterances.

Thanks for the help!

ActionSessionStart is always performed by Rasa when a new chat starts. But you can overwrite the default variation with an own action server. This is actually quite well documented:

Oh got it. Thank you for your help!

That may be your best route to accomplish what you wanted.

Here’s my over-the-top experimental-overkill solution for you. I don’t expect you to do this, because @harloc’s solution is dead on, but I do offer this up as a thought experiment to maybe trigger something.

To take @harloc’s solution (different slot value for each college set by the webpage to the extreme) you could create different API connectors for each college, and that would enable you to change and/or augment all traffic coming into the rasa server with other data (ie a slot with the college key) You may want to enable different spellchecks for the School of Math and Science, or if you have a School of Health maybe with medical majors, you could spellcheck those terms because we all know they have their own world of vocabulary.

You also may want to train up a different Sentiment analysis model for each of those as well, because the IT majors will always be pissed off (I can say that because I was one) and you may need to normalize their responses :rofl:

Again, this is way over-the-top and probably not even a viable or sustainable solution, but knowing you have the option to control the data flow into Rasa as well as out of Rasa is super valuable.