Everyone Will Use AI Agents in 2025: Build Yours Now

Everyone Will Use AI Agents in 2025: Build Yours Now

Show Video

<b>In this video, I'm going to teach you how</b> <b>to build AI agents that can see, speak,</b> <b>and think for themselves</b> <b>without writing any code.</b> <b>And don't worry if you're a complete</b> <b>beginner, this tutorial is for you.</b> <b>The adoption of AI agents</b> <b>is absolutely exploding.</b> <b>It's clear that 2025 will be the year of</b> <b>the AI agent, so you definitely don't</b> <b>want to be left behind.</b> <b>Right, now let's have a</b> <b>look at what we'll be building.</b>

<b>This workflow might seem intimidating,</b> <b>but it's really not.</b> <b>We'll go through the</b> <b>process step by step.</b> <b>We will integrate our AI assistant into</b> <b>Telegram so that we can access it from</b> <b>absolutely anywhere.</b> <b>You can use the techniques that you learn</b> <b>in this video to integrate it with</b> <b>WhatsApp or any other platform.</b> <b>Let's have a look at a few</b> <b>capabilities of this agent.</b>

<b>First, it can read and</b> <b>create events in our calendar.</b> <b>So I can say something like, "What's my</b> <b>schedule for today?"</b> <b>And we can see we have this budget</b> <b>discussion with Sally</b> <b>from 5 to 6 pm today.</b> <b>And switching over to our</b> <b>calendar, that is indeed correct.</b> <b>We can also use voice to communicate with</b> <b>our agent, and our agent will then</b> <b>respond back with audio as well.</b> <b>Thanks for that. Please can you also give</b>

<b>me a summary of my unread email?</b> <b>Alright, and let's listen to this.</b> <b>You have one unread email in your inbox</b> <b>from leonvansil, leon.vansil at</b> <b>gmail.com, deployment status, summary.</b>

<b>The email is a follow-up regarding the</b> <b>latest release for Project X, asking if</b> <b>everything is set to go live on Friday.</b> <b>If you need help responding to it or</b> <b>anything else, just let me know.</b> <b>Awesome. And by the way, you</b> <b>can change the voice as well.</b> <b>Our agent also has multimodal support,</b> <b>which means we can ask</b> <b>it to analyze images.</b> <b>So I'll simply upload an image, and let's</b> <b>ask it, is this character happy or sad?</b> <b>And of course, our agent is correct in</b> <b>saying this character</b> <b>appears to be happy.</b>

<b>Our agent also has access</b> <b>to a custom knowledge base.</b> <b>So to demo this, I created this very</b> <b>simple CSV file that contains a list of</b> <b>contacts, along with</b> <b>their email addresses.</b> <b>So let's ask our agent</b> <b>to send an email to John.</b> <b>And what our agent will do is find the</b> <b>email address related to</b> <b>John and send the email.</b>

<b>Let's try this. Please send an email to</b> <b>John asking if he's keen</b> <b>to play squash on Saturday.</b> <b>Right. Our agent says the email was sent.</b>

<b>So we are expecting the email to be sent</b> <b>to John.do at example.com.</b> <b>So going to our sent items, we can see</b> <b>this message to John.</b> <b>And we're just receiving this message</b> <b>saying that the address failed because it</b> <b>doesn't exist, which was expected.</b>

<b>But what we are interested in is the</b> <b>message that was sent to John, which is</b> <b>very well formatted.</b> <b>And if we look at the email address, it</b> <b>was indeed sent to</b> <b>John.do at example.com.</b> <b>And finally, our agent can also go online</b> <b>and perform research for us.</b>

<b>So we could ask it, what is</b> <b>the latest AI news from OpenAI?</b> <b>And our agent will now perform a Google</b> <b>search and then summarize the results for</b> <b>us, making this an</b> <b>effective research assistant.</b> <b>And here we can see all the headlines as</b> <b>well as these links that will take us to</b> <b>the original article.</b> <b>And indeed, this</b> <b>article was posted today.</b> <b>Now, if all of this seems intimidating to</b> <b>you, please don't worry, as I'm going to</b> <b>show you in the next few minutes</b> <b>how anyone can build AI assistance</b> <b>without having to write any complex code.</b>

<b>Let's begin.</b> <b>In order to build our assistant, we will</b> <b>be using a platform called N8N.</b> <b>N8N is exploding in popularity and</b> <b>definitely worth learning.</b> <b>What's great about N8N is you can't sell</b> <b>those that for free.</b>

<b>Or if you don't want to deal with the</b> <b>setup process yourself, you can</b> <b>definitely sign up</b> <b>for their cloud service.</b> <b>If you would like to learn how to sell</b> <b>post N8N, then I've got other videos on</b> <b>my channel going through that.</b> <b>But for this tutorial, I highly recommend</b> <b>using their cloud service.</b> <b>If you use the link in the description of</b> <b>this video and it will</b> <b>greatly help my channel.</b> <b>So then all you have to do is sign into</b> <b>your account if you already have an</b> <b>account or click on get started,</b> <b>complete your full name, your email</b> <b>address, a password and set a unique</b> <b>account name and then</b> <b>click on try for free.</b>

<b>And afterwards, you will be presented</b> <b>with the N8N dashboard.</b> <b>You can change the theme to dark mode by</b> <b>going to settings, then go to personal,</b> <b>scroll down to the bottom</b> <b>and change the theme</b> <b>to dark theme and save.</b> <b>You can go back to the dashboard and for</b> <b>you, you won't have any workflows,</b> <b>but we can create a new workflow by</b> <b>clicking on create workflow.</b> <b>Then the first thing we need</b> <b>to do is set a project name.</b> <b>So let's rename this from my workflow to</b> <b>AI agent tutorial and press enter.</b> <b>Then I highly recommend</b> <b>setting your time zone.</b>

