Create a custom graphs custom actions using matplotlib library and display it to user


I have created a prototype bot which can answer question asked by user in natural language and translate it to SQL fetch data from database and display it back to user. Now, based on the data i got from database I want to convert it into graphs (eg: Bar, pie, etc) and show graphs to user.

Can someone help how to do it ?

In a custom action, you could produce the graph as a png or jpg, push it somewhere that is accessible by your bot UI and then reference the image in the bot response.

Thanks for the reply. Is there a way to do it within rasa and to make graphs interactive like drilling down etc.

No, you’d need to look at python modules for the graph and pushing to S3 or another store.