nnn has done it again they've somehow found a way to make building AI agents even easier so whether you've been building agents for a while now or this is going to be your first time taking a stab at it what we're going to look at today is how you can get one spun up in minutes and completely understand what's going on and start to add more tools and more functionality super easily so don't want to waste any time here we're already in nadn I'm going to hit tab type in AI agent and we're going to grab one and bring it into our workflow so the first thing to recognize is that we're chatting with our agent in nadn that's why there's a chat trigger right here and if we click on this red chat P at the bottom we can see this is where we actually talk to the agent next what we want to do is add a brain for the agent so I'm going to click on the chat model the plus button right here click on open AI chat model and I've already got my credentials connected so I'm good to go with chat gbt 40 mini as the brain for our agent and so now we're already able to talk to it I can come in here and I can say hello and it will respond hey how's it going today and then we'll just quickly take a look at what actually goes on in the agent all we're getting is the prompt user message so every time that we talk to the agent down here in this little window the agent right here as you can see because we're searching for a prompt within the connected chat trigger node this is what it's getting which is we just said hello and then we can see on the right the output which is what it said back to us was hello how can I assist you today now that we have our agent up and running all we have to do is add tools and this is where it gets super super easy so I'm going to click on the plus under tool and then on the right we have all these nodes as tool options and I made a video about this a week or so ago talking about how easy it is to connect these things using the from AI function but what I'm going to show you guys today is even easier than using from AI so when you think of an AI agent and you start to think about functionality the first thing you may think of is being able to send emails so I'm going to grab a Gmail tool right here if I can type it correctly we're going to grab Gmail and then we can see what we're going to do is set up our Resource as a message and we're going to be sending a message by the way if this is your first time you're going to have to connect your Gmail using a credential um I'll tag a video right up here where I talk about how to do that anyways when you want to send an email you have to basically fill out three things who's this going to what's going to be the subject and then what is going to be the actual body content message of the email also the email type which we're going to change in this case from HTML to text and anyways in that previous video when I talked about from AI we'd have to go into the two parameter click on expression type in two curly braces grab from Ai and then we'd have to define a key and then we'd have to describe that key so that the model knows what it's looking for to fill in this parameter and if that doesn't make sense to you yet don't worry it will but I'm just going to keep breaking this down real quick so now we don't have to do from AI anymore we can simply just click on this button over here that says let the model Define this parameter so all I have to do is click on this button click on this button and click on this button and now when we're talking to the agent it's going to use its brain it's a large language model to understand who to send it to what to make the subject and then what to fill in as the message you can see that we also have the ability to add a description to one of these Keys which I'll show an example of later but this just says explaining to the llm how it should generate this value a good specific description allows the llm to produce expected results much more often anyways I just changed the name of this node to send email so that the agent understands what it does and what I'm going to show you guys that we have no system message in here typically the system message is like the instructions for the agent and in this case all we saying is the default you're a helpful assistant and the reason I'm not changing this is just to show you guys how intelligent these agents are when you start to add tools like I said this took me a minute and it's already going to be able to send emails for us intelligently so let's get in here and try out a prompt so as you can see I said send an email to Nate herk asking him if he wants to go to a baseball game this weekend we'll send that off we'll see the agent think about it using its brain and now it's already sent that email before I could even finish reading that off so it said the email has been sent to Nate asking if he wants to go to a baseball game this weekend we can click into this node to understand what just happened so because I told you guys that it's using its brain to figure out the two the subject and the message you can see in the top left it filled out these parameters with the email with the subject and then also with an actual body message so let's hop into Gmail and take a look at this so here's the email we can see the subject is baseball game this weekend and the message says hey Nate hope you're doing well I was wondering if you want to go to a baseball game this weekend let me know if you're interested best your name so obviously we don't want the email to be signing off like this every time and we want to also get rid of this automatic message so back in Ed end all I'm going to do is add a description to this message field and I'm going to say sign off emails as Nate from ABC Corp so that should take care of the actual sign off and then I'm going to add an option down here click on append nadn attribution and then flick this off now all I'm going to do is come down here to the chat window hit repost message and it's going to do the exact same thing but this time we'll see that the email doesn't sign off with a placeholder and the message is gone so it looks like it already took care of that I'm back in my email now we have the message baseball game this weekend hope you're doing well wanted to see if you're interested in going to a baseball game and then you can see best Nate from ABC Corp and then there's no um this message was automatically sent by naden so just to put it into perspective of what's going on behind the scenes of that send email tool all we're doing is we're asking chat gbt 40 because that's the chat model we chose to extract the certain parameters out of our query so let's take a look at this example extract the event start time end time attendees and title I'll send this off it says um create an hourong meeting for 4:17 p. m. to go over the corporate retreat with Kelly and so here's the details that the AI model was able to extract event title start time end time and attendees so this is all that's going on within those tools and it's just filling in the details in the right spot in order to make that request to calendar email whatever you're interacting with so let's hop back into NN and do an example of creating a calendar event just like this real quick just wanted to say if you're looking for a more Hands-On approach to learning nadn and building AI agents then definitely check out the paid Community Link for that's down in the description we've got a great community of members who are dedicated to learning NN we've also got a great classroom section with deep dive to topics like building agents Vector databases apis HTTP requests and then I'm doing step-by-step builds of all the YouTube videos that I've shown on my channel we've also got five live calls per week but anyways let's get back to the video all right so now we're going to do a calendar example so I'm going to move this one over hit plus under tool and I'm just going to search for calendar and we're going to be creating a calendar event in our Google Calendar so clicked into the tool all we have to do is create a event so that's already set up um we have to choose the calendar to actually put this on so I'm just going to choose my emails calendar and then once again all we have to do is Click this button click this button so now the model is automatically going to be determining the start and end times and then we can add properties down here so we want to add attendees and we also want to add a summary which is just going to be the title of the event and then once again we just have to click that button and click that button and now the last step here is we just want to name the node so the agent knows how to use it and this is just going to be called create event and now in the chat window what I want to say is create an hourong meeting for 4:17 p.
m. tomorrow to go over the corporate retreat with Kelly and Ryan just like we did in that chat TBT example except for right now the agent doesn't know what today is so it doesn't know what tomorrow is so real quick I'm going to show you guys how we can do that and give the agent access to the current date and time we're going to do this within the system message so I'm going to change this to an expression I'm going to open up this up full screen so we can see and I'm just going to say here is the current date time and then we're going to do two curly braces I'm going to type dollar sign now and then it's going to go green meaning it's an expression on the right you can see that we actually have the date and time and if we just want to clean it up so it looks better for us I'm going to do format and then we have a nice clean date on the right anyways now we're going to send this off and we're going to see that it's going to be able to use its create event tool to actually make that event for us it's going to fill in those parameters like start time end time summary and who it's inviting and as you can see it just responded to us with the meeting details and we can also click on that link and what's really cool is that it also sent an email notification to both Kelly and Ryan letting them know of this meeting and we didn't even ask it to do so so first looking at my calendar here's today if we go to tomorrow we can see that we have our corporate retreat discussion from 417 to 517 and then looking in the emails we can see that we sent one to Kelly with the information for the meeting for tomorrow and then it also sent one to Ryan and obviously these are fake emails so it didn't really get sent but you get the point and we can see exactly what happened in here so within the create event tool we can see it created a start time end time attendees and also a summary and then if we click into the send email tool we could see that there were two runs so we have run one out of two and run two out of two and on the left hand side they changed so the first run if we go to this was sending to Kelly and the second run was sending to Ryan okay so that was cool and all and we spun that up in a few minutes but what if we actually wanted be able to send a real contacts in a database let's connect that up so here I am in aor table we can see that we have a contacts base contact table and we have these different contacts here so what I'm going to do now is go back into nadn I'm going to click on ADD tool and I'm just going to be adding an air table tool because that's where my contact database is stored and I'm just going to click on search I'm going to choose the base and the table that I'm looking for which is called contacts and I'm just going to say return all and we're going to change this node to get contacts and then all I want to do here is quickly just let the agent know that it needs to get contact information before it sends emails or creates events so all I said in here was before creating events or sending emails get contact information from the get contact tool so this should work and we should be able to do that exact same thing but now it's going to be looking at contact information so now I'm saying create a meeting for tonight at 7: PM with Michael Scott I'm going to fire that off as you can see it just went and got Michael Scott's information from the contact tool and now it created the event so we have the event created here's a little summary so as you can see it just responded it said that it was able to do that for us but if we go into calendar even though we asked it to create the this at 7:00 p. m.
it created it at 5:00 p. m. because it doesn't really know time zone right now and that only is because it's using local time as you can see so the way we need to fix this is we go into the system prompt and we just have to get rid of this format because when we do format it it gets rid of the time but now over here we have the actual time of where I am right now so all I'm going to do is send this off once again and we're going to see it's going to do the exact same process but now it's going to create that calendar event at the correct time so it's finishing up right now we'll see it post a message down in this window there we go we have our event created and now if I go back into the calendar we can see that we have an event created for 700 p.
m. which is correct but you guys are also always asking for Outlook integration so I just wanted to show you it's the exact same thing we have Outlook send email Outlook create event and all we have to do is the exact same thing where we click on these three buttons now the two the subject and the message are automatically being filled in by the model as well as the title of the event start time of the event and the end of the event so I'm going to send in this other query now that's saying create a meeting for tonight at 7:00 p. m.
with Michael Scott and send him an email to confirm and we should see it hitting both the send email tool as well as the create event tool there we go and now let's go take a look in our Outlook so here we are on Outlook you can see we have our meeting at 700 p. m. with Michael Scott and then if we go into our sent messages we have to Michael at dundermifflin.
com hi Michael this is to confirm our meeting scheduled for tonight at 7:00 p. m. but one difference I want to point out with Outlook and Google Calendar integration is that we don't have the ability to add attendees natively in this node to um a calendar event we would just have to access an HTTP request where we're accessing outlooks API in order to actually add people to these events but but unfortunately that's not what we're talking about today in this video so let's keep going so if you're still not impressed with how intelligent this agent's being already with a 40 Mini model let's go in here and grab a slack tool so what we're going to do is we're going to name this one send slack message we're going to choose the um Channel we want to send in and then we're going to let the AI decide the channel as well as let the AI decide the actual text of the message and so in slack there's multiple channels we have all up at AI social and YouTube testing and what's going to happen is we're going to let the AI decide what channel to send in based on our message so I'm saying send a slack message to social reminding everyone to log off early today so we should see this one hitting the send slack message tool as it did there we go the message has been sent let's go into slack click into the social Channel and we see hey everyone just a quick reminder to log off early today enjoy your evening but now what about a channel like all up at AI where there's spaces in there and then they have to be filled in by hyphens what I'm saying here is send a slack message to the all up at AI Channel asking if the Wi-Fi is down for anyone else is it can hit the slack message tool it's already been sent let's head over to slack and we'll see within up at AI Channel we have is the Wi-Fi down for anyone else so back in N end what's happening in here is the model is able to figure out the channel as you can see it populated it with all-up it- a and it's because it knows that a channel and slack if there's spaces it's going to have to have hyphens in there but let's say you have 10 or 15 channels and you don't want your agent to get confused this is a perfect use case of when you would start to add descriptions in here and you could say you know here are all 15 slack channels I have and you could list them out and then it's knowing it has to pick from one of these 15 and then it's always going to be sort of popular correctly so really this was just a simple demonstration to show you how easy it is to get something like this spun up um you know we could we could easily add an air table tool we could want to um add a record so we'll do create record within our contact base So within our contact base we have name email and phone number I can just click on these three buttons and now it's going to intelligently be able to understand how to add a contact using this tool so I'm saying add JN to my contacts here's his number here's his email the number isn't formatted correctly as you can see and it has been added to the contact database we come in here we can see we have John John and example.