<b>So click on these three dots, click on</b> <b>settings, then on the time zone, select</b> <b>your local time zone.</b> <b>This will affect the time and date that's</b> <b>used when doing</b> <b>research, sending emails, etc.</b> <b>So I highly recommend setting this and</b> <b>let's click on save.</b> <b>Let's add our first trigger node.</b> <b>Here we have plenty of options.</b> <b>We can trigger the workflow manually or</b> <b>on an app event, which is what we'll use.</b>

<b>We can also run a workflow on a fixed</b> <b>schedule, on a web or</b> <b>call or on a form submission.</b> <b>We can also search for triggers and in</b> <b>our example, we'll search for telegram.</b> <b>But of course, if you wanted to use</b> <b>something like WhatsApp</b> <b>or some other platform,</b> <b>you should find a trigger for that.</b>

<b>Again, we'll be using telegram as it's</b> <b>super simple to set up and the specific</b> <b>trigger that we want is on message.</b> <b>This simply means that when we receive a</b> <b>message on telegram, it</b> <b>will trigger this workflow.</b> <b>The first thing we need to do is select</b> <b>our telegram credentials.</b> <b>It's defaulted these credentials for me</b> <b>because I've already set up credentials.</b>

<b>But what you need to do is click on</b> <b>create new credential.</b> <b>Then we can rename this by clicking on</b> <b>this name and let's call</b> <b>this AI agent tutorial.</b> <b>Now we need to provide this access token.</b>

<b>Where do we get this from?</b> <b>Thankfully, NNN is very</b> <b>helpful in this regard.</b> <b>Go to the section that says need help</b> <b>filling out these fields</b> <b>and click on open docs.</b> <b>Then scroll down with this page and find</b> <b>this bot father link.</b>

<b>Click on bot father and you should be</b> <b>prompted to sign into</b> <b>telegram at this stage,</b> <b>which I recommend you do.</b> <b>And afterwards, you can either start bot</b> <b>father on the web or</b> <b>using the telegram app.</b> <b>Either way will work.</b>

<b>Personally, I'm going</b> <b>to use the desktop app.</b> <b>Creating new bots are super simple.</b> <b>Simply enter front</b> <b>slash and select new bot.</b> <b>Now let's give our bot a name.</b>

<b>I'll simply call mine AI agent tutorial</b> <b>and let's send this.</b> <b>Now we need to set a unique username and</b> <b>this username must end with the word bot.</b> <b>So I'll just call mine</b> <b>AI agent tutorial bot.</b> <b>Now this is saying our bot was created,</b> <b>but very importantly,</b> <b>we get this API token.</b> <b>So let's copy this token and let's paste</b> <b>it into this access token field in NNN.</b> <b>Let's click on save and we should see</b> <b>this green connection</b> <b>tested successfully message.</b>

<b>Great.</b> <b>And let's go back to the canvas.</b> <b>This is optional, but I do</b> <b>like doing this for my agents.</b> <b>We can give it an avatar image by typing</b> <b>front slash, then set user</b> <b>pick this option over here.</b>

<b>It will now ask us which agent we want.</b> <b>We can then select our agent from the</b> <b>list and now we can send any image that</b> <b>we want to use as a profile image.</b> <b>I'll just use this image.</b> <b>Let's send it and cool.</b> <b>Our image has been set in order to access</b> <b>this bot simply go back to this message</b> <b>with the API token and</b> <b>click on this link over here.</b>

<b>Now we can start a conversation with this</b> <b>bot and we can see a little avatar image</b> <b>showing up on the left as well.</b> <b>Now, obviously we can send something</b> <b>like, hey, but nothing happens.</b> <b>That is because NNN isn't</b> <b>listening for events quite yet.</b> <b>So back in NNN, let's click on test</b> <b>workflow and now NNN is waiting for a</b> <b>message from telegram.</b> <b>Let's try this again by saying hello.</b>

<b>Now back in NNN, we can see that we</b> <b>received one item and in this output, if</b> <b>we go to schema, we can</b> <b>see the name of the sender.</b> <b>And if we scroll down, we can also see</b> <b>the text that was sent to NNN.</b> <b>We will add the ability to send voice</b> <b>messages and images in a second, but</b> <b>let's first build out the process to</b> <b>respond to simple text.</b> <b>So what we can do is add an action.</b> <b>Then under advanced AI, click on AI agent</b> <b>and from this node, let's change the</b> <b>source of the prompt by clicking on this</b> <b>dropdown and let's</b> <b>change this to define below.</b>

<b>Now what we can do is grab the text that</b> <b>we received from telegram.</b> <b>So this is a load text every year and</b> <b>paste that into this prompt field.</b> <b>Now, if we execute the step by itself,</b> <b>this won't work yet because we haven't</b> <b>designed a large language model,</b> <b>which is effectively the brain for this</b> <b>agent to attach a model to this agent.</b> <b>We can click on chat model and navigate a</b> <b>list of many different service providers.</b>

<b>If you want to try free models, you can</b> <b>definitely try Grok and I do have</b> <b>separate videos on my channel showing how</b> <b>to set up Grok with NNN.</b> <b>But for this video, I will be using open</b> <b>AI or if you want to use an anthropic,</b> <b>you can definitely do that as well.</b> <b>Just be sure to use Claude 3.5 sonnet.</b>

