Maintaining context

Storing the context is a strategy used to keep track of what has been said before, and to be able to reuse it for the conversation. This becomes necessary when the response of the chatbot cannot be based only on the last message sent by the user but must draw information from some previous message.

To better understand the usefulness of context management, let's take an example:

  • User: My name is Giuseppe.
  • Chatbot: Okay Giuseppe.
  • User: What is my name?
  • Chatbot: You told me before calling you Giuseppe.

If the user has not yet declared his name, the chatbot's answer will have to be something like:

  • User: What is my name?
  • Chatbot: You still have not told me your name.

It is therefore easy to understand how to manage the context to formulate an answer. This is extremely important in order to give the chatbot a much less mechanical and more human appearance.

Having memory of previous messages is also useful for detecting when the user sends a message repeatedly, or it can prevent the same chatbot from sending the same message by checking the value of the last message before choosing the next one.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.55.42