Hi everyone.
In this lecture we are going to build a squad of our AI assistant, meaning we will be having multiple
of our assistants and we are going to combine all of them into creating one new whole assistant that
will act as customer support, account checker, appointment booker, submit a note creation, etc.
etc. and why we are using squad because we don't want to fade all of the information into one assistant.
Like one assistant cannot perform all the account, booking all the account checking all the questions
and notes, answer all the user's query, etc. it will definitely go under hallucination and will
not able to answer it properly.
And that's why we are using squads in VAPI.
Let me show you a whiteboard and that way you will have a better understanding of what we are going
to achieve in this lecture.
So how to build a squad of AI voice assistant?
Well, let us consider our receptionist as a main assistant or our routing assistant, and it will handle
all of the customer queries and customer support.
Basic customer queries.
Then if the customer wants to book an appointment, it will redirect it to another assistant, which
is named as Appointment Booker that will check the availability and book the appointment with the customer,
as well as send the confirmation email, SMS, whatever you like.
After booking the appointment with our user, if the user still have another question, it will route
back to our main assistant and let's say the customer has or the user has the question about their account.
Therefore, our main assistant will route the user to our account checker assistant, which will handle
all of the account details like balance, statements, score, etc. etc. after confirming the account number,
after checking the account details, if the user still has a question, it will route back to our main
assistant and our main assistant will route it to submit a question or note assistant, which will act
as a or which will store the question asked by the user with their name, email and their company name.
So this is how a squad of AI works.
An ultimate goal of creating a squad is because if we try to integrate all of this feature in this one
assistant, it will definitely tend to hallucinate and it will not answer properly.
And that's why we are creating squad in Vapi AI.
So let us go ahead and build a squad in Vapi AI.
In this lecture is going to be long, but don't worry, it is very easy and if you have literally any
question, feel free to ask me.
First of all, let us create all of the assistants separately.
So as you can see, I have no assistant, no files, no tools, no blogs, no squad.
All I have is phone number.
So first thing first we will create our main assistant and you can select blank template and name this
assistant as receptionist.
And then we can say squad to identify then create assistant.
What I have done here is I have written all of the first messages, system field prompt, tools that
we are going to create in this doc, and I will be sharing this doc in the resource section so that
you can simply just copy and paste it for your squad or for your assistance.
Our main receptionist assistant has this first message which is hi, I am Alex from your agency or Lunax
agency.
How can I help you?
So we can simply just copy this to save our time and we can paste it here.
After that in System field prompt, I will explain it to you.
Let us just first of all, copy it.
The first part of our system field prompt is very basic and generic up till here.
All I am trying to say is you are a friendly and helpful assistant of lunax AI Automation Agency.
And now from your task, the actual game begins.
Well, we have to define on how to route things to different assistant.
For example, if the user want to book an appointment, we have to tell our main assistant to route
this information or route our user to appointment booking assistant.
And same goes for our account checker assistant, which will check all the details of our user as well
as note taking or submit a question or leave a note.
Assistant where we will take all of the information about our caller's full name, company name, message
content and we will confirm all of the details.
Back to the caller to improve the accuracy and we will use our tool.
So let us not worry about this tool right now.
Then the 4th point is transfer the call, based on the caller's needs and question.
Decide whether to transfer the call to our appointment checker assistant or our appointment booking
assistant, and then call transfer smoothly and manage return calls.
For example, if the call is forwarded to a appointment booker and the appointment is booked, and if the
user still has a question, it will route back to our main assistant.
And that's why we have included this 6th tasks, which is manage return calls.
And lastly, this part is again basic and engineering, so don't worry about it.
As well as you can add knowledge base if you have a FAQs or about us or contact us information about
your company or agency.
But right now we are not using any knowledge base.
So for model we will use GPT-4o cluster.
Let us decrease the temperature to 0.3.
Perfect.
Then click on Publish in transcriber publish.
In voice, we can use Azure's Andrew right.
Then hit on publish and we will look into function advanced analysis after on.
Amazing.
We have created our first assistant.
It's time to create our second assistant.
Appointment booking squad.
Feel free to change the name as per your liking and we are going to be using blank template.
You will be able to find the first message under this appointment
Booking Assistant.
Simply copy this, paste it here and same from our system field prompt.
Till here.
The first part of our system fill prompt is very basic, but under meeting booking rules we are only
booking the meeting by using callers current phone number from available meeting times.
We are only selecting from weekdays, which is 9 a.m. to 5 p.m. IST.
Here IST means Indian Standard Time.
Feel free to use your time zone and the meeting duration are 30 minutes only.
And here is the main part which is booking process.
If we are booking appointment with any client or our customer, we obviously want to know their name,
their company name and the subject or theme from the meeting as well as we are getting the backup phone
number in case of booking issues.
So why we are using this third point?
So sometimes our assistant is not able to get the proper ID or proper email from our user, and they
kind of misspell it.
Even human misspelled it on the phone.
So we are using this backup phone number in case of any booking issues.
Then we are asking from email confirmation and we always ask them to spell their email.
So we are trying to increase the accuracy of our user's email by asking them to spell their email,
and then ask from 30 minute time slot for this week.
So it will ask the user which time slot do you want?
And it will use this tool to check in our calendar.
And then it will double check the time slot internally.
7th point is reserve the time slot in the calendar using this tool.
As well as it will confirm all of the details like date, timing as well as phone number
back to the user.
And at the start of each conversation we are saying always use this datetime tool.
Don't worry about this tool.
We are going to cover it in this lecture and then after booking the appointment, ask the customer has
any other question.
If they have,
So route them back to our receptionist or our main assistant from further assistant.
And if they don't have any question, you can say goodbye and hang up.
And last part is again basic and generic prompt.
That's all for our apartment booking assistant.
In model we can select GPT-4o, click on publish.
In voices,
We can use 11labs Sarah and you can see 11 turbo V 2.5 is available now.
So you can use this which is the best model in functions.
We have to actually start creating our tools now.
As you can see we have bunch of tools to create which is get availability, set meeting etc.
So let us start creating tools.
Click on tools.
And then first of all we have to set up our make server URL.
So go to make.com.
Create a new scenario, Let us rename our scenario for, let's say, submit a question node or submit
a question right.
Then we will use a webhook.
Click on custom Webhook and not mail webhook.
Let us rename this as Submitaquestion and click on save.
Now copy this URL.
Go to Vapi Dashboard and paste it here.
Click on next.
We will define our schema or property so that LLM can use them to generate the answers.
So if we go to our documentation here, if you scroll down you will be able to see this tools option
where you will have all of the options, all of the property details.
All you need to do is copy and paste it in Vapi.
So the first property we are adding is obviously the question or the message that the user want to submit.
So just copy this.
Go to property name.
The message that the caller want to submit for Manthan Patel
Because I am the owner of Lunax AI Automation Agency, it is a fictional company.
So describe the property here and then click on save.
Then the second property we are going to need is the first name of our user or caller.
Copy this.
Paste it here.
Description is pretty simple.
Lastly, we also want to get the company's name of our user or caller.
Click on save next and we will name our tool.
So under Tool name you will find this submitaquestion.
Paste it here as well as the description for our tool.
This tool is used to submit a question from the owner, Manthan Patel, and then click on create.
Well, our first tool is created.
Now we need to create all of the other tools as well.
So simply click on okay, save it.
Create a new scenario for let's say, setmeeting.
Trust me, it is very easy and basic, but it will take some time in the first part.
So just paste our name which is setmeeting.
Let us name our webhook the same.
Copy this URL, create a new tool and then paste it here.
Obviously, if we are setting a meeting or booking a meeting, we will need all of this information
like date, name, subject, email, company and phone number.
Copy the description.
The date and the time for the meeting in ISO 8601 format.
Well, what is this ISO format.
So this format is actually recognizable to our LLM, and it will able to better interpret the date in
the timing.
So don't worry, just simply copy and paste it.
Now add all of the properties.
All right.
We have added all of the property.
Click on next in our tool name is setmeeting.
The description is this tool will schedule a meeting.
All right.
The second tool is also created.
Then third tool is Getavailability and datetime.
Both of this tool does not require any property.
And I will explain you why.
Just wait for a minute.
First of all, let us create a new scenario in Make.com.
Let us rename this as get availability.
Same for webhook copy URL.
Paste it here
So why we are not defining any property or schema for this tool?
Well, we are getting information from Make.com and we are not giving.
So let me give you an example here in this about tool which is setmeeting, we are giving all of this
information which is date/name/about to Make.com.
So whenever the caller will provide all of this detail, we actually want to send those details to Make.com.
So we are giving that.
And that's why we have to define schema or property.
But in Getavailability we are not setting any availability.
We are getting availability from our calendar through Make.com.
And that's why we don't need any properties or schema.
I hope you got my point.
So simply click on next and name our tool.
Copy this, paste it here.
The description for this tool is-
This tool will look to see which time slots are already booked and therefore unavailable for our meetings.
Lastly, we have to set up our date and time tool and we are not going to use this example, which is
getcurrentcredit because we have already covered this in the last lecture, which is we are getting
the information from a table back to our user because it will make this lecture a lot lengthier.
And again, it is very simple and very basic.
You can do it, but it will make this lecture unnecessarily lengthy.
So let us create our datetime tool which is going to be our last tool.
Click on okay, click on save and click on New Scenario.
Rename our scenario.
Copy this URL.
Again, we don't need any schema or property because we are receiving the current date and time from
Make.com and we are not giving back to Make.com.
Simply click on next.
And obviously we need to know the today's date and time in order to book an appointment with our users.
Now create. There we go,
We have all of the four tools that we are going to need for this instant or for our use case.
Now go to our assistants and in function we have to actually add our tools.
So in first of all let us select from our appointment booking assistant.
We have to use our date and time.
Then we have to use our setmeeting and Getavailability.
These three tools we are going to use for our appointment booking, as well as in the documentation.
In documentation, I have already added the tools that we are going to use from our appointment booking
assistant.
Go to functions and you can enable this end call function.
So our assistant will be able to end the call.
If they feel that all of the user's queries and questions are solved.
So setmeeting, getavailability, and datetime right.
Click on publish and for our main assistant.
We are going to use a tool which is submitaquestion and datetime.
And if you don't want to use this datetime, you can remove this tool as well.
It is not necessary so submit a question and datetime.
Click on publish.
It's amazing.
So we are all set up with our VAPI dashboard.
Now it's time to actually create the scenarios for all of the tools.
Don't worry, they are very easy and basic and already we have covered it.
All we need to do is just set it up in a perfect way.
That way we can create a call center or squad of AI assistants.
Here we are going to build everything from scratch because I don't want to keep you hanging in anything,
and I want to make it very clear to you so that you can create any use case, any instance, any workflow
for your niche or for your company