In this step-by-step video I’ll show you the ba...
What if you could build your own AI assistant, one that writes emails, books, meetings, handles customer questions, or even sells for you without being an AI expert? Now, imagine being able to sell these AI agents to your clients for $5,000 or more, just like the AI automation product that I sell that helps me generate more than $100,000 per month, all without writing a single line of code. Sound impossible? That's the power of AI agents. It's a lot easier than you think. Let me show you how. By the end of this video, you won't just have an AI assistant. You'll understand how AI agents work, when to use them, and when not to use them, and how to customize or sell them as a service. This isn't just about building something cool. It's about unlocking a new skillset that will put you ahead of 99% of all the other people trying to figure out AI. So here's the plan. First, I'll demo an AI-powered voice agent using Telegram. And then while we build it out from scratch, we'll talk about what AI agents actually are, why they matter, how they work, and when to use them. We'll build out your first agent, and along the way, I'll explain all of the logic that you need to know in order to imagine, build, and sell your own agents. So here's the agenda today. First, I'll do a demo of the AI-powered voice assistant, and then we'll get into the build. And while we do that build, we'll talk about why agents matter, and then we'll build out that entire Telegram AI voice agent. If you have ever felt overwhelmed by AI, feel like you're getting left behind, or if you've wasted hours trying to figure out where to start, this video's for you. Let's get started. All right, so now let's go ahead and show you how this AI voice assistant actually works. And I'm building this out in N8N, largely for this AI agent that they have, which I'll explain in more detail in a bit. Now, I'm specifically using Telegram because I can send it voice notes, which is easy to do when you're on the go. I can also send a message and type that in as well, but I wanted the ability to send voice notes. Currently, I have the agent responding in text, but I could also have the agent respond in a voice note as well. So I'm here on my phone here. I'm gonna send an email to Steven. Hi, could you reach out to Steven Pope and see if he's available tonight, February 22nd, for a meeting to talk about YouTube and what we're gonna publish next week at 5 p.m.? So you can see there that we got the message back from the agent saying that they sent out the message. I can double check here in Gmail. Hey, Steven, hope this message finds you well. Are you available tonight to talk about the YouTube video that we're gonna publish next week? Looking forward to your response. So now let's just go ahead and assume he confirmed. I heard back from Steven. Can you go ahead and book that event tonight? So we got that message back, and now if we check out the calendar, we can see I tried to book a meeting with myself tonight at five o'clock to talk about the YouTube video, and you can see here on my phone that the agent was able to successfully book that. So this AI assistant only took a few minutes to build. It can send emails. It can get all of your context and book events. Now let's go ahead and build this out from scratch, and along the way, I'll explain the important things that you need to know about AI agents, when to use them, how they work, which ones to use, everything that you need to know about AI agents. Now this automation that we're reviewing today can be found in the NoCodeArchitects community inside the classroom. When you click on this resource here, it'll download the template, and then from within 8.8n, you simply create a new workspace and import the file, and you'll have the entire automation set up just like that. But I'm also gonna build this entire automation from scratch, so let's get started. So I'm gonna start with the AI agent just to talk a little bit about this agent and how it works and how to think about it, because this agent is one of the primary reasons why I'm currently using 8.8n to develop some automations. They make it very straightforward to add an AI agent. They even make it so that you can chat with it without actually hooking up something like Telegram, which isn't necessarily hard, but when you wanna chat with your agent just to test, it's quite nice to just be able to open up a chat and say, hello. Now we haven't configured this agent yet, so we're getting an error, but let's talk a little bit about what an agent really is. From my point of view, what an AI agent does is that it actually does some amount of thinking to determine what path to take in your automation. So you really only need an AI agent when you need your automation to think. Now, realistically, these agents really only have two functions. They monitor the chat, and then from that chat, which is just a typical conversation that you'd have with anybody, like a real assistant, it's trying to figure out, okay, what exactly does this person want to do? Like, do they want to send an email? And if the agent, through the conversation, is able to figure out that they want to send an email, it then has to figure out, okay, who is this email to? What is the subject? And what is the contents of that email? So this agent is simply trying to figure out what is the tool we need to use right now? And then for that given tool, what are the different inputs that we need, right? So we talked about what we need for email, but to book a calendar event, we'll need who is the event with, and what is the date and time? And there are other types of agents as well, like OpenAI's Operator. This is an agent that actually runs on your PC, and then you can give it some simple instructions, like find and book the highest-rated one-day tour of Rome on TripAdvisor, and then it will actually take control of your PC and try to execute the entire task on its own. And so you can see here, there is a wide range of AI agents, those that understand specific tools and how to use those tools, and then there are other agents all the way on the other spectrum, where you give it a task, and it tries to figure out everything on its own. And there really is a place for both of these agents. Really, the strength of the agent that we're gonna build today is that it's much more specific, the tools are more simple, and it's much more likely to succeed without any human intervention. These more advanced AI agents are trying to accomplish the entire task on their own, which you can imagine is much more prone to error, or they're much more likely to make a mistake or get stuck. And then, of course, there's AI agents that are in between the more specific and the ones that are completely automated all on their own. And so again, the agent we're building today is definitely more specific, where we give it specific tools, and then we show it how to use those tools, and that is really all that it can do. But the advantage to that is that it's much more simple, and you're much more likely to get 100% success rate. All right, so now let's explain a bit about how this AI agent works. There's a few different things that we need to hook up to this agent in order for it to work. We need to add a chat model. In this example, I'm just simply going to use OpenAI, and I'll just go ahead with its pre-built decisions here. You might actually go with GPT-4.0 to start. This model tends to perform a bit better, and you can always downgrade it to a more cheaper model after you get it working. So the first thing that we added here was the chat model, and this is really the brain. This is what allows your agent to think on its own. If you think about a robot here, where we have a head, a body, and then the legs, inside this head here, we definitely want to have a brain. Now, also, in order to make this agent work well is we need a memory. As it's talking to us, it needs to be able to remember the conversations back and forth, not just remembering the last message that you sent. So in order to add memory, we're gonna come here, and we're simply going to use the window buffer memory. This is the easiest one to set up. We can go ahead and leave these details as is, and that should be everything that we need in order to test this. I'm gonna go ahead and type hello. So again, we just used this built-in chat interface to start interacting before we've actually set up something like Telegram, where we can chat with it in a typical interface that we're used to. But again, this is why I like N8n, because it gives you this chat interface so that you can go ahead and start chatting with your agent without having to set up anything else. So this is really great for testing. So I said, hello, and it said, hey, how can I assist you today? What are you able to help me with? So right now, it's just giving us some general information on how it could help, and it's really just using this ChatGPT model right here to answer any of those questions. It doesn't have any additional tools to pull from in order to help us. It can really only help us as much as ChatGPT could here. So if we were to log into ChatGPT, it would really be like conversing with OpenAI ChatGPT through the UI interface. So as you can imagine, that's not terribly helpful, so we're gonna add in our own tools as well. And you can also see here that the agent is also accessing its memory so that as these messages come in, it's not forgetting the previous conversation. And the cool thing about these agents are is that you can actually see what's actually happening in that agent. How is it making decisions? What are the previous conversations it's had? As it updates its memory, and as it's chatting with ChatGPT, and as it's using these tools, you can always come back here to debug how the agent is actually working and make it better. And so again, before we move on, remember the primary objective of this agent is to converse with whomever it is via chat, and then to identify the right tool to solve the problem for the particular chat that is happening right now. And then once you identify what tool to use, whether it's to send an email, to get the contact list, or to book a meeting, it's to identify what information do we need to execute that tool. Let's have the conversation with the user to make sure we have that information, whatever it is. And then once we have it, let's execute this tool to make it actually happen. All right, so now let's go ahead and add the three tools that we need for this particular AI agent. And then once we're done, we'll come back and we'll replace this built-in chat that we have in N8n, and we'll replace it with Telegram, and we'll actually respond back to Telegram. But until then, we'll just use the built-in chat that N8n has to make things easier so we can focus on the tools. So first, let's go ahead and add a tool to actually look up our contacts. So for our contact database, I'm gonna go ahead and use Airtable. Now I've gone ahead and added an Airtable base. It's very simple. It's just a contacts list that keeps track of names and email addresses for our AI agent. This could easily be hooked up to your CRM instead. So you'll want to create a connection to your Airtable base. And then you just simply want to create a very simple table with name and email. That's all you need. And you'll be able to use a free account on Airtable for this example. Now, in this case, we're using this to search the contact list for all of our contacts so we can get their email when we need to send them something. So for this, I'm gonna change the operation to search. Then we're gonna search a base, type contact list. We'll select that base. And then for the table, we'll select contact list as well. Now I'm gonna leave the formula blank because we want to return all of the records in our contact list. And then I'm gonna go ahead and leave return all on. And then I should be able to come back here. I'll go ahead and save it. And then I should be able to ask the bot, please tell me who's in our contact list. And then from here, it should be able to figure that out. Now, one thing I do want to mention is that as you add these different tools, you want to give them a name that describes exactly what they do. And the reason why is because this agent is smart enough to actually look at the tools that we hook up. And it's actually looking at the names that we provide in order to figure out which tool to use. So if this tool is to get our contact list, then name it, get contacts, and then just go ahead and hit rename. Because what's gonna happen here is that when the agent is actually trying to sort out what the user is asking for, it's gonna use all of the information, including the name of the tool to figure out if that is the right tool. So as you add these, be as descriptive as possible. So you can see here that it went and used the tool and it returned the two contacts that are in my contact database, Stephen Pope and Aaron Pope. So that's working just fine. Now let's go ahead and add the next tool. This time I'll use Gmail. You'll want to create your own credentials so that you can connect up to your email. You can leave these as is, set automatically, resource message, operation send. Now here we have to actually send the email to someone. So N8n is making this very easy for us. In order to map this field to the agent, we just simply need to click on this little AI button here. And then what you're gonna see here is that this is now actually defined automatically by the model. So again, remember what I said was, is that the main objective of this AI agent is one, to figure out what the tool is to use right now. So it's gonna listen to that conversation and it's gonna figure out, oh, they need to send an email. So it's gonna look for that tool. And then by defining these specific fields here, we're telling the AI agent, hey, we need to fill in the subject. So can you monitor the conversation and extract out the email that we need to make this successful? So they make this as easy as possible. So we'll go ahead and do that for the subject as well. And then I'll go ahead and do that for the message. And what that's basically saying is, we're gonna let the AI agent help figure out what these should actually be on our behalf. I'm gonna go ahead and add another option here because I just know this is gonna be there. N8n always appends this little message saying that the email was generated from N8n. So I'm just gonna go ahead and turn that off. Now, I'm gonna jump up here. I'm gonna rename this tool to send email. Remember, it's important to name the tool exactly what it does so that your agent is able to find that tool. Becomes a lot more important when you have a lot more tools here. So now we have get contacts and now we have send email. So now one thing I am gonna do is I'm gonna come up to the agent here and I'm just gonna remind it that when it is sending emails to make sure it looks up the email from the contacts first. So I'm gonna come here to the agent and then I'm going to add an option. We're gonna add a system message. And I usually do try to keep this simple. So it starts off with you are a helpful assistant but I'm also going to add a directive here. Always use the get contacts tool for finding an email address for the send email and book event tool. And then one other thing I'm gonna do because it's going to be booking events for me and it needs to understand the date and time is I'm going to tell the agent what time it is. Essentially every time this agent runs, it's gonna look at this system message. And with N8n we can actually define a dynamic message using the expressions here. If you're not familiar with this, you can have a fixed expression that will use this every single time. And you can also use the expressions here which allows you to put in variables. So here we're gonna go ahead and say, today's date is, then I'm gonna use the curly braces, dollar sign, now, which is going to get the current time. And then I'm simply going to dot format. And for the format, I'll use year, month and day. And so you can see here, we open this up right here. This allows you to expand it to see the full message. This is the actual system message that will be interpreted each time it's looking at a chat. You are a helpful assistant. Always use the get contacts tool for finding an email address for the send email or book event tool. And today's date is 2025 to 22. So that should be good. I'm gonna go ahead and save things here. So now we should be able to say, please send an email to Steven Pope about attending a meeting at 5 p.m. Pacific on 222 about discussing the next YouTube video. See if he can make it. So we'll go ahead and send that message. So we're gonna see here that it already sent the message. I'm gonna jump over to my email and I'm just gonna take a look here. Looks like it did send that message. And now you're gonna notice here that it was able to send it to the correct email address. Even though in this particular message, I said, send an email to Steven Pope. I didn't give the actual email address, but because previously in our chat, we had asked for all of the contacts, it was able to figure that out simply by looking at its memory. So it didn't actually have to go to the contacts to look it up again because it had already done that. So again, I really wanna drive this home. What this agent is doing is that it's using its brain and its memory and these tools to figure things out in order to produce a specific outcome. Now, if I had removed this memory, it wouldn't have had that and it would have had to go to the contacts first and then it would have had to send the email. All right, so now that we have the get contacts and the send email, let's go ahead and add the next tool, which is the calendar booking. So we'll add the calendar tool. Now you'll need to set up your credentials here. For tool description, we'll set automatically resource event, operation create, and then we need to select which calendar. I'm gonna go ahead and use SGPLabs. Now for the start time, it already has some values in here. Now again, in this case, we're gonna go ahead and use the AI feature here and we're gonna let the agent define the start time because we're gonna talk about it in our conversation. So it should be able to figure out what that start time is and we're gonna do the same for the end time as well. Now, the only thing that we do need to add here is the attendees. So let's go ahead and add the attendees. And then for this as well, we're gonna let the AI agent figure out the attendees for us based off of the conversation. And then I'm gonna come up here to the name of this tool and we're gonna call it book event. And then we'll go ahead and rename that. So let's come back out. Let's go ahead and clean the actual workspace up just a bit. Let's go ahead and save. And then let's come back down here to our chat. So now we can say, Stephen Pope said the time was good. Can you please book the YouTube discussion meeting with him for today, 2.22 at 5 p.m. Pacific. So we'll send that into the agent. Looks like it already booked that event. Let's take a quick look at the calendar. We have the event here. It added Stephen Pope, but notice that we don't have a title or description. So let's come back to our workflow. Let's go into book event. Looks like we've got to add a couple other fields here. Let's add description and let's add the summary. And again, we could type this in ourselves, but we're gonna go ahead and use this as well so that we'll let the agent figure that out. And then let's just take that message, copy and paste it again. Now this is kind of interesting because it didn't actually send anything because I think that it knows from its memory that it already did. So I'm just gonna type in a different command. Can you please schedule another meeting at 6 p.m. on 2-22 to discuss the YouTube thumbnail with Stephen Pope. So it looks like it's booking that event. Let's go over to the calendar. Now you can see that we have the new one at six. Now we have the summary, we have the attendee, and we also have a description. So there you go. In just a few minutes, we created an entire AI agent with three different tools so that we can send emails, book events, and also scan all of our contacts. So now all we need to do is to hook up Telegram so that from our phone, we can send text messages directly into the agent, or we can actually send in voice messages where we download the audio file, transcribe it, and then we map that into our agent. Then it's gonna do the work that we've already built out using these tools, and then we'll finally send a message back to Telegram. So now setting up that Telegram bot is super simple. Here I am in the web interface for Telegram. You're going to want to connect to a user called botfather, and you're gonna wanna look for that verification mark so that you know you're talking with the real botfather for Telegram. Believe it or not, this is where you can start a conversation and create a new bot on Telegram. It's super simple. You're gonna say new bot, and then it's gonna ask you for a name, and I'll go with SGP Assist, and I'll put YouTube, and then it wants a username for that bot, and it gives you an example. We'll go with SGP Assist underscore YouTube, but it looks like I left out bot at the end. Has to be there. SGP Assist YouTube bot, and then after that, it's gonna give you this access token. You just click on that, come back to N8N, and then we'll get rid of this built-in chat for testing. Add a new node, Telegram. We're gonna go with a trigger here on message. Then we're gonna come here. We're gonna add a new credential. We're just gonna drop that access token directly here. Save that. You should see a connection tested successfully. Then you can test the step. You can come back to Bot Father. It's gonna give you a link to your assistant. You can go ahead and click on that. You can start that conversation. Even that in itself is going to send a message to N8N, which is the start conversation message here, and you can see it. So as long as you see that, you know it's working. So from here, we're gonna move this right there. Now, the first thing I like to do is to send a message right back to the user. Since the bot can take a few seconds to respond, I like to just send a message back. We'll send a text message, and you wanna pick the same credentials as you were using in the trigger, and then for the chat ID, you're gonna wanna use the data from the initial start message. We can grab this here, drag that into our Telegram message. This is so that we can respond back to that same ID, and then for the text, I'm just gonna go ahead and put, one second, please, dot, dot, dot, and then we can test it. Come back to Telegram. We can see one second, please. You can go ahead and add a option to remove the N8N message that we saw right here. Test that again. One second, please. So now what we can do is we can go ahead, and I'm just gonna move this over just a bit. We can add a switch so that we can have one path for when it is a text message like this, and another when it's a file. So then what we need to do is we need to move this back to the original incoming message, and then what we're gonna do is we're gonna take this text here. We're gonna drag it, and then basically what we're gonna do is we're gonna come here, and we're gonna say, is string exists? If this text message exists, then we're gonna go down this main path here, and we can connect it directly into the agent, and now this agent should use the message coming in from the trigger. So we'll jump into the agent, and now instead of saying source for prompt, we're gonna change this to define below, and then we're going to pass in the text from the first trigger. We're gonna come up here, go to the trigger, and we'll pass in the text. That's gonna automatically turn this into an expression so that it can pull in the value in the text. So from that, we should be able to come back. Let's go ahead and save it. Let's go ahead and test the workflow. Can you please give me all my contacts? So we come back to our bot here. Now it looks like we have an error. Let's take a look at that. So what's happening here is that the message is actually for our memory here. It's basically saying, hey, we have no session ID. So originally when you set up the window buffer memory, it has a default to look at the previous node for determining what that session ID is, and what this segment does is that it allows us to have separate conversations with different people and have a different memory for each person. So in this case here, we're gonna change this to define below, and for the key, we're going to use the chat ID. And so what that tells the memory to do is, hey, use the chat ID for this memory so that the memory that we store for this conversation is tied to this chat ID. So if other members or other people are chatting with this bot, they will have a different chat ID, and then therefore the memory that is associated with that chat will not be the same if the chat ID is different. So if I'm talking to the assistant, it's gonna create one memory and one chat for me, and then if somebody else is chatting with the assistant, they will have their own chat and their own memory associated with the conversation. And then this message here just allows you to determine how many of those messages will it save and remember as it goes on. So the smaller this number is, the faster it will forget the conversation, and the bigger this is, the longer the conversation it can remember. And that's really gonna come down to context of the problem that you're trying to solve. In this case, five should be plenty. So let's come back here. Let's go ahead and save it. Let's test the workflow. Come back to our bot. Can you please give me all my contacts? Contacts. Come back to N8N. It's getting the contacts and it's done. But the only issue is, is that it wasn't able to send that message back to us. So now we need to add another Telegram module here. Telegram. This time we're going to send a message. You'll want to set up the credentials for this new bot for the chat ID. Again, we're going to come back to the original trigger. We're going to take that chat ID. We're going to drop it right there. And then for the text, we're going to go back to our agent itself and we're going to grab the output there, drag it into the text. And again, I'll come to the add field and remove the N8N message. Come back, save, test the workflow. Come back to our assistant. Can you give me all my contacts? Paste that in, come back to our agent. And now it sent it back to us this time. And so there we have our contacts. So everything's working. The only thing that we can't do now is send a voice message. So let's fix that. I'm going to come back to my agent here. I'm going to test the workflow. And now again, from my phone, I'm going to ask the same question. Please give me all of my contacts. Now this time the message is going to come in, but it's not going to go anywhere because there wasn't actually a text message. So let's take a look inside here. So you can see that there's no actual text message. So that's why it didn't progress because this switch here is looking for a text message. In this case, we don't have that. We have a file. So now we need to create a new path that is going to transcribe that file. So I'm going to come in here. We're going to add a route. This time we're going to come back up here. We're going to go to the trigger. And now this time what we're looking for is a file ID. So I'm going to drag this here into the other route. And then we're going to come here and we're going to say string exists. So in this first one, we're looking for a text message. For this one, we're looking for a file ID. We can now test this step. And we're going to see it's now going to the second output. So now it's coming down this new path here. So now what we can do is we can download that file. Going to go to Telegram. We're going to get a file. And again, set up those credentials with the same Telegram account. And now for the file ID, I'm going to come back up here, go to the original trigger, and we're going to grab this file ID, going to drop it right there. We want to download it. That's fine. Let's go ahead and test the step. Now we've got that file. Now all we need to do is transcribe it. We're going to go to Whisper, which is from OpenAI. Grab that. Transcribe a recording. Go ahead and set up your credentials for OpenAI. The operation is transcribe a recording. I think that's all we need. Let's go ahead and test the step. So we have that text message coming in. Please give me all of my contacts, which is correct. So now we just need to connect this up to the agent, clean this up a little bit, the formatting of the workflow. And now the only thing we need to do is to come into the agent here and update the message that we're sending the agent. Because if you remember what we did before is we sent in the text message. But in this case, we're not going to have a text message coming in here. So this is going to be empty. And that's also why it is red here. So instead, what we can do is we can come into this expression. We can put two question marks. And what that's telling the system is, hey, I want to use this if it exists, but if it does not, I want to use something else. And the something else here is going to be up in our inputs here. We're going to go to the OpenAI module where we can drag in the text from our transcription. And so what you can see here is I put $JSON, which means that it's referencing the previous module. This should work just fine, but sometimes I like to be a little bit more verbose, just like how we have here where it's actually addressing a specific previous module versus just the previous. So here we're giving a specific name for a previous module. So if we come here, we have Telegram Trigger. So this is actually accessing Telegram Trigger, whereas when it's just $JSON, this is shorthand for the previous module. And this normally works fine, but when that previous module changes, it breaks this. So I'm just going to go ahead and be more verbose and let's just go ahead and type this out. So I'll start with dollar sign. This is going to pop up. We're going to go with OpenAI.item.JSON.text. And we can always just double confirm what it is if we go to OpenAI here, text, and now it went green because we have the right value. So now we should be able to come back to our agent. Let's go ahead and save it. Let's go ahead and test it. And then from my phone again, give me all of my contacts. And there you can see it coming back on my phone. And then again, if we want, we can test the other tools as well using a voice message. Can you please send Stephen Pope an email asking him if he can join us to talk over the new AI agent? I'd love to have a talk with him sometime this week. Just reach out and see if he's available to talk. So there it's figuring everything out and it sent the email. So here's the new email discussion on new AI agent. Hey, Stephen, hope you're doing well. I'd love to have a conversation regarding the new AI agent sometime this week. Can you let me know your availability to talk? And there we go. Now, if you want access to today's template so that you can import that directly into N8N with everything already built out, as well as getting tech support directly from me and working with a bunch of other engaged members, make sure to jump into the NoCode Architects community. There's a make an air table course, all of my AI automation templates, including my content systems, social media, content automation, and faceless video generators. And there's also a business clarity course if you're trying to build out an AI automation product. And we have calls almost every day where you can get personalized help from me. I hope to see you inside the community. Either way, I hope you enjoyed this video and I'll see you on the next one.
No AI insights yet
Save videos. Search everything.
Build your personal library of inspiration. Find any quote, hook, or idea in seconds.
Create Free Account No credit card required