I have got some expirience with api.ai.(similar to watson conversation api) If you ask how it works, it uses machine learning to analise user intends and some key eneties, like shipping address, number of goods, type of good, (if we are talking about trade chat bot for example). After it analized conversation with user, it sends it's details on your rest service using json format. So using that your program can make some actions, for example form an order. Or whatever you need, and whatever your bot is about. You don't need to code machine learning by yourself, if your are using an api. I can make a bot, like this but i need more details about it.