<b>So I'm going to add</b> <b>this open AI chat model.</b> <b>The first thing we need to do is set our</b> <b>open AI credentials.</b> <b>So in this dropdown, click</b> <b>on create new credential.</b> <b>Then for the API key, go to</b> <b>platform.openai.com slash API keys.</b> <b>You do need to create and sign into your</b> <b>account and this is a paid service.</b> <b>So you do need to load</b> <b>a little bit of credit.</b>

<b>Then let's click on</b> <b>create new secret key.</b> <b>Let's give it a name</b> <b>like AI agent tutorial.</b> <b>Let's create this key.</b> <b>Let's copy this key and paste</b> <b>it into NNN and click on save.</b> <b>Then select your credentials and then we</b> <b>should be able to click on this dropdown</b> <b>to select a large language model.</b>

<b>For this video, we will be using GPT-40</b> <b>Mini, which is a</b> <b>really fast and cheap model.</b> <b>Let's go back to the canvas and let's</b> <b>also assign a memory node.</b> <b>Let's simply select window buffer memory.</b>

<b>Let's also change the</b> <b>session ID to define below.</b> <b>The memory node simply allows the agent</b> <b>to recall past</b> <b>messages from our conversation</b> <b>and each conversation will</b> <b>have a unique identifier.</b> <b>So we can actually get a conversation ID</b> <b>from telegram by going to mapping.</b>

<b>Then within this telegram trigger, you</b> <b>can simply add this chat ID.</b> <b>The context window length is the amount</b> <b>of messages that should be included.</b> <b>So let's simply say we want the previous</b> <b>20 messages to be included.</b> <b>Now let's go back to the AI agent node</b> <b>and now I'm going to show you the correct</b> <b>way to prompt these agents.</b> <b>Under options, let's add an option and</b> <b>let's add the system message.</b> <b>Then I'm going to switch over to</b> <b>expression and we can click on this</b> <b>button to expand this view.</b>

<b>This is something that people seem to</b> <b>overcomplicate and in this video,</b> <b>I'll show you the correct</b> <b>way of writing a system prompt.</b> <b>What I like to do is to start off with a</b> <b>heading called role</b> <b>and within this heading,</b> <b>we can assign a role and explain things</b> <b>like the behavior of this agent.</b> <b>So we can keep it simple by saying you</b> <b>are a friendly and</b> <b>helpful assistant called Sammy.</b> <b>Keep your answer short and to the point.</b>

<b>What I also like to do is to create</b> <b>another heading called</b> <b>additional information.</b> <b>Here we can say things like you are</b> <b>currently chatting to and now we can</b> <b>provide the name of the person</b> <b>that it's interacting with.</b> <b>Now we obviously don't</b> <b>want to hard code this name,</b> <b>but instead we can grab the name from the</b> <b>telegram trigger and</b> <b>add it to this template.</b> <b>Great!</b> <b>And on the right hand side, we can see a</b> <b>preview of the final</b> <b>result, which does include my name</b> <b>and that's all we have to do for now.</b> <b>We will add to the</b> <b>system prompt as we go along.</b>

<b>So we can close out of that</b> <b>and let's go back to the canvas.</b> <b>Let's test this agent again and this time</b> <b>we do get our response</b> <b>back from our AI model.</b> <b>How cool is that?</b> <b>All we need to do now is send this</b> <b>message back to telegram and we</b> <b>effectively created a telegram agent.</b>

<b>Let's go back to the canvas.</b> <b>Let's add a new node and let's search for</b> <b>you guessed it telegram and</b> <b>let's scroll down with this list</b> <b>and select send a text message.</b> <b>Select your credentials, which you</b> <b>created earlier in the chat ID.</b> <b>Grab the same chat ID</b> <b>from the telegram trigger.</b> <b>Then for the text, all we have to do is</b> <b>go to your AI agent and assign this</b> <b>output value like so.</b> <b>Now watch what happens</b> <b>when we press test step.</b>

<b>We get our response in telegram, but we</b> <b>also seem to get this</b> <b>text, which is not great.</b> <b>We can remove that by clicking on add</b> <b>field, append n8n</b> <b>attribution and disable this toggle.</b> <b>Let's run this step again and indeed we</b> <b>get our response without the attribution.</b> <b>Awesome.</b> <b>So let's also have a look</b> <b>at sending audio back in n8n.</b> <b>Let's click on test</b> <b>workflow then back in telegram.</b>

<b>I'll simply hold in this</b> <b>button and I'll just say anything.</b> <b>Let's release to send</b> <b>it and back in our flow.</b> <b>We can see that we received a new message</b> <b>and looking at the schema.</b> <b>This looks a little bit different instead</b> <b>of receiving the text.</b> <b>We now get this voice node over here,</b> <b>which contains a file ID.</b> <b>So this means we have to handle the</b> <b>situation slightly different depending on</b> <b>the type of message that we received.</b>

<b>We can simply add a new node between the</b> <b>telegram trigger node</b> <b>and the AI assistant node.</b> <b>And what we want is the switch node.</b> <b>The switch node will simply allow us to</b> <b>branch down different parts.</b>

<b>So in the first rule for the value, what</b> <b>we can do is we can look at this file ID</b> <b>within this voice object.</b> <b>So we'll simply add</b> <b>that to this value field.</b> <b>We want to check if this field exists.</b>

