How I’d Teach a 10-Year-Old to Build AI Agents (No Code, n8n) - Full Step-by-Step

Michael Elliott walks through building AI agents in n8n without code. He shows how to set up assistants with memory, connect Gmail and Google Sheets, and create working workflows from scratch.
What's going on guys? Michael Elliott here. And today we're going to be learning everything about AI agents in NAN in the most simple way physically possible. This video is going to be short by the time you get to the end of it. You're going to understand how to deploy your full AI assistant for yourself step by step, initially starting with some diagrams that I've got that will build on your basic understanding already from LLMs and ChatGPT, Claude, whatever. And then from there we're going to add step by step and understanding on the most basic level possible of you can implement them. So let's jump in. Now this initial graph is what you would typically see when you write to an LLM. So when you use chat GPT you have a manual input can be very long winded if you're asking specific questions. The large language model, which in this case is OpenAI goes away. It thinks about it for a little while and then it spits an output out. Now there's no reference to any of your individual tools, your tech stack, what you use, Google Calendar, Gmail, anything inside of this, you just ping messages backwards and forwards. With an LLM, it can't take actions, it cannot do things for you, it cannot send emails, it cannot send Slack messages, it can't do anything. All it can do is answer based off of its understanding of what is happening in the conversation. If we look at the next step, which is a level up from that and an NAN function in flow, there's one example here, like a meeting transcript is received, we could generate a summary using an LLM and it's sent to Gmail, you can do that. The two examples below are Google Sheets. So this is a Google Sheets trigger. So it's watching the sheet for any update. The LLM then goes and does its thing and it updates a row in a Google sheet. Great, great, simple flow, fantastic. In certain use cases where you can send them off, the problem is is they're extremely rigid. You can't ask it to send different information, update a row in a, in a, in a different way. You can manipulate system prompts, etc, but it has no reference to any other tools that you may be using. It simply just has the sheets access and it's watching for when they're, they're updated. Now when we look at what we're going to build today, this is your own AI staff member and the difference here is very similar. I know it's a bigger graph, but don't be fooled by this because the input and the output still Exist exactly the same way you would just write a message to Chat GPT inside of this AI agent. It has a mind which is the LLM itself. So it's Chat GPT itself in mike. In this case, that's what I'm going to use. You can use any, but then it can take commands, it can take instruction you by using a system prompt which we'll get to shortly. We can then tap into a whole bunch of individual tools that we might use on a day to day basis. And those tools can include things such as Slack, Gmail, Supabase, Google Sheets, Click up. You know Supabases here. This is a, as a basic flow example, this does have an output. This isn't necessary. We're gonna, I'm gonna show you the build why in a moment. But this is the key thing here, the tool section that allows us to be able to leverage tools and the memory here, which is, allows us to be able to keep a track of what has been happening in the chat previously. So let's jump in to nan. If you don't have an NAN account, just head over to NAN IO, sign in, you'll get some free credits. This is a good example of them using an agent actually. And you can then get into deployment. So just literally sign in, sign up. And when you sign in and sign up, you're going to come to a page that's here, okay. And you'll probably come to, you'll probably come to an overview page where. But when you're, when you're in here, what you want to do is just hit this little plus sign at the top left and then hit workflow and it will bring you to a new canvas like this. This is called the Canvas. Throughout this video I'm going to give you some hotkey information. Take it or leave it. You don't have to use them. But for example, you can see logs is showing at the bottom of my screen here. Hit right here. So if I press the letter L on my keyboard, if I'm on the canvas, that is if I press the letter L, it will open and close. The log can be really clear now you can see the canvas extremely clearly. If I hit L, it just makes it a little bit smaller. So that is how the, the process, you know, from a log perspective goes. So I'm going to hit command or control and I'm going to scroll on my mouse and that zooms in or out. So these are some basic concepts of how you can use NAN to be able to do it and operate Functionally, especially when you're looking at maybe larger flows, this little button that's obnoxious when you're actually at the real size of what NAN is, hit the plus sign on it and that will bring up a list of triggers. This is what is on the right hand side of our screen right now is a list of triggers that allow us to be able to trigger it in any way we can trigger on a schedule. We can do it on a form submission. This sort of gets into the power of what you can do with AI agents, et cetera. But we want to run it on a chat message. So I'm going to select it. Don't worry about any of the individual settings inside of here. If we press Escape, that will bring us back out. And I want you to get into a habit of hitting space and renaming, because renaming nodes is really important when you're building them out so you understand them when you reference them tomorrow or next week. So I'm just going to call this chat trigger and then hit rename. Okay, so we now have a chat trigger. You can see it here, bottom left, which is great. We can now start a chat. The whole workflow will start when a chat is triggered. So on the lines of building the AI agent, what we want to have next is we want to have an AI agent. So if you just click this little plus button again and if you search for AI agent, you will find it. This, this cool dude here, AI agent, hit him and this will bring it up. Now what, I'm not going to go into any detail about this, but there are no settings that need to be, need to be changed. The source for prompt, which is the user message, it comes from the trigger node. So that's just to explain what this is. All the other settings we don't need, we don't need to worry about the format of the output. We don't need to worry about any of this. We literally just escape out and then hit. I'm going to hit space again and I'm going to call it my AI Assistant. Let's call it AI Email Assistant. Okay, My email assistant. So we now have a chat trigger and we have the shell of an AI agent. So it exists, it's there. But at the moment we don't have anything connected to the assistant. And that's where the agent and that is where the power comes from from this, this perspective. So we're going to hit chat model and on the, the plus icon under chat model and on the right hand side, you're going to see loads of options. Deepsea anthropic. I'm grok. I'm just going to go with the OpenAI chat model. Now when you come in here, you may not have a credential, okay. And if you don't have a connection, have a credential already. Just hit the, just, sorry, let me just close that quickly. Hit the, the pen icon. Sorry. Hit the drop down, hit the Create new credentials and you'll go into this API screen. Now this, an API is simply just a secret. It's a password. It's something unique to you that you should use. If you had my API key, for example, then you would be able to go out there and you would be in a situation where you were able to manipulate data using my Chat GPT account, which you don't want. So keep your API keys safe, don't share them with anybody, but look at them as a secret. They're effectively a secret. They're just. It's a password, it's something that you've got that no one else has got. So that you can connect two platforms to one another. In order to get this, in order to get this API key, what you want to do is you want to head over. You see, I just created one. So let's go back to here. Let me just go to platform.API.com because.OpenAI.com this is where you need to head. And once you get inside of here, you could, you need to create an account. Create the account with the email address, obviously that you've, you've got with your own account. You can connect others, but you go to the top right of the screen and you hit the little cog icon. And once you hit that little cog icon, you hit API keys and then you hit create a new secret key. And I'm going to call this ignore test key. But I advise you call this nan email assistant, AI assistant key, whatever, because that's what we're going to build out. We create the secret key and here is your password effectively. Now we go back to nan. You paste that key inside of the API key section and hit save and your connection is made. You now have a connection. I'm going to press escape. You now have a connection with your OpenAI account, your ChatGPT account. I'm going to go back and use my original one, but you just select the credential you've created. It'll be the only one there potentially. And from a model perspective, don't worry too much. The mini is more than capable of Taking what we've got now, I mean, you could use chat GPT 4.1. It's all about the usage of tokens and connection points and things and the cost that it ultimately has to you. You should get free credits when you sign up. So there should be no issue for you to test this out. But the model doesn't really matter in this particular use case because we're not building anything that's crazily complex. So I'm just going to hit escape. And now the canvas that we've got, I'm going to press L to close the lock screen so you can see this clearly. What you have here is a trigger, an AI assistant slash agent and a brain. This is the brain. This is what fuels our AI, AI agent. This is what, this is where it pulls all of its information from. As it stands. This is where it can go out there and search just like we do usually. So let's, when you use Chat GPT, let's ask it a few questions. Hey, I don't know, how are you? So I've asked the robot how it is today because obviously we don't want them to come after us. So you should always be friendly. And then I'm going to say, I just wanted to let you know my name is Michael and my favorite color is green. And I'm going to send this message. It's probably going to thank me. It's going to say thank you. Yeah, thank you, Michael. That's a great name and green is an awesome color. Thank you very much. You know, I appreciate the cheerleading Chat GPT but now is where a key section happens. If I ask this agent, so what is my name? It can't answer and I've just told it what my name is. And the reason for that is because it doesn't currently have memory. It needs a memory in order to be able to reference previous and historical conversations. It requires one. So what we're going to do is I'm going to hit escape from my. Because I was presenting, you don't have to escape there. I'm going to clear the execution and I'm going to reset the chat session so this will bring it back to this screen and I'm going to hit the plus icon under memory and I'm going to add a simple memory. What's really important here is that simple memory is an NAN based memory system. No credentials are required. We can use it. It's fantastic. But when you, if your brain's sort of thinking a little bit further ahead, it's okay. And I'll just give that some context. You could use anything here. You could use, you know, Supabase, you could use anything you could use. You can connect them as tools, but your memory can be. And I'll disconnect this and I'll just showcase some more to you. What like on the Motorhead memory, there are a few other individual memory platforms that you can connect and go into APIs, et cetera. But for now we're going to stick with the memory. Simple memory node and I've disconnected it by hitting the. Hitting the little garbage can that's there. And if you do that and you want to reconnect the node, you just want to grab the. Literally click the. The diamond that's above it and drag and drop it and then you move it anywhere. But if you keep them in nice order, this is. This is fine. So it now has a simple memory and that simple memory. If we go inside it, there's no settings to change, but there are a context. There is a context window length. You can set this at 5, you can set this at 50. You could set it at 100. I'm just going to set it at 50. It doesn't really matter. The questions we ask it are not going to be too in depth. Now I'm going to hit command save because I haven't saved in a while, which is something I was trying to get into you which is always a good habit. And now clicking these nodes, I'm going to click the OpenAI node, I'm going to hit space and I'm going to say that it's chat, it's OpenAI Model 4.1. And then I'm going to go in here and I'm going to click the memory node and I'm going to hit space. And when I hit space I'm going to say this memory simple. This simple memory node provides powers memory for my agent. It's long winded. You didn't really need to rename it. But I'm just trying to give you. And you can't see it when you based off of the size of that. But I just wanted to do it so that you can maybe reference later. You know, it powers the memory for your agent in case you come back and look and get a bit confused. But that is that simple memory would be absolutely fine. So let's just. I'm going to revert it. Simple memory rename looks messy on the screen. So now command S again or just click the save button. Now we have. I pressed L There to get rid of the logs. We now have an agent that has a memory. So now when we provide it information, it should remember. I'm just going to hit refresh just to pull this in because the memory sometimes bugs when I try and do it. So let's hope it doesn't do it now. But when we do this, have this conversation, it's exactly the same process. So, hey, my name is, well, let's say, hey, how are you? Let's humor the typo in there, but let's humor the agent. I'm doing well, thanks for asking. My name. Oops. One thing that you can see here which is really important is you can see the log section and you can see what the AI agent did and it goes through. So it goes to simple memory. It then goes to the OpenAI model and it goes to simple memory again. Right. And if you look at this, the output. I'm doing well, thanks for asking. How are you? You can see what they. You know, what they are. So the chat history here is, is I'm doing well. So you can, every time you trigger this, you're going to see this, this develop. So if I say I'm good, thanks. My name is Michael. Okay. And now when I ask it. So, hi, Michael, nice to meet you. How can I assist you today? What is my. Your name is Michael. So now it remembers me and it understands who I am. So I could keep going through this and tell it my favorite colors. I could tell it anything, and it would be able to reference it up to 50 messages back, which is what I set inside of the AI agent node. Okay. Under the settings section, you might have five, you might have ten. Whatever. Sorry, where was it? Simple memory, the memory node context window length, you can choose how, how far back it goes. But importantly, you can see what happens here. You can see that it pulls from the memory first. It then goes to the AI agent model to create the response. And then the simple memory references it and has the output. If you scroll all the way down as to what this is, so you know input output, you can turn them off by pressing these little buttons here. So you just see the input. You just see the output. It can be useful. But the point is, is that it now has a memory. It understands who we are, which is excellent. So I've pressed L again. There. Now if I. So, so we're good to. We're rocking and rolling. The problem here is, is that it still has the very same issue. We've provided it with a memory, but we haven't provided it with any tools that are part of our tech stack. We haven't given it any instruction. Now the next step of our journey is under the tool section and the tool section is where we connect to, we provide it access. And this is the main difference. It has a memory now, but this is the main difference on how we can manipulate this. If we hit the plus icon on tools, you'll see down the right hand side there are loads of individual tools that are available to us. Dropbox, ClickUp, Fresh Desk, Fresh Service, whatever, Google Calendar, all of these things. Well in order to connect them we, what we want to do here is I'm going to use, I'm going to search for Gmail. So search for Gmail as a tool and inside of here you want to select a credential. Hit create new Credential, sign in with Google and then sign in with whatever email address it is that you want. You want select all so that you, you have all of the abilities to be able to do whatever is necessary. In this case we are going to send but this is, this is fine. And your connection is now complete. So really simple. Once you've connected that Gmail account. The thing is, is that actually the tool description and resource, forget about those, you don't need to worry about the operation. You know you have many options here and you have many selections in the tools output column sort of scrolling that we were scrolling through when it under Gmail. But we want to send. There are other options that you can use. Send and wait, wait for response. Mark as read get many get emails. But we're gonna, we're gonna have it send an email. And then the really cool thing about this with the AI agent is that these here where it's, it's two subject and message. Well we're going to click these wonderful little stars on the right hand side. And that basically lets the model define the parameter. It uses AI to define what these parameters are and it's based off of our chat discussion. So now we've clicked all of those, we can just literally exit out of there. And what you can do from here, what I'm going to do is I'm going to have it as if I have hidden a knowledge base. Okay so I'm going to go to Google Sheets and I'm going to create well this, this might have it inside of it actually. AI agent test emails. So I'm selecting a document here. You see tool description set automatically. Resource sheet within documents means that it's a sheet that we've that already exists effectively, it's not a new document and we want to get rows. So I'm going to select this and I'm going to. From this list. It's just sheet one. This is this sheet here where you have the sheet name, which is sheet one, which I just selected. And we have two columns, name and email. Extremely simple. If you want to pause the video and go and create this now you can, there's no issue with that. But this has two names inside of it. And I'm hopefully going to show you something quite cool about the AI agent here, the power, without doing anything else. So we now have two tools. We have a send an email tool and we have a sheets tool that actually allows us to do it. Now, one thing, bottom left, you will see this little button. If you want to tidy up your flow, you hit that and it gives it and just lays it out more centrally. Okay, so, and then L is to bring that. So I'm going to rename this and I'm going to call it client. Fake client list, fake inquiry list, whatever. Send a message in Gmail is fine now. Now things are cooking because let's do, let's do this. So, hey, my name is Michael and then we're going to ask you our name because we started, we've cleared the logs, we've hit the, we've hit the reset chat session and cleared the executions. So we're going to say what's my name? Just to make sure that it has the memory that it should have. Your name is Michael. How can I assist you today? Great. Can you tell me. Oops. Can you tell me all of the contact names inside of my Google sheet? It gives me two names. So here are the contact names from your Google sheets. David Smith's. Let me know if you need more information or want to do anything. Can you share their names and emails? You can see what I'm doing here. I'm doing this slowly, intentionally to get it to manipulate the information. And really specifically you should keep an eye on these logs because the logs show you the order that the agent went through and that's exactly right for what we're trying to get it to do. You know, we're trying to get it to literally run through the tools that we've provided. So I'm going to now show you the power of AI, hopefully if this works because you see the name is David Smith and The email is michaeladtrain.co.uk. now if I say, can you send an email to David that reminds him about our call tonight at 6:00pm it's mandatory. Let's see what the AI agent does. So. So he sent the email and you can see from this that he gave the example. What I was trying to show you is. And it doesn't matter, but what I was trying to show you is because the name doesn't match, sometimes you can be left in a position where it will actually pick up on the fact the name doesn't match the email and say. And say that to you. In this case it didn't. Sometimes it will. Now we can do it. So this is all well and good, but the final point that we need to go through here, I mean I asked this what time it was in London. Let's start a new chat. We go to chat GPT and we're just going to give it a basic, a basic instruction. Please write me a basic system prompt for an AI agent in N8N. In N8N. This AI agent sends has two tools. One send Gmails to Google Sheets Read access for contacts. Please ensure the agent checks the sheet first and is friendly in nature. Let's just say this, this should now spit out a very basic system prompt for us to use. You're a helpful and friendly email assistant. Always check the Google sheet first to find the correct contact details before sending an email. If the contact is not found, politely let the user know. Instead of sending when sending an email, keep the tone warm. Clear professional only use Gmail to send the final email after confir confirming contact details. Summarize what you. That's a bit of a fussy one. Summarize what you. You are about to send before sending. So I'm going to copy this. Okay. And I'm going to remove those last two sentences. But what's key is that we go inside of here. Sorry, we go inside of here and inside of the. The AI agent we want to add an option and that option wants to be a system message, which basically is. So it is already. You are a helpful assistant, but we just give it a little bit more context about that. Okay. And then wear it down. Here is summarize what you're about to send before sending so the user can approve it if needed. You can see how you could manipulate that. You could manipulate that by having it do specific things. But. But for this we just want to copy and paste it. Your goal is to make email communication feel natural and considerate. Keep the tone warm and clear. Tone warm and clear. You know, it's, it's pretty, it's pretty Simple. So I'm happy with that. We exit out, we command S, we save it and now. Yeah. Please send an email to Michael saying he left his coat at the office yesterday and he needs to pick it up. So you'll see, look, you see the order it checked, the memory. The OpenAI model produced the, the information in terms of the email. So send in, send a message in in Gmail. OpenAI 4.1 was the model I chose. If you click through them, you can see exactly the sort of steps that you are in the output, the system message formatting instructions. And if you just strictly look at the, look at the output, you know it'll say it sent an email. If you go into the, into the the Gmail step of the, of the log you will see that this, that this says sent. So we know that the email has been fired off. And I can confirm from my inbox literally here now. Mandatory call tonight at 6pm Hi David, just a reminder about our call tonight. Your attendance is mandatory. Best regards. So I hope I've shown you the power in this video. Tools are unlimited. We can just keep adding tools. We could add a Google Calendar inside of here and literally connect it. And then once you've connected your Google Calendar, you could ask it to book a meeting with somebody. There are so many options. You now have a fundamental understanding around what AI agents can do and how they can be useful to you. I hope you enjoyed this step by step guide and process like subscribe, comment below what you want me to build next. I'm open to suggestions. Thank you for your time. Speak soon.










