To discuss the functions and sources of information a chat bot would need to participate in an intelligent and “stateful” conversation.
The main functions:
1) If the input was a statement, determine if it is suitable for evaluation in a logic true/false sense, if so, evaluate it and produce response. Example, “All birds can fly” is false.
2) If the statement is one which the system would have no way to evaluate from a true/false perspective, (example “I have a headache”), then provide some useful, relevant information (example, “Have you tried taking a pain killer?”).
3) If input is a question, try to determine the answer from knowledge base.
4) If input is neither a question nor statement, try to determine if it is a response to a question that the system asked, example, if user entered “Bob” and we just had asked what is your name, then update the “state” to user’s name is Bob.
The sources of information a chat bot needs:
1) The latest your input
2) a knowledge base
3) a ‘state’ of the conversation, this could be broken down into:
state.context - would store what the topic of the conversation currently is. Perhaps when program first loaded into memory this would be set to “initial”
state.objective - maybe we are currently engaged in a debate with the user and we are trying to prove that we are correct about a particular point.
state.user.mood = a value to indicate whether the user is happy, angry, sad, etc
state.history - history of lines of text entered by user and output from chatbot.
** An important point here is that the chatbot must first consult state.history before responding. In the example above, “I have a headache”, the chatbot must not respond immediately suggesting pain medication if the conversation went as follows:
user : I just took some pain relievers.
chatbot : why ?
user : I have a headache
It would be silly if the chatbot responded with the pain medication suggestion at that point !! Thus any intelligent chat-bot *must* first exhaust all ‘state’ information before producing a response.
4) state of the ‘world’ - example, current time, weather conditions, time of year, etc.