<b>So in this drop down, we can</b> <b>go to string and select exists.</b> <b>If this voice file ID exists, we want to</b> <b>branch down the audio path.</b> <b>So I'm actually going to just</b> <b>rename this output to audio.</b> <b>And if you go back to the canvas, you can</b> <b>see we only have this one route at the</b> <b>moment called audio.</b> <b>But of course, we want to do something</b> <b>different if we receive text.</b>

<b>So just to simplify this, I'm going to</b> <b>click on test workflow.</b> <b>Back in telegram, I'll just send some</b> <b>basic text and let's</b> <b>open up the switch node.</b> <b>Now this is showing red because this</b> <b>actually doesn't exist.</b> <b>But instead, we have this text property</b> <b>that we received from</b> <b>the telegram trigger.</b> <b>So let's add a new routing rule.</b>

<b>Let's add this text field as a value and</b> <b>you guessed it, we'll change this drop</b> <b>down to string and exists.</b> <b>Let's rename this output to text.</b> <b>So back in the canvas, we now have a</b> <b>route for audio and for text.</b> <b>So if we receive text, we</b> <b>can pass that to the AI agent.</b> <b>That's simple enough.</b>

<b>But if we receive audio, we have to do</b> <b>something a little bit different.</b> <b>Let's add a new node.</b> <b>Let's just pass an audio</b> <b>file into this flow again.</b> <b>So hello there.</b> <b>How are you doing?</b> <b>Now we can see that this</b> <b>audio triggered this audio route.</b>

<b>So the first thing we want to do is to</b> <b>download that audio file.</b> <b>So let's click on add action.</b> <b>Let's search for telegram</b> <b>and let's select get a file.</b> <b>So all we have to do is pass in that file</b> <b>ID, which we can receive on</b> <b>the left hand side under voice.</b> <b>You can grab this file ID and watch what</b> <b>happens when we test this node.</b> <b>This downloaded the file</b> <b>that we received from telegram.</b>

<b>I'm just going to rename</b> <b>this node to get audio.</b> <b>Let's click on rename and</b> <b>let's go back to the canvas.</b> <b>Now that we've downloaded this file, we</b> <b>want to transcribe it back into text.</b> <b>So let's click on add nodes.</b> <b>Let's go to open AI and in this list,</b> <b>let's go to transcribe a recording</b> <b>and we actually don't have to change</b> <b>anything in this node.</b>

<b>We can test it and now we get the</b> <b>transcribed text from that audio file.</b> <b>And all we have to do now is pass this</b> <b>text to our AI agent.</b> <b>So I'm just going to scoot all of these</b> <b>up and let's pass our</b> <b>text into the AI agent.</b>

<b>Now there's one issue with this though.</b> <b>If we have a look at our AI agent, we can</b> <b>see the agent isn't quite happy with us.</b> <b>For the normal text scenario, we're</b> <b>receiving the text within</b> <b>an object called message</b> <b>and within this object</b> <b>is a property called text.</b> <b>However, from the transcription, the</b> <b>value is simply stored</b> <b>in a field called text,</b> <b>not in a messages object.</b>

<b>So what I recommend we do is standardize</b> <b>this request that we pass to the agent.</b> <b>After this switch node, let's click on</b> <b>add, then let's search for the set node.</b> <b>Let's select manual mapping, then let's</b> <b>click here to add a new field.</b> <b>Let's call this field text and I would</b> <b>just have to map a value.</b> <b>Let's do that by testing this workflow.</b> <b>Let's pass in some text from Telegram.</b>

<b>All right, now let's</b> <b>go back to edit fields.</b> <b>Then let's search for our Telegram</b> <b>trigger node and this is</b> <b>what I was referring to within</b> <b>the Telegram trigger node.</b> <b>We first received this eye level node</b> <b>called message and within</b> <b>message, we received the</b> <b>property called text.</b> <b>So we're just going to simplify this by</b> <b>grabbing text and</b> <b>assigning it to a value called text</b> <b>within this edit field node.</b> <b>I'm just going to rename</b> <b>this node to agent input.</b>

<b>Cool, let's go back to the canvas and I'm</b> <b>just going to clean</b> <b>up this canvas a little</b> <b>bit by moving things around.</b> <b>Great, so this simply means whether we</b> <b>received the text from</b> <b>this transcription node or the</b> <b>agent input node, we will always expect a</b> <b>property called text</b> <b>to pass in that value.</b> <b>Well, let's run this workflow to make</b> <b>sure that everything is working.</b> <b>Let's send some text like hello and we</b> <b>get our response back.</b>

<b>Great, let's test the audio.</b> <b>So I'll run this again and</b> <b>it's a why is the sky blue?</b> <b>Right, we get the text back from our</b> <b>agent, but usually</b> <b>there's a reason why I send the</b> <b>voice node to begin with.</b> <b>I might be on the move and I don't have</b> <b>time to stop and read.</b>

<b>So if I send the voice node, I want this</b> <b>agent to respond with voice as well.</b> <b>So what we can do is add a new node</b> <b>between the agent and</b> <b>this telegram node and what</b> <b>we'll do here is add an if condition and</b> <b>let's just expand this a bit.</b> <b>So what we want to say is let's go to our</b> <b>telegram trigger and</b> <b>what we want to say is</b> <b>if the voice file ID exists, so I'll</b> <b>select string exists and</b> <b>then we want to respond</b> <b>with audio else will simply return text.</b>

<b>So we'll leave this node as is.</b> <b>You will now see we have</b> <b>these true and false conditions.</b> <b>So true would mean that we do have audio,</b> <b>false would mean everything else.</b> <b>So we'll simply attach this sent text</b> <b>message to the false</b> <b>condition and if it's true, we</b> <b>want to generate audio instead.</b> <b>So let's click on add nodes.</b>

