This is going to be a beginnner video on building your first AI agent from a all the way up through Zed even if you know nothing about AI or automation or AI agents we're going to be walking through literally every single freaking step by step so that you feel 100% comfortable and confident in building AI agents for your work or your business let's get into it right now so the first thing that I want to point out here is we're Going to be using a platform called m.com it is free to get started and in
this platform we're going to be building out a system just like this obviously it looks very complicated but it's not we're going to break it down step by step so that you know exactly what's going on here but let me give you a high level overview in a nutshell we have twilio here okay twilio is a messaging platform where you can send text messages receive text messages call um Be called all that kind of stuff right so what we're going to do is we're going to um send a text message right to our AI agent
and we're going to ask it to do something and then it's going to give us a response back at the end of the day being like hey this task has been done right and we're going to have multiple tasks task one is here task two is here practically what these tasks look like is we're just asking it to go to our Gmail account find any receipts in the Form of PDF documents and then parse those PDF documents into line items and then actually add that into Google Sheets right another thing here is we're saying hey
find receipts in her Gmail account and and just up upload them into Google drive right so those are just two really powerful tasks that you can have automated using AI agents right so here are the tasks and then we have this part right here that I want to explain so essentially um what the distinction here Is is that we have like a manager which is acting as you can think of it literally just as a manager that's delegating tasks to employees here and then these employees are using tools to accomplish certain tasks the tools or
Gmail or chat gbt or Google Sheets or whatever right so we're receiving a message we're sending it to a AI manager to delegate that to AI employees and then those employees have various tools at their disposal to get the job done And then they send you an update on at the end so um with that being said let's dive into it right [Music] now now the first thing that I want to talk about here is um actually the distinction between generative Ai and and an AI Automation and um and AI agents because um there's a
lot of there's a lot of confusion and at least for me when I was starting out with this kind of stuff it was it was really Challenging right so I created this Nifty little uh presentation here but essentially what I like to think about it is and you can see these images down below here really when you're when you're de dealing with like AI automation it's repetitive rule-based tasks so so you have a flow like this and you're just executing task after task after task after task and when you're dealing with AI agents the biggest
distinction between this is that They operate on some level of autonomy making decisions within a set uh set boundaries right so this AI manager will say well crap which employee do I want to send this task to and it has to make that decision by itself with some level of autonomy right and then these AI employees are going to take that task that the manager gave them and they're going to say well crap I need to figure out which tools that I need to use to get the job done right and There's some level of
autonomy there as well I like to think of this literally as just like a a standard Corporation where you have managers you have employees that you have tasks for them to do and you have D they have tools at their disposal to get it done so that's really the distinction is um AI automation focuses on reducing repetitive tasks uh with consistent outcomes in AI agents act more like a digital employee not just following Static rules but uh flexibly responding to changing situations the only other thing that I want to mention here is that usually with
AI automation it's generative AI so like what I mean by generative AI is it actually creates things right those things can be images those things can be text they could be music they could be audio files whatever right whereas an AI agent is going to uh interpret instructions right and then handle complex inputs so for example You're like hey I want you to do this it needs to figure out what it is you're asking and then how to accomplish those goals and then create a definitive answer to move forward to the next stage so that's
essentially it in a nutshell and both of these can accomplish the same results and um with AI agents as well there usually is some level of learning involved in this really simple tutorial we're not going to get involved in how to inject learning capabilities Into to this particular workflow and just before we begin to just so to let you guys know Chad gbt technically is generative AI we're just using it in a different way here that gives it um kind of like AI agent responsibilities where it is handling incoming instructions and it has to uh
act as an employee to figure out what exactly is going on so this is just a very simplified version of building your first AI agent so that at least you can understand it and That's why I also like make because for a beginning video on how to learn this kind of stuff it's very visual you can really see how it works it's not like kind of hidden right you get to see okay here's the manager there's the employees and then there's the tasks that they have to do right so with that being said let's dive
into it right now the first thing we're going to do is we're going to actually create a new scenario so what we're going to uh end up doing here Is just going into make.com creating a new scenario at the top and the first thing that I want to figure out here is twillo so essentially with twilio and by the way guys if you haven't actually if you're not familiar at all with make.com I'm going to be going pretty fast through this I do have a two-hour breakdown where we go from like learning knowing nothing about
m.com to being like very very proficient in it I'll link that up above here but essentially We're going to start with tlio as the trigger here with twilio we're going to watch for incoming text messages right so we're going to use our phone and we're going to have this the interface here so what we're going to do is we're going to watch for messages and we need to actually create an account with twilio twilio is just like a essentially I don't know it's like a Voiceover IP company that deals with all things um texting and
and phone calls it's Literally like the backbone I think of multiple companies out there a lot of companies that provide text message Services phone call services they just white label too and they provide it to you anyways even if you don't even know that this is the backbone Pro uh supporting a lot of these applications online so we're going to start for free here and we're just going to work our way up so I'm just going to get started here um jono catli and I'm going to Create enter my email and I'm going to enter
in my password as well here okay sweet so I have gone ahead and I've logged in to my account here and it's going going to essentially ask me to um verify my email so I just need to go ahead and do that I've gone ahead grab the code verifi the email and it's also going to ask me to verify my phone number as well so I'm just going to send over the text message And once this comes in I'll verify this as well and we're going to be good to go okay sweet so everything looks
good and we are in so we've officially signed up for a uh a twio account and we're pretty much good to go now the first thing inside of too that we need to do is we need to actually get a number now usually this does cost money but fortunately twio lets us get started for free and all we have to do is essentially just get started with Their okay of course answering a million questions I'm just going to Breeze through this and just um give whatever random answer I'm sorry to the analytics team ATO but
this is uh not going to be very beneficial to you okay sweet let's go we're now officially in we're going to click get a phone number this shouldn't cost you any money but if um yeah this shouldn't cost you any money whatsoever I haven't even added a credit card to this account so far sweet so now We have our phone number here and we are going to click next and I'm going to close this actually and what I want to do is I want to go into the phone numbers and I want to manage my
phone numbers here actually here we go so we we have just on the homepage I just back though this is literally the homepage we have our account uh ID we have our authentication token and we also have the phone number this is the information that we need in Order to um Connect twilio into make.com so we're going to go ahead and we're going to add a connection here and I'm just going to call this test automatable I would make sure to label this uh properly and then we'll go ahead add the Sid in here and
also the authentication token save it we're good to go sweet so now we have a connection in twio and we're able to actually receive text messages and see those text messages Through make.com really at this point in time we're just going to grab this phone number here copy that paste that by boy into the two phone number click okay and we're good right so I'm actually going to just text this phone number just to see if we can actually get a response in and then we'll we'll take a look and see what's going on here
so just give me a second here as I do this 775 363 2 4 39 man it's so hard to like Actually I always struggle with actually putting the numbers in when there's no dashes or anything like that okay so I'm going to send a text message here you can see my phone just sent it off and essentially what I want to do is see did we receive this text message in too so let's go ahead run it and we can see that we did receive it so I just clicked on this Cloud button here
to see the results and you can see my wellth thought out meticulous text message up Test has appeared in our particular trigger here which is great and obviously we shouldn't be saying like hey you know um test right we need to give some instructions in this this message so that we can actually do something with it right so that is officially the first part of the equation done now what I want to do is I want to be able to figure out by setting up an AI um manager what it is that this person is
looking to do and then once we Have an AI manager setup then I want to direct those instructions to AI employees and then those AI employees will be um taking those instructions and then accomplishing tasks with it so practically speaking I'm going to bring back in this this uh presentation that I built here and there's really three different things that I want to do here so first of all I want to essentially have one AI manager right you can think about this manager being This purple box here telling instructions to one of their three employees
um and one of these three employees or these three employees will have all different functions one will be dealing with invoices one will be dealing with contracts and one will be dealing with resumés and then they'll all have certain tasks here they're going to have to take that information so the AI manager is going to delegate to one of the employees and then the Employee is going to have to take the same message and understand what the task is that they're looking to do so for example example in invoices we're going to set it up
so that you can extract documents and load them into Google Sheets right so if you have an invoice maybe you want to pull out the date and the line items and the tax and the total and the subtotal you use AI to pull that data out and then load it into a Google sheet maybe you want to save That PDF file into a Google drive folder as well and maybe you want to find overdue invoices and send a follow-up email as well same kind of deal with contracts and resumes in this tutorial we're going to
be dealing with mostly just um PDFs and documents and all that kind of stuff because I think that that's also really trending too and I love the idea of merging these together I think it's really really powerful stuff so with That being said let's go ahead and let's set this up so I'm going to add another module and this module is going to be open AI chat gbt we're going to create a a um a completion here sweet and the method that we're going to use here is not going to change and then the model
that I want to use here is gbt 40 right now with this we need to add some messages right and there's going to be multiple messages that we need to add essentially we need to add a system Message a user message and an assistant message a system message is just giving Baseline context to Chad gbt the user message is giving the question that needs to be answered right here's we're setting the stage we're just saying hey this is what we actually need to do and then the assistant message is just telling it what an expected
return value should be what should they respond back to us with right I'm just going to copy and paste this in here and read through It together with you guys just so that you don't watch me and ending up uh typing for a very long time and I'm going to start with the system message first typically the system messages should always start first so this is just going to say um you're an intelligent AI manager tasked with delegating jobs to the right AI agent right there can only there and there can be more than one
right answer so maybe you're saying in this text message like Hey I want to um download both contracts and I want to download invoices simultaneously right it doesn't have to just be one thing at the same time so it's important to just give the context that there can be multiple right answers to the same question the next thing that we're going to do here is we're going to copy and paste in the contents or the the user message and then with this user message we'll just go ahead and uh I'll just read it out so
you're an AI Assistant manager you're asked your you're tasked with receiving messages and figuring out what AI agents or paths to assign them to here are the a uh here are the agents or paths so we need to deal with receipts we need to deal with invoices SLC contracts and we also have to deal with like resumés or applications or all that kind of stuff right so um here are some examples of the messages that you're going to be receiving and I like to give examples Right because it's one thing to be like hey you're
dealing with receipts but what happens if somebody comes in here and they they don't even mention the word receipt right they could go about saying the same thing in a different way and that for that reason I just want to make sure that we give some context to chbt to understand pragmatically what the result might look like because there's multiple ways of same the same thing so for example in receipts Somebody might say I want to parse this receipt I want to upload my receipts to Google Drive summarize my receipts for the month this is
probably not the best example because I used Reed in all three of them but um I think you get the point so the second one is going to be invoices and contracts and this should be number two here and with this we have three examples I want to save my invoices to Google Drive I want to get summary a summary of overdue invoices And I want to f up on overdue invoices right same kind of deal with applications and then essentially what we're saying is hey respond with the number representing the action to take right
so if the message comes in being like I want to upload receipts then respond with one because receipts is number one if they're asking to screen resumés and give a rating of those rums then it's going to respond with number three and similarly if it's about Invoices and contracts it'll respond with number two but it could have multiple different responses here as well last thing we need to do here is we need to actually provide the message so it understands what the hell that needs to analyze in the first place and we're going to delete
this and we're going to add in the body message here right so it would say test in this example but please don't ever uh said text because test because you're probably not getting The other response you're looking for and then the last thing here is we just want to add in assistant messages assistant messages are essentially telling chat gbt hey what should you actually reply with so in this example I'm just going to put one and then I'm going to add another assistant message just to give additional context where it's like two and three right
and then there we go there's two examples of what that could look like now what we're Going to do is save the scenario and we're going to add in something called a flow control and router with this router what's going on now is we're segmenting it to multiple different paths so let's say we have three paths it's going to start by going on path one and then after path one then it's going going to go down path two and then path three and it's going to check all three the thing is though is we need
to have filters set up here because we want to make sure That we only run the right paths because if for example we're dealing with receipts we would only want to go down path number one right because that's what receipts is corresponding to we wouldn't want to deal with invoices and contracts or applications so how we end up doing that is setting up filters here and this is going to be let's just call it receipts and the result of the AI manager must contain the number one and it's Contained because there might be multiple right
answers here might be right answer one right answer to second thing here is we're going to do invoices slash oops invoices SLC contracts and this result must contain the number two okay perfect and lastly what we're going to do here is we're going to do um resumés let's just call it and this result has to contain three sweet okay perfect so now we have our AI Manager set up and it will be delegating responsibilities to the AI employees that we're about to create right now so let's go ahead and now let's pretty much do the
exact same thing but this time instead of dealing with the manager now we're dealing with the employees that the the manager will be deleting the work towards right okay so we can we can kind of come back into chbt here and we're going to create another completion and this completion is going to be the Same model more or less I'm just going to copy and paste it in just to speed up some time here it's going to be gp-40 and we're going to add a couple different messages and here one is going to be for
the system one for the user and probably a couple for the uh assistants here sweet so let's take a look here going to first copy in that system message okay and that looks good to me I just want to Go back here oops and I want to add in just exactly what I said for the system message and the AI manager as well because um I wrote something in here as well so you're an AI you're an intelligent AI manager Tas with whatever okay cool sweet so we've got the first part down we're going to
add in another message here and this time it's going to be the user message and it's very very similar like you'll you'll you'll see that the The messaging is is very similar but um there's some small differences here so you're an AI assistant this time or AI agent or or whatever task with receiving messages and figuring out what tasks to assign them to here are the agent paths right and then this is actually dealing with now the particular tasks that you want this AI employee to actually do right do you want them to parse receipts
do you want them to upload those receipts to Google Drive do you want to Summarize those receipts for the month and then send it back to you these are all tasks that you're likely going to want to do right and likely tasks that you're doing anyways manually and likely tasks that you think that you don't like doing and that you're probably thinking man I could just automate this right so this is going to be something that you know hopefully practically speaking can can help you out here so same kind of setup but just this time
instead of Delegating it to employees now we're just going to be actually executing on tasks here and very similarly we have the examples written out so we have parsing receipt well what does that look like there's multiple different ways of saying the same thing I want to parse this receipt I want this line item of the receipt I want the line items of the receipt please upload this receipt to Google Sheets right emphasis on putting Google Sheets in there line items in There pars just all these different words to describe the exact same thing uploading
a receipt to Google Drive is option number two here and um yeah just sending the receipt to Google Drive uploading or putting or whatever and then thirdly thirdly um it's summarizing the receipt receipts for the month and then sending a text message back being like hey let's uh let's let's just have a nice text come in with an overview of all the receipts that we've um received For the entire month right and then we're going to respond with a corresponding number one for parsing two for uploading and three for summarizing we'll pass that same message
in again which will be the message from the text message okay sweet so that looks good to me and then ultimately speaking what we're going to do again here is we're going to take another router and we're going to create three different paths right and one each path will be for Every single task that you want to be executed now you can see Qui that this is going to become large right um so just keep that in mind and the first thing we're going to do is set up the filtering again this first filter is
going to be parse and very similarly they did before the result has to contain one and then the second option here is going to be Google Drive and the result has to contain Two sweet and finally the uh this is going to be summarizing okay sweet and the result has to contain number three right awesome so you can kind of zoom out here and see like the setup we got the manager employees tasks and now all we have to do is just fill out the tasks so for the first one what I want to do
is essentially I want to find receive s in my inbox and then I want to push them Into a Google Sheets um that has those uh specific line items in there so let's go ahead and build that out just highle overview we get the information from Gmail or Outlook or wherever your your email provider is and then we're going to take that and we're going to enter that into Google Sheets but before we enter into Google Sheets we need to use generative AI to be able or chat gbt to be able to take out all
the line ofms the date the the uh description the ti Title the um taxes the total the discount all of that kind of stuff so first module here is instead of using Gmail I'm just going to use email because I want to use the functionality get emails so we can pull in multiple emails at a given time right we'll select the right account this is so many accounts it's overwhelming um and then next what we're going to do here is we are going to choose the right folder now for me personally um I just want
to take All the files from every single folder or just the general inbox that works for me and then we're going to do a Gmail filter here and you can see in the red it says the has attachments we're going to use this particular query here because we want to make sure that there's PDFs or documents or whatever and the max maximum number of results is 100 so what that means is that we're going to search for the top 100 emails that came in and we're going to make Sure that those top 100 emails are
only emails that re that actually had attachments associated with them just for this I'm actually going to test with 10 because I don't want to deal with 100 results at the same time it's a bit overwhelming when we're testing it and yeah that looks good to me so we're going to go ahead and we're going to um we're going to fire this off now just for the remainder of this workflow what I'm going to do here is I'm actually Going to clone this and I'm going to move the trigger from this twio module to the
email just because instead of always having to text on my phone to toio to get this to start what's better is that we just build it out and then connect it afterwards once it starts working so what we're going to do here is we have the trigger here if we run once it's going to automatically pull in 100 emails from my inbox here so let's just wait and we can see Okay perfect so we have 100 different um invoices okay perfect so we have a 100 different invoices um or 100 different emails with particular uh
invoices being pulled in right or at least with attachments we can look down at the attachments plus one and then we can see like the file information and all of that kind of stuff right so that's that's really cool now the next thing that I want to do here is I want to actually use um a software application Like pdf. and essentially what we're doing here is we're taking those PDFs and we're going to uh convert them into text file so instead of it being a PDF now it's text and then we can use chat
GPT to read that text understand what's going on create line items and then we send that data into Google Sheets here so we're going to convert from p PDF right if you don't have this account set up here all you need to do is you just Need to go to their website log in at pdf. and the first thing they're going to give you is an API key and it is free to get started so um it's very simple way to to do this we're going to import a we're going to upload a file and
that file is going to be from this email here right so the data is going to be is going to ask for two things first the name and the data and the data and the name are going to be in the attachment section here so I'm just going to type At the top attachments and now we can see two things the data which we can plug in here and then the file output name which we can plug in there as well and what I want to do is I want to turn this from PDF to
text right and I want to turn it into Json output at the bottom here Json is just a file formatting way or it's a way to structure data and usually you know make.com is structured on Json this is kind of Json and a nutshell you have key Value pairs so uh key would be data and the value would be the the data of the file um and then for example let's go out of attachments maybe something a bit easier the key would be like you know who you're delivering it to and the value would be
while you're delivering it to me so that's kind of an example of what's going on here so that looks good to me all I want to do now is press okay and we can run this once and just take a look and see how this worked if we're Able to actually convert it from a file into text and the answer the short answer is no absolutely not we ran into an error here job error something went wrong please try again or contact our support well that's a very very helpful error to be dealing with um
it gives like no practical advice as to what the problem actually is so what we can do here is we can try again and um and work through this so I'm going to set up a filter here and this filter is Going to be that the attachments the data exists in the first place because I want to make sure that that actually exists and I'm going to click okay here and for the name section of this what I'd like to do is I'm I'm just going to add like a dash one on the end just
so there's at least something in there and we'll go ahead and try this again maybe it didn't have document for whatever reason maybe there's no name to the document so let's Just give it a shot again okay cool so definitely didn't work here um okay no problem so we'll go through it again and again and again until we can figure out how to debug this properly so I'm going to show advanced settings down here everything looks good to me H and okay so I'm just going to take a look at what I actually did before
to see if there's anything different because I don't think there is but I Could be wrong maybe it's just a system error on there end okay PDF to text in line async yeah it's essentially well the exact same the only difference here is I can just change this to receipt and we can try this one more time see if uh see if that solves the problem here okay so I think I figured out the uh the issue here and the issue is that um in this particular query I put has Attachments but I didn't specify
what those attachments actually were so in uh in in in this example it's pulling in all different file types CSV files images jpegs and also PDF files so all we have to do is just click this more information here and open up this documentation from Gmail on how we can filter better and what I'm going to do here is I'm going to do file name equals PDF so now when we add this in here we have two queries it has to have an Attachment and the file name has to be uh has to include PDF
and when we come back into the uh pdf. here we're going to fire this off one more time and this way it's only going to upload documents that are actually PDFs because it's not going to be able to pick up um transcribing essentially a picture to text it has to be in the right file format which is a PDF and here we go we have one response uh it looks good to me so we can see tons of different data Here and all we want to do is just look at the text right or yeah
so that looks good to me we have this particular information and now what I want to do is I want to take that information from this PDF and I want to break it down by line items so you can see in this example here that this doesn't even look like it's a invoice or receipt so what we'll do is We'll add in one more metric or one more thing here and and it'll be receipt and has attachment and file name Equals PDF and then that way it's only going to pull in emails with the name
invoice in it somewhere or receipt and then it's going to to continue on to the workflow um also if you didn't want to just have the the query here you could have like a chat gbt module afterwards being like tell me if you think this is a receipt and then only pass if it is but we're just going to set it up this way so the next module here is chat GPT and we're going to create a complete now With this completion what is going to go on is we're going to um just essentially want
to break this down into line items here so we're going to choose a model it's going to be chat same one as before gbt 40 and we're going to add in three different messages here first message is going to be a system message I'm going to say you're an intelligent bot that is um excellent at turnning receipts into line items right and the next thing we're Going to do here is have a oops a user message and we're going to say please convert this uh receipt into Json data with the following properties right and we're
just going to add in some some particular like data for receipts like price and tax and date and all that kind of stuff but we need to do it in a particular way which is Json data and the reason we need to do it in Json data is because of this right um we Need to like this is all Json data here right so for example remember earlier in the like video how if we just circle back here we're we're pulling in the message that the AI manager needs to listen to right the problem becomes
um what happens like we're finding the message based on the key body right so we know predictively when we enter in the key body it provides us the value of test but what happens if the key of body changed every time first time it was Body then it was paragraph then it was text then it was message then it was info then it was input well if you're always trying to find the key with body it's it's going to be undefined it's not going to pull in an answer because it's always changing every single time
so we have to standardize the key so that when we go to find if uh you know body it always pulls Us in the the value of that and that is why we're going to use Json here because we need to structure it in A predefined way so that when we pass information like price into a Google sheet price is always price it's not total for example right so we need to do that now how we're going to do that is we're actually going to go into chat gbt here so so I'm going to go
to chat gbt and say please create me Json data for a standard receipt and it's just going to do all the heavy lifting for me and that looks good to me right I'm just going to copy This let me actually just see here yeah I'm just going to copy this that's fine and we're going to add in one more message here this is going to be an assistant message and I'm going to say please output the data in strict Json with the following um structure and I'm going to say these values are templates below please
fill them in okay sweet and we're going to paste That Json here so essentially what I'm saying is the values are templates below so this is Supermart is a template 1 2 3 main street is the template but the keys need to stay the same so we have a receipt with that has a name it has a address it has a phone it has a website it has all the critical information that we need right speaking of which um what I probably want to add in here is price so we're going to convert a receipt
into Json with the following properties like Price um tax uh actually you know what I think it's fine just to leave it the way it is sweet just convert this receipt into Json data okay and we'll click okay here and actually before we do just one last thing here is we need to make sure that we show advanced settings and the where is it the output there we go finally is Json object and we're paring It to Json what that means is that in the next modules the data will look like this structured we can
pull it in it's standardized and we're good to go so I'm going to go ahead and run this one time I'm going to change the max number of results to one just so that we're not pulling in a million entries here and we're going to click run here and we're going to see the results come through and keep in mind this is not necessary this is Generative AI right we're generating Json data of a receipt based on some inputs but it's not thinking autonomously and it's not creating it's not making decisions on its own so
that's that's another huge difference there the result here we have all the information like the total and so on and so forth right so there we go pretty powerful stuff now we're going to move on and we're going to add this into Google Sheets so we're going to do Sheets do uh Google Sheets we're going to add a sheet but before we can add anything first of all we need to change the connection so that it is in fact the right Google account that we're pulling data in from and I'm going to actually go ahead
and create a sheet here and this sheet is going to be called AI agent make.com receipts okay sweet and let's just say we want the date we want the um line item name we want the Total or we want the uh price tax discount total so on and so forth right um we can easily go ahead and do that so let's take a look at our receipt here we have a result and in this we have multiple items here so it looks like we have three items right and we want to pull this data out
right so we want to create a line item for every single item how we're going to go about doing that is we're going to add another module in Here and this is going to be flow control and it's going to be an iterator what this means is we are going to take every item right and we're going to create a new row for it so if we look at the results again we have items we have three in here we want a different Row for every single item item one goes in row two item two
goes in row three item three goes in row four right um and how we do that is using an iterator to go through the first item first second item Second third item third all we need to do is go into this iterator here go into the array section pull up receipts and we'll enter in just this items array an array is a f fancy way of saying list a list contains multiple things those things can be items on a receipt then we'll click okay that looks good to me what this is going to do is
it's going to take a list that contains three items and it's going to go through those items one at a time first time it'll add the First item to Google Sheets second time it'll add the second item to Google Sheets third time it'll add the third item to Google Sheets so um circling back here to set this up what we need to do is just connect the right sheet we're going to search from all we need to find the spreadsheet ID to link make.com into this spreadsheet how we do that is through the ID in
the URL after the d slash and before the slash edit and we'll paste that bad boy in there okay Cool um so we're almost here sheet one is just the default sheet uh it's like a tab in Google Sheets you can see it I think my face was blocking it there and all we want to do now is just add this data now we have data from this iteration right or for that particular item but both all of these iterations of items contain similar um values so for example these Items are all on the same
receipt and they all share the same date so what we could do is we could pull in date here and no matter which item it is on the receipt they all share the same date and then the second thing that we could do here is we could do um the item I don't know let's just do do the description here right and then the price could be the total price of everything and then the tax could be uh okay we're just going to skip that for now and Discount is going to be this let's just
say 20% we can put in tax here and it's going to be that and then total will be the total from the entire agreement so we could do like total amount here okay sweet so we'll add this in save this let's run this and let's take a look and see we're grabbing the agreement from the email the PDF from the email we're passing that through pdf. which is turning it from a PDF to text we're turning that text into line items and Then we're going to go through every single version every single item in the
receipt and you can see that we go through a list one time because a list contains three items on the receipt but we enter in the Google sheet three times right up here where there's now three rows added and if we come back in here we have all of the information here right so that looks pretty good to me now all we have to do from now on out is just to finish this off is we're going To go back into twilio and we're going to send a message so I'm going to create a message
here and I'm going to say you know um phone number and I'm just going to say two is like whatever I'll pull in the the phone number that we purchased and I don't know 1111111111 I'm not actually going to spend any time doing this I'm just going to say Um invoices have been um pulled from emails and parsed into Google Sheets right practically speaking I pull up my phone here I send a text message saying hey please parse these receipts and then it'll send me a text message straight back being like the job has been
officially done that looks good on this end so we can connect this back in so we're going to move the trigger back to the starting point on twilio and Then we're going to just drag this plus button uh oops we just we're going to drag this plus button into these modules you'll see that these two are the same all we have to do is go ahead and delete this module okay so this is Task number one completed we get a text message through twio we say hey we want you to deal with receipts it says
receipts then receipts is path one we want you to parse the receipts and add them into Google drive or Google Sheets Okay Google Google Sheets parse okay path one and then it goes down this executes the tasks puts the the the line items into Google Sheets here and then it will give you a response back mean like the task has been done and then you tell your AI assistant thank you very much for doing something that would have taken me a few minutes pretty much instantly I saved a punch of time doing that so that's
task number one I'm just going to go through one other example today because Obviously this is uh this is going to be this would be a lot of work to set up now the three threei employees and the three tasks for those employees but I do have videos pretty much describing all of this kind of stuff and and how to get started with all of these different modules that you could Import in here all you have to do is watch other videos where I kind of go and break down these Concepts just in different ways
but yeah we have path two here which is going to Be once again pulling in all of those emails and I just cloned this module because it works in the same way where we want to find emails with receipts that has an attachment that has a file name of PDF and from there what we're going to do is we're just going to add that into Google drive right so what we can do here is we can upload a file and we're just going to choose the right account here which this is so overwhelming it's crazy
um I'm just Going to upload these all of these PDFs into the uh the red account folder I'm going to select from a list that list is going to be my drive and I just have this test folder but you probably want to create like an invoices or seats folder or whatnot and then all we have to do is just enter in the file information so we'll come back we'll search for attachments here and we'll enter in file name and we are going to enter in the data and that looks good to Me okay sweet
so this is what's going to happen is we're going to pull in the emails here right now we're just pulling in one but we could pull in two or three or four and it's going to go through each one individually this is pulling in a list so it could be a list of five or 10 or 100 emails and we're going to grab all of those receipts and we're going to upload them one by one into Google Drive and then from there um what we're going to do is we're going To hold on one second
I'm just going to clone this because I want to make sure that we can test this quite easily here without having to trigger from uh twio over here so I'm going to just disconnect these modules here and bring the trigger back over to this email and just make sure that this routing is set up because right now the uh it's pulling in from the wrong module right you can see it's invisible here uh meaning that the connection isn't set up So we're going to put in attachments again and this will contain the file name and
this will contain the data okay perfect so now we can just go ahead and test this really all I want to do from here on out is be is is just make sure we send off that text message but this time I want to do something special with that that text message I want to send a message to myself I'm going to clone this just so I don't have to redo it here I want to send a message to myself Being like hey not only did I uh upload all docu not only did I upload
all documents to Google Drive but I want to actually send a message with all the documents that I uploaded so all documents have been uploaded to Google Drive and then a colon and we need to add all these documents how we need to do this is we need to enter another module in here and this is going to be a text aggregator now what an aggregator is is it's the Exact inverse of an iterator so you take a list for example and you go through it one by one by one and then you add each
item to the sheet right one at a time first row two second row three third row four in this instance what we're doing is the exact opposite where right now it's pulling emails say it pulls 10 emails it goes to the first email uploads the document to the Google Drive second email uploads Google Drive 30d email uploads to the Google drive what We're going to do here is we're going to add a tool text aggregator what this does is we're going to set a source module here on email and it's going to essentially go through
all instances of the emails first email uploaded to Google Drive second email uploaded to Google Drive and it's only going to continue at the text aggregator once it's gone through all iterations or all versions so if I had 10 here it would upload 10 files and Then only once all 10 are uploaded then it would go to the next step of the text EG grader it's going to grab all of the data from those 10 runs and merge it into one piece of text why that matters is because from here what we can do is
we can put in um I'm just going to do attachments I'm going to do file name and we can do date for example so why this matters is that it's going to come through and and I'm just going to actually probably show you this As we uh because I think it just might be a bit easier just to actually visualize it instead but we're going to run this document with two results okay and we'll click run so it's going to run the first one it's going to pull the emails in run the first one and
then it's done now it's running the second one and then it gets to this stage here and then it grabs both of those and it creates it merges the text of both um receipts into one so I have One receipt here and then I have a second receipt down here right uh or or whatnot so instead of it being two separate or three separate rows like this now we're merging it all into one kind of um text field instead and then that text field would be sent back to me by text message saying hey you
have um well you have all of these receipts uploaded to Google Drive and here are the receipts that we have uploaded to Google Drive I just want to do one thing Which is show Advanced setting and row separat new row so that every single receipt that's uploaded um it's showing on a new line instead of being merged onto the end there so that essentially in a nutshell is is done now we'll connect this back together I'm going to delete this module and then we can align this I'm save this and I'm now going to take
out my phone here and I'm going to go ahead and give a text to the system to have this run so let's go ahead and Do that together so I'm going to say uh please uh parse my receipts and upload them to Google Sheets and upload them to Google drive and I've sent that text message out I don't think you'll be able to see it here but now we've received it let's start this workflow and let's see what happens so we've gone down the AI manager it routed it to the receipt section it said okay
we need to upload It to Google um sheets so routed it down the first path here we pulled in all the emails converted those PDF files into um into uh text line items and put them into the goog sheet here I'm just going to disconnect this these twio modules and try this again just because um just because I didn't set up a right number I just put in a burner number and it's it's causing an error because of that so we're going to try it one more Time we're converting into text and then line items
going through each line item one by one and then adding them into a uh you know a uh spreadsheet just like this and then because I also said please upload these receipts into Google Drive um it went down the second path because remember this gave an output of saying hey we're going down path one and two the AI employee was smart enough to detect that you wanted to execute two tasks at the same time and then it went Down and it uh grabbed the emails uploaded all the documents into Google Drive and then it would
have created an email back or message back being like here is the first line item with the date here's the second uh receipt with the date and then you just send that back via a text to yourself so that you could get notified on having that AI agents status right that the task has been complete and that in nutshell is how you can create U AI agents and Really like an AI Workforce right where you have multiple layers of AI employees right you have ai managers that manage AI um employees and those AI employees have
their own tool tools uh and tasks that they're responsible for and then they can execute those things and then give you the deliverables back the way I like to think about this is really if there's things that you um that you're doing over and over again and you're thinking man there must be a better way To do this i' probably recommend automating it and um yeah when you're dealing with really complicated workflows where multiple things have to happen at the same time this is a great opportunity for you to be able to build your own
AI agent to do a of the work that you're currently doing by hand so thank you guys so much for watching I hope you found value in this video if you did make sure to subscribe to this channel down below and uh leave any Comments in the comment section that you have if you guys are interested in getting help building these systems out either number one you can come to my uh automation agency here where we essentially help people just like yourself automate your their entire business so if that's something that you're interested in then
make sure to check out this website as well because I'd love to to see if we can work together and other than that guys I'll See you in the next video thank you so much and have a wonderful day bye-bye