Can aws-lex be used to build a conversation flow bot?
Asked Answered
S

1

6

Can aws-lex be used to build a conversation flow bot?

For example:

enter image description here

Is there a way to do something like this in aws-lex or not?

I tried using slots/prompts/lambda but I am not able to go to 2nd or 3rd level depth in diagram. can be done somehow?

Thank you very much!


Reason for all this: So we have our own "dialogue builder" and "bot-service". Our own "Dialogue Builder": is maybe similar to Amazon Connect dialogue builder, and our own "Bot-service" is similar to Microsoft bot framework. Before we were using microsoft-luis to get "intention" of a sentence while using our own dialogue builder and our own bot-service to build a conversation/dialogues flow like if a user says "yes" then go to another flow and if a user says "no" then go to different flow (can this be done in slots?) === Binary tree :)

So now we are switching from luis to aws-lex and trying to think if it is possible to just use aws-lex UI and not our (dialogue builder/bot-service) anymore. But what I am understanding is that to use aws-lex without some kind of dialogue builder we would need to write alot of if/case statements if it contains large data, right? what is your suggestion? One way would be to just use "Amazon Connect" to utilize their dialogue builder so we don't have to write alot of if statements but then if we are using dialogue builder we can just use our own (old one) dialogue builder? what do you think?

Splenetic answered 18/6, 2019 at 21:51 Comment(1)
So my main question is how would I do that using lambda b/c lambda is being used before responses?Splenetic
P
4

This is exactly what Amazon Lex was built for!

Managing the flow of information (or session context) is handled by a persistent session property in Lex called sessionAttributes. You can think of the sessionAttributes as a set of flags, where user input/conversation flows can alter these values and be used to alter dialogue paths. You can read more about the nuts and bolts of sessionAttributes in the official docs.

This blog post demonstrates how to use sessionAttributes to carry context from message to message throughout a user's session in a taxi booking example.


Additionally, since you mentioned having a pathway that results in a call, you may be interested in combining Lex with Amazon Connect, an easy to configure cloud contact center that enables configuring flows through the GUI. Depending on how your app is architected, it is possible persist the sessionAttributes to personalize the call experience for the user, to avoid them having to re-enter information they've already entered in your Lex bot.

Great tutorial on the Amazon Lex + Amazon Connect integration available here.

Painterly answered 19/6, 2019 at 16:56 Comment(9)
@MuhammadUsman Anytime! If this answered your question, upvoting and resolving the response will help with visibility for others that are wondering the same thing :)Painterly
So Amazon connect (aws.amazon.com/blogs/aws/…) has a dialogue builder? so if we are trying to build conversation flow so is it better to use some kind of UI like (amazon connect) instead of only using aws-lex and writing (thousand of "if conditions")?Splenetic
For the diagram you mentioned above, you should be able to accomplish conversational flow with a handful of case/if statements using sessionAttributes for lostPassword and remembersEmail flags, but that can definitely get a bit scarier if you start to have a large number of properties. You can architect your lambdas in such a way where downstream lambdas will only be called by certain upstream lambdas to cut down on the conditional complexity and case switching within any one lambda here.Painterly
ok thank you very much! So would sessionAttributes be used in "DialogCodeHook" not in "FulfillmentCodeHook" right?Splenetic
Few questions to understand if I understand everything correctly (to make above diagram in aws-lex): 1) would "do you remember your password" be a "slot" or "confirmation prompt" in the "Editor" of aws-lex? Thank you very much!Splenetic
and after "forgot my password", would "yes" and "no" be slot? The reason is: B/c once we use lambda function so it would return the response and lambda functions only work before response. (two places where lambda function can be used: "DialogCodeHook" and "FulfillmentCodeHook") and 'response' section comes after those two. Order: : (utterances => Slots/validation-lambda [aka DialogCodeHook] => Confirmation prompt => Fulfillment-Lambda [aka FulfillmentCodeHook] => Response) Am I understanding everything correctly? Thank you so much!Splenetic
Reason for all this: So we have our own "dialogue builder" and "bot-service". Our own "Dialogue Builder": is maybe similar to Amazon Connect dialogue builder, and our own "Bot-service" is similar to Microsoft bot framework. Before we were using microsoft-luis to get "intention" of a sentence while using our own dialogue builder and our own bot-service to build a conversation/dialogues flow like if a user says "yes" then go to another flow and if a user says "no" then go to different flow (can this be done in slots?) === Binary tree :)Splenetic
So now we are switching from luis to aws-lex and trying to think if it is possible to just use aws-lex UI and not our (dialogue builder/bot-service) anymore. But what I am understanding is that to use aws-lex without some kind of dialogue builder we would need to write alot of if/case statements if it contains large data, right? what is your suggestion? One way would be to just use "Amazon Connect" to utilize their dialogue builder so we don't have to write alot of if statements but then if we are using dialogue builder we can just use our own (old one) dialogue builder? what do you think?Splenetic
So my main question is how would I do that using lambda b/c lambda is being used before responses?Splenetic

© 2022 - 2024 — McMap. All rights reserved.