Learning from the user on the fly?


Can RASA learn on the fly?


User: “What does an apple taste like?”
Bot: “I don’t know. Can you tell me?”
User: “Sweet and crunchy”
Bot: “Thanks”

User: “What does an apple taste like?”
Bot: “Sweet and crunchy” <<< bot knows the answer now

Can RASA can do this sort of thing automatically?

(One solution involves a database of Q&A pairs but I’m wondering if RASA can handle it)


Have you tried online training? https://rasa.com/docs/core/master/interactive_learning/

Thank You @akelad

So if I’ve understood it correctly, RASA supports on-the-fly corrections and that is only available to bot admins.

However RASA does not support learning during conversation with regular users. (in this case learning things it didn’t know at all before)

Is this correct?

Indeed, that is interactive learning to correct the bot, but I guess in your case I would use a graph database to create relations and use them as slots in the conversation. Having long term memory for a model is quite challenging

You can continuously update your actions for a particular intent in your domain file based on new learnings from the user and retrain your bot

Thank you :slight_smile:

I’ve heard of the concept of graph databases, but I’m not familiar with them in practice. Any particular one you recommend for use with RASA? Do you have a sense of how you would organise that information? Perhaps: intent → entity → answer e.g. what_taste → apply → sweet and crunchy


1 Like

I would say Neo4J ( though that’s the only one I know).

You can do so at two steps First your story will look like

Q: What does apple taste like? (Intent: taste, Entity: Apple)

B: I don’t know, you tell me (Action: Find_out )

Q: It is sweet and crunchy (Intent: inform, Entity: Sweet/Crunchy (use CRF to capture the different tastes(definitive, which is quite tricky so probably give quick replies to user - I’ll come to recommendations later))

B: Interesting, I’ll make note of that. give me some moments ( Action: Update_Domain - here change your domain.yml file , print this conversation as a story similar to interactive learning and maybe start training again asynchronously)

Add follow up action -

Create relation

Entity(apple)->relations(taste) -> characteristics (sweet and crunchy)

Now, cool things from GraphDB, you have Cypher query that allows you to create recommendations like

If Fruits -:watermelon:-> sweet then :apple: → sweet ( which could be your quick reply for him to ask)

Keep in mind that the characteristics should be definitive , apple can’t be dirty because it doesn’t relate to taste, so your characteristics in terms of taste should be categorical , you can even go far as updating your categorical list if the user tells you this is important.

it ain’t perfect but graph databases has a lot of cool features to derive relationships and creating a memory for the bot as long as you are updating the actions and you continue to add relevant information in the graph.


Thanks Souvik - I really appreciate your detailed reply. I will give it a go :slight_smile:

I’m also searching for this feature in Rasa can you tell me detail about how to develop a chatbot with ability to learn from user and the concept of Graph database. @souvikg10 @mattgoss33

@souvikg10 After updating domain and stories , how to do asynchronous training?

AWS Sagemaker perhaps?

for open source you can try MLFlow as well