Today I'm going to show you how to build an AI voice agent using N810 and retail AI to automate phone
calls for appointment booking, lead generation and customer support.
When a potential customer fills out a form on your website, they're already interested.
But if you don't reach out quickly, there's a high chance they'll go to your competition.
Studies show that responding within the first five minutes can increase conversion rates by over 400%.
Yet most businesses take hours or even days.
This AI voice agent ensures you never miss an opportunity.
It will instantly call new leads, confirm their interest, answer basic questions, and book appointments
directly in your calendar, all on autopilot.
And book appointments directly in your calendar, all on autopilot.
By the end of this tutorial, you'll have a fully functional AI voice agent that you can customize to
fit your needs.
So this is our simple automation which will trigger our voice agent.
This prompt guides our agent on what to say and how to behave.
All right, now let's do a quick demo.
Yes.
This is Sophia.
Am I speaking with Damien?
Hi.
Yes.
How can I help you?
Great.
I'm reaching out because you recently showed interest in our AI automation solutions.
Is now a good time for a quick chat?
Oh, yes.
That's fine.
Awesome.
At adaptive AI, we create AI agents and automation to help businesses work smarter, save time and
scale with ease.
Would you like me to schedule a discovery call with one of our AI automation specialists to discuss
how we can help optimize and scale your business.
Yes, please.
We can do that.
Great.
What date and time worked best for you?
Can we do Tuesday next week?
Sure.
What time?
On Tuesday?
Next week works best for you.
Uh, at 10 a.m., please.
Let me check if we have availability for next Tuesday at ten in the morning.
It looks like we don't have availability at 10 a.m. on Tuesday, but we do have nearby options.
We can schedule for Monday between 10 a.m. and 1 p.m. or 3 p.m. to 5 p.m. or Wednesday between 9 a.m.
and 11 a.m..
Do any of these work for you?
Can we do Monday at 12 p.m.?
Please?
Let me book your appointment for Monday at 12 p.m..
Your appointment has been successfully booked for Monday at 12 p.m..
Thank you for your time, Damien.
If you have any questions before then, feel free to reach out.
Have a great day.
Goodbye.
Yeah.
So as you can see, uh, the meeting has been successfully booked.
I strongly recommend changing your time zone so the times are correct for all tasks.
So click on these three dots.
Click on settings.
And select your time zone.
Save it.
So for the sake of this tutorial we'll be using a form submission, which is a dedicated node in an
attempt to generate web forms and pass the responses to the workflow.
But you can easily integrate Typeform, Jotform or any other forms builder.
So this HTTP request Note.
Trigger.
Our voice agent on retail AI platform.
Now, when I click Test Workflow, the submission form should pop up.
When a prospect fills out a form on your website.
Your AI agent will immediately call them, gather their details, and schedule a meeting without you
lifting a finger.
Right, guys?
Now let's create this setup from scratch.
So first we need to add our submission form.
So let's search for form.
Choose the first one.
Now we need to create our form and all the fields.
So give it a name.
Description.
Please tell us more.
About yourself.
self.
The first bit be.
What's your name?
As a placeholder.
Give it some random first name.
As you can change it to the first name.
The next field.
What's your email address?
Obviously we need a phone number.
So what's your.
Phone number?
And what services?
Are you most interested in?
Now when you click Test Step.
The submission form will pop up.
So just simply fill out the form and click submit.
Now that we have data in our flow, we can create the next node which is HTTP request node to send all
the data to our agent on retail AI platform.
So simply search for HTTP request node.
And because we want to send all the data.
So all this information such as first name, email, phone number and services, we need to switch the
method to post method.
Now you have to provide URL.
So we need to check retail AI documentation.
So go to retail AI documentation and under Create Phone call you will see this dashboard.
Simply copy this URL.
And paste your workflow.
Just right here.
Now we need to send headers.
And as you can see the first header we have authorization.
So copy it.
Paste it in the name field.
As a value.
You have better.
And our API token.
Go back to Nathan.
Paste it right here.
Then create an account on retail AI platform.
And.
On the left hand side.
Under API keys.
Add new API key.
Give it a name.
Create.
Just copy it.
Go back to Nathan.
And paste it.
Paste it right after beta.
Now we need to send the body.
So we need.
Name and value.
Go back to the documentation.
Copy the name.
And the value.
Application Forward.
Slash.
Jason.
Now this step will be.
It will be technical.
But don't worry.
I will guide you step by step.
Just follow me.
So click.
Try it.
Enter your API keys here.
Now we need to provide a number our arrivals agent will will call from.
There are two options.
You can buy a phone number directly on retail AI platform.
By simply going to the phone number section.
Click on plus button and buy a new number.
but there is a limitation because you can't use this number for international outbound calls.
So the better option is to buy a number on Twilio and connect it to your agent.
So now I'm going to show you how to do this.
If you are new to Twilio, it's a communication platform that provides virtual phone numbers, messaging
and voice services in over 100 countries.
And using Twilio, you can buy a virtual phone number and make calls as if you have a local presence
in multiple countries.
And that's why we are using it.
So if you are using Twilio for the first time, you will get a $15 shell credit.
Usually it costs just $2 a month.
So basically you have seven months for free.
First, create an account.
Now go to the phone numbers section.
Which is in the left menu, then under Manage by number.
And search for a number in your country.
After you have bought a number, we need to connect it to our Avis agent via SIP trunking.
So go to search bar and search for SIP.
Click on elastic sip trunks.
Give it a friendly name and click create.
Now we need to configure the connection.
And this is really important step.
So please don't miss it.
Otherwise it won't work.
So under general we have to.
Enable code transfer as I prefer and also enable PSTN transfer.
Then under termination provide some name right here.
Then scroll down.
Create credentials.
So give it some friendly name username and password.
Then click create.
And that's it in this intersection.
The next one origination we're going to add the origination URL.
So let's copy it from the retail documentation.
I'll attach the web page as a resource for this lesson.
So copy it.
Add a new origination.
Paste the URL here and click add.
And on the numbers.
Just add the number if button Twilio by clicking on add a number and add an existing number.
So you can select from the list.
Now go back to termination.
Copy this recipe.
Go to your retail account.
can't.
And other phone numbers.
Connect to your number via SIP trunking.
And paste it right here.
Also need to provide the phone number you just bought and click save.
And now we successfully connected the phone number we bought to our agent on retail I.
The next step is to finish creating a new advanced phone call in the retail documentation.
Playground.
So we already have our API key.
Now we need to provide the phone number we just bought.
So go to your retry account.
And copy number paste it right here.
Now we need to provide the number we want to call.
So I'm going to use my number.
But just to let you know this is just to set up dynamic variables in our workflow.
Now we need to provide our agent ID.
So go back to retry account and let's create our agent.
So create an agent.
It will be single prompt agent.
Start from blank.
Now here you can switch to different large language models and different voices and languages.
For now we need just ID, so copy it, go back to the playground and paste it right here.
We don't need to change metadata.
And now the dynamic variables are the fields we just created in our submission form.
So you want first name.
Email.
And services.
You have the number in the previous value.
Right.
That's it.
Now you need to send the body.
So we need name and value.
Now this step will be it will be technical.
But don't worry, I will guide you step by step.
Just follow me.
Go back to the documentation.
Copy the name.
And the value.
Application.
Forward slash JSON.
Now we need to use the code that was generated and the curl, and paste it into the HTTP request node
in the body.
First switch body content type to row.
And then in the body field switch over to expression.
So copy the fragment of the code from data including curly brackets.
And paste it right here.
Now we don't want the values to be fixed, so we need to use dynamic variables.
This way, every time a new user fills out the form on your website, new data such as their first name
and phone number will be passed to our agent.
So instead of.
Random number, let's drag and drop.
The actual phone number from the submission form I filled out earlier.
Now the first name.
Email address.
And service.
All right.
Great.
Now all these dynamic variables will be passed to our voice agent so it can personalize each call.
It will use the prospect's phone number and first name for the greeting, and try to convince them to
book a discovery sales call.
And you can use all these dynamic variables in the prompt for your voice agent right here.
I've just changed the theme to dark because it's easier on the eyes.
If you prefer the dark theme, you can change it by going to settings and right here under your email,
change the theme to dark.
Now going back to our agent.
So now, if you want our AI voice agent to perform tasks for us, like checking availability in our
calendar, booking meetings after finding a suitable time for the customer, transferring the call to
a human agent, or ending the call at a specific time.
We need to enable the built in retail functions inside the agent.
And then we can call these functions inside a our prompt so the agent knows exactly what to do.
So retail makes it super easy by handling all the back end logic for integrating with your agent and
create those functions.
So you can use other calendars, but it requires a bit more, uh, setup.
So if you are not using Calcom already, I highly recommend it.
It's great.
It's a great tool, and there are plenty of tutorials out there showing how to create and configure
your calendar on the platform.
So now we need to add some functions.
You can do it by just clicking functions right here.
And here you can choose the functions you want to add.
So I already added all of the functions but you will see this empty.
So let's just add the check calendar availability function.
Click add.
And we want to add this one.
So our invoice agent will be able to check our calendar and find availability for our customer.
So just simply click add.
And here you have to add two things.
API key from Calcom and event type ID.
So now I'm going to show you how to find these details.
So first go to calcom.
Create an account login.
And here you can create different type of events.
So I have 15 minutes a meeting set up right here.
And this is my calendar.
So I'm going to show you how it looks like for a potential clients.
So you can see it by clicking on this view public page.
So this is how my calendar looks like now.
So as you can see, I have a 15 minute slots.
Uh, Wednesday to Friday from 8 p.m. to, uh, from 6 p.m. to 8 p.m..
So let's go back to the event types.
And here you can create different types of events just by clicking on this plus button.
And here you can specify all the details like a title of the meeting duration, etc. you can also modify
a lot more things like for example availability limits, advanced settings, recording, uh schedule
apps, workflows, etc. I'm not going to dive into detail in this tutorial.
You can find a lot of tutorials online.
Now I'm going to show you how to find API keys to enable the check availability function in our voice
agent.
So you can find your API key by going to.
My my settings.
Then scroll down and under developer you will see API key section.
And here you can add new API key.
So let's say demo.
Retail never expires.
Save copy your API key.
Then go back to your retail Voice agent.
And paste API key right here.
Then we need to find events type ID.
So let's go back to Qualcomm.
And once you create your event just click on it.
And this is your event type ID.
So this number just copy it and go back to retail and paste it right here.
Hit save and that's it.
And we need to do exactly the same thing the same process for every function.
We want to be used by our voice agent.
So to book appointment.
To end the call or to transfer the call to a human.
Just to quickly show you it looks exactly the same.
So we need to add API key and event type.
And here we can add the description which is optional.
But in that case I just simply wrote when users asked to book an appointment booking on the calendar
or check calendar availability.
When users ask for availability, check the calendar and provide available slots.
Now for end call.
We don't need to provide API key and event type ID.
So description is ends the call after saying goodbye to the user.
So that's the trigger.
Our keyword.
Now.
Transfer call.
The description is if the users request human agent support or express frustration.
So our agent is able to recognize to detect emotions.
So transfer the call to a human agent immediately.
And here we are going to provide our mobile number.
And that's it.
Regarding the functions.
Now we have to call these functions in our inside our prompt.
All right.
So now let's create our prompt.
I'm going to provide this prompt template the resources.
So here we are specifying the role.
So you are Sophia a customer support representative at adaptive AI and Automation agency that helps
businesses leverage agents and automation.
Your role is to follow up with leads who have submitted a service consultation request and guide them.
And here we are providing the current date and time.
By using this variable.
So our voice agent to make sure that our voice agent knows what the current date and time is.
And here we are passing all the dynamic variables we used in our submission form in Naa10.
So delete information first name and the first name variable email and service as the objectives.
We want this agent to verify the leads details and confirm the interest in a consultation, as is in
scheduling and maintain a friendly, professional and engaging tone.
Here we want the best practices during the call, so we want our agent to keep the conversation flowing.
Naturally conversational rhythm, professionalism, etc..
Here I added more details to guide our voice agent.
And this is important bit because we want our voice agent to say exactly this sentence at the beginning
of the call.
So hi, this is Sophia from adaptive II and I'm speaking with and we are passing the dynamic variable.
So our agent Sophia knows the first name of the user.
So the customer who filled out the form.
Then we want to wait for Users input.
So for the user's response, then the second question, second sentence is great.
I'm reaching out because you recently showed interest in our AI automation solutions.
Is now a good time for a quick chat?
And again, we want to wait for the user's reply for the user's response.
So this is basically the conversational flow.
So we decide exactly what our agent is supposed to say during the call.
Here we want our voice agent to.
Recognize if the user agrees say what time works best for you.
Otherwise, say if the user is not interested, say okay, no problem.
Thank you for your time.
Goodbye.
And here we are calling the end call function to end the call.
And actually, we can save a lot of tokens and and a lot of money.
Because if the user is not interested at all.
Does it make sense to continue the conversation?
So when the user wants to book an appointment and gives you the day and time they are available.
Our voice agent will use check calendar availability function before booking.
So it's going to look through our calendar and check the nearest available slots.
And then.
When they agree on the time slot.
Our agent will use the function to book appointment.
To book an appointment on the on the calendar.
So if the user requests human agent support or express frustration, we call our last function tool.
Our function.
So transfer call.
We are requiring from our voice agent to transfer the call immediately.
And at the end we publicly.
And at the end, we politely thank the user for their time and mention that we won't keep them any longer.
And we want to close the conversation with goodbye and use the end call to to terminate the call.
And this is the welcome message.
So.
We can choose between I initiates the conversation.
We've defined the Message.
So in the in that case we want to use.
Hello, this is Sofia I'm speaking with and I'm speaking with.
And the first name of the customer.
But you can easily change to.
Trigger our voice agent when the user initiates the conversation.
Or pass some dynamic begin message.
Here you can find more awesome features such as knowledge base.
So basically you can add a knowledge base to give your agent context, such as information about the
company or about services you offer or your client offer by simply clicking on this add button.
And here you can choose the knowledge base.
So if you want to add a knowledge base into your retail account, just go to The main dashboard and
under agent you can see the knowledge base section.
And here you can add the new document.
Document.
Enter a name.
And here you can even provide the URL of the order of the website.
Upload files or articles manually by typing a text.
And then in your voice agent settings you can choose which knowledge base you want to use.
So it should pop up here.
You can also modify speech settings such as responsiveness.
Interruption sensitivity, etc. but I'm not going to go into detail in this tutorial.
This feature is really useful because you can enable Post-call analysis.
So basically you can define the information from the conversation that you need to extract from the
call, and ask LM to provide you a summary of the call.
And based on that, you can improve your prompt to gather specific details from the customer.
If you want to know more about all these features and you are interested in implementing them in your
agents, you can check retail AI documentation and blog.
You can find plenty of useful tips and information how to use those things.
Here you can switch between different large language models, as you can see.
In that case, I'm using GPT four, but you can switch to cheaper models such as GPT four or mini,
which is less accurate and can hallucinate sometimes.
You can also use cloud models.
Here you can change the voice.
You have plenty of 11 laps voices to choose from.
So you can test them out and and decide which one you like.
You can also.
Choose a specific accent like American or British.
Gender.
You can add your custom voice.
By clicking your voice.
Here you can use OpenAI's voices.
I personally like voices from Bell Labs.
I have cloned my own voice.
Here you can see the cost per minute by using a specific large language model and the latency.
Okay, that's it for this tutorial.
I hope it was helpful.
Thank you for listening and see you next time.