VAPI SQUADS - Full Advanced Tutorial in Under 30 Minutes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
the most powerful feature for building AI voice agents just got released and it allow you to have better performance lower latency and a much better user experience it's called squads and in this video I'm going to give you a full breakdown of what they are how they work and how to implement them for yourself step by step this video is for you if you've already created a prompt that is complex enough to try to handle different scenarios with the user or if you manage a business with multiple departments or phone extensions could you help me understand how a Leo team can help um wonderful actually I have questions about Saia what would you like to know about Saia wonderful thank you so much sayia great so it have the very smooth transfers from one to the other before we get into it my name is aljo I've been a data scientist for about 6 years and I've worked on a variety of problems in Ai and machine learning and about 6 months ago I got really interested in the capabilities of voice and we've recently seen what it can do with the release of GPT 40 and the demos so we know where it's going I want to help position you in a way that you can really take advantage of this teonic shift in AI towards a voice interface by the way I'm going to share every single resource that I use in this video so please just take them they're linked below and if you need help implementing these I'm happy to help you out just uh click little work work with me link below so let's get into it we're going to look at three things number one how these teams of agents are designed number two how they work in actual practice and number three how you can implement this yourself we're going to mainly be using two tools vapi and make so what is a squad it's a team of voice agents that are working together to handle different scenarios with the caller when a caller calls into your business they will be greeted by a customer success agent they will have a short back and forth and the customer success agent can route based on what the caller is calling about to the right agent and we have these arrows to represent how the agents can interact with each other maybe they want to set an appointment maybe they have some questions so that conversation can flow based on what the customer is looking for what does that look like in practice the best way I can show you is show you what we've built for ourselves I own an AI development company and what we've specialized in is voice technology our voice product our voice agent is called Saia voice so when people are calling in to our company maybe it's a lead maybe it's a client maybe it's an investor they'll be greeted by a customer success agent and based on the query that they have hey I want to learn more about Saia voice in that case they can get routed to the correct agent to take over the conversation when the person is ready to talk more or make a purchase we can set an appointment you probably already noticed that here there's one Arrow that's facing only one way well what we want to do is that when questions were answered about Saia voice and the person is ready to buy that now we set the appointment that there's not just a back and forth between these once the customer wants to set the appointment that's the mission and that's where the flow will go and still if the caller wants to take the conversation in a different way the customer success agent can always take over and continue the conversation from there so I hope you see how this adds a lot of fluidity to the user experience so how about performance and latency that's when we step into why you would Implement squads when your use case is complex enough to have multiple if and then statements in a prompt and the prompt starts getting out of control when it starts covering one or two full screens that's when you want to implement squads so we've implemented voice agents for companies uh with multiple departments obviously the use cases start getting very complex The Prompt starts getting very long so what about performance the longer the prompt the lower the performance the higher the latency so what if we could reduce the size of the prompt and assign each agent only a specific task that they are really good at handling higher performance lower latency so instead of a a really long complex prompt that impacts user experience latency cost and performance what you get instead is a team of Agents with short effective prompts for each use case so a better user experience low lower latency lower cost and higher performance so let's jump straight into creating these three agents customer success agent the sa voice rep and the appointment center and we're going to see that in action now so the first thing we want to do is create a new assistant we'll call it um the customer success manager we'll create the assistance we'll create it with a blank template for now um just to show you how to put these assistants together we'll create a second one for um say rep and finally one for appointment setter great this is the cool part they've added a feature where you can create a squad and you can visually visually put them together so we have the squad's customer success that we just created wonderful and we have it here and we want to connect it to the other agents so in this little plus button add an assistant and the one we created was just Squad sa rep and then the second one was squats appointment setter the beautiful thing about vapi is that they are so fast in development so they release features very fast and then they iterate on them so this is not going to look like uh the best user interface you've ever seen but it's very useable and it'll get better and better so we will connect the squad's customer success agent to the C rep and then we will also connect the customer success to the appointment seter so now they are connected but they're only connected one way in our graph what we saw is that customer success agent can send the conversation to Saia voice rep and vice versa so we need to conect create a connection back to the customer success agent how you do that is you click in the circle and you put it in the rectangle so again this user interface will get better in time but if you move the blocks around you can start seeing the relationships that start getting formed customer success agent to CB and then CB can send it back to the customer success agent we also have another relationship from the appointment setter back to the customer success agent and from sayia voice to the appointment setter so from customer success agent to appointment setter appointment setter back to customer success and then wh we'll move in back there you go and from s rep also to the appointment setter and now we'll rearrange and now we have that that Squad that I showed here it looks a little different again the user interface will get better but customer success SC rep and appointment seter ideally for a production grade product you want squats to be more than just three agents but the relationships start multiplying and it's very hard to keep track so for this tutorial I'm just keeping at three agents with relationships between each other so now we have the squad created and we have the squad ID here we're going to use that later so keep that in mind next let's actually create the prompts for these agents I'm saving you the trouble to go through all the prompt engineering with me so I went ahead and created them the first message is going to be hello this is Saia from aljo team who am I speaking with and how can we help that is the customer success agent the initial conversation with the client you have the role their task you mention that uh there's a flow of the conver ation with two other agents and you will route the call to the right agent based on whether the user is looking for schedule or rescheduling an appointment or interested in learning more about Saia voice and for the context you're now in a voice call with a potential lead great agent number two you'll be tempted to just click duplicate on the agent and this is where most mistakes happen this is a mistake I've done and I've seen others do which is they keep the first message the same but as the conversation continues this is not going to be relevant anymore so number one you need to change the first message so for the first message says the customer success agent is passing the conversation to the say rep we're going to say something like what would you like to know about Saia great the role is very similar but we're going to change um Alo is the owner of an AI development company working on an AI voice system called Saia voice the technology you work created from the primary task is going to be slightly different um is to answer questions about Saia voice and orchestrate the flow of the conversation with two other agents number one is schedule or reschedule an appointment number two customer success agents wonderful uh to handle all other inquiries not related to SA or um scheduling and then I give it a bit of context usually you'll have this in a knowledge base since this is a very you know short uh uh piece of text about Saia voice then we'll we'll keep that there and then context we can we can probably do this better you are now answering questions about Saia voice wonderful we have S ready and then finally the appointment setter the first message that I chose for this is a much better flow for appointment setting and I'm going to do a video specifically about this cuz it feels like everybody's doing this wrong what how we set appointments is sending a text message with a booking link and uh staying in the line with them for them to book answer any questions if they have any questions we'll see it in action in a second so for context you're in a phone call with the user and they want to book a meeting with AO uh you give it the role and uh a task how you book an appointment important notes if the user has any other inquiries pass the conversation back to sa uh the customer success agent so now that we have this flow set up let's actually give it a call the customer success agent can route the call to C or to the appointment seter and then we have those relationships we'll give it a call and try it out I've built this make automation that you can take from the resource Hub this is going to be the simplified version and we'll step into the more complex fully fledged version in a second we're going to have an inbound call and remember the squad ID this is what we're going to use it so we're going to need three things the squad ID the phone number ID and the vapi API key let's get those Squad ID is here the phone number ID is going to be here and then the API key you're going to find under your uh under the name of the organization API keys and you can copy it here bam and this is pretty much all the setup you need so let's give it a call and see it in action [Music] hello this is sa from aljo team who am I speaking with and how can we help hey this is actually Alo that's funny beautiful name um yeah I wanted to learn more about sa voice transfering the call now what would you like to know about Saia great um no I just wanted to understand what it is and how it works sure sa voice is an advanced AI voice assistant developed by fiz is designed to streamline and enhance communication across various Industries such as real estate and education wonderful um thank you thank you for explaining that uh great I'd love to set an appointment and and uh get ready to make a purchase transferring the call now great I just sent you a text message with a link to book your meeting please click it and choose a time go ahead I'll stay on the line and say will stay on the line with me to make the appointment and that's a very very important part of the flow when we're when I'm talking user experience is what is the user feeling on the other side not not how are you designing it as a Dev that's a very very important difference so what did we learn so far the let me transfer the call is not going to cut it there's a way to fix that and this is the level up so if you watch this far get ready cuz this is where it gets good okay so here's the sauce I just spent 2 hours debugging it's already night time this is going to get really good so check it out number One never forget to make these squats work you're going to need a make back end remember to always uh set up your server URL to copy the web hook address to the clipboard and go to your uh organization settings bam server URL I uh know I'm showing all the keys and all that stuff so I'll I'll remove them and uh erase these organization security is key okay wonderful um we are now going to show you how the Json is set up to actually call these assistants this is where it starts getting a little tricky because it has a new format to actually make these calls with squads you're going to need to use well you would call some custom code but once you actually understand it it's pretty straightforward it's the usual you'll have a phone number ID and instead of an assistant or an assistant ID you'll have a squad and this squad will have members just like it showed you in the figma board you will have multiple members and each member this is one member each member will have an assistant ID or a whole breakdown of a new assistant and what's called assistant destinations this isn't anywhere else in developing documentation except for squads the destinations is who can I transfer the call to and when we open that up you have four things to fill in uh number one assistant that's always going to be assistant uh the assistant's name so you're not going to insert the assistant ID that you want to call you're going to insert the name that you actually write out and then the message that the uh assistant says when it's transferring the the the call and then the description what is the condition in order to transfer we're going to see examples of all of this and actually call it up so hold uh hang on with me for a second so what constitutes an assistant assistant ID and some destinations simple as that you're going to get used to the syntax very very quickly as as did I but um you're not only going to have one member you're going to have multiple members so you're going to essentially copy the same structure over down here and you're going to have an assistant ID with assistant destinations you can have three four many many assistant we'll start with two for the template and you can copy paste this uh in the resource Hub uh and and start out start out yourself but let's show you a working example of what this looks like so we have the same exact thing the phone number ID the squad with members there's one member here but we're actually going to have this assistance destination um mapped out what that looks like in practice we saw in the figma the customer success agent which is this ID has two people that it can send the call to the S rep or the appointment setter so for C when should it send that um uh transfer that call and what should it say so what would you like to know about SAA is the me the transfer message that's going to happen and it would transfer the call with a condition that if the user has questions about s that's going to be the destination one the potential transfer one which is right here then the potential destination two the transfer two is to the appointment center and we'll we're going to see it in practice in a second and when should it transfer if the user is ready to set an appointment or if they have all their uh questions answered so that's one member that's member number one let's look at member number two this is going to be the sa rep and it has all this all this knowledge base about Saia and it can answer all these questions so we have the assistant ID of the sa rep and then this is a new one assistant overrides and all we want to override here is the uh first message mode which is going to be don't say anything um say rep let the user ask you a question so best practice so far is uh have one transfer message and then we override the first message from the C which is usually what would you like to know about Saia so this is a different way to do that you can also leave this empty it varies depends on your use case that's a beautiful thing about squads is very very flexible so we have the s c um assistant with ignoring its first message and the assistant destinations is going to be the customer success which would say a first message of could you help me understand how well a host team can help and the uh appointment setter which is the same no message and if the user is ready to set an appointment finally we have the appointment setter and the appointment setter also how we saw in the figma receives transfers from the customer success agent and from the sa voice rep but can only send uh transfer the call back to the customer success agents so in assistant destinations we only have the customer success now let's put this into make and actually make some calls let me quickly walk you through this make automation that you'll have access to to number one in the web hook always remember to set this uh web hook in your server URL So within your organization settings and you can set up your server URL um you're going to try to actually call this and use this after I release this video don't worry it's all going to be gone so don't even try first there's two things we're going to set number one the phone number ID number two the V API key now we're going to get get some um names and IDs this is what we're going to fill in in the code that in the Json that I showed you uh so you don't have to go mess with the Json every single time you can just have these preset and number three is going to be the actual members so the list of members that are in the uh in the squad finally we're focusing on inbound calls um outbound calls is essentially the same so we're going to uh set up in the web hook response the phone number ID uh that we set up as a variable and then the squad and we're going to actually give it a call that's the whole setup let's hello this is sa from alaho team who am I speaking with and how can we help hi sayia um yeah I just wanted to get some information on sayia voice what would you like to know about Zia um I would like to know how it works and how it could help my business in real estate say voice is designed to streamline and enhance communication through advanced natural language processing and machine learning here's how it works and how it can benefit your real estate business and it'll go we're obviously going to refine the knowledge base to not be so robotic but um great wonderful so uh I'd like to sit on appointment now transferring the call now great I just sent you a textt message with a link to book your meeting actually I have another qu a different type of question that's like totally out of scope who could help me transferring the call now hello this is sa from alaho team who am I speaking with so there we had two things come up number one transferring the call and number two the first message all over again we're in the middle of that of a conversation we don't really need a second message so let's tackle those one by one so after some testing I discovered that if we leave the first message empty it is always going to override with transferring the call now so we don't want that something more natural is 1 second and then the first message will play for the appointment setter is great I will send you a booking link and we can finish the conversation there um so this is where you get some options and when people talk about the flexibility that using the vapi code gives you this is what they're talking about you could have a transfer message and a first message or you could have a transfer message that just deals with the um query and then a new assistant takes over without any message just like we did here assistant waits for the user to speak so you get that flexibility and the second thing we're going to tackle is when I transfer the call back to customer success which is this agent and it it began the conversation from the beginning we definitely don't want that but if I override the first message then it will not say the first message in the first place but that's how the conversation starts so we're in a bit of an impath here and the way to solve it is actually going back to the figma because there's not actually only three agents here there's four there's a customer success agent that will take the call from whatever whoever's calling route it in One Direction and from there there's going to be a customer success fallback agent and how we create this agent is very simple we're going to go to our assistant and we're going to go to the uh customer success agent and we're going to duplicate this one we're GNA remove the first message so there's no first message on transfer but everything else is pretty much the same you want the conversation to be transferred one way or the other to scheduling or to uh learn more about sa voice everything else is is the same so we're going to call it fallback now we can go with our design of these four agents uh having a fallback is so important the first video I released was on testing and bulletproofing your AI agents this little guy here is the magic is really where any edge cases that happen they can take care of and at the end of the day if the conversation goes arai then there can always be a hey I will let allejo know about what you asked he'll be in touch with you thank you for calling so the user going back to the user experience which is so important can never be worse then aljo will hear what you what you shared and uh he will be in touch which is which is a pretty decent user experience finally let's get into the final version we're going to have member number one with the assistant ID and assistant destinations of c and appointment center member number two um this is going to be the sa rep we're going to override the first message so it doesn't say hey what would you like to know about sayia that's going to be the transfer message with assistant destinations the customer success fall back our new agents and the appointment setter then the um appointment setter is going to have the destination of customer success fallback so the conversation can continue from there and finally this is the fourth one the new one uh customer success fallback is going to have we can remove this we removed that first message already uh so this assistant customer success fallback can continue the conversation to CF or appointments better and now we're ready we're going to we're going to copy these members into the make uh automation right here which is members great bam so we have the members everything's mapped out in the in the template version that that you're going to get uh we're going to make sure that these for example assistant ID number one has member ID number one member 180 okay so the final version is ready let's call it and uh give it a spin hello this is s from Al team who am I speaking with and how can we help hi I wanted to set an appointment great I can help with that could you please provide me with your name yes it's allejo one second great I just sent you a text message with a link to book your meeting please click it and choose a time go ahead um actually I just really wanted to ask you about car racing could you help me understand how a Leo team can help um wonderful actually I have questions about Saia what would you like to know about sa wonderful thank you so much say great so it had the very smooth transfers from one to the other send a sent a link for an appointment uh was able to go back in the conversation to uh have a conversation about Saia and this is the final build you'll have access to all of this and I can't stress enough that this is just the beginning you can make these for a whole company for multiple phone numbers for a brokerage with real estate department and uh mortgagees department and customer success you can really take it as far as your imagination and and that's what I'm so so excited about this technology if you'd like to work with me or have some questions please book a time I'd be happy to talk more about any projects or anything that you want to work on related to AI specializ in voice AI as you can see so always happy to keep the conversation going that being said never stop prompting
Info
Channel: Alejo & Paige Voice AI
Views: 3,130
Rating: undefined out of 5
Keywords: AI Dialers, Air.ai, Air AI, VAPI Squads, Alejo, Voice AI
Id: uJ52-EqBscQ
Channel Id: undefined
Length: 28min 47sec (1727 seconds)
Published: Wed Jun 26 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.