n8n AI Agent Tutorial | Step by Step Guide to Building Your First AI Agent | Low code

17.4k views9325 WordsCopy TextShare
Devin Kearns | CUSTOM AI STUDIO
WHAT TO WATCH NEXT 🍿 https://www.youtube.com/watch?v=HWonospFOhE&t=122s MY TOOLS (btw, these links...
Video Transcript:
okay so today we're going to build a personal AI agent and actually take it uh pretty much step by step there's a couple things that I'm going to skip because um it's a little tedious and it would get boring uh but honestly once we go through this and if you follow along you'll pretty much be able to build any kind of agent that you want because you'll know um at least the way that we build them right um you'll know the functions the Integrations the tools the components that go into building an agent and not
only that but probably most importantly um the mindset right the strategy and how we do it right uh so we're going to build a personal agent and the tools that it's going to have are email calendar Google Drive it's going to be able to update the uh database and it'll have access to a database so technically the pine cone database itself is a tool right the the vector database um so it's going to have those five tools right and the updated the uh database is going to basically just allow it to add information into that
database like manually like allow the user to do that right um the resources that we're going to need are inad in obviously uh pine cone for the vector database open AI API model that's the one that we use um obviously you can use whatever one that you want uh and then we're going to connect it to telegram pretty much because it's like the easiest uh I think to just like spin up you could obviously put this into Slack Discord you can give it its own email address essentially and have like a web hook trigger whenever
an email comes in you know from that address or to that address um you could probably hook it up to SMS as well WhatsApp Facebook so you could obviously Port this into any kind of communication Channel but I'm going to do telegram today um and so let's get into it so the first step is to collect your data and I already did this part um because it is timec consuming and sometimes it can take days to run uh but I basically just had it extract a bunch of contacts from my email and calendar and all
it like all it is is just like a name email address and like the company they work for so have it here on this doc blacked out the uh emails but essentially you want to collect all of your data first so in this case we're collecting contacts data we don't need that much information um but you know that'll get that'll get uh get the job done like essentially like I don't want to type in the person that I'm emailing I don't want to type in their email address every time right so we use the the
database to have the agent like just pull the email address when needed right so Step One is collect your data this one does take a bunch of time and this is the one that I skipped in this video because um obviously like there's there's no point you know you guys can figure that out essentially um the next step is create your database and upsert the data so we're going to go into pine cone and I'm already logged in but essentially just log in create an account if you don't have one log in um you're going
to want to create an index name it something right just going to call it data you're going to set up the model we do small and then you know I'm sure you can fiddle around with all of this but we're not going to so I guess I have to upgrade because I'm on the starter plan so whatever I have this database already set up that's all you would be doing right it's just creating the index and then just like hit like submit or set up and it'll it'll create the database that's all you need right
and then grab your API key if you haven't done that already or know to do that okay super simple step one and two done step three so I put step three here um with um asteris because um in this scenario we don't necessarily need data capture automations because like there's there's not a lot of data that's like necessarily coming in and out of this personal agent um and and it also takes a little bit of time and and it really depends on you know what what your use case is if you're going to collect the
data right so like we used to say like and we still do where we want to create a hive mind for the agents where it has all of your data vectorized in a vector database right or embedded in a vector database um and we still do that but when it comes to like the agent's actually performing and and doing tasks we would much prefer we would much rather prefer that the agent pull the data from the original data source like where it lives so if it lives in Google Google drive or it lives in the
email or if it lives in your calendar wherever we would rather pull the data from there than a vector database and that's simply for accuracy reasons right like you know there's a bunch of chunking methods and and uh batching methods that you could do to um improve your results right but a lot of times we need like an exact answer and um we could do it right but like there's still you know that off chance that it might be you know wrong right and we don't want it to be wrong the whole point of this
is for it to be reliable right so I say that to say like we don't always need to do the data capture thing if you don't have to like if you just want to get the job done and you don't want to create kind of like this master database you don't have to do this like it's it's not necessary right to build one um and I kind of just want to get into the building stuff anyway so step four build your tools so now here's the fun part I'm basically going to build this from scratch
um most of it at least and I'm only going to give it a couple of different tools I'm not going to go crazy but you'll see like once you build one tool you'll see like how what the flow is like right so I'm basically going to have it uh send email have it create a calendar event I'm G to have it uh grab a you know Google Drive doc or just gra grab a document from from Google Drive and I'm going to have it um you know add stuff to the database if needed right so
let's start from scratch okay so we're doing a send an email tool and the way that we do it um at least our philosophy our method is we want to give the agent access to the platform not just like you know just oh this agent sends email so all we do is like give it send email no we would rather give it every action that's possible within an email within an inbox uh and then the agent can decide like what needs to be done right um that's that's how we go about it but in this
like for for this video I'm not going to do every single action but you'll see what I'm talking about here in a second so if I were to grab like a Gmail node uh let's do send message if I'm going to grab this node you can see that there are different options and parameters here so I always do this turn that off because it says like it was sent by inad in and I don't necessarily want that I add BCC I add CC cender name uh and I don't touch any of that we make all
these Expressions boom boom actually for now we probably don't need to do that um obviously add your credentials which I'll do that in a second but for now we want to do this right and so what what we do literally is just like copy this command C copy and you can see I've already been working on it and we're just going to throw it in here in chat gbt and we're going to say yeah this thing is getting pretty annoying I'm move it over here um we're going to say so you see how we have
the parameters here this is what we're looking for we also need we also need uh the two we need two subject and message so let me just make sure that it knows that um oh shoot get that in there sorry just filling around okay now I'm going to say actually let me delete some of this actually list out the parameters include um two address subject and message so it should give me the parameters here all right I just had to refresh I'm going to regenerate I don't know if you you guys have noticed seems like
chat gbt has been pretty slow recently okay so it's still going but this is perfect this is all we need right here we're going to grab these parameters I'm going to say put these parameters in a query field stringify uh the list of parameters make sure there are no objects only strings boom okay so this should give us what we're looking for we're essentially essentially what we're doing is we want the agent to Output the exact Json parameters that we need to implement or to add to the send message node right uh and so this
is what we're looking for right here so I'm going to copy that this will make sense in a second I'm going to come back I'm actually going to get rid of that and do a when called by another workflow and then here I'm going to pin this uh output so this is what we're looking for this output right save it boom so this allows us to kind of do some testing um without having to you know go to the agent uh workflow and then call this to to trigger it right like we can just kind
of pull it you'll see what I'm saying so you see how that quer is there um makes it super easy so obviously like if I were to pull this query here we can't use it right it's uh it's unusable at this point it's just like one string so what I do um is I use an AI node I know you can use a code node and we use those sometimes um but you know the AI nodes just get the job done a lot easier and it's part of the uh benefit of using AI these days
is like you can realistically like like basically the benefit of using an AI node is that like you could just tell it what to do and it'll do it like obviously duh um but like you can use it in like by replacing like a code node or a function node or or an aggregator node or a concatenation node or any kind of node that is simply there to manipulate and change and reformat data you can pretty much replace with uh an AI node right which is what we're doing so I'm going to go ahead and
go into uh chat gbt or into open Ai and add an API key here um I imagine you guys know how to do that so what I'm going to do is is just pause really quick grab an API key and then come back okay so we're back just put that in there boom and we should be good to go awesome I'm just going to rename this really quick just so we keep it all straight cool okay so we are going to do gb24 and then I'm simply just going to say parse the query and output
the parameters separately I'm going to make that a system prompt I don't think it actually matters but I like to throw that in there and something you have to do with these AI nodes especially when it gets passed through like a tool is like if I were to test this right now like output it content as Json it probably would work right but what you notice is like you see I outputed it separately here but what you notice when you start connecting these agents is it's like oh this was a you know an object and
we were expecting a string right so like simply just put Json and all caps stringify open parenthesis and close the parenthesis at the end and that'll fix your problem like if you're running into it where it's like okay like the tool didn't work because it couldn't you know it it it was expecting a string and it got an object it's because you need to stringify the query I imagine some of you guys are probably running into that issue uh because I ran into it myself so it's going to give us the same result here in
this little test but you know realistically when we're going live it's not going to work okay so back into the Gmail node we're just G to drag over these Expressions to subject there's obviously no data I always do text um it's never made sense to do HTML for us this right here this list is going to be uh it's going to create a list because I told it to at least I'm I'm pretty sure it will um like it'll it'll create a string a stringified list of these instead of like nested uh like a nested
list uh I'm just gonna say Deon make it fixed but I could I could drag sender name over there but it just it doesn't make any sense okay I'm going to go and and do the credentials for uh Gmail really quick um and I'll get i'll get back okay it takes a little time you can see these instructions here like just follow the instructions you'll get what you need if you don't know how to do this just follow the instructions right here you'll get it like it's just get your you know your client ID and
client secret doesn't take too long but I'm going to go ahead and go do that and then I'll come back okay just grabbed it now you just need to sign in with Google sometimes like this little button here to like sign in with Google doesn't show up it's just a blank white space it's still there so like hover over your mouse and you'll still be able to click on it um maybe they fixed that that bug but uh it was a bug earlier on that I was I was confused for way too long um for
like why it wasn't working okay cool so email account is connected beautiful just G to rename this just keep everything organized boom saved awesome okay so we have all of our data entered in here looks great cool last thing we need to do for this tool is add a response field so when like so the agent itself right it's gonna get my chat message say hey send an email to uh Andrew and it's gonna say okay I gotta send an email to Andrew let me use the send email tool so it's going to send that
like query with all the parameters it's going to send that over the open AI node is going to parse that and it then the Gmail node is going to send the message but then there needs to be another uh response that tells the agent that the job was done right so we just do response it has to be response I mean I guess it could be whatever you want but you'll see when we do the agent in a second so but we're going to do response and then I'm just going to say sent so it's
basically just telling the telling the agent hey that email was sent good to go right cool so that's it I mean this right here is a send email tool like it's uh super super simple and if if you watched my earlier videos you saw like my email actions tool was like super robust there were so many different nodes flying around every where a switch many different AI nodes um and what I uh and what I was looking for was like a more efficient way of doing the tools themselves and we figured out when I get
into the agent part that you really have to define the uh input or the output that the agent is sending to the tool um because when you do that then you can use that data to then go and use the do the tool so like let me just get into it uh instead of just rambling so step four build your tools I guess we have a couple other tools to build right calendar okay let's do calendar really quick so that's send email let's do calendar so same thing add a trigger it's going to be when
oh when called by another workflow not going to do anything there yet we are going to need an open AI node most likely so I'm just going to get it GPT 40 parse the query and output the parameters separately boom system output is Json we're going to need to have this query here so let me just first go and I'm going to add a calendar create an event additional Fields attendees oh so this one's weird because you might have to um actually we we'll test it later but what I was going to say is like
if we can only really input like strings right and so like if we have like multiple attendees can we fit multiple attendees in this one like attendee thing I'm not sure um haven't actually tried it oh my God okay let me do this credential thing again uh and then I'll be back with you all right so we should be good to go cool again we are going to rename it save beautiful okay nice and easy we're going to do my calendar um expression expression sure now we're going to add these fields here um what do
we need we can do summary that's going to be the title right the title of the event we also [Music] need I mean there's options here for you but description I think this is all we need just for just to kind of show how it's going right we have start end attendees description and summary beautiful okay so same thing right copy it take it back into chaty BT and and okay I'm going to just grab these parameters right here and say um what did I say up here okay I'm just G to put this in
here and copy this I'm going to try to create a uh a GPT that just does this for me um because I'm doing it a lot right like if I'm doing HubSpot it's like so many different HubSpot actions that you could take right and so what I want to do is I create a HubSpot agent you know that can do anything in HubSpot or a Trello agent that can do anything in Trello right just because we give it all the possible like actions that it could take inside of nadn um I think that'll work like
I think that's a viable like approach but we'll see cool so basically what I did was I I took the query thing that Chach outputed right this little string here like we need the start date we need the end date we need the attendees we need the description we need the summary and actually attendees right here it's showing as an object so what we need to do is make attendees a list a string stringified list so hopefully that'll uh fix the problem here okay cool it's giving me an example which is what I needed okay
perfect all right copy that take it back we're going to replace this because that's not going to work boom awesome okay so test it we're going to get it over into this node here drag that in and then we are going to stringify stringify open close boom awesome test it there we go although this is not what we're looking for [Music] exactly um because attendees needs to be it needs to be like a comma separated list so let me see this for for the attendees parameter make it a stringified list that is comma separated okay
let's see if that worked there we go perfect see how it's got a comma here that's what we're looking for okay back into the calendar node same thing as last time start and uh attendees nice description and summary awesome and that's that I'm not going to test it because there's no actual data here so it's just going to be like it's just not going to work um so we're going to do another set Noe here and we're going to do response and actually instead of doing sent I want it to get me the URL of
the event that it just created so let me just do this it's not going to work or do anything bad request yeah um I'm trying to think like because what I want to do is I want to to Output the the URL to the events so I could just click on it um but I might have to add a different like another uh tool for that right like get an event or something um these are micro tasks right like micro tools that we're that we're creating here so obviously that wasn't going to work I'm going
to clear that out so for now I'm just going to say uh you know the event was created going to hop out save actually I need rename this to um great event awesome okay so I think we have we got Google Drive I'm gonna skip Google Drive um it's the same it's the same concept like just grab you know what never mind I'm not g to skip it we're gonna do it like but it's the same right like it's kind of like you know every little microtask that could be done we trying to package it
up as a tool and giving it to the agent okay yeah you know might need to update the prompt at some The Prompt at uh some point I'm just going to put this in here because I know what it's going to be cool um next one would obviously be Drive Google Drive we're going to do uh create a file no let's just get a file what am I doing it should be up here create get a shareed drive and maybe it's like a dock um let's let's just create a file why not all right hopefully
this will just be like a sign in and it's not give me two seconds all right we are good to go got that in there obviously rename it cool okay file content we'll get to that in a second file name obviously and then we could add some of this stuff I'm going to do convert ah let's not let's extra steps that we don't need to do right now but you could obviously take this like many steps further um in terms of like the detail and exactly what these nodes are going to output for you um
but this is kind of just to show you you know the process right okay so we have what we need copy same thing back to chat GPT I mean I have a list of these already but I want you to uh just kind of understand the process that I go through uh to get this stuff done I actually don't need all of this I just need true mode Let's look just really quick okay we need file content we need file name and that's it folder ID where is it mode list Drive true list uh credentials
okay I don't see it here um okay you know what I'm going to do going to just delete all of this and just say uh create on package where query is the field and file content and file name are the [Music] parameters uh what did I say stringify only strings boom okay that should work it's not going to be a very long package here I probably could have written it myself but I honestly prefer not to there's some editing things like the space like this little tab space here that like it's you know I'd rather
just not type it out myself just have chat gbt do it do it right the first time okay so we grabbed that we're going to go add it back to this so we can just finish up with the nodes boom open AI awesome again we are going to need to stringify that I should just separated out for us cool and pull this in here and pull the file name into here okay I would honestly like be a little bit shocked if this uh worked the first time because the first time you know it just um
it doesn't uh create a file it doesn't like you know sometimes it works the first time sometimes it doesn't most of the time it is not uh G to work the very first time anyway what I'm doing is again I'm going to need to I'm going to need to add another tool that will actually pull this uh file that we just created and output it back to the uh agent itself or the agent can go and grab it so I'm not going to I'm not going to mess with that now but that's something that you
would probably want to do if you want to have it output like hey create create a Google doc um you know based on our proposal template and send it to me or send it to you know my colleague and so it's going to need to like create the doc and then it's going to need to grab the URL of the doc and then it's going to need to go and send it right uh so that's three different tools right there okay [Music] uh create document Drive okay awesome so I think we have three tools and
maybe need one more here um you know the database will be easy because that's already set up for me update the database let's get into that this one requires even fewer nodes right like we we genuinely just need like the pine cone uh Vector store right so pine cone right here credential going go grab that API key this one I can show you guys because it's not GNA expose me okay save uh cool save nice and we are not retrieving we are inserting and we'll insert it into Vector that's cool uh because that's the one
that I have and if you were creating this like specifically like I've talked to a bunch of people the past couple of weeks about different projects that they're working on or different projects that they would like us to build and a pretty popular one is you know the client success agent that I mentioned in uh some previous videos and the way that we set it up is like you still have one vector database but each client has their own namespace and then each agent that is connected with that client only accesses that Nam space so
if I were if I were going to do that in this case I would just make that clearer right client client name right assuming that I had already created that namespace in Pine Cone so we don't have to do that that today actually yes we do because this name space is contact data or it's contexts so yeah we had to do that anyway so there you go it's only going to get added to that namespace all right embedding we use open AI I mean when we set up pine cone we did text embedding small so
we're going to do that here as well document this is going to chunk it up for us right make it possible to embed these and turn them into numbers uh I guess we can keep this I mean for accuracy sake why not like the larger you do the numbers uh the more accurate it gets when you're looking for exact information um like if you're looking for uh it depends it depends how your data is structured right like like if you're looking for exact information but it's cluttered up with other information that is somewhat related to
it then the model or the agent is going to get confused uh but if it's like very clear like well structured data that's in there like how I have my contacts it's going to understand like what I'm talking about essentially like even if it's reading a list of contacts it'll know oh pull Devon's email because it can read my name there um tinkering with the database is a little a little bit of a process and it really depends on what your data is right and how you want to break it up and you know there's
so many questions to ask before you even get in there and do anything with it right so just going to call that done right set field done let the agent know fantastic okay so we don't need to do any of the chat GPT stuff literally the data is going to come in through here and it's going to store store it in the uh Vector store the index that we created in that specific name space uh and then it's going to let the agent know that it just did that right and boom okay so here are
our tools five tools right here the other one is going to be like attached to the agent so we don't have to create a whole workflow for it but now we are on to put it all together which is you know easy part because it's you know it's just an agent and once you get it give it the tools it's all it's really just all about the prompt like it's how you prompt the agent you can build the tools the tools are um somewhat simple to build there's a little bit of technical that goes into
it but it really is about the prompt and making sure the agent knows exactly how to uh use its tools and what its job is and the context in which it works right and maybe some examples um so what I'm going to do is go [Music] to AI agent boom I'm gonna use the tools agent and I'm actually going to Define so I have found that defining the input makes it so much better um because sometimes for for one reason or another it just it just breaks because there's uh data coming in so you know
hopefully this will make sense so I'm just going to say like maybe this won't work because I don't have this stuff attached let me attach a model really quick give it its brain and then the tools we might not have to do um just G to put M there we'll say hello it'll say hey what's going on oh no tool so a tools agent really wants to use tools right we're just going to throw chat input in there so it knows okay cool now we are going to attach our tools so we have three of
them what is it send email call this tool to send an email the description is important because the description will kind of be loaded into the prompt for the agent and it tells the agent what the tool is full it's four essentially right so call this tool to send an email we're going to grab the workflow ID in a second um but now we're going to the way that I've I've made this work essentially like reliably where it works every single time is specifying the input schema this right here is the Ultimate key if you
don't do this then it it'll work and you can find workarounds but it will not be efficient and it's not going to be 100% of the time so I always do specify input schema schema type is defined below and then we're basically just going to grab the schema that we had from the tool right so let me rename this send email and I'm going to show you guys like at the end what a full like version of this looks like uh just so you kind of have a visual so I'm going to save that I'm
going to go back into my send email I'm going to grab this workflow ID you can always find the workflow ID right here where it's like workflow slash ID it's essentially an ID uh go back I need to name it we're going to paste that in there and I'm going to go back to chat gbt and just grab the one that was for sending an email so I believe it's this one so we're going to grab this query string and we're going to paste it in there awesome okay so this is set up beautiful we're
going to add another one it's going to be our calendar one create event create event specify input schema Define below let's go grab it right here stringified attendees come back boom awesome now we just need the ID and the description to create a calendar event okay beautiful cool let's go back and grab that ID you know this is so easy the worst part about it is just clicking back and forth um but if that's the worst part about it then you know the world's about to change not to be hyperbolic or jump on the hype
cycle but it's hard to uh it's hard to think otherwise when you start seeing some of this stuff in action okay now we need to add our other one update data database I feel like I uh no Google Drive well I mean I guess it doesn't matter because we did both database workflow ID specifying RP put schema um actually we don't need to because this one we don't need to specify the input schema because it could just go right into pine cone we're not structuring it prior to going into pine cone we're just throwing it
in there um if you wanted to you should probably add some nodes like prior to the pine cone insert node that just like manipulate the data in one way or another um prune it right maybe maybe check it against some other database I don't know um but you could do I mean you know the world is your oyster because you can create custom tools inside of in8 in like it's it's the ultimate hack so we're going to grab that head back into here I'm going through this quickly because uh you guys can always slow down
the speed and um there's a lot of people who are you know kind of good at in or understand this stuff uh implicitly and I know when I'm watching like tutorial videos I kind of just it's like I know how to get the API key I know how to do the credentials and stuff just tell me like generally like tell me how to do it so I can go and hack away and figure it out myself so that's that's what I'm trying to give you guys here to update your database uh I'm G to say
if needed if uh requested The Prompt matters like the way that you communicate with the agent um matters a lot uh like it makes or break whether or not this thing works like you'll be like man why isn't this working why isn't this working and it's literally because the prompt isn't isn't dialed in the way it needs to be um Okay cool so we have our tools no we need one more sorry Google Drive create document Drive I think I called it rename call this tool to create a document in Google Drive we are going
to specify this one Define below let's go back and grab it it's not a lot so don't matter okay sweet we're just blowing through this right now I need to grab that ID create document Drive yeah that's what I called it okay grab this ID right there nice and boom awesome okay so usually I would be like testing this like every step of the way making sure that it's working um but yeah I'm pretty sure it's working I hope I'm right uh Vector store tool so we're going to add the um I'm just going to
call this database so this is going to be the actual tool or this is going to be the pine cone try to talk and do this at the same time to retrieve contact information like email addresses okay sometimes I actually I'm G to pull this over here sometimes I like to make this like really large because like I said the more the more I give it the more accurate it is for stuff like this when it's just like you know I just need accurate information I need that exact thing just give it to me right
Vector um name space so this is contacts actually let me double check because I'm pretty sure it is contacts name spaces uh it's contacts data okay so I was right the last time when I did the upserting so I'm going to go in there and fix that when I get a chance here so we're going to add this embedding model here boom nice and we are going to add just a gbt 40 I always use 40 like I just don't see a reason to use 3.5 I I don't even see a reason to use mini
um the reasoning capabilities on Mini are terrible in my experience so I just don't use it just G to try to use the best one that exists I mean the claw ones are pretty good but why why make things more complicated okay so I'm G to fix one thing here I need to change this to context data there we go okay cool and then we need to rename this call a demo agent okay and that's that I mean we should be good to go I mean the last thing realistically is the prompt um so this
is what this is how I like I would do it like super super quickly right I'm going to take a screenshot screenshots over my face right now put it into my prompt generator here boom generate a prompt for this agent based on the tools I've given it so it should give me a pretty decent prompt um that's not going to require a ton of editing I mean this is honestly a demo run so like I could just like type in a uh you know kind of a very Bare Bones prompt but you'd be surprised like
even a Bare Bones prompt it's just not going to work sometimes even if it's like oh you know super super simple tools and actions it's supposed to take it's still just like won't work the way that you know we want it to so you can see this is based on our template right objective context giving it context of the tools that it has the the uh what it needs to do instructions analyze user request retrieve necessary information prepare parameters execute the action and then it's telling it what the parameters are boom see and then giving
me some uh or giving it some output requirements so I'm going to copy that hop back in here and we are going to do system messages or system message I also going to do return immediate steps because I like to see the log of what's happening but anyway I'm going to paste that in here remove that little bottom piece that it always seems to add and then remove this top piece okay and we should be ready to go all right let's fire it away let's see if this thing works chat send an email to uh
Andrew Lewis saying is this working um it might come back to me and ask like you know hey you know you didn't give me a subject line or you didn't give me a body uh or a message to send uh so we'll see because sometimes you have to really tell it like just generate the stuff you have the ability just generate it uh yep so the email has been sent fantastic first thing it did was it obviously asked what is his uh what is Andrew's email right pulled his email and then did it again I
guess oh it responded to the database got it the database responded pulled my contact list here so this is this contact list that I'm like scrolling through quickly so you guys don't really see is uh you know let me get off of that because I that just seems like sketchy anyway it just pulled like a um you know a batch a chunk of that contact list uh so it pulled it and then it said you know this is his email address gave it back to the tool and then it used the send email you see
how it gave us the query here nice and beautiful and then the response sent right so that worked perfectly as expected and let's go to all executions just to really Peak behind the hood at uh you know the tool itself so we're going to go to send email okay so you can see like it sent it through sent this testing is this working it gave us the subject that's awesome this thing parsed it as expected the data was inputed here obviously there was no BCC or CC so it doesn't matter and then you know the
response node exactly as we designed it to do right um now let's do something more complex let's say I mean because we don't have any retrieval tools we're not going to be able to like create a document and then send that document because I would need to create a tool that would uh grab the document that was just created um but we can do like a calendar I'm just going to say like uh create a document called testing then send an email to stepen Lyn saying hey buddy uh also don't forget to schedule a meeting
for me and uh Andrew for tomorrow at we'll just do 10 pm just to make it easy so multiple steps right let's see if this thing can do it I kind of want to see it in action all right so it's pulling it up it's creating the document it's grabbing step Lyn's email most likely Crea an event didn't work we're going to go check that out in a second uh but here's what we got the document has been created let me move this over the document named testing has been created and email has been sent
to Steven Lind however there was an issue scheduling a meeting with Andrew Lewis for tomorrow at 10m would you like me to try scheduling the meeting again okay so that didn't work for some reason um let me go check exactly what happened if you want to check by the way quick tip if you want to check like let's say you're testing at your agent and a tool doesn't work you can't go and you know look at the executions in this like agent uh workflow you have to go to like all executions or the specific like
e executions for the for the tool so like go to the tool and see it um okay I mean it says all succeeded create an event is this what we're looking for yeah probably all right let's just see I don't know if this is it let's see bad parameters it's probably this right here um or maybe this oh wait what no start date because I didn't give it a start date wait did I said tomorrow at 10 p.m. oh no this is from earlier this is from earlier what am I doing let's go back all
right let's try tomorrow 10m uh with okay let's see we're just going to test that one tool okay that didn't work let's see what happened workflow does not exist the workflow ID must be wrong I guess I missed something there create event oh I'm missing an N you see that that N I bet one of you all caught that earlier so that's why it didn't show up in executions because it didn't even go all the way over there boom all right so now it should work one more time create an event for tomorrow at 10
pm with andreus okay nice beautiful beautiful beautiful all right I guess I'm gonna have to I want to go see but I'm going to have to like blur some things really quick okay so tomorrow at 10 p.m oh it created it for Sunday 7 to 8:00 pm and it did that because I didn't tell it what today was that's why that's funny okay so you can see it's all in the prompt it's literally all in the prompt like if you set up your tools and the tools are operating correctly and it's just like doing just
things just a little bit wrong I'm telling you it is 99% most likely that the issue is in the prompt uh which is why having a good a good prompt template is extremely important um but yeah I mean that's an agent I think we built it in a little bit less than an hour uh a little bit tedious um but that's just part of the process but once you understand like you know you have to in order to get it to work every time you have to tell the tool which parameters to Output right like
you have to define the output that's like the main lesson here Define this because if you don't Define it it's going to be like sometimes it works and sometimes it doesn't work and sometimes it does like you know if I want to send an email it's going to do like recipient address and then the next time it'll be like two address or recipient email address right so it changes the name every time and we don't want it to do that it needs to be reliable do the same thing every time when it's using these tools
and when we create these tools in a micro fashion like this we allow it to just do multiple different things rather than connecting an entire workflow to it what we're doing is is giving it the tools that it needs to do that entire workflow right uh and the agent will figure out which steps need to be taken it also helps when you give it really good instructions but yeah I mean it makes sense so let me just show you like um what like a full-fledged tool might look like like an email tool so if you
watched one of my earlier videos I showed off um a personal agent that had an email actions tool connected to it and that email actions tool had all these things right uh I'm replacing that now with an email agent and having like this trigger be that you know called by um you know being called by another workflow right and that workflow will be my personal agent and my personal agent every time he needs to take an email action will call this email agent here right and this email agent has every email action that could be
taken send an email reply to an email add a label create a label um delete a draft trash a thread reply to a thread and then what I did also is be like some of these like if I were to delete a draft I need the draft ID right like if you go into here let's do Gmail and let's do um delete a draft you'll see that the only parameter here is draft ID and the only way to get draft ID is to you know like search a draft basically you know like get a draft
um or get manyi drafts return you know however many add in some you know filters I guess not not necessarily here but return your drafts and then have an AI know understand which draft you're talking about grab that ID give it back to the tool the tool uses that ID to then go and delete that draft right step by step by step by step uh so I have four like retrieve so like retrieve message retrieve thread retrieve label retrieve draft and then all of the actions are like these are message actions these are label actions
these are draft actions and these are thread actions um and then this is obviously like the contact information right the vector store uh but yeah this is our email agent and um like now I can just copy and paste this to any agent that is going to have to take email actions at any point and it should plug right in obviously we're going to have to do some switching right like if you look at this list over here you know every single tool the hammer and wrench every single tool like there's a lot but like
let's so let's say I did like get message same thing right parsing it putting it in there response super easy delete email parsing it putting it in there response right uh now let's do a a little bit more complicated one retrieving draft IDs to be used so this comes in we're basically taking this right here the chat input so like the input from the user we need to do that because we need it to understand like which draft we're talking about exactly um and then we're obviously manipulating the uh data a little bit and then
this node is figuring out which draft I'm talking about that needs to be deleted and it's grabbing the ID only it's only outputting the ID and then the response node is this is going to be the actual ID right and then the tool will use that ID to go and delete the draft right so yeah I mean if you take an iterative approach a bottomup approach a tools not workflows approach you can build pretty powerful agents that have access to entire platforms like this email one has access to email essentially like it can do email
now um and I want to create you know we have a calendar one uh we want create a HubSpot one but HubSpot has a lot of a lot so it's it would be like a a very robust tool that we might need to just break down into multiple different tools um just depending on different buckets then we want to create a Trello one uh a slack one would be cool but they have a lot as well a lot of Scopes in their apis um but there's a lot you can do basically like if you define
the the input the tool is going to work Almost 100% of the time um and then it's just building from there it's really making sure that your data and your prompts are squared away and if they are squared away and you built your tools right which are easy to do as you can see uh then you have an AI agent and then you can build multiple and then you can build them on top of each other and have them talk to each other and interact uh and all of a sudden you have an autonomous business
right which is going to come out of nowhere it's G to happen slowly and all of a sudden you realize all you're doing as a human is just strategizing planning listing out tasks and then just like pushing it to the agents and they're going right the people that I work with who are uh not only the easiest to work with but get the most out of it working with agents are extremely organized on the exact tasks that need to get done in their business in the past if you're hiring a person you can rely on
that person to kind of like fill in any gaps that you have at times um that can still happen with agents but obviously it's not the the same as with like a person like you can hold a person accountable a little bit more right than you can with agents um but if you're if you're organized about the tasks that need to be done the workflows that you have uh and a little bit on the instructions on what needs to happen then you can run your entire business on agents today uh for the most part right
um so yeah I think that's pretty much it uh all I had at the end of this little deck here was put it all together um but that was like a really quick personal AI agent and you can keep adding to tools and keep making it better uh but I'm going to stop rambling it's been it's been a few days before I uh um since I posted the last video had to get a new computer because the old one was making the video super super choppy um and I didn't like it and I know some
of y'all didn't like it so hopefully this is going to be better quality overall but yeah I'm going to start rambling that's about it
Related Videos
How to Build AI Agents | Complete AI Agent Tutorial for Beginners
1:58:47
How to Build AI Agents | Complete AI Agent...
Nick Puru
8,471 views
How To Build Scalable AI Agent Teams | AI Agent Architecture 101
27:49
How To Build Scalable AI Agent Teams | AI ...
Devin Kearns | CUSTOM AI STUDIO
19,016 views
The Ultimate n8n Guide: From Beginner to Pro AI Agent Builder
2:32:10
The Ultimate n8n Guide: From Beginner to P...
AI Workshop
15,130 views
How we're creating AI Implementation Strategies for our clients
27:28
How we're creating AI Implementation Strat...
Devin Kearns | CUSTOM AI STUDIO
3,433 views
The Only RAG AI Agent You'll ever need
22:20
The Only RAG AI Agent You'll ever need
iOSCoding
3,263 views
16 Months of Building AI Agents in 60 Minutes
1:00:49
16 Months of Building AI Agents in 60 Minutes
Frank Nillard | AI Studio
139,456 views
26+ AI Agent Projects in 60 days, Here's What We've Learned
44:39
26+ AI Agent Projects in 60 days, Here's W...
Devin Kearns | CUSTOM AI STUDIO
10,653 views
Build a WhatsApp Personal AI Agent with n8n (text + images + audio)
58:00
Build a WhatsApp Personal AI Agent with n8...
Frank Nillard | AI Studio
14,995 views
I can't believe we coded an app with AI in 67 mins (V0, Cursor AI, Replit, Claude AI)
1:07:40
I can't believe we coded an app with AI in...
Greg Isenberg
582,325 views
Studio Update #02: TikTok Video Generator AI Agent, n8n Pin Data demo, Qdrant RAG Vector Stores
36:31
Studio Update #02: TikTok Video Generator ...
n8n
3,899 views
Flowise + n8n - The BEST No Code + Local AI Agent Combo
29:12
Flowise + n8n - The BEST No Code + Local A...
Cole Medin
29,328 views
Everything You Need to Know About Vector Databases for AI Agents
27:21
Everything You Need to Know About Vector D...
Devin Kearns | CUSTOM AI STUDIO
8,996 views
How to Build a Personal Assistant AI Agent in n8n (Step-by-Step, No Code)
1:06:32
How to Build a Personal Assistant AI Agent...
Nate Herk | AI Automation
15,421 views
Bolt.new Masterclass: How To Build AI Apps | STEP BY STEP
2:58:57
Bolt.new Masterclass: How To Build AI Apps...
Mani Kanasani
28,332 views
How To Use AI Agents To Do ALL Your Work - Full CrewAI Course for Beginners
2:16:59
How To Use AI Agents To Do ALL Your Work -...
Tyler AI
21,469 views
This Real Estate AI Agent Changes Everything! (NO CODE!)
20:11
This Real Estate AI Agent Changes Everythi...
AI Workshop
9,614 views
Ultimate Guide to Creating a WhatsApp AI Agent with n8n and Facebook API | Step-by-step Tutorial
18:58
Ultimate Guide to Creating a WhatsApp AI A...
FuturMinds
6,526 views
ADVANCED Python AI Multi-Agent Tutorial (RAG, Streamlit, Langflow & More!)
1:47:56
ADVANCED Python AI Multi-Agent Tutorial (R...
Tech With Tim
47,672 views
Step by Step: RAG AI Agents Got Even Better
34:13
Step by Step: RAG AI Agents Got Even Better
Nate Herk | AI Automation
20,678 views
n8n Masterclass: Build AI Agents & Automate Workflows (Beginner to Pro)
1:31:43
n8n Masterclass: Build AI Agents & Automat...
Nate Herk | AI Automation
62,125 views
Copyright © 2025. Made with ♥ in London by YTScribe.com