I’m building a DialogFlow Agent with multiple intents, some has conflicting variables, and I’m struggling creating a clean conversational flow - specifically around the area of moving back and forth between intents.
For example, let’s say I support supplying information about weather and flights, to each I built a corresponding intent. Consider the following dialog:
- User: I want to book a flight for today.
- Agent: Where to?
- User: What’s the weather in Rome?
- Agent: In Rome it's 21°C.
- User: Rome it is, then.
At this point, I’d wish to flight intent to get recognized, and get “Rome" as a parameter, in addition to the previously saved parameter of “today”. However, I cannot tell if the system would identify a flight or a weather intent, as the sentence may apply to both - depending on the context.
I managed to get the desired behavior by defining a main and 2 context dependent parameter intents per each dialog subject (i.e. flight with flight as output context, flight-time with flight as input and output context, flight-destination with flight as input and output context, and same for weather), by setting a life-span of 1 for each context, and restoring it in code once the other intent is finialized - in order to keep the already filled slots, and also to support phrases such as “Rome” and understanding they are contextual. I also thought about dynamically alter intent priority, not sure yet if it’s possible.
That being said, it feels like this is something I should be getting out of the box, from the infrastructure. I’m referring to a stack-like intent prioritization, so that the last unfulfilled intent context would get the highest priority. Did any of you encounter such issues? Am I missing some key features that could help me achieve such behavior more naturally? Maybe a way to interfere with intent identification?