<b>Let's search for open AI and let's go to</b> <b>audio actions and generate audio.</b> <b>Select your open AI credentials.</b> <b>I'm actually just going to rename this</b> <b>node to generate audio</b> <b>and let's just run this</b> <b>scenario so that we can</b> <b>get some data into this flow.</b> <b>So again, I'll just</b> <b>say, hi, how are you doing?</b> <b>Okay, let's let this run.</b> <b>Okay, let's go into</b> <b>our generate audio node.</b> <b>Then for the text input, we'll simply</b> <b>grab the output from</b> <b>our AI agent and add it to</b> <b>this.</b>

<b>This is where we can select the voice.</b> <b>I'll simply select Nova, which is that</b> <b>female voice that you heard in the demo.</b> <b>And after this generate</b> <b>audio node, we'll add a new node.</b> <b>We'll search for telegram.</b>

<b>Then under message actions, let's look</b> <b>for send an audio file.</b> <b>I'm just going to rename</b> <b>this to audio response like so.</b> <b>And for the chat ID, we can click on</b> <b>schema and let's search</b> <b>for our telegram trigger</b> <b>and let's add the chat ID.</b> <b>Let's enable binary file.</b> <b>And this simply means that it will use</b> <b>the audio file that was</b> <b>generated from the previous</b> <b>node and that's actually it.</b> <b>So let's go back to the canvas.</b>

<b>Let's test this workflow.</b> <b>Let's say, hey, how are you doing?</b> <b>All right, so we received the file and</b> <b>let's have a listen.</b> <b>I'm doing well.</b> <b>Thank you.</b>

<b>How about you?</b> <b>Great stuff.</b> <b>So we've achieved a lot.</b> <b>We can add text and audio to our agent</b> <b>and our agent is able to</b> <b>respond back with audio</b> <b>as well.</b> <b>Next, let's add vision to our agent.</b> <b>Let's start by testing the workflow and</b> <b>let's send an image via telegram.</b> <b>I'll simply send this.</b>

<b>All right, so back in N8N, we can see</b> <b>that our workflow was</b> <b>triggered, but the switch</b> <b>statement realized that this</b> <b>is not audio and it's not text.</b> <b>So what is this?</b> <b>And looking at the input from the</b> <b>trigger, we can see that we</b> <b>now get this photo object,</b> <b>which contains a file ID as well.</b> <b>So what we'll do is we'll add a new</b> <b>routing rule and for the</b> <b>value, I'm actually going</b> <b>to grab this very first photo object,</b> <b>which is an array of images.</b>

<b>Well, then change this</b> <b>dropdown to array and exists.</b> <b>An array is simply a list of values.</b> <b>And what telegram does is it actually</b> <b>sends us the image in</b> <b>different file sizes, like</b> <b>the very first result as a width of 90</b> <b>pixels by 90 pixels.</b> <b>The second image has a</b> <b>size of 320 by 320 pixels.</b>

<b>And then the third one</b> <b>is the original image.</b> <b>So all we're saying is if this list</b> <b>exists at all, then we</b> <b>want to go down the image</b> <b>path.</b> <b>So if we go back to the canvas, we now</b> <b>get this image route.</b> <b>And if we receive an image,</b> <b>we want to do the following.</b> <b>I'm simply going to drag it up here.</b>

<b>Then we want to download the image first.</b> <b>So we'll search for the telegram node.</b> <b>Let's select get a file,</b> <b>select your credentials.</b>

<b>Then for the file ID, I'm simply going to</b> <b>run this node again,</b> <b>which now takes us to</b> <b>this image route.</b> <b>And within this node, I'm just going to</b> <b>rename this to download image.</b> <b>Right then for the file ID,</b> <b>we'll simply go down to photo.</b>

<b>And now we can decide which of these</b> <b>images we want to use.</b> <b>I'm going to grab the file ID from the</b> <b>original image, like so.</b> <b>Let's test a step.</b> <b>This simply means the</b> <b>image was indeed downloaded.</b> <b>Then let's go back to the canvas.</b> <b>Let's add a new node.</b>

<b>And what we want to do now is use a large</b> <b>language model to analyze the image.</b> <b>So let's add the open AI node.</b> <b>Within this node, let's go to image</b> <b>actions and let's select analyze image.</b> <b>We'll leave the resources image, the</b> <b>operation is analyze image.</b>

<b>Then for the model, we can</b> <b>simply select chatgpt40 latest.</b> <b>Then for the prompt, we'll simply leave</b> <b>it as what's in this</b> <b>image for now, but we will</b> <b>change that in a second.</b> <b>This will simply describe the image.</b>

<b>Then for the input type,</b> <b>let's select binary file.</b> <b>This simply means it will grab the image</b> <b>from the previous node</b> <b>and that's really it.</b> <b>However, if we run this,</b> <b>we will run into an issue.</b>

<b>This is saying that</b> <b>the MIME type is invalid.</b> <b>This node is actually expecting an image</b> <b>like a JPEG, a PNG or</b> <b>something like that.</b> <b>The problem however, is if we have a look</b> <b>at this binary file</b> <b>from the previous node,</b> <b>this is giving us a MIME type of this</b> <b>thing over here, which</b> <b>is not seen as an image.</b> <b>So what we need to do is simply convert</b> <b>this MIME type to an image.</b>

<b>Let's go back to the canvas.</b> <b>In between these two</b> <b>nodes, let's add a new node.</b> <b>Let's search for code and</b> <b>let's add the code node.</b> <b>Now please don't run away.</b> <b>This is really not that scary.</b>

