Chatbot works by mapping out all the possible replies to visitor's chat message. When a new message comes in, it finds a list of possible replies and estimates how likely each of them is to answer to the visitor's message. If the likelihood (so called 'confidence level') is above a predetermined threshold (e.g. 90%), the chatbot replies automatically to the visitor.
The chatbot repeats this cycle and keeps the conversation going until the confidence level drops below the threshold. At that point, it apologises and either invites a customer service agent into the conversation or, if no agent is available, performs another action it's configured to do.Once the customer service agent has joined the conversation, the chatbot can act as an intelligent assistant providing recommended answers for the agent. A common alternative to inviting a service agent into a conversation is to ask for contact details and promise that someone will get back to the issue.
Note: there are many chatbots available out there and not all of them are capable of detecting their own failure. All chatbot providers we use rely on this method.