How Does a ChatBot Work?
There are four main stages in a Chatbot:

- Interpretation: In this stage, the application analyzes the user’s input to determine the intention of the dialog. Once the intent is recognized, the Bot discovers all the entities from the dialog. For instance, in the above example, the purpose is identified as the greeting. There are no entities identified in this particular interaction.
- Dialog: Based on the purpose identified in the previous stage, the application decides on the type of response for the user. In the above picture, the Bot knows that the intent was to greet. Thus, the response drafted is, ‘Hello’ with the username variable.
- Data Retrieval: If the application requires any additional data to draft the final response, it either asks the user for further inputs or retrieves it from the relevant connected database. Once all the missing information is available, the Bot becomes ready to prepare the final reply for the user. As an exemplar, the above system fetches James.
- Response: Once all the necessary information is collected, the application prepares the final response and sends to the user.