<b>In fact, you don't have</b> <b>to write this code at all.</b> <b>You will find the code snippet in the</b> <b>description of this video.</b> <b>So simply copy that code</b> <b>and paste it into this field.</b> <b>Then let's go back to the canvas.</b> <b>Let's execute this node again.</b> <b>Let's execute the code node.</b>

<b>And in the result of this code node, all</b> <b>we did was change the</b> <b>MIME type to whatever the</b> <b>type was that the user passed originally.</b> <b>Now in this openAI node, I'm just going</b> <b>to rename this by the</b> <b>way to analyze image.</b> <b>Let's rename this.</b>

<b>Let's run this step.</b> <b>And look at that.</b> <b>We now get the description of that image.</b> <b>So you guessed it.</b>

<b>All we have to do is I'll send this</b> <b>description back to Telegram.</b> <b>And this is really easy.</b> <b>You can simply attach this to the</b> <b>Telegram sent message node.</b> <b>That's it.</b> <b>In Telegram, let's upload an image.</b>

<b>But let's also add a caption.</b> <b>This will allow us to ask very specific</b> <b>questions about the image.</b> <b>So let's do, why is this funny?</b> <b>Let's send this.</b>

<b>Right.</b> <b>And we actually have an error.</b> <b>And this was expected.</b> <b>And this is kind of the same issue we had</b> <b>with the AI agent where</b> <b>the source field could</b> <b>have different names, depending on where</b> <b>it's being passed from.</b> <b>The Telegram node is expecting the text</b> <b>to come in from a field called output.</b>

<b>But to analyze image node,</b> <b>call the field content instead.</b> <b>So we can simply fix that in a very</b> <b>simple way by adding a new node.</b> <b>And as we did earlier,</b> <b>we'll add this edit fields node.</b> <b>We'll add a new field over here.</b>

<b>And we know we have to</b> <b>call this field output.</b> <b>And for the value, we'll simply assign</b> <b>content from our analyze image node.</b> <b>Great.</b>

<b>Let's test this.</b> <b>Now we're getting the</b> <b>result in this output field.</b> <b>Great.</b>

<b>Let's move this edit field up here.</b> <b>I'm just going to rename it as well to</b> <b>format image output.</b> <b>So let's test this again by</b> <b>clicking on test workflow.</b> <b>Then let's send an image again.</b>

<b>Let's add a caption</b> <b>like, why is this funny?</b> <b>And we get this response back, simply</b> <b>describing the image.</b> <b>Now of course we asked it why this image</b> <b>is funny, but instead</b> <b>it simply described the</b> <b>image.</b> <b>That is because in this analyze image</b> <b>node, we simply hard</b> <b>coded this instruction, what</b> <b>is in this image.</b> <b>Instead we want to make this dynamic.</b>

<b>So we can go to schema.</b> <b>And if we scroll down to our telegram</b> <b>node, all the way to the</b> <b>bottom, we get this caption</b> <b>field which we want to</b> <b>add to this text input.</b> <b>So I'm just going to remove this text.</b> <b>Now we're grabbing the</b> <b>value from the caption.</b>

<b>But do keep in mind</b> <b>the caption is optional.</b> <b>And it's possible to send the image</b> <b>without the caption.</b> <b>So what I like to do is to specify a</b> <b>fallback value just in</b> <b>case the user did not supply</b> <b>this.</b> <b>We can add two pipe values.</b> <b>Then in quotes, we can</b> <b>say, describe the image.</b> <b>So we'll first try to use the caption.</b>

<b>Otherwise we'll simply run</b> <b>the prompt, describe the image.</b> <b>Great.</b> <b>Let's try this again.</b>

<b>So let's upload this image.</b> <b>Let's say, why is this funny?</b> <b>And now we're getting the</b> <b>specific result that we wanted.</b> <b>You now have an AI</b> <b>agent with vision and voice.</b>

<b>Our agent is very impressive,</b> <b>but we can greatly improve it.</b> <b>The whole purpose of building a genteq</b> <b>workflows is to have it</b> <b>interact with the world around</b> <b>it.</b> <b>Like answering emails, setting calendar</b> <b>events, searching the</b> <b>internet, and whatever else.</b>

<b>So this means that agents</b> <b>are able to execute tools.</b> <b>And tools allow it to</b> <b>interact with its environment.</b> <b>So let's get our agent to read our email</b> <b>and respond to emails on our behalf.</b>

<b>Let's click on tools.</b> <b>Then within tools,</b> <b>let's search for Gmail.</b> <b>Under credentials, let's</b> <b>click on create new credential.</b> <b>If you're using the N8 in cloud service,</b> <b>I believe you don't</b> <b>have to specify the client</b> <b>ID and client secret.</b> <b>You should see a button asking you to</b> <b>authenticate with Google.</b>

<b>But if you are seeing this client ID and</b> <b>secret, like I am, then</b> <b>this is what you need to do.</b> <b>Go to cloud.google.com</b> <b>and go into the console.</b> <b>Then click on this dropdown to create a</b> <b>new project or select one</b> <b>of your existing projects.</b> <b>Let's create a new project.</b>

<b>I'll call mine AI agent</b> <b>tutorial and let's create it.</b> <b>This will only take a</b> <b>few seconds to start up.</b> <b>And afterwards we can select our project.</b> <b>Then let's click on the menu.</b> <b>Let's go to APIs and services.</b> <b>Let's go to library and</b> <b>let's search for the Gmail API.</b>

