Transcription
Guys, hello everyone. And today I would like to show you how you can quickly create your own AI agent yourself, just to really feel that it is very simple, that the phrase AI agent actually sounds more intimidating than it actually looks. Therefore, today, literally within a few minutes, I suggest you spend this time with me, to see how you can create an agent. You can also follow my steps, create together. This will be a very basic example, but I think that by mastering these basic steps and understanding the logic behind building AI agents, you can build truly powerful things. You can build useful agents that will help increase your personal productivity somewhere, and can also be incredibly useful at work. Today we will build an AI agent that simply takes a list of competitors. Let's imagine, for example, that I work in the banking sector and decided to conduct a competitor analysis. And I have a simple table in Google Sheets where I have gathered four major competitors and I want an AI agent to gather information, analyze it, and insert it here into Google Sheets. That is, if before you had to do the research yourself, to do the analytics yourself, now you can completely delegate this work to an AI agent, and it will do it no worse than a person. But first, I would like to tell you in a few words about the essence of an agent, what logic is behind the agent's work. And we will do this using the N8N platform as an example. Perhaps I will make another video where I will talk in more detail about this platform, about its functionality. But, in principle, if you want to start building agents, building AI automations, this is one of the best platforms. There are also platforms like Make.com, Zapier. They are very similar in functionality. I am currently focused on this platform. You can register and get free access for 14 days. After the free access expires, you can either, a, subscribe, or you can transfer N8N to your own hosting and simply pay for hosting a very minimal fee. As soon as you register, there is essentially nothing superfluous here. You just need to click on "Create Workflow". And here, we simply select "AI Agent". And we essentially already have the foundation, the framework with which we can work. The first node is the trigger, that is, what will send a signal to our AI agent. It is a kind of input information. And in this case, by default, N8N offers "Chat Message", so we can simply click on "Open Chat" and start typing information here. I will just move this window a little to make it more convenient for us. For example, we can write: "Hi, how are you?" Okay. Of course, we get an error here because we haven't set anything up yet. Next, we see that this node connects to the AI agent, right? So all the information will be fed to our agent. The agent itself consists of three main modules. What it has, it has a module. And here, if you click on the plus, you can see the possible models to choose from. And explaining in simple terms, I can say that a chat model, a language model is the brain of an AI agent. That's what it will use to process the input information, to process the tasks that we will give it later, the instructions that we will write. And, most likely, you all know OpenAI Chat, right? That's the ChatGPT that is very popular. [music] You can choose Anthropic, that is, Claude, you can choose DeepSeek. In most cases, to use a language model, to use this model, you need to have a small amount of money in your account. For example, if we talk about the OpenAI Chat module, the minimum amount to, in principle, make the workflow work, to be able to test and, so that our workflows function, you need at least 5 dollars. But these 5 dollars will last for a long time, because, in principle, the models are very economical, meaning this money is spent very slowly, depending on how many requests are made and so on, what the input and output are. I will show an example using Gemini. That is, in this case, today we will not top up anything, we will not spend any balance at all, so I am using the Google Gemini Chat Model. It has a certain number of requests per minute and per day, if I'm not mistaken, which are available for free. Therefore, this is an excellent example to test something in your workflows, in agents, and not pay anything. So, Google Gemini Chat Model. First of all, we need to connect credentials here, right? That is, we want N8N to connect, to get access to the Gemini model. To do this, click on "Create New Credential" here in "Credentials to connect with". That is, we want to create a kind of key that connects both platforms. It's called an API Key. And everything is quite simple here. We can type "Gemini API" in Google. Go to the first link. And here you can click on "Explore Models in Google AI Studio" and "Get API key". I am already logged in here, so if you are visiting this site for the first time, there might be one or two additional steps you need to take to get here. And here we simply click on "Create API key". You will need to create a project. I already have them here, so I will choose one of the existing ones and click on "Create API in existing project". My unique API key is created. I copy it and paste it. And here I saw information, perhaps it won't be displayed now. Yes, you can read information here about different models, input/output, how much it all costs. But we won't top up anything for now. We have enough iterations, requests that can be made for free. Therefore, I will paste the API here now and save. Great. Connection test is successful. Now we are connected to Gemini, and now we need to select a model. [music] As a rule, each of the Language Models has different versions, and new versions are released very often lately. As for Gemini, for example, we can choose one of the latest versions, and it is economical, right? So, for example, if you use this agent later in work where there will be a lot of requests and so on, then the model, Gemini 1.0 Pro, the release was in July 2023. We have chosen the model, and that's all for now. So the first important step is done, right? We have defined the brain for our agent. And now we can say hello to our agent. And we get the answer: "Hello. How can I help you?" And let's say I write: "My name is Marina. I love swimming." Okay, we sent the information. The model wrote to us: "Nice to meet you. Swimming is a great hobby." But notice, now if I ask: "What is my name?" "I am a large language model, developed by Google." The model does not provide information about my name. Or, for example, what I like to do? "I don't know what you like to do." So, at the moment, the model does not remember the information I entered. This issue is solvable, very easily. And here we have a second important step. This is memory in an AI agent. That is, we need to add a memory function so that our agent remembers the requests that we entered earlier. To do this, we simply click on the plus. And here there are also several different types of memory that we can add to our agent. But for beginners, it's enough to choose "Simple Memory". It's a working tool, a working instrument, nothing superfluous. And at the same time, it remembers everything. There is such an important field here, "window lengths", set to 5. That is, here you can, for example, set it to 10. We tell our AI agent how many recent requests it should remember, when communicating. And, accordingly, you can enter any number here. Great, we have completed this step. Let's test it again. My name is Marina, and I love walking in the park. Okay, we see that the brain has worked. Right, a green checkmark has appeared. And the memory has also worked. Right, and here you can, in principle, see the steps that our agent is taking. And here it gives us information. Nice to meet you. Walking in the park is a wonderful hobby. Now let's test if it remembers my information that I entered. What is my name? "Your name is Marina." What do I like? "I don't know what you like." Where do I like to walk? "You like to walk in the park?" Great. And the next step is "Tool". And in principle, you can connect a huge number of tools here. That is, as soon as you click on the plus, you will see the services, the applications that are already integrated into N8N and that are easy and simple to add. These are various CRM systems, some documents. Well, in principle, everything, everything you can think of, probably, rather, a lot is already here, a huge list of various applications, programs. And there can be many of these tools, not one, but dozens of tools. And then we have a continuation of our agent, that is, it will be the output, the information that we want to get at the output after the AI agent has completed all the necessary steps. I will allow myself to return to the workflow, to the agent that I showed you, what we want to build. And since I want my AI agent to analyze the list of competitors and give me information about them, I will use the Search API as a tool. Right? That is, this is the tool that Googles information, checks it, and gives us various findings. Right? Therefore, in principle, it is very easy to do here. In Tools, I will search for "Search API". "Search API Google Search". Right? Here we also need to connect, install credentials, create new credential. And again, how will we do this? I simply Google "Search API". Right? And we see that "Search API is a real-time API to access Google search results", so this tool will check information on Google in real-time. Right? And here you will need to either register or sign in. Let's try to just log in. Right? I have already used this tool. As you can see, I have a free plan. Again, we don't pay anything. And here, you can see that within a month we can make 250 requests for free. Right? I have already made 32, and we want to get an API key here, so I just copy it, return to my workflow, paste this API key, save. Connection test successfully. Okay, we have connected the tool that will search for the necessary information. Now we need to add the list of competitors. Right? To do this, I will delete this chat message window. In principle, I don't need memory because I will not be communicating with the AI agent. I will simply give it a list of competitors and create an instruction, following which it will perform certain steps. So, let's add Google Sheets. First of all, we need some kind of trigger. Right? As the simplest, it can be a manual trigger. Right? So, by clicking on "Start Workflow", my AI agent will start analyzing Google Sheets, researching information, and will provide output. As a trigger, it can also be, for example, a timer. Right? For example, every Monday at 7 AM, we want the AI agent to start the analysis, to take, for example, some new competitors that we have added, analyze them, and provide us with information. This output information can be either in Google Sheets, just in a new column, or, for example, the agent can send this information to Telegram or email, Gmail. So, the trigger can be absolutely different, and the output can be absolutely different, convenient for you. Right? Here, we connect Google Sheets. And as actions, we select "Get Rows In", because I already have some information in this spreadsheet. I just want the AI agent to take rows from there. I don't want it to create or delete anything yet. And here we also need to connect N8N to Google Sheets. Here I click on "Create New Credential". And here, actually, the process is a bit more complicated compared to the APIs we entered for the Search API tool and for Gemini. As you can see, there are at least four mandatory fields to fill in. Different keys here. And you can find a video that I recorded on how to connect N8N to Google services, including Google Sheets. It's literally 10 minutes, where you can immediately connect N8N to Google services. This will include Google Sheets, Google Calendar, Gmail, Google Drive, Google Docs, Google Slides. I will leave a link to this video in the description. I will not go through these steps now. I already have a created credential, so I will just choose it. If you have connected correctly to your Gmail account, to your Drive, to the disk where the Google Sheet is located, then here we should see Excel files, right? That are there. Here is my "competitors" file and "sheet", the "sheet1" tab. And I will show you this competitors file. I have a "competitor" column. I have simply chosen four major international banks. And the "Findings" column is where the AI agent will add information. So, we have connected. At the moment, I will close this window. Great. So, what do we have? We have Google Sheets. Google Sheet connects to the AI agent. The AI agent should read these four competitors using the brain. And then it should search for information about them and add it to the Findings column. Therefore, as output, we will also add Google Sheets. Right? Only now, what do we want to do with this table, with this document? We want to "Append or Update Row In", that is, so that we have some update to the existing rows, to add information. Again, credentials, I already have them installed. And here too, we select the document "competitors" and select the tab. Here, "Column to Match". We want our AI agent to match based on the competitor, right? That is, it finds information for the first bank, searches for this bank in the name of this bank in Google Sheet and adds findings. Right? And here, "Values to send", "competitor using to match". Here we add, uh, we make a connection, right? We connect the AI agent, the results that the AI provides, with the Google Sheet that we want to see at the output. And to make it easier to understand how to fill in these fields, let's close this window for now, and we will return to it in a minute. Before we run this workflow, before we launch the AI agent, we have one more very important step. This is creating instructions for our AI. How to do this? Go to the AI agent settings. And here, you need to click on "Add option system message" and by default it just says "You are an assistant". But this information will definitely not be enough. We want to give a clear, more precise instruction to our agent. Again, the better the quality of this prompt, this instruction that we give to the agent, the better our results will be. There is a specific rule on how to create an effective prompt, an effective message, an instruction for an AI agent. I will try to create a separate video on this topic. But since the main topic of this video is simply to get acquainted with AI agents, to build one, to go through these basic steps through these basic modules, I will write a fairly simple prompt here. How did I do it? I simply created this workflow, took a screenshot, then went to ChatGPT, pasted the screenshot and explained that I am creating a workflow, creating an AI agent, briefly explained the essence, what I want to see, and asked ChatGPT to give me an effective prompt. Therefore, I am pasting the text that I already have. System message. Here you can click on "Expressions" and on this button to see the whole window. And here, what do we have written? "You are an analytical agent that helps gather up-to-date information about business competitors." And this is very important information, this is a very important sentence. You always need to inform ChatGPT or the model you are communicating with about the role it should perform when making your request. And then, some kind of background, a brief instruction. Every week you receive a list of company names, competitors from Google Sheets. And for each of them, you conduct a quick search through the Search API. That is, we make it clear which tools it has access to. Your task is to find and summarize the most relevant information about each company to enter it into the Findings column of the table. For each company, try to gather the following: a brief description, main products/services, unique selling proposition, recent changes, releases, news, general market trends, etc. Process one company at a time, use only fresh and relevant information from reliable sources. Write concisely, clearly, to the point, five sentences, avoid repetition. If there is very little information, indicate that there is no up-to-date data. And some example. Here you can add, of course, that in Google Sheets, in addition to this overview, in addition to the points we have already listed, the model should also provide us with links to the sources. You can also specify the format in more detail, so that, for example, it is in bullet points, clearly to the point, for example, 1, 2, 3, 4, 5. So, here, in fact, there is a huge scope for cooperating with the AI agent, and training it, giving it instructions. There are also special tools that allow you to create effective prompts, especially if we are talking about AI agents that include many tools. But we will stick to such a simple example. We have added the system message. Great. Now let's try to run what we have. Let's see where there will be any errors. We just want these nodes to start interacting at the moment. So, we have an error in the AI agent. So, look here, "Source for prompt". You need to select "Define below". And what will be the input information for our agent? It will be the competitor's name from Google Sheets. Here on the left side, "Input", we see Google Sheets as input. Just drag it here. And here you go, we have [music] the user message that the AI agent will take into account and work with based on our instructions. Great. Let's run it again. Execute workflow. We see that the Search API has gone through our four competitors. Here we already have an output, but an error occurred in those two fields that we haven't configured yet. And here, what do we need to specify? Findings, right? So now we need to connect the information that the AI agent provides, where it should be located. So, this output should go into the Findings column in our Excel. It's simple enough to drag. And competitor, we also need to set up a match. Right? And the competitor is in Google Sheets, so we also drag it here. And now everything should work. Let's launch it again and go to Google Sheet and see if the information has really appeared in the Findings column. So, understanding the essence of how an agent is built, the principle, knowing some specific examples, based on this, you can build truly powerful tools. So, everything is now successful, there are no errors. Let's go to competitors. And what do we see? Indeed, information has appeared in the Findings column. Right? Of course, there are very few sentences here, because in the instructions we specified three to five sentences, but you can't limit yourself to that. Right? If we want some overview, then of course, this information will not be enough for us. Uh, well, and here we see, right, about Citibank, a financial conglomerate, what services it provides. It recently launched a credit card, so some recent news. There are competitors, also P. Morgan, Bank of America. I definitely lack links here, because this is very important for such research. Well, but this is already working with the prompt, with the System message that we give to our agent. That's all, guys. I hope this video was helpful. I hope this will become a basis on which you can independently create AI agents. You can look for what I like, for example, it's also to look at the agents that other guys create, to be inspired and at the same time to create a broader spectrum of possibilities in your mind, because sometimes it just doesn't occur to you right away, what an AI agent can automate. How it can help me, for example, in my current work. Therefore, I recommend you to be inspired by examples of other more complex agents. I will try to share information with you too, gradually exploring this topic. We will build more complex AI agents. And if you have any questions, let me know in the comments, we will communicate, we will share. And thank you very much for being with me for these thirty minutes. And see you in the next videos. Bye everyone. M.