If you want to build an AI voice assistant app,
stick around.
I'll show you the services that you need
to get your app off the ground.
Gaurav is a software architect from Pennsylvania, USA.
When he's not spending time with his daughter,
he's thinking about building a chat bot
to help people better understand their medical expenses.
I know I personally could use something like this.
Let's hear from Gaurav.
So the problem I'm trying to solve is,
the insurance/health insurance plans in the US is pretty convoluted
a lot of the time the insured has to go to the customer care executives,
or work forum to understand their plan benefits.
How much they'll end up paying for a given...
therapy, or a test, or a visit.
So the system that I'm trying to develop
will be able to tell on its own,
or interact with the insured on its own,
and answer their questions.
In the initial phases, it could be basic questions that it could answer.
Whether a provider is within the network reach or not.
And later on, as it develops,
it should be able to tell more and more.
Or, answer more and more questions of the insured.
Now, the main focus of this video,
is going to be on showing you
the services that you need to build an AI Voice Assistant.
You're building an AI assistant for healthcare,
and your app is for the US market,
then make sure you check out my video
on HIPAA, which I've linked to below.
I break down what HIPAA means for building your app in AWS.
Let's dive in.
In Gaurav's case,
he's going to have to search through all the patient's medical records,
as well as insurance information
in order to answer a user's question.
He'll store the medical records and insurance documents in Amazon S3.
S3 is your go to service,
for scalable object storage in the cloud.
Once the data is in S3,
an AWS Lambda function will be triggered
to call the Amazon Comprehend Medical API.
Lambda allows you to run code without having to manage servers.
Lambda functions can be triggered based on events.
So in this case, putting data into S3,
triggers the Lambda function to run.
Comprehend Medical is a service that uses machine learning
to extract health data from medical text.
Don't worry.
You don't need machine learning expertise to use the service.
If you need to extract data from documents or text, but not from medical documents.
Then you can use Amazon Comprehend.
When the Lambda function calls the Comprehend Medical API,
it will return JSON with information that's in the document.
This JSON will be stored in Amazon DynamoDB.
DynamoDB is a fast and scalable NoSQL database.
If you don't have any files like PDF files to parse,
then you can skip the S3 step.
You would just call the Comprehend API
and pass in your string of text to be processed.
Then, you would store the results in DynamoDB.
All the data that is related to the user like,
like, date of birth address and a medical history,
will be stored at Amazon Aurora.
Aurora is a MySQL and Postgres compatible, relational database
built for the cloud.
Now that you have your data stored,
it's time to build the Voice Assistant.
Since Gaurav wants to allow his users to call in to talk to the AI Bot,
he will use Amazon Lex with Amazon Connect.
Lex, enables you to build conversational chat bots.
Connect, is an easy to use cloud contact center,
that you can set up in minutes.
You can bring your own phone number,
or get a toll-free number through Amazon Connect.
You can associate your Amazon Connect instance
to a Lex bot in the Amazon Connect API.
Amazon Connect will translate verbal request to text,
so they can be processed by Lex.
When a user calls in,
Lex will use Lambda to look up the users account
based on their phone number in Aurora.
Once the account is found,
the user will be prompted to verify his or her health plan subscriber number
and a zip code.
After the users identity is verified,
the user will start to engage with the Voice Assistant.
If you don't need your users to call in to talk to a Voice Assistant,
then you can omit Connect from your architecture
and just create a text-only chat bot using Lex.
The best way to think about creating a chat bot with Lex,
is you want to define
as many scenarios of what a user could say
and match them to what a user would want to happen.
These scenarios are referred to as 'utterances'.
And the objectives that a user might be trying to accomplish
are called 'intents'.
In the documentation.
The keywords of an utterance are referred to as slots.
Let's say someone asked,
"Does my insurance cover acupuncture?"
The intent is that someone wants to know
if certain procedure is covered by their insurance.
The utterance would be, "Does my insurance cover?"
The slot would be the procedure.
Lex will use Lambda to query data,
and DynamoDB to fetch information about their insurance coverage.
Without them having to wait on pins and needles.
Now, there will probably be cases,
when the user is going to ask a question like,
Did I pick the right health insurance plan?
The response from Lex will return a confidence score
for the intent.
Alternative intents.
And a confidence score for each alternative intent.
This is useful in scenarios where the intent
with the highest confidence score is not far off from the alternative intent.
Instead of your AI Bots returning a snarky comment like,
How would I know? I'm just a bot.
You can use your domain knowledge
to select the right intent to return from the list of alternative intents.
If you're starting the conversation with your users from a Lex bot,
you could design your bot in a way that if the user
is unable to get their question answered in two attempts,
then connect the person to an agent.
In this scenario,
Lex would trigger a Lambda function
to invoke the Connect API to call an agent.
My guess,
is that you're going to want to analyze the conversation history.
You can stream the chat bot conversation log
to a feature of Amazon CloudWatch called,
CloudWatch Logs.
CloudWatch is a monitoring service for AWS Cloud resources
and the applications you've run on AWS.
You can use a sub feature of CloudWatch Logs called,
CloudWatch Logs Insights,
to interactively search and analyze your log data in CloudWatch Logs.
Once the chat history is in CloudWatch Logs,
You can run queries in CloudWatch Logs Insights,
and build dashboards.
Using Gaurav's app as an example.
He could create a chart of the top utilized intents.
And a rank ordered list of the users, that talk to the bot most frequently.
If you have agents talking to your users over the phone,
then you can have Connect store the call recording in S3.
Then a Lambda function would create an Amazon Transcribe Call Analytics job,
to transcribe and analyze the call.
Transcribe Helps you automatically convert speech-to-text.
Transcribe Call Analytics,
is a feature of Transcribe,
that makes it easier to understand calls with your customers.
I know I covered a lot.
So it's time for a recap.
Use Amazon Comprehend Medical,
to extract key entities from medical documents,
or Amazon Comprehend for non-medical use cases.
Need agents to talk to your customers?
Use Amazon Connect.
Build an AI chat bot with Amazon Lex.
Store the chat bot history in Amazon DynamoDB.
Store user information in Amazon Aurora.
Analyze conversations with the chat bots in Amazon CloudWatch.
Analyze calls with Amazon Transcribe Call Analytics.
An apple a day keeps the doctor away.
That's what you need to build an AI Bot,
without needing to know the AI.
Make sure you check out the links at the bottom of this video
to help you get started.
It doesn't matter when you start, as long as you just get started.
Thanks for hanging out with me.
See you soon.