<b>Like so.</b> <b>Let's select Gmail API.</b> <b>Let's enable this API.</b>

<b>Then while we're here, let's</b> <b>also set up the calendar API.</b> <b>So let's go to library.</b> <b>Let's search for calendar.</b> <b>Let's select the Google calendar API.</b>

<b>Let's enable this.</b> <b>Great.</b> <b>The next thing we need to do is to set up</b> <b>our OAuth consent screen.</b>

<b>So let's click on OAuth consent screen.</b> <b>For the user type, let's select external.</b> <b>Let's click on create.</b> <b>Let's give our app a</b> <b>name like AI agent tutorial.</b>

<b>Select your support</b> <b>email and scrolling down.</b> <b>Let's enter our developer contact</b> <b>information and let's</b> <b>click on save and continue.</b> <b>We don't have to do</b> <b>anything on this page.</b>

<b>Simply click on save and continue.</b> <b>We don't have to do</b> <b>anything on this page either.</b> <b>Simply click on save and continue.</b> <b>And under summary, scroll down to the</b> <b>bottom, click on back to dashboard.</b>

<b>And finally, click on publish app.</b> <b>And confirm.</b> <b>We're almost done.</b> <b>Let's click on credentials.</b> <b>Let's click on add credentials and let's</b> <b>select OAuth client ID.</b>

<b>Under application type,</b> <b>select web application.</b> <b>Let's give it a name like n8n.</b> <b>Then under authorized redirect URIs,</b> <b>click on add URI and back</b> <b>in n8n, simply copy this</b> <b>redirect URL and</b> <b>paste it into this field.</b> <b>Then click on create.</b> <b>That was a lot, but we finally got there.</b> <b>We now have our client ID, which we can</b> <b>copy and paste into n8n.</b>

<b>And we can also copy our client secret</b> <b>and add it to n8n as well.</b> <b>But as I mentioned, I think the cloud</b> <b>service allows you to</b> <b>simply sign in with Google.</b> <b>So let's do that now.</b> <b>Select your email address.</b> <b>If you get this</b> <b>screen, it's perfectly fine.</b> <b>Simply click on advanced and go to</b> <b>whatever your URL might be.</b>

<b>Select everything, click on continue.</b> <b>We get our closest pop up</b> <b>as our account is connected.</b> <b>What we want this now to</b> <b>do is to read our emails.</b>

<b>So I'm going to</b> <b>rename this to read emails.</b> <b>Let's rename this.</b> <b>Then under operation,</b> <b>let's select get many.</b> <b>I'm going to change the</b> <b>amount of emails to five.</b>

<b>Then under filters, I'm going to add</b> <b>label names and IDs.</b> <b>And what I want to select is my inbox</b> <b>only and only unread emails.</b> <b>Right let's go back to the canvas and</b> <b>let's actually move our</b> <b>tools to the bottom of the</b> <b>screen.</b> <b>So let's test this out.</b>

<b>I've got this unread email in my inbox.</b> <b>So let's click on test workflow.</b> <b>Back in telegram, let's say</b> <b>summarize my unread emails.</b> <b>So back in eight, we can see the read</b> <b>emails note was indeed</b> <b>called and this is 100% correct.</b> <b>Now we will be adding additional tools to</b> <b>this agent and in</b> <b>order to assist the agent</b> <b>in selecting which tools to call and when</b> <b>I do recommend</b> <b>enhancing the system prompt.</b>

<b>This is really easy.</b> <b>In our AI agent node, let's open up our</b> <b>system prompt and under</b> <b>additional information, let's</b> <b>add a new heading called tools.</b> <b>And within this I'll create a sub heading</b> <b>called read emails,</b> <b>which is effectively the</b> <b>name of the tool.</b> <b>And now we can provide a short</b> <b>description to tell the</b> <b>agent when and how to use this</b> <b>tool.</b>

<b>So let's simply say use this tool to</b> <b>retrieve unread emails.</b> <b>Right so let's allow our</b> <b>agent to send emails as well.</b> <b>Let's click on tools.</b> <b>Let's open up Gmail.</b>

<b>Let's add this node.</b> <b>We'll select our credentials.</b> <b>Make sure the operation is set on send.</b> <b>And now we have to figure out how to get</b> <b>the two email address,</b> <b>the subject and the email</b> <b>body.</b> <b>Now this information should be passed</b> <b>from the large language model.</b>

<b>In other words, it's supposed to</b> <b>intelligently figure out</b> <b>what the email address is, the</b> <b>subject line and the body and then pass</b> <b>those values into these fields.</b> <b>So we're not hard coding anything.</b> <b>We're leaving this up to the AI agent.</b> <b>Now how the heck do we do this?</b> <b>NNN makes it super simple.</b>

<b>They give us this tip up here.</b> <b>They say simply copy this expression.</b> <b>So let's go ahead and copy this all the</b> <b>way to the closing curly braces.</b>

<b>Then in the to field, switch over to</b> <b>expression, then paste in</b> <b>that expression and change the</b> <b>placeholder name to</b> <b>something like email address.</b> <b>Now what we can also do, and this is</b> <b>optional, is we can add a</b> <b>comma, then with in quotes,</b> <b>we can describe this field and this could</b> <b>assist the agent in</b> <b>figuring out how to retrieve</b> <b>this information and in what format this</b> <b>information should be.</b> <b>So I'll simply say the</b> <b>recipient email address.</b> <b>So let's copy this.</b> <b>Then let's do the same</b> <b>thing for the subject line.</b> <b>So let's simply change the name of this</b> <b>field to email subject and</b> <b>let's change the description</b> <b>to the email subject line.</b>

