Handling multiple accounts queries in RASA

Hey team…

I am working on RASA and i have to configure multiple accounts in the chatbot (approx. 50 accounts)

The chatbot should reply to only those query of any user to whichever account he/she belongs to.

If a user of any account enters the query which is configured for some another account, the chatbot should restrict that and should give some reply like - “you are not authorised to view that link”.

Kindly assist on this.

Thanks!

Hi @gaurvitbhatia. Did you mean you want a dedicated one-to-one query between bot/user ( all the information will be stored in one database and fetch and show to the user?), same with other 49 accounts?

Can you correct me or share some example between bot/user?

Hey @nik202 , for example there are 2 accounts A and B. There are 5 queries configured in chatbot for account A and 10 queries configured for account B.

Suppose chatbot asks me please enter you account. I reply - My account is A. So I should be able to get the response from the chatbot for only those 5 queries only which are configured for account A.

If I write some query which is configured for account B, then it should restrict me to see the actual response of that query.

Using a database or not, I am not sure. Can you please help?

@gaurvitbhatia Well, Gaurav you use case is really complex, and honestly if you want to extend with more then this, it will be a really headache for you. But, still if you want some go though process on this, I can suggest you some.

Firstly, you need to create 2 different databases (schema) that can be MySQL or Postgres as per your requirement. Secondly, you need to write two separate custom action for retrieving the queries i.e 5 queries for A and 10 queries for B, Finally, you again need to write some python code whilst using Form Validation to validate the A and B database for fetching the data, whilst making the username or or password, then it only allow to communicate with the databases either A or B.

You need to me more vigilant whilst creating the nlu.yml files in your case accounta.yml or accountb.yml if you are doing manually. Incase of database the approach will be different.

I’d recommend first, try use a manual approach, if is successfully then migrate to SQL database, I hope it make sense to you?

Note: This is my own proposed suggestion, and personally I not implemented; I am only suggesting and guiding you this solution!

Another (easier but heavier) solution is to load different models according to the user. You can do it in two ways:

  • You can create a Multi-Project Importer
  • You can have two different projects and, in your frontend logic, connect to the correct one according to the username for example

Hi @ChrisRahme thanks for your answer…do I need to implement both the steps you mentioned?

@nik202 Hello Nik, thanks for your answer…this seems to be quite complicated …will try to implement the way you told.

Nope, those are two options