AI Personal Assistant 2.0 | This Agent Calls Other Agents (No Code) in n8n

Dr. Violet Howard builds a no-code AI assistant in n8n that delegates tasks to specialized sub-agents for email, calendar, research, and projects. Instead of giving one agent all the tools, she splits them across multiple agents that call each other, which cuts down on prompt confusion and scales better.
Chapters
So I said, can you schedule a meeting for tomorrow with Michael Scott at noon? And then can you email him to confirm if that works? So we're gonna fire that off, see it take place real quick. It just got Michael Scott's email information from the contact database. Now it's gonna go back to the agent, and then the agent is going to figure out which agent to send it to. As you can see, it's hitting the calendar agent as well as the email agent. Looks like the email just got sent. Looks like the calendar event just got made, and now it's gonna respond to us. The meeting with Michael Scott has been successfully scheduled for tomorrow at noon. Additionally, an email has been sent to him to confirm if that time works. You can view the meeting details here. As you can see, here's that meeting confirmation. Hi Michael, I hope this message finds you well. I wanted to schedule a meeting with you tomorrow at noon. Please let me know if this works for you. Looking forward to your confirmation. Best regards, Nate. And then hopping over into calendar, we can see tomorrow at 12 to 1 PM we have a meeting with Michael Scott. And if we click in, we can see that he was emailed as well for the meeting. A few weeks ago, I uploaded this video where I showcased this personal assistant AI agent that I made within N8N, and you would be able to talk to it and it would take action on your behalf within Gmail, Calendar, Google Sheets, etc. So today I wanted to introduce you guys to Personal Assistant AI Agent 2.0. So I've come back and I've made this agent a lot smarter, a lot faster, and more scalable. And here's how. Switching back over to the original personal assistant, we gave it access to the following 6 tools: 2 in database, 2 in email, and 2 in calendar. Now switching over to the new version, instead of giving the agent access to tools, we gave this agent access to 4 different agents. It has email agent, which has actions within email, calendar agent, which has actions within calendar, and the same thing for a research agent and a projects agent. This is a lot more powerful and a lot more scalable because once the agent gets the incoming message from our Telegram trigger, Rather than it figuring out which tool it needs to go to and passing a ton of information between each step, it's just going to be figuring out, okay, if I need to do email, I'm just going to send it to the email agent and the agent's going to take care of it. Same thing with the other agents. It's super powerful and super scalable because the prompting is a lot less intense and we can start to slowly add more agents and more agents. For example, if I was to text this personal assistant and say, hey, can you email Nate and remind him about our meeting at 3 o'clock? It would get this message and then it would think, okay, I need to email someone. So first I'm going to get that information from the contact database and then all I have to do is send this information to the email agent because the email agent knows how to take care of this. So I hope you guys already see how powerful that this type of AI agent framework is going to be. We're going to get into examples. We're going to test out every agent, every tool that this personal assistant has access to. But before that, I just wanted to quickly set a goal. I'd love to make a how-to sort of step-by-step tutorial on this sort of build. and I would love to do that if we can hit 1,000 likes on this video. I think that's a good goal to set, and it would be a new record high for me. So let's see if we can get there. But with all that being said, let's hop into a first live example where we'll be using the calendar agent. So real quick, I'll open up the calendar agent workflow. As you can see, this agent is being called by the larger agent, so the trigger is when called by another workflow. This agent, all it has to do is understand the incoming query and then figure out which of the 3 tools it needs to use. It can get events, it can create events, or it can create an event with an attendee. And then all it's going to do is respond to the agent with the success message, or it's going to tell it that there was an error and tell the main agent to try again. All right, so we're going to hit test workflow on this main agent so that the Telegram trigger is listening for a Telegram message. I'm going to pull up Telegram, paste in this message real quick that says, can you create a calendar event with Michael Scott for tomorrow at 6 PM for dinner? We'll fire this off. We will see it taking action. It looks— it's looking in the contacts database to get that email. Now it's hitting the calendar agent, and it should be finishing up any time now. So we got the message: the calendar event titled Dinner with Michael Scott has been successfully scheduled for tomorrow at 6 PM, and an invitation has been sent to Michael Scott. So let's check our calendar. As you can see right here, tomorrow, 6 PM, we have Dinner with Michael Scott. And if we click into here, we can see that he he in fact was invited. Michael Scott was one of my emails, so this is the email that it sent off to. So that's the proof that this agent is working. Let's go back into the agent, click on the execution, and make sure that it actually did do exactly what we said. So this is the most recent execution of the calendar agent. The query that it got in the beginning was to create an event titled Dinner with Michael Scott for tomorrow at 6 PM, invite Michael Scott, and then it searched our contacts database in order to pull that email, which I filled in as up@digital@gmail.com. So then once the agent saw that, it knew that it had to create an event with an attendee. So let's click into this node, see what's going on. And before I hop into this stuff, I wanna explain why I decided to come in here and update my personal assistant. I saw a video from AI Workshop, Tuber. Hey, if you're seeing this, keep up the great work. But he showcased these new tools that you can give agents that are much, much stronger than they used to be. So there's these, this Java JavaScript function, which is dollar sign from AI, where you can tell this node what to fill in for each of these parameters. So previously you would kind of have to map them out based on the input, and you would use some sort of like OpenAI node maybe to figure out based on a query, what's the start time, what's the end time, who's the attendee, and then the summary of the event. But now you can have that sort of baked into this node. So from AI, you're gonna label the, what it's pulling. So in this case, it's gonna search that query and look for a start time. And then I gave a brief description of what that start time is. I'll explain this in a, in a second, a bit more detail, not in this editor, so we can understand better. But basically it's just a way to bake in, the AI is going to look at the query and interpret start time, end time, attendees, and summary. So it's a lot, lot smarter than it used to be. So as you can see, it filled in the start times automatically. It filled in the email and then it filled in the summary, the title of the calendar event, Dinner with Michael Scott. And then all it did in the success message was sent out that the event Dinner with Michael Scott was created and it responded to the agent so that the agent could respond to us. All right, so I wanted to hop into the editor real quick and explain this dollar sign from AI thing in more detail so that for the rest of the nodes and the agents that we're testing out, it's all gonna make more sense. So let's come in here and pretend that we're adding another calendar tool. We're just gonna say that this is another create event. So to create an event in your calendar, once you have all your credentials set up, you need a start time, an end time, and then let's just say we want to add a summary as well, which is just the title that shows up in Google Calendar. So from the query, let's say we asked, you know, can you make an event for dinner from 5 to 6? So obviously the start time, end time, and the summary are all in there, but this node doesn't know that. So we need to give this node some context of how to fill in these different parameters. So typically what I would do is once that query comes in, we would run it through like maybe an OpenAI node to message a model, and then that model would figure out what's the start time, what's the end time, and what will we title this event. But now we don't even need that. We can just sort of come in here and we can do an expression, which is going to be, um, dollar sign, dollar sign right here, from AI. We click on this and then we can see we need to add a key, and then we can add other things that are optional. Usually what I've been doing right now is adding a key and a description. So in this case, the first thing we need to enter is a key. So we're filling in the start time parameter, so our key can just be start, or I guess let's just do start time to make more sense. And then if we— we can leave it as that, and the AI will probably be able to figure out what the start time for the event is. But if you want to be more detailed, you could add a comma, another quotation mark, and say the start time of an event, and then end the quote, and it should go gray. And that's how you know that it's going to be good to go, because then the AI will read in from here based on the query, what's the start time. And if it can't figure out the start time, it's going to look at the description in order to understand more context about the start time. So that we did the exact same thing. Let me just go back into the execution real quick. We're going to look at the create event with attendee node that just executed with that example that we did. As you can see, the start time is from AI. It's looking for a start time. We said the time the user asks for the event to start. Same thing with end time, except for the event to end. Then for attendees, we said, we gave the key of attendees, and the description for what an attendee is, is the person or people that the user is asking the event to be scheduled with. So in this case, it was upatdigital@gmail.com. And then finally, we gave it from AI, the key is a name, and the description of this is just a name for a calendar event. So hopefully that made sense to you. Hopefully I explained that well, but basically all you're doing is within each parameter, You're telling the AI how to pick out of the query what should be going in here. All right, we're going to do another quick example of the calendar agent. Our Telegram trigger is listening to us. We're going to send off create an event for today at 4 PM for my meeting with my team. It's going to check that, talk about what it needs to do, hit the calendar agent, and then we should be seeing a success message. The schedule— or sorry, the event titled meeting with the team has been scheduled for today at 4 PM. Tap into the calendar. We can see right here after an event called gym, we have meeting with the team. Real quickly, let's test out the last tool the calendar agent has access to, which is getting and summarizing a calendar. So I said, can you please get my calendar for today? We'll send that off. It's talking to the brain, it's hitting the calendar agent, and then we should see back in Telegram our calendar getting summarized for us. So let's just give this one sec to finish up the run. It just finished, so we should be getting the message any second now. It's just summarizing the information. There we go. Calendar events today, November 5th, we've got gym from 3 to 4, meeting with the team from 4 to 5, and then dinner from 6 to 7. We also invited up@digital@gmail.com, and you can also click on View Event right within here, and it will open up the actual, actual calendar event for us. So as you can see, we have the gym, we have meeting, and then we have dinner. So it did that successfully. All right, the next agent we're gonna be looking at is gonna be the email agent. So let's hop into this workflow real quick. Same thing, we're calling this agent from another agent, so that's why the trigger is here. And in this case, we're only giving it send email and get email messages. You know, there's so many different options. If we come in here to Gmail, you could delete messages, you could mark some as read, mark them as unread, you could add label, you could reply. And that just involves using different things, filling in different parameters. But for the sake of the video, I just wanted to keep this one simple. And really the whole point is to show how agents can call multiple other agents and how that's more efficient and more scalable. But right now, let's really quickly look at one of these nodes. So for send email, we need to know who it's going to go to, what the subject is, and what the message is going to say. So once again, the query is going to come through with something like, can you email Nate Hurk reminding him to bring the presentation material for our meeting today? So now these, these from AI functions are going to be figuring out, okay, from that query, we're going to find the email address, and then that's how we're going to fill in the to. We're going to, we're going to figure out what the message is going to say and then we're going to make a subject and put it here. And then finally, we're going to actually make the email message and put it in right here, email body, which is the body message of the email. So like I said, I'm amazed that they've added this kind of stuff. It's super cool that you can sort of bake in like an OpenAI node within each parameter. It's super cool. But let's just pull up Telegram and test out this agent. All right. We're going to send off, can you email Nate Hurk and ask him how the project is coming along? We'll send that off, it's gonna think about it, it should be hitting the contacts database to get Nate Hurk's email, and then it's gonna go back to the email agent. The email agent's currently deciding which tool it's gonna use, and then it should send us off the email and then let us know. So I've sent an email to Nate Hurk asking for an update on the project. Let's go check our email and see what that one looks like. Okay, that email just came through. The subject is Project Status Update. Hi Nate, I hope this message finds you well. I wanted to check in and see how the project is coming along. Could you please provide an update at your earliest convenience? Thank you, best regards, Nate. So with very minimal prompting, we were able to have it send a very, you know, it's formatted like an email, it signs off, it has line breaks, and that stuff is awesome. And like I said, within this email agent, I hardly even prompt this thing. All I did was say, if a number of emails isn't specified, just assume it will be 5. You'll see that in the next tool. But then I also just said, when sending an email, always sign it off from Nate, never include something like square brackets, your name. So obviously I wanna build on this agent, I wanna upgrade the prompting, I want to start to give each agent more tools, but I really wanted to get this video out so you guys could see how to start playing around with sort of very custom AI agent frameworks. So the next tool that this agent has is get messages. As you can see, it's going to be looking for messages from a specific sender, so that will be specified based on the query, and then it's going to figure out how many messages to get. So that's why in the prompt I said if a limit isn't specified, just grab 5. All right, the trigger's listening for us again. We're gonna say, can you please get my emails from Michael Scott? And this one should check the contacts database to understand who Michael Scott is, what that email is, so then it can tell the email agent that we're looking for emails from this specific address. Looks like it's working through to do that right now on the backend, and then we should get a success message here, and we should get our messages from Michael Scott summarized in Telegram. So that just came through. Here are the emails from Michael Scott, which is up@digital@gmail.com. We've got lunch this weekend. It's gonna give us a date and content. We've got the subject Project Rhino. It's gonna say a reminder about your meeting with him tomorrow. Don't forget to bring note cards and the poster. And then the third one is Project Panda. Reminder that the project must be completed by 2025 to avoid any consequences. So super cool way to get emails quickly summarized from a specific person. All right, moving on to the third agent that this personal assistant has access to is the research agent. Let's take a look at what this one is doing. Same format in the sense that it's getting called by the agent, so it's triggered like that. The research agent, we gave it a very brief prompt, basically just saying, you're a research agent, you have Wikipedia, Hacker News, and SERP API. To answer the question, first search Wikipedia. If you can't find it there, then look through Hacker News. And then if you can't find it there, use SERP API. So that's just sort of the flow that we wanted to go through. And then finally, if there's an error, it's going to tell the agent to try again. And if it's a success, then it's going to output the information that we wanted. Okay, so for the first one, let's try just saying, can you find out some recent news about OpenAI? Let's hit that off. It's going to talk to the brain, go to the research agent. The research agent right now is figuring out which of the tools that it's going to be able to use in order to answer our question. And any second now, it should be going back to the AI chat model, which will go back to the agent and give us our answer. So as you can see, we just got some recent news about OpenAI. OpenAI's board has fired Sam Altman. The board of OpenAI announced the dismissal of Sam Altman from a CEO position. Each of these has links to read more, which is pretty cool. Let's look at this last one. OpenAI's Whisper search— or sorry, OpenAI's Whisper speech recognition. They've released Whisper, which is an open-source speech recognition model showcasing their advancements in AI technology. We could click on read more and we could open up the specific article that it was able to find. So let's go into the research agent, look at the executions, and then see which tool it ended up using in order to give us that answer. Okay, it looks like this time it was able to come through. The prompt was recent news about OpenAI. It hit the agent. It figured out that it was going to go to Hacker News in order to get recent articles for us. And then in the output, we got sort of like a summarization about those articles. Another very simple use case, but let's just say we're asking, what is Tesla? I imagine this one will go to Wikipedia since it's something more basic, but right now it's hitting the research agent. The agent's thinking about which tool it's going to use. and I'll be back in a sec when we get the answer. Okay, looks like we just got the answer. Tesla most commonly refers to Nikola Tesla, a Serbian-American engineer, Tesla Inc., or Tesla, a unit of magnetic flux density in the International System of Units. So that's kind of interesting. Um, Tesla Inc. is related to vehicles and sustainable energy. Okay, so that was an interesting response. I wonder which one that this one went through. So let's give this a second to update. Right here we got the newest execution. So this one just did Wikipedia. So that's pretty cool. I imagine the search criteria was what is Tesla. So it pretty much just searched Wikipedia and gave us 3 different answers of what Tesla is. All right. And for this third one, I'm gonna say, can you find Apple's most recent earnings? Hopefully this one will hit SERP API. We will see. Um, but it's pretty cool to see that you don't actually have to be using credits and SERP API in order to get some of your questions answered. Like, I kind of thought that Tesla one, you know, with the answer that it gave, I thought that was pretty complex. But let's see, right now it is hitting the research agent. It's going to hit the brain, summarize the information that we're getting, which is the chat model, and then it's going to go back to the agent and then respond to us in Telegram. All right, looks like this one's about to finish up. There we go. Apple's most recent earnings highlights for 2024 second quarter reported a profit of $23.6 billion, revenue of $90.8 billion. Third quarter profit was $21.4 billion. Additionally, Apple has authorized a $110 billion share buyback. Good information. Um, let's just see real quick which, which tool that this one ended up using. Hopefully SERP API, but maybe even just Wikipedia again. Okay, so this one actually used a combination of Wikipedia and Hacker News. So super cool that it's not gonna be blowing through your credits within SERP API cuz that can get a little pricey. But as of now, I just asked 3 questions and it only used the other 2 tools. So that's super encouraging and cool to see that it is able to figure out how to get your questions answered. Okay. And for this last agent that we gave it access to, the projects agent, this one's really simple. All that this one is doing is, um, it's going into our database for projects, which we can either get projects or update projects. And let me show you real quick. I used this one in a, in the previous video with my personal AI assistant, but let's say you had a ton of projects in here and you had notes and you had different statuses. You could also do this with something, you know, in something like Airtable or another sort of database system, but just using Sheets for the sake of the video. So we can ask it to get information and summarize our projects or a specific project, and then we could have it update a status of one of these projects. So let's hop back into the personal assistant and let me pull up Telegram real quick and we will ask it to do something. Okay, so we're just gonna be asking this one to get the project database and summarize it. So it's hitting the project's agent, as you can see, should be coming back here to the large language model and then feeding back to the agent and then responding to us. So we will see. Here's a summary of the current projects and their statuses. AI tool is complete. Complete marketing campaign is pending action. Draft content is ready. Pending review. We've got other information here. And now let's just really quickly say, let's say we just found out that marketing campaign just wrapped up. So let me type in a prompt real quick. All right. So really simple. I just said, can you update the notes and status of the marketing campaign project to complete? Right now it's pending action and the draft content's ready and pending review. So we'll send this off, we'll see it hit the project's agent, and then maybe we'll just go into the actual project database and we can see right there, it just got switched to complete and complete in the marketing campaign. Let's go back over here. We can see that everything was successful. And then the Telegram said, the notes and status of marketing campaign project have been successfully updated to complete. If there's anything else you need, feel free to ask. So I know that these 4 agents weren't super complex as far as the tools that they had access to, but you can tell that they're very efficient at sort of delegating out the tasks to the specific tool. But the point to take away here is how easy it is to connect an agent to another agent and, you know, sort of give the bigger agent multiple agents to run through. I would say the best rule of thumb is to never give an agent more than like 10 tools would probably be too many as far as it's gonna get confused with the prompting and with the flow of how it should be operating. But those were the 4 main agents that we gave this personal assistant. But let's run through these other tools real quick. So the first one we'll just go to is sending a Slack message. This one's real simple. We set this one up within a specific channel. So the channel that it's gonna be going to is YouTube Testing, and then the message that it's gonna be sending is one of those from AI expressions. Again, it's gonna be grabbing the message from the query and then sending that off into Slack. Okay, so this prompt here, I'm saying, can you send a Slack message to my team letting them know I'm gonna be late to the meeting? Send that off, see this happen live. and then once it goes green, I have sent a Slack message to your team letting them know you'll be running late. We'll open up Slack real quick, and you can see, hi team, I just wanted to let you know that I'll be running a bit late to the meeting. Please feel free to start without me. So that is how that one works. Super simple tool, but could be super useful if you're, you know, in the car and you're running late. And then finally, let's check out this knowledge base real quick. This is the document that I uploaded to the the Pinecone vector store, which is just, um, you can see body shop services, terms, conditions. So we've got services and prices, we've got current terms and conditions, and then internal policies. Obviously you'd probably be giving it more information or, um, you know, just specific to your use case as far as like internal policies or whatever you want to be talking with. But let me type in a few things and we can see how it's coming through. All right, so I just hit test workflow. The Telegram trigger's waiting for us to talk to it. I'm asking, what is our policy on health and safety and data privacy? So we'll send that off. It's going to hit the knowledge base and then it will return us a nice clean answer. Um, let's actually just pull up the document real quick and then we just got our answer from Telegram. So the health and safety policy emphasizes maintaining a clean and safe working environment. And then the data privacy policy ensures personal information collected like contact details and payment information is kept confidential and used only for service-related purposes. And as you can see, we've got this information right down here. Now let's see, what else should we ask it? Maybe let's ask it about our payment terms and how much an oil change costs. So we'll hop back in here and I will type out this prompt. All right, so now I said, what are our payment terms? And also, how much do we charge for an oil change? So hit send. Telegram is going to take that. It's going to hit it off to the Pinecone Vector store, and then it will give us a nice clean answer about payment terms and oil change. So as you can see, our payment terms are that all payments are due upon completion of services. We accept cash, credit cards, blah blah blah. For an oil change, we charge $35 for standard and $65 for synthetic. So as you can see, $35 and $65, and then payment terms, cash, credit, and approved financing options. Yeah, so that seems to be feeding through correctly. And then finally we have the calculator. So I don't think this is really too much to show off. I'm literally just gonna say 8 times, um, 451 and see what we get there. It should be— oh, I didn't test it. We'll test it. So now it's going to be running that prompt. It will hit the calculator and it's going to say the result of 8 times 451 is 3,608. So that's obviously just how the calculator tool works, but that's in case you had a prompt where you wanted to do a calculation within maybe sending a query. So that's why we always include the calculator. But like I said, let's look at the prompts real quick because this is really simple and I didn't even have to take too much time on it. I definitely plan on making a video soon about prompting and sort of what should go into it, but the fact that the agent can run super efficiently when calling multiple agents with a prompt that is this small should show you guys just sort of the power of having agents call multiple agents. But anyways, let's read this prompt real quick. I said, you are a personal AI assistant agent designed to handle various tasks efficiently. Your primary role is to manage contacts, emails, calendar events for the user. You have access to 3 tools to help you fulfill your requests. So honestly, that's not even true. I haven't even fully updated this prompt and it's still working really well. So contact data, use this when you need to look up contact information like an email address. You need to use this tool before sending an email or before getting emails because a lot of times it has to look up the email address to get information from. It also has to look up an email address if it wants to send a calendar invitation sort of with an invite. Then we have the email agent. We just said to use this for handling sort of all email-related actions. Calendar agent, use this for handling all actions related to calendar. We can send a Slack message. The projects agent, use this tool to access our projects. We can update them or get information. And then if you've noticed, I didn't even prompt in the research agent, but we could see that it still was able to call that research agent efficiently because it doesn't have too many tools at its disposal. So it's able to sort of figure out when to use each tool. And then at the bottom I said, when a task requires one or more of these tools, make sure to identify which tool is the most appropriate. Pass along relevant details and execute these actions needed to complete the task. Your goal is to be proactive, precise, and organized in managing these resources to provide a smooth experience for the user. And then the most important thing is to include the current date and time. So as you can see, we just did a simple JavaScript function, curly bracket, curly bracket. $now. And if you watched my masterclass on AI agents, you saw how you can format this kind of stuff. So if I went in here and did format, now it's coming through as a simple, simple date rather than the way it was like this over here. As you can see, sorry, right here. Now it looks really ugly. And then also you're able to sort of play around with the formatting. If I just did two capital Ds, within quotes, of course, we would see November 5th, 2024 instead of the way we just currently saw it. So that's how you can give it context on current date and time. And that is super important because when we say things like, get my calendar for tomorrow, it knows how to do tomorrow rather than, you know, what is tomorrow. It's going to figure out the day that it is currently and then add one day to it. Or if you want to get emails from two days ago, you'd be able to do that because it has the current date and time. So as far as configuring how you actually call these AI agents in here, all it's gonna be is you're calling the agent from a list. I didn't have to specify any sort of input schema. The most important thing really is just to make sure it's returning the field called response. And then within each agent, you're having the success messages come out as responses or the error message or any sort of output comes into the field called response. And then just a quick description on when to call each tool. I said this is one that's for any email actions. This one's obviously for any calendar actions, but also you'll have that sort of into the prompt a little bit. But it's super simple now because it all, all has to do is figure out if I'm doing email, I'm gonna send all my information from the query into this agent, and then the agent's going to be able to figure out how to do that for me. I hope you guys found this one useful. Like I said, the main point of this video was just to show you how to have agents link up to a larger agent and sort of open your eyes to how that can be more efficient and more scalable. Like I mentioned earlier, I'd love to do a sort of a step-by-step tutorial as well as build on and add more tools within each of these agents. And I would love to build a, make a video for you guys about that. But let's hit the goal of 1,000 likes and then I'll start to work on that sort of content. And I'll also be uploading this, this template into the FreeSchool community. So if you're already in there, be on the lookout for that. And if you're not in there, it's completely free. I upload a lot of resources in there. As well as, you know, there's a ton of other like-minded individuals and talk about NNN, talk about AI automations, other AI projects, stuff like that. So I'd love to see you guys in there, but that's all I've got for today. So thanks so much for watching. I'll see you guys in the next one.










