6 Managing State Data
This chapter covers
- Understanding why and how the bot can maintain context
- Using in-memory data storage to maintain state about previous conversations
- Using an external data storage to store the context data more reliably
- Using state data to implement a recursive technique to collect missing information from user
In the last chapter, we learnt about dialog management and why we need it to manage and implement complex conversational flows. We employed Prompts to get the missing information from the user that might be needed to solve a user query. And we looked briefly at how to use in-memory data storage to remember the answer that the user gives and also to maintain context of the dialog state. As it turns out we will need to manage and remember the state of the conversation in many other scenarios, as well. Since this state data has the key information about the previous conversations, it is very useful in making our bot’s responses sound more natural and more contextual (more on this later in the chapter).