How I'd Teach a 10 Year Old to Build AI Agents (No Code, n8n)

953 views4506 WordsCopy TextShare
Nate Herk | AI Automation
In this video, I break down building an AI Agent so simply even a 10-year-old could do it! I’ll wal...
Video Transcript:
today I'm going to be walking through the simplest way to understand what an AI agent is the different components how they actually take action and do things and then I'm going to show you guys how to build a super simple one in minutes there's a lot of information out there on the internet about AI agents so I'm going to try to break it down for you guys as simple as possible using this little pretty diagram that I built and then we're going to get into nadn and I'm going to walk you through step by step
how to get a email agent up and running really really easy I think you guys will be surprised by how quick you can spin one up so don't want to waste any time let's get straight into it as you can see right here we're looking at an AI agent sort of diagram with the different aspects right so in the blue here we're looking at the actual AI agent and you can just think of this as kind of an entity a human um an employee anything that you can pretty much talk to anything that has a
brain and understands instructions just think of it like that right so when we are talking about an AI agent the two main components within one are the brain which is basically a large language model like chbt CLA 3.5 something like that um and then some sort of aspect of memory so memory just basically means giving the agent context of what's been going on in a conversation that way it feels more human-like it's more conversational um rather than asking um a question and then getting an answer and then the Slate is wiped clean we pretty much
have a running history of you know a window of the agents able to understand that so that its answers in the future make more sense or its actions and tools make more sense based on what we've talked about the past then we also have instructions so instructions within an AI agent basically just to fine this is your role this is what you should be doing this is how you act these are the tools you have this is how you take action it's just it's commonly known known as a system prompt within a AI agent or
a system message um not to be confused by user messages which is more of the actual input going in so once we get into NN and we're looking at the agent I'll break this down it'll make a little more sense but the user message is the actual input this is how we're talking to the agent and the system message is the agent's instructions that don't change the input kind of changes every time based on every interaction finally of course it outputs something to us whether that's hey you know we were able to take action for
you or whether that's explicitly using a tool like a vector database to pull information back and then returning you that information there's usually some aspect of output so as far as this section of this little diagram input AI agent with a large language model memory system prompt and then outputting something this is like just kind of like a chat gbt thing that you would do um on your laptop or whatever and you're talking to it that's chat PT but then when you start to introduce tools this is where the magic really happens because now the
large language model has the ability to actually take action and let's say you just have one tool that's that's pretty cool but what we want to do is we ultimately start to add multiple tools and the agent uses its brain to understand sorry it uses its brain in combination with the instructions to understand what just came in what was the user message what tool do I need to do because what tool does what function and then how how do I actually go out there and take action so this is what it looks like right and
now if we go over here this is pretty much the agent we're going to be building today it's it's similar so as you can see we have the input right here which is um on chat message received so we're just going to be chatting with our agent in the naden environment so that's the user message coming through to the agent the agent uses the user message um along with its system message to understand um what do I need to do here so here's its brain here's the chat model here's another aspect of the brain which
is the memory and then finally our tool here is going to be sending an email so it understands to take the message um from the user craft an email and then it spits out to back to us it basically says the email was sent to blank so um I hope that all made sense I am going to hop into nadn now and we're going to walk through step byep how to build this really simple email agent okay we are now in nadn so first thing I'm going to do is hit add first step and we
are going to type in AI agent we're going to grab this AI agent here and as you can see it put in this AI agent um entity and right now it automatically connected with a chat message receive trigger we can come in here and we can say hello this is how we talk to our agent this is the user message this is the input going into the agent however as you can see um there was an error because there's no chat model subnode which basically means the agent has no brain it doesn't know how to
respond so under the agent we can see that we have chat model memory and Tool options we're going to add a chat model because we just got that error so let's give it the brain it pulls up a list of large language models on the right and we're going to click on open a chat model okay so now that we have the open AI chat model pulled up we have different options we have different models to choose from um but first what we need to do is connect a credential if we haven't done so already
so you'll click into this arrow and you'll click create new credential and as you can see what we need to get from open AI is an API key that basically allows us to access their different models so you can click on docs and it will give you a good sort of walk through documentation of how to do this but basically you're going to go to open AI on the left hand side you'll see API keys and then you're going to come up here and click create new secret key um we're going to name it whatever
we want and then it's going to give you a API key you'll copy this and then you're just going to paste it into nadn right here once you paste that in you'll hit save it will think about it it will go green to let you know that it was um connected successfully and then you're good to go you can click out of there and then you can explore all the different models that we have so right now I'm just going to leave this as GPT for mini one thing to note about your open AI you
have to connect a few credits or some sort of source otherwise it's going to say insufficient funds so if you're getting that error just add some money into your account now if we were to click on chat we could come in here and just say hello and it's going to be able to respond to us because it has a brain as you can see it said hello how can I assist you today okay now that we see that the brain is working let's try to add some memory first what we're going to do is I'm
going to tell the agent U my name is Nate so it's going to say like something like like Kate okay so nice to meet you how can I assist you now I'm going to say what's my name and it's probably not going to know my name I'm sorry but I don't know your name so as you can see it has no context of what we just talked about so now if we click on this Plus for memory and there's a couple different options here and we're going to use window buffer memory it's super easy especially
if you're chatting within andn um very very easy and very quick to set up as you can see it's referencing our connected chat trigger node the session ID is coming from that chat trigger node and the context window link is five so it just means it's going to remember five messages um past interactions so if you're interested in the session ID it's basically going to be different for um the different ways of communication so right now um within the chat input we can see it's an action of send message actually I'll go to table view
real quick the chat input that I just typed in was what's my name and then we have a session ID so basically what's going on here is that is what is being kept um in the context window length is based on the session ID that's dynamic because we have the Json variable as you can see right here anyways now that we have memory connected I'm going to say hi my name is Nate and it will say Hello nice to meet you Nate and then we're going to say what is my name and you can see
that it's going to say your name is Nate okay awesome so we have memory we know that it's working we just tested that we have our input over here we have our actual agent with its brain we have the output coming right here and what we could do is um if we just want to make things look a little more VIs visually appealing you could pretty much just add the output right here um this isn't doing anything this is basically just for me to show you guys how it looks so input agent output right it
says your name is Nate how can I help you today um and then brain so now we need to add the tool and then after we add the tool we can configure the system message so we're going to click on the plus and we're going to add a Gmail tool what we have to do here is connect our Google credentials um so if you need to do this and you haven't set it up yet you're going to click on docs from there um it'll walk you through how to do it pretty much but also I
made a video um I'll tag it right up here how to connect your Google credentials within 5 minutes so you can watch that it will all make sense what we're going to do here is um leave everything as is for sending a message and we need to fill out the two the subject and the message to pass over to Google to actually send this off so the first thing I'm going to do is I'm going to change the email type to text because we want to do that rather than HTML and then for two we're
going to come in here and make this an expression this basically just means um rather than putting in a fixed email that would every single time this tool ran it would go to that email we want this to be dynamic so we're going to click on expression so that way the two is going to change based on every interaction we have with the agent asking it to send a message for us so what we're going to do is type in two curly braces and then we're going to grab from AI this is a really really
cool function because it lets us to find a key and potentially descriptions about the keys and the type of data it's looking for but really I found that you can pretty much do it just do a key so in this case we're going to do a key called email address or no actually let's do just be a little more specific email recipient so this is telling the AI that when it wants to fill out this parameter of the two field all it has to do is look through the query that's coming in from the user
message the input it's going to look through that input and then it's going to decide who is the actual email recipient it's going going to pull that out of the query because it's going to use AI to do so and we're going to do the same thing for the rest of this node so subject we'll paste that in here make sure it's an expression and then the key is going to be subject and then we're going to do the same thing for message the expression is going to be email body so now we have those
three Fields set up automatically AI is going to be looking through the query based on the user input and it's going to fill out the parameters and then finally I'm just going to click on ADD option click on append and attribute and then turn this off all this does is otherwise it's going to at the bottom of an email it's going to say something like this email was you know sent by nadn so finally we're just going to name this node send email just so that in the future if we wanted to start to add
more tools we were able to Define to the agent what each tool is called and what each tool does we pretty much have everything the input the output the agent the brain the tool now we need to set up the system message so in this agent we we are going to click on ADD option and add system message by default it's going to say you're a helpful assistant which is fine it probably would work but we want to Define exactly what tools it has and when to use them um and so as you can see
we have the system message down here like I said this tells the agent how to act this is the instructions but then the user message up here is going to be the input every time so right here as you can see it was what is my name so I'm going to be using this custom GPT that I've built to help me prompt my AI agents if you want to access this you can do so in my fre School Community the link for that will be down in the description and I know I'm going through this
a little fast but if you're looking to dive deeper with nadn feel free to check out my paid Community Link for that will also be down in the description we've got a great community of people also trying to learn naden always asking questions always sharing resources a great classroom section as well as five life calls per week to make sure you can hop in there and get all of your questions answered so I'd love to see you guys in here anyways back to the GPT I pasted a screenshot of our workflow into the GPT and
then I said an AI agent that uses the send email tool to send emails based on the user's query it is a helpful assist that is friendly so let's send this off to the GPT and we'll see what kind of system message we get back as you can see it's outputting it in markdown format which is really really nice because that helps the AI agent sort of establish um different sections of the prompt as you can see we've got overview context instructions tools examples standard operating procedure and then final notes so we're able to copy
this prompt come back into nadn and then paste this as an expression um I just like to do Expressions so I can go full screen in here and it's fully marked on formatted which is really easy for for us for readability as well as for the AI agent to read through so we'll hit save and now let's test this out by asking it to actually send an email for us so we're going to say can you send an email to Nate herk 88@gmail.com asking him how his day was okay so we're going to see this
in live time which I always think is cool um that is going to take place really quick but essentially what happened here was um we got the input the user message was can you send an email it's what I just asked right so then it used the brain and the system message to understand what it needed to do and then it hit the email tool if we click into here we can see that we got the correct email um the correct two the subject was made which was how how's your day and then the actual
message was made which was hi Nate I hope this message finds you well I wanted to check in and see how your day has been going looking forward to hearing from you best placeholder your name so that's something I wanted to show you guys by default it's going to sign off like that because in the system message it doesn't know who to send an email from so if we came into the system message real quick and at the very bottom we just said um always sign off the emails from um Frank and now we save
this and we pretty much just rerun this exact same query we'll watch this happen and there we go new email was sent and as you can see now it was signed off best Frank so let's hop into Gmail and actually see this email okay so here it is hi Nate I hope this message finds you well I just wanted to check and see how your day has been going and then you can see it signed off best regards Frank so something else important to understand here is the logs but let's pull it up within the
AI agent just because it's a little bit bigger so we'll click in the agent we'll click on logs and now we can see basically what the agent did so we can see the steps that it took first thing that it did was it put our chat message into the window buffer memory that way we can store it later um if it needs to reference it from there it went to the open AI chat model which all it did was it looked through its prompt so it could understand what it needs to do based on the
input coming in from us so it realized based on the prompt that it needed to use the tool called send email so we can see that it created this um these three parameters which was the email recipient the subject and the email body and if you remember those are the three that we set up as keys in this email tool right here um email recipient subject and email body so anyways after it created those parameters using AI it actually sent out the um email this is just a response from Gmail basically saying it went through
here's the ID of that email it came back to the open ey chat model to check if there was anything else needed to do and also to craft a response to us and as you can see the response down here was I've sent the email to Nate herk asking how his day was if you need anything else feel free to ask and finally it hits the window buffer memory again in order to update the memory so that's really cool we had that working we're able to chat with it and it's able to send emails on
our behalf but what if we don't want to type in an email address every time well what we can do is we can connect a contact database in this case I'm just going to be using this Google sheet database um just for Simplicity sake but this could always be something from your CRM or an air table or a vector database even so right now what we're going to be looking at is just this contact database we're going to be asking to send an email to Phil which is the email that we just use of course
and then we've got some dummy data here to make sure that it's searching through and find the right one so all we're going to do in our agent is move this guy over add a new tool and we're going to grab a Google Sheets tool once again your credentials will have to be connected this should be easier now that you've already done it once with Gmail but um we don't really have to set anything up all we have to do is grab the right document which is contact database and then just choose the right sheet
which in this case there was only one sheet and then we just want to name this something like contact database that way it knows how to look through it based on our prompt but you may have realized that in our prompts we didn't mention anything about a contact database so what we're going to do is we're going to go into chat gbt and we're going to utilize the memory aspect of a large language model and just say can you refine this prompt and add a tool called Contact database that the agent will use to retrieve
contact data like email addresses okay so there we go we'll fire that off it'll pretty much keep all the same content that it already knows of you know from the previous prompt it's just going to add in the tool um about contact data so as you can see now we have the contact database tool retrieves contact data such as email addresses based on the user's query um it comes back with some more examples and stuff like that um so we're going to copy this back in to our prompts right here so we're going to save
this and we're going to try to chat with the agent again um so remember this time we don't want to give an email address we want to say send an email to Phil and then we want to make sure that it goes to the contact database to get Phil's information and then it will use that to send the email so can you send an email to Phil um letting him know that I will not be at work today okay so it's going to hit the contact database going back to the brain going back to the
Gmail node back to the brain we'll look at the logs in a sec but let's just see what happened so first of all the agent responded to us with I have sent the email to Phil letting him know that you'll not be at work today if there's anything else you need just let me know so click on the contact database we can see that it looked through all um how many rows there are it looked through those right um and then we can click into the Gmail node and see that it got the correct email
the subject was not attending work today and the email body that it created was hi Phil I wanted to let you know that I will not be at work today please let me know if you need anything urgent in my absence thanks Nate but yeah that's basically going to be it for today's video I know that it was kind of a simple build but I just wanted to show you guys how quick and easy you can spin some of this stuff up especially if you haven't built one before it may seem a little daunting but
especially with these Cool Tools and the from AI function it's really really easy to continuously add more tools as well as get them up and running really quick um so you know once you've done this there's other ways that you can have outputs and inputs sorry I should have gone the other way around inputs and outputs um right now obviously we're chatting with it within naden and we're able to get the output within NAD as well but you could connect this to you know your telegram you could connect it to your phone you could connect
it to slack anything you want um and they can be triggers as well it doesn't have to be just hosted within the endend environment and then similarly you could get the outputs pushed somewhere else to you so this could be a complete backend application that you're able to hook up and you know talk to however you want I actually just made a video very similar to this about a email agent where I connected the input and the output to 11 Labs so that I was having a phone conversation basically with this agent and in real
time when I was asking it to send emails it was doing so and we kind of saw it take place and then it would respond to me after the email was sent and say I sent that off for you um so really cool stuff that you can do once you understand sort of the basics but as always if you guys enjoyed please leave a like definitely helps me out let me know in the comments what else you guys want to see and I really appreciate you guys making it see on this video so I'll see
you guys in the next one
Related Videos
Build Everything with AI Agents: Here's How
39:58
Build Everything with AI Agents: Here's How
David Ondrej
81,971 views
The BEST (and easiest) Tutorial To Learn n8n - RAG AI Agents And Vector Database
28:56
The BEST (and easiest) Tutorial To Learn n...
Kirk Artman
2,243 views
Turn ANY Website into LLM Knowledge in SECONDS
18:44
Turn ANY Website into LLM Knowledge in SEC...
Cole Medin
77,676 views
The Best Agent Framework Has Arrived (Coding Tutorial for PydanticAI w/ OpenAI, Ollama, AzureOpenAI)
17:12
The Best Agent Framework Has Arrived (Codi...
AI Software Developers
15,964 views
5 n8n Tips You NEED to Know
16:46
5 n8n Tips You NEED to Know
Nate Herk | AI Automation
5,221 views
How I Built an AI SaaS as a Solo Founder
20:04
How I Built an AI SaaS as a Solo Founder
Levente Szabo
2,406 views
How to EASILY Build AI Agents (5 Steps)
10:50
How to EASILY Build AI Agents (5 Steps)
Tyler AI
18,591 views
Generative AI is a Parasitic Cancer
1:19:55
Generative AI is a Parasitic Cancer
Freya Holmér
323,517 views
Everything I Learned About AI Agents in 2024 in 19 Minutes
18:44
Everything I Learned About AI Agents in 20...
Nate Herk | AI Automation
10,348 views
Turn any YouTube Channel into your AI Mentor - Obsidian is the ultimate automation workbench for PKM
29:29
Turn any YouTube Channel into your AI Ment...
Zsolt's Visual Personal Knowledge Management
8,792 views
How I Built an AI Agent to Automate my Emails in n8n (Step by Step, No Code)
22:37
How I Built an AI Agent to Automate my Ema...
Nate Herk | AI Automation
6,117 views
How to Build AI Agents with PydanticAI (Python Tutorial)
33:56
How to Build AI Agents with PydanticAI (Py...
Dave Ebbelaar
18,375 views
Elon Musk’s SpaceX Starship rocket BLOWS UP minutes after takeoff with debris raining down on Earth
10:12
Elon Musk’s SpaceX Starship rocket BLOWS U...
The Sun
358,273 views
The Best RAG System On YouTube (Steal This!)
18:36
The Best RAG System On YouTube (Steal This!)
Nate Herk | AI Automation
16,650 views
Anthropic Revealed Secrets to Building Powerful Agents
19:06
Anthropic Revealed Secrets to Building Pow...
Matthew Berman
132,302 views
Flowise + n8n - The BEST No Code + Local AI Agent Combo
29:12
Flowise + n8n - The BEST No Code + Local A...
Cole Medin
33,810 views
The ULTIMATE Local AI Setup: LLMs, Qdrant, n8n (NO CODE!!)
29:32
The ULTIMATE Local AI Setup: LLMs, Qdrant,...
AI Workshop
61,825 views
smolagents - HuggingFace's NEW Agent Framework
29:10
smolagents - HuggingFace's NEW Agent Frame...
Sam Witteveen
31,113 views
Building AI Agents: Chat Trigger, Memory, and System/User Messages Explained [Part 1]
20:16
Building AI Agents: Chat Trigger, Memory, ...
n8n
13,230 views
The Future of Knowledge Assistants: Jerry Liu
16:55
The Future of Knowledge Assistants: Jerry Liu
AI Engineer
128,790 views
Copyright © 2025. Made with ♥ in London by YTScribe.com