Sources

Whether you like it or not, you're going to need to learn AI in some regard over the next few years, as AI will be taking vast amounts of entry-level jobs. In this video, I'm going to make it as easy and simple as possible to understand AI agents, and we're going to set up a very basic agent called a personal assistant agent. It will be able to get and summarize all of your most recent emails, reply to those emails, see your calendar events, and create new calendar events. So with that being said, let's dive right into it. You're going to want to get N8n. You'll just need a cloud account of N8n. You can start a free trial to get started today, you don’t have to pay to create an account. So if you get started for free, you’ll end up in something like this. You’ll create a new scenario, and this is what the screen will look like. What you’ll want to do next is connect Telegram with your Gmail and Google Calendar, as well as various large language models. The first thing we’re going to do is set up the chat trigger, which basically just means this is what will trigger the agent to start. Anytime you send a message to a specific bot that we're going to create, the agent will start. To create a new credential here, you’ll see this access token. Now, inside of Telegram, you’ll want to go to something called Bot Father. Bot Father is something you can search for on any Telegram account. It’s not something you need to download or anything like that. It’ll look like this. Click Start and then type /new bot to create a new environment inside of Telegram that we can chat with our agent. We’ll call our bot Personal Assistant. We’re going to name it AI Agents University Bot, which is the community where we go super deep into AI agents. Once you see this key, make sure it’s kept private and not shared with anyone. I’ll be creating a new key after this so it’s no longer valid. Now, take that access token, paste it here, and click Save. That will allow us to chat. If you click on this link right here, it’ll take you to your bot. Click Start and say “Hello world.” This will pull data into our N8n environment, allowing us to interact with this agent and build it out. Now that this is up and running successfully, we’ll go ahead and set up our agent. Click the plus button, go to advanced AI, and click AI agent. We’ll set it to tools agent and define the message prompt below: “You are an intelligent AI agent personal assistant. You have access to my email and calendar and can take the following actions: You can get and reply to emails. You can get calendar events and create new calendar events.” So that’s the core prompt for this agent. We'll be building on this as we develop the agent further, but that’s what you need to know for now. Instead of the chat model, we’re going to go into Open AI chat model and set up an Open AI connection. Click create new connection and you’ll see API key. If you don’t know where to find this, go to openai.com, go to openai.com/api, sign in, and you’ll be able to access your API keys. It’s super simple. It looks like this. Once you sign in, go to the dashboard, and you’ll see API keys on the left-hand side. Once you’re signed in, click create new secret key. Name it something like N8N key and then create the secret key. Your API key will show up there. Once you have the connection set up, you’ll connect the model. We’ll connect GPT4L mini, as it’s a solid model to build with. The next step is to give it various tools. We’ll connect it to Gmail. You’ll sign in with Gmail by creating a new credential with OAuth 2. Once signed in, you’ll have access to your Gmail account. You’ll set up the message, limit it to, say, 10, and then you’re ready to go. The next step is to set up the basic infrastructure of our agent. Click the plus button after the agent, go to Telegram, and select “Send a message” under "send a text message." We’ll take the output of this model and send it back into Telegram so we can interact with the agent. Click execute previous nodes, and it should give us some data right here. We’ll go to the Telegram trigger, find the chat ID, and input the text into the text window. Now our agent is pretty much set up. We have the basic infrastructure: the agent, the model, the tools, and the chat interface (which is Telegram). Let’s test this workflow out. It says “waiting for a trigger event,” meaning we have to type something into the bot to get it to do something. If I go to the bot and say “Summarize the most recent email I received,” it will work, and you’ll see the response in real-time. At this point, the bot should access Gmail and provide the requested summary. If it doesn’t, we’ll double-check the connection. Once everything is working, the agent will summarize the most recent emails from your inbox.

Podcast Editor
Podcast.json
Preview
Audio