<b>And let's remember to</b> <b>change this to an expression.</b> <b>Then let's do the same</b> <b>thing for the message.</b> <b>This changes to expression, then it's</b> <b>pasting this example.</b> <b>It's changed this from email address to</b> <b>email underscore body.</b> <b>And for the description, I'll simply</b> <b>enter the email body.</b> <b>Let's change the email</b> <b>type from HTML to text.</b>

<b>Then finally, let's go to add options.</b> <b>Let's go to a paint in NNN</b> <b>attribution and disable this.</b> <b>That should be everything we need.</b> <b>Let's go back to the canvas.</b> <b>Let's move our tool down here.</b>

<b>Let's also rename it to send email.</b> <b>I'm actually going to copy this name and</b> <b>in our AI agent, we can</b> <b>add to the system message.</b> <b>So let's add a new tool and paste in that</b> <b>tool's name and it's a use</b> <b>this tool to send emails.</b>

<b>This tool requires the recipient email,</b> <b>the email subject and body text.</b> <b>Simple enough.</b> <b>So let's go back to the canvas.</b> <b>Let's click on test workflow.</b> <b>Back in Telegram, I'm just</b> <b>going to send an email to myself.</b>

<b>So let's say send an email to Leon</b> <b>Fonsai, dev at Gmail dot com</b> <b>asking Leon if you remember</b> <b>to close his GRI tickets today.</b> <b>It sent this.</b> <b>This is saying the email was sent and</b> <b>back in NNN, we can</b> <b>indeed see that send email</b> <b>was triggered.</b> <b>And if I refresh my inbox, we can see</b> <b>this email coming</b> <b>through with a subject line of</b> <b>GRI ticket follow up.</b> <b>And how awesome is that?</b> <b>Let's do the same thing for</b> <b>setting up calendar events.</b>

<b>Let's click on tools.</b> <b>Let's search for Google Calendar tool.</b> <b>I'm going to rename this to get calendar.</b> <b>Other credentials.</b>

<b>Let's click on create new credential.</b> <b>Again if you're using the cloud service,</b> <b>you might not need to</b> <b>enter the client ID and</b> <b>secret but for the rest of us, we've</b> <b>already done that hard work.</b> <b>So we can simply copy and paste as values</b> <b>from Google cloud</b> <b>platform and add them to</b> <b>NNN.</b> <b>Let's authenticate ourselves.</b> <b>So I'll select my email address.</b> <b>I'll pick an advanced, continue.</b>

<b>Select all these options.</b> <b>Continue.</b> <b>And that's it.</b> <b>Our calendar is now connected.</b>

<b>So be sure to select your credentials.</b> <b>Then for operation,</b> <b>let's select get many.</b> <b>Then from list, I'll</b> <b>select my email address.</b> <b>I'll limit the amount of events to 50.</b> <b>And this will simply select all the</b> <b>calendar events from</b> <b>the current date and time.</b>

<b>And this is why it was so important to</b> <b>set the time zone at</b> <b>the start of the project.</b> <b>And it will look for</b> <b>events up until a week from now.</b> <b>That's all we have to do.</b> <b>So let's go back to the canvas.</b> <b>Let's just move this tool down and let's</b> <b>add a new entry to the calendar.</b>

<b>So let's add something</b> <b>like Jira ticket follow up.</b> <b>Okay, that seems good.</b> <b>Then back in N8N,</b> <b>let's test this workflow.</b> <b>Let's ask it, what are</b> <b>my meetings for today?</b> <b>And indeed we see our Jira ticket follow</b> <b>up session for later this evening.</b> <b>And of course we can see</b> <b>the calendar tool was called.</b>

<b>We can also create calendar events by</b> <b>clicking on add nodes.</b> <b>Just search for Google calendar tool,</b> <b>select your credentials</b> <b>under operation, leave it</b> <b>on create.</b> <b>Then for the calendar,</b> <b>simply select your email account.</b>

<b>And now we have to figure out what the</b> <b>start and end times will be.</b> <b>Again, we're expecting this information</b> <b>to be populated by the</b> <b>large language model.</b> <b>So we can use that technique that we</b> <b>learned earlier by using</b> <b>this from AI expression.</b> <b>So I'm simply going to</b> <b>copy this expression.</b> <b>Then in the start</b> <b>field, let's paste this in.</b> <b>Let's rename this placeholder to start</b> <b>and let's replace the end node with end.</b>

<b>Then under additional fields,</b> <b>let's add the summary field.</b> <b>This is effectively</b> <b>the title of the meeting.</b> <b>And again, I want the AI agent to</b> <b>populate this field.</b> <b>So let's switch over to expression.</b> <b>Let's paste in that</b> <b>placeholder expression.</b> <b>Let's rename this to email title.</b>

<b>And that should be it.</b> <b>Go back to the canvas.</b> <b>Let's move this tool down.</b> <b>Let's test this workflow.</b> <b>And in Telegram, let's say create a new</b> <b>event for 8pm today</b> <b>and titled feed the dogs.</b>

<b>Now you'll notice something interesting.</

2025-01-27 05:26

Show Video

Other news

I Didn’t Expect It to Be This Good | TCL QM6K TV Review 2025-02-22 07:27
Nagios Monitoring Tool Tutorial By Deepak Sood || Video-2 || Tech GURU 2025-02-19 22:39
Understanding Web3 and Decentralized Cloud with Davy Wittock, CBO, InFlux Technologies - Episode 13 2025-02-17 19:19