0

I am trying to develop a chat-bot in google Dialog Flow where user deviates from the original conversation flow (CF) but ends up coming back to original somewhere in the middle.

bot responses are in bold For example: original CF: hi -> how may i help you -> i would like to go travelling -> OK, i would suggest Europe. would you be interested? -> yes -> alright here's the price

deviated CF: hi -> how may i help you -> i would like to go travelling -> OK, i would suggest Europe. would you be interested? -> maybe -> Europe has lot of beautiful destinations u can travel to. would you be interested -> yes -> alright here's the price

The only way i found to implement this is to make a new intent and develop its followups which is making this very redundant. I had to develop two separate intents fully. Is there any way i can make an intent just for the deviated CF and join it to the original intent?

keepAlive
  • 6,369
  • 5
  • 24
  • 39
Nihar
  • 15
  • 5

2 Answers2

1

One simple solution is to make many follow-up intents, but that is never ending process.
Here is another approach I want to suggest:

  • Make a list of important intents which you want to handle in case of deviation
  • When the intent is hit, save that to some DB (or cache), let's say unfinished_intent
  • In each request or every 2-3 requests check the value of unfinished_intent, if it contains some intent name, prompt for it
  • After your intent is fulfilled, delete the unfinished_intent

This is just an idea, how to implement is upto you.
I suggested this because it is generic and it will catch all the cases.

Hope it helps.

sid8491
  • 6,622
  • 6
  • 38
  • 64
1

Keep in mind that the user can change the direction of the conversation at any time. So using a long chain of followup intents is a bad idea. Even using a short chain is a bad idea. Followup intents should be limited to fairly narrow circumstances, and in most cases they're not wise nor necessary.

Instead, keep track of the information that you have about the user and the information that you still need as part of a context. If you are engaged in a side conversation, or have made a recommendation, keep track of that as well, since the user may ask questions about it. Build many top-level Intents that represent what the user is saying, not where you are in the conversation or how you plan to reply.

See also Thinking for Voice: Design Conversations, not Code based on this answer on StackOverflow.

Prisoner
  • 49,922
  • 7
  • 53
  • 105