Context management in wit
Hi, I have a question for the topic in object, there is a manner to manages the context? For Example:
User: there is a parking? Wit.ai: "entities"{Parking} BOT: Yes, of course, in front of us.
User: How much does it cost? Wit.Ai: "entities"{NULL} BOT: ####### (The Bot in this case without a context he can not know that the user is talking about the parking)
How can I hook the first question with the second? I must implement it in my application or there is something that i could use in wit.ai. There is something in the roadmap?
TIA Cristian
Same question.
hey team, currently, I'd suggest you store it on your app's end. The reasoning is:
- Context can extend far beyond the conversation
- For example:
- you may fetch information about the user from the database (their previous preferences, information they entered online, etc)
- We found storing context on Wit can lead to some brittle situations, where you end up needing to move more and more logic onto Wit, and that becomes cumbersome to functionality down the road
- For example:
We are still thinking about better approaches however, and may introduce better ways to manage context with Wit down the road.
In the meantime, if you come across a problem managing context on your end, feel free to ping us and we'd be happy to weigh in.
Another workaround you may want to try is to send back both the user request and the previous one and train your wit app to handle them. In this case: "How much does it cost?" may not returned anything but "there is a parking? How much does it cost?" will return something
What is a good way to implement context management like a good data structure if any?
Please any help would be appreciated. Facing a blocker in the current chatbot project.
Hi @rajathgunners, the above ideas are generally what we recommend for context management. what are you trying to accomplish?
A flight service bot mainly to check on lost luggage, reservation details and flight details. I plan on using a decision graph. Are graphs commonly used to store the flow of the conversation?
This may be something worth posting on our Facebook group to see what other developers are doing, as we aren't always aware of how developers are doing things like context management.
When you say you plan to use a decision graph, do you mean:
- bot receives a message, and based on the intent, moves down one branch and keeps track of this new state
- bot receives another message, based on the intent, either goes down one branch based on the past state, or "resets" and goes back to the top
Seems feasible to me, though I don't know how commonly it is used.
Thank you
Please add a recipe to manage the context. Right now I am not sure how to create a dialog flow that remembers the state. :(
Besides managing the dialog flow by your own coding, Microsoft Bot Framework is probably the sole setup where a context object is defined facilitating a stack to manage each and every "dialog" you have in your dialog flow. Pls refer to Bot Framework web pages for details.
So in principle you can keep relevant context/state info in each dialog instance. For example I plan to use a dictionary data structure to store all context variables of an interaction, which will be very "scenario based" then. But that's the most common design I can imagine so far.
The NLU I use is api.ai. Unlike the wit strategy revealed here, you can specify output/input context variables to link related intents. A simple construct but can sort of offer context in chaining intents.
Context variables in Bot Framework code plus the input/output context at the NLU intent level is the solution I plan to write intelligent bots so far.
Hope it helps.
wouldn't it help the engine if we could just add a context string to an intent, so if the context is set to X you will search only for intents with that context? It would help the engine focus on relevant intents and maybe increase the probability of understanding the utterance?
Hi everyone, we've recently launched the alpha release of Composer, a way to manage dialogue state and support multi-turn conversations. Check it out!