What is the best Ai Agent building software? (n8n + Relevance AI tutorial)

Rory Ridgers builds identical email-assistant agents on Relevance AI and n8n, comparing their setup and performance. Relevance AI is simpler and faster, while n8n offers more integrations and finer control over variables. Ridgers prefers Relevance AI for most agents but uses n8n when he needs broader third-party connections or custom code.
Chapters
If you've watched my videos before, you'll know that I like to use Relevance AI to make my AI agents. I wanted to figure out what the best platform to make these AI agents is. So in this video, I'm going to be comparing Relevance AI to NAN and make the exact same AI agent and compare the two and see which one I prefer. I'm going to be making an AI agent that can send emails for you and then also retrieve data on emails you've sent or received. If you haven't seen me before, my name is Rory Ridgers and I'm an AI enthusiast and I'm passionate about helping business owners integrate AI into their business. So that's something you might be interested in, do consider subscribing. And also I've left a link to my website where you can book in a call with me and we can discuss some ways to integrate AI into your business. So let's not waste any more time, let's get into the video. Okay, so starting off with Relevance AI, I've already made the email assistant just to save us some time. The tools I've used in this video I did make in a previous video, but I'm just going to show you quickly how they all work just so that you know. So you can see here we've got the agent profile, which is giving it a name a simple description. And then if we go to Tools, we've got the Email Generator tool and the Email Retriever tool. So I'm just going to show you inside both of them so you can see how they work. If we take a look at the Email Generator tool first, so you can see here we've got two inputs: the user email request and the email recipient. And now the email recipient is obviously going to be the person that you're going to be sending these emails to, and then the user email request is going to be the content of this email, so what you want to send in the email. So For instance, if you ask the AI agent, send an email to Dan saying, are you still up for that meeting? Dan would go into the email recipient, and then are you still up for that meeting? We're going to the user email request input. And what we have to do here, the first step is retrieve data from the knowledge base. You can see here I've got an email list with names PDF. So what this is basically is just a PDF with a long list of names and then some emails that match up to the names. So what these two steps here is going to do is going to retrieve the email address from the email recipient name. This is just so that the user can just say the name of the person they want to send to rather than having to say the full email address. So this retrieve data from Knowledge, this is just going to return this entire PDF. And then this LLM step here, what this is going to do is it's going to sort through that data and then find the email address that matches up with the name and output just the email address. So really, really simple. Then we have another LLM step here, and what this is going to do is it's going to take the user email request and it's just going to expand on it a little bit. And in my case, it's going to sign it off with Rory Ridgers. So for instance, if the user email request is, are you still up for that meeting, as I said before, then it's just going to expand on it a little bit and say something like, hi there, hope you're well. I was just wondering if you're still up for that meeting later on, then sign off with Rory Ridgers. So that's all that's going to do. And we've got another LLM step here, and this is just going to take the output from this step here and create a simple subject line. So it'd just be a 3 or 4 word subject line, pretty much summarizing the content of the email. And then we have a Send Gmail Email block here. And then all we've done here is put in the to email, we've put the output of the first LLM, which is going to be the email address that we want to be sending to. And then we've got the email body. This is going to be the output of the second LLM, which is just expanded version of the user email request. So that's going to be the whole body of the email. Then the email subject line is going to be this last LLM step here that I just touched on, just going to be a short, easy subject line. So I'm just going to test this tool out really quickly just to show you how it works. So I've just put for the user email request, are you still up for the meeting? And then the email recipient is going to be Rory, just because my email on that list is the only valid email, so I kind of have to use it with me as an example. So we're just going to hit run tool. I'll show you how this works. So you can see here, this has retrieved the entire PDF here, and then this LLM step has outputted just our email, which is perfect. Then this LLM step has created an email body, and this LLM step has just created a simple subject line. And then that's all sent off. Then if we come over to my inbox here, you can see we have this email. So perfect, really, really simple. So now I'm just going to show you inside this email retriever tool. So you can see here, the only user input is the email summary request. So this is just going to be what the user actually wants to retrieve from their email. So for example, it could be, has anyone emailed me about that project recently? Or has Dan emailed me recently? Anything like that. So that would be the email summary request. And you can see the first step here is just get emails from Gmail. And you can see it's set to 100. So basically what it's going to do is just going to return 100 of your most recent emails from your inbox. And then we've just got a simple LLM step here. That's pretty much just going to summarize these emails, sort through them, and then find what you were looking for. So you see I've given it some examples. If the user said, did Katie email me about the recent project she'd been working on? So then I would want the LLM to search through the email, see if Katie's emailed, and output if she had, yes, she should be finished with it by Friday, just for example. And another one, has Tim scheduled a meeting yet? And then I want the LLM to search to see if there's a time mentioned about that meeting. And then output, no, it looks like Tim hasn't scheduled a meeting yet, if that's what's happened. So, and I want to output only the summaries that are relevant to the user's query. So really, really simple. Again, I'm just going to give you an example. So I've just put in the email summary request, has OpenAI email recently, and this is linked to my email, and I get quite a few promotional emails and stuff from OpenAI. So that's why I put that in there, and we're just going to see what comes out. If you can see here, this is the output of my most recent 100 emails. And then the LLM step has— yeah, the LLM step has summarized it here and told me all the emails from OpenAI. So that's perfect. So those are both the tools, and then we've added them together into an agent here. You can see we've got the core instructions, really, really simple. We've just got role: your helpful email assistant that can send emails for a user and also retrieve data on emails that have been sent to them. And then for the task, I've just said Your job is to recognize whether a user wants to send an email or retrieve data on emails, and then use the appropriate tool to fulfill that request. You have two tools, the email retriever and the email generator. Here's a breakdown of how and when to use them. And you can see here, just giving them a really, really simple breakdown of the tool, what it does, the inputs for the tool, and then when to use it. If a user says, for example, send an email to Rory saying what's the update on the project, put Rory in the email recipient input. And then put what's the update on the project in the email request input. And I've just realized I put the wrong tool here. Instead of email generator, it should be the email retriever tool. This tool allows users to retrieve data on their inbox. The only input for this tool is email summary. Users still want to use— ask any questions about their email, like has Sally emailed me about that meeting yet, and then put that whole entire message into the only input, the email summary input. So really, really simple. We're just going to test it out quickly, just just show you how it works when it's actually inside the agent. So if we choose the same inputs as before, let's say, send an email to Rory saying, are you still up for the meeting today? We hit send, and then you can see it should be able to recognize the tool that it needs to use. So you can see, use the email generator tool, and then the email has been sent to Rory asking if he's still up for the meeting today. And then if we go into my emails, hey, you still up for the meeting today? She wants to confirm if we're still on. Looking forward to our discussion. So perfect. Now we can just say to it, has OpenAI emailed me recently? So just pretty much the same inputs that we used before, but obviously just inside the agent so we can see how it works when it's inside the agent. You can see, using the email retriever tool, Use the email retriever tool. And then yes, OpenAI has emailed you recently. Here are the relevant emails. So then subject, the date, and then the body. So yeah, perfect. That works fine. The agent knows which tools to use, when to use them, and also how to put your prompt into the right inputs for these tools. So really, really simple. Now if we come over to NAN, this is how my agent setup is looking at the moment. At the moment, the only tool I have is the email sending tool. You can also see I've got a Google Sheets here, and this is basically just the email list with names PDF, but in a Google Sheet. So it has the exact same names, the exact same emails, everything like that. And if you haven't used NAM before, this is basically the basic anatomy for an AI agent. So you've got the AI agent block here, you've got the trigger. In my case, it's when a chat message is received. So you can see we have this chat box here, but there are a bunch of other triggers you can do. As you can see here, you can trigger it manually, on app events. So if something happens in another app, and you'd use this if you wanted to communicate with the agent through things like WhatsApp or Telegram or Slack, or anything like that, on a schedule, on a webhook call, on a form submission, which is quite cool. So you can set up forms on your website or wherever you like, and when those forms are filled out, it will trigger the agent. When called by another workflow, on chat message, which is what I have set up. And then we have other ways, things like workflow errors, file changes, things like that. Anything that isn't listed here would be under that. And then we have to link up an LLM to this AI agent. In my case, I'm just using GPT-4o. You have to set up your credentials, which is really, really easy. If you want to do that, you just hit create new credential, go over to Assistants API, get your API key, and then put it in there. And then it just links up to your Assistants API account. This is what's sort of going to power the AI agent. Then you can see here we have memory. I haven't got anything hooked up to that at the moment, but we can do things like storing it locally in NAM, which probably, as it says, yeah, the easiest way of doing things. Then we have all these external databases that you can link to. But for this agent, we don't really need any of that, so I've left that blank. And then we have the two tools here, the Google Sheets tool, which is just going to retrieve those names of emails to be able to get the right email. And then we have calling an NAN workflow tool, and this just kind of what it says on the tin, is able to call another workflow inside of NAN. You can see here, this is the send email tool. We've put in a description of how and when to use this tool. Call this tool when a user wants to send an email or message someone. Always use the Google Sheets tool first to receive the email address that matches the name of the person. User wants to email, and then input that email address and the full prompt from the user. So the difference between this and Relevance AI is that in Relevance AI I've done it so that the tool actually retrieves the email address first, but in this case it has to use another tool to be able to retrieve the email and then send it over to that NAN tool. There are other ways of doing it, I've just found this is the most simple way of doing it in this case. And also you can see here, just to link it up to another tool, you set this to database and then workflow, and you can see we have our different workflows here, and that's how you link it to the other workflows. Then in the AI agent, we have obviously a name, a prompt. We just take that prompt from the node before, which is just the chat message. And then we have a system message here, and this is similar to the main prompt on Relevance AI. If I show you that, the core instructions— this is essentially the core instructions box. So just how to use the tools, what tools it has, how to input the correct data into these tools. So I'm just going to show you inside of our send emails tool. You can see here, this is the setup, really, really simple. The first block is going to be an execute workflow trigger. So this just means when it's called on by another workflow, which we had set up before in the AI agent step. And then we have an LLM step here. And you can see here the operation is message a model. And then we just have the instructions here. I want you to pass through this data for an email request into this format. So this is an example of how it would receive the data, send an email to Rory@autonomouslyai.com. It should also say actually what's going to be in the email. So send an email to Rory@autonomouslyai saying, are you still up for that meeting? Whatever it is. And it's going to pass that data into the email recipient as its own variable, the email subject line as its own variable, which I've said here it will have to generate on its own, and the email content into its own variable, which you also have to expand on a little bit, the same as the Relevance AI tool. And I've just said, always sign the email content with Rory Ridgers, never your name, because I found that it was just as default signing off with your name, which we don't want. Then I've said, here's your data, and all you have to do here is just drag in the data like this. So really easy to use. And if we just test this step with the variable we've got here, you can sort of get an idea of what it'll look like. So You see these are the separate variables: email recipient, email subject line. Obviously it's just made up some content for this email because there actually isn't any content, just said request for collaboration on upcoming project. Yeah, you can see it's just made up an email subject line and email body, but that just gives you an idea of how it works. Then we have a Gmail block here and we just drag in— really, really simple— we just drag in the variable. So email recipient would go in the to Email subject line going to there, and the email content will go into there. And I found setting up your credentials with things like Gmail and also Google Calendar and sort of a lot of the Google apps, it's a little bit more complicated than with Relevance AI. What you have to do is you have to go into your Google Cloud, set up a new project, and enable the APIs, whereas on Relevance AI you can just sign in with your Google account. So if I go to new credential here, you can see it wants all of this stuff, the client ID, the client secret, then it gives you a zero auth redirect URL. But if you've never done this before, don't be intimidated. As you can see here, we open docs, it gives you a walkthrough of how to do it. It should only take you about 5 minutes, but it's still just a little bit more hassle than doing it on Relevance AI. One of the things I realized straight away that NAN is much better at, especially with these LLM steps, is being able to pass data through correctly into different variables. If I'd use this exact same prompt in an LLM in Relevance AI, it would have outputted these separate things like this— the email recipient, the email subject line, and the email content— but it would have done that as one variable. With this, it does it as separate variables. So as I showed you before, you're able to just drag and drop them in. So that's really nice, makes it a lot easier. What we do after this is we put down an Edit Fields block, and we have to set the response to sent. So what this does is basically the AI agent Once it calls a workflow, it's listening for a response. And in this case, if the workflow goes all the way through and it works fine, it'll get to this end block and it'll set the response as sent, because that's kind of all the data it needs to know. If you're actually passing some data through, like on the next step when we're going to be retrieving the emails, then you'd have to drop the variables into there of what it's retrieved. But for this, we just need to tell it that it's sent. So this is the message that the AI agent will get. Once this workflow has been completed. Now we need to go and we need to make the email retriever tool. So I've already started here, just call it tool number 1. We can change that quickly. So email retriever tool, exact same thing again, is going to be execute workflow trigger. So it needs to be called upon by the AI agent. And we're doing this a little bit differently just to show you a bit more of NAN. The inputs that this workflow is going to get going to be the date and time range and then what the user is actually looking for. So for instance, a user input would be has anyone emailed me about the project from 26th of September to today, or what emails have I got this week? So for that to work, it needs a time range. So first thing we're going to do is we're going to add an LLM step. So we put an OpenAI block down, we're going to do message a model, and then change your model. I'm going to set it to GPT-4o Mini. And then one of the things we need to do before this actually is we're going to put some mock data into this step before, because on Relevance AI, the variables are already there when you want to reference them in another node. But for this, you can see, even if we execute it, it will just give us nothing because there's nothing being passed through. So what we do is we just create some test variables. So if we hit add output, we have the JSON schema here, so we can just write in some variables. I've just put in all the variables here. I've put start time 26th of September, end time is today, the request is, have I got any emails from OpenAI recently? So we're going to save that. This is kind of dummy data to be able to input the data in the right way in these next steps. So you can see here, when we're in the OpenAI LLM step, we have these three separate variables here, and this is how it's going to look when we're actually using the tool. So what we want to do is we just want to add in a prompt here, and essentially what this LLM step is going to be doing is going to be passing through the data and it's going to be formatting the dates into the right format. So we're going to prompt it to do that quickly, and I'll come back once I've written the prompt. Okay, so I'm thinking I might have to change it a little bit because I've written out the prompt here, and as you can see, it's outputting the right things, but it's outputting them as 3 separate items, and all of the variables are just in the content variable, which is wrong. So I'm thinking if the data inputted is one variable, then it should only do it one time, because I think what's happening here is because there's 3 separate variables it's doing it 3 times. So I'm just going to change that quickly. Okay, so this is what I've changed the input to. It's just going to be the summary and then all of these variables as one. But you can see they are labeled here, so the LLM will be able to tell which is which. So we're going to save that, and then we're going to slightly rework this LLM step and see if it can figure it out this time. Okay, so I've got it working out. As you can see, we have 3 separate variables here, and I think what one of the problems was, was it was doing it 3 times. But then when I changed the summary to one thing like this, it was only doing it once, but it was outputting the variables as just one thing. I've just flicked this on and made it output the variables as JSON, and then you can see it's done 3 separate variables. So, so top tip for that, do bear that in mind when you're using the LLM step. You can see this is my prompt here. I've just told it basically to pass this information through and format it like this, and then I've told it the format that I want for the date and time. And I've used this little piece of JavaScript code here. This is just the dollar sign now, and what this does is just returns today's date. So you can see here, this is what it looks like to the LLM. It returns today's date in the right format, which is perfect. So I basically said to it, if the inputs it gets through is something like today, then it needs to be able to work out what today is. So the inputs could be the start time is yesterday and the end time is today. So if a user wants their emails from yesterday needs to be able to work out what today is for a reference point. So that's perfect. And as you can see, it's done it perfectly. So the start time is the 26th of October, which is done, and then the end time is today, which is the 27th of October, which is perfect. And the request— have I got any emails from OpenAI recently? Okay, so that's perfect. So what we need to do now is we need to add a Gmail step, and we need to return these emails. So we go on Get Many Messages, connect our Gmail account, which obviously I've already done. And then at the moment the limit's 50, but let's just put it to 100 just because that's what we did on Relevance AI. So we're just keeping it simple. And at the moment this is literally just going to do exact same things the Relevance AI step. It's just going to return 100 of our most recent emails. Another thing you can do here is you can add status, so you can do things like the read status. So if you want unread emails only, or read emails only, or all of your emails, unread and read emails. So that's really, really cool. So you can say, what emails have I got from yesterday? And it will just return you the ones that you haven't seen yet. So really cool. You can also do this on Relevance AI, although it might not be a thing that everyone knows. So if you go to the email retriever tool here— now, I didn't know this about Relevance AI when I first started using it. If we go to build, and then for certain steps like the get emails from Gmail step, you can see there's a settings here and you've got advanced settings, which is really, really cool. So you can do a subject filter, you can do label filters, you can do a before date and an after date, you can filter for keywords, you can, you can set it to either read or unread emails with attachments, spam emails, trash emails, draft emails. So really, really cool. And if you didn't know this about Relevance AI, this is a little tip. A lot of these steps will have these advanced settings like the LLM steps. You'll be able to add a system prompt. You can obviously change the LLM, which you can do here also, so that's not that crazy. But you can do things like change the temperature of it, change the max tokens. You can tell it what the response format you want it to be is, so, you know, JSON object. So yeah, just a little tip for Relevance AI if you didn't know that was a thing. It's really useful and it allows you to do a lot more things with these tools. So just to keep it the same, we're going to go with unread and read emails. So it's just going to do the same thing. It's going to return 100 of our most recent emails. And then what we need to do now is we're going to add another LLM step, and this is going to be able to— the same thing as a Relevance AI, it's going to be able to look through all these last 100 emails and then find the ones that we actually care about. So again, we choose the model, we're going to say GPT-4o Mini again. And then again, we've got the prompt. So what we're going to do quickly is we're going to execute the previous node so that we can return our last 100 emails just so that we can use the variable. Just makes things a little bit easier. One of the things I have realized with NAN is when you're using these variables, if you want to just put in the entire output from the step before, it seems like you can't really do that in a straightforward way. Maybe you can, I'm just not too sure how. Sort of similar to Make.com, you can put in these bundles here, so things like that, but you can't just put the whole output. But for this, we're just going to put the snippets from the emails. This is going to be like the email content because we're going to be looking through the email content. But if you did want to return emails from certain people, so, you know, has Sally emailed me recently, then you can also put— you can also drag the from variable in as well. So yeah, so we're just testing it out here, and I have noticed that it is taking a lot longer than the Relevance AI tool. I think obviously because it's having to go through 100 pieces of data but I think it's still taking a lot longer than the Relevance AI tool. I'm not too sure why that is, but yeah, we'll see what it comes out with. Okay, so that was taking way too long, so I think what we're going to do is we're going to change this down to 50 and then just try and do the same thing, maybe 100 items. It's just too much for it. So if we run this tool to get the 50 most recent emails, and then we can test this LLM step again and we'll see how long it takes this time. Okay, so I've just gone ahead a little bit and what I've done is I've set it to unread emails only, so differently to the Relevance AI tool We want to try and get just the unread emails just to change it to up a little bit. I've put the limit as 10 and then received after the start time here. And then what we have is an LLM step that's basically just going to summarize that data. And then after that we have an aggregate filter that's just going to filter all of it into one thing. So if we test this step, you should see, yeah, it just summarizes the data we've got. Perfect. And now these are just kind of like promotional emails. From my inbox. So, and then in this aggregate step, you can see we've set this to individual fields, and then we've literally just put the content in there, and then it just puts it into one item like this. So then what we do is go to edit fields, and then for the value, we can just put in the whole content here. So this is what's going to be returned to the agent and then hopefully outputted back to us when we talk to the agent. So we can save that, and now we can go back to our AI agent here. We can add another tool, which is going to be calling an NAM workflow. We can name it— I've named it Email Retriever. We're going to leave the description for a second, and then we can choose this tool. So the Email Retriever tool here, and then this is what we was looking at before. The field to return is response. So maybe I didn't explain this earlier, but it's looking for response, and it's going to look for the value of the response. So that's why we do that edit fields bit at the end. So now we need to add a description of how to use this tool. So, so I've just said to it, call this tool when a user wants to return their recent emails, format the data as one variable like this. So the start time and the end time, then the request. So now we just also have to prompt the agent to know when to use this tool and also to input the data correctly. So I'm just going to do that quickly. Okay, so I've just written out a little bit on how the agent should use the email retriever tool, when it should use it. So when a user says something like, what emails have I got in the last week, they use the email retriever tool, format the data like this. So the same as before, And I've also said when the user says something like this week, just put the start time as a week ago and the end time as today. So pretty simple. Let's see if it's able to figure it out so we can chat with it. And first of all, we're going to test out the email sending tool. So we can say— so I've said send an email to Rory saying, are you still up for the meeting? And then once this has worked, it will show you the process that it went through. Okay, so it's saying there was an error here trying to get the email address, which is weird. So if we look at the Google Sheets node— okay, so just run it a couple more times, and what I realized was the Google Sheets, the authentication, there was something wrong with the credentials, which is weird because I set it up and it worked earlier. So all I had to do was just re-authenticate it. So not too sure why I did that, but re-authenticated it, and it seems like it's worked now. So you can see sort of the workflow that it went through. This is the input to the NAN tool Rory at Autonomous AI, are you still up for the meeting? And the output was sent. So this is the email that was sent. Hi Rory, hope this message finds you well. I'm checking to see if you're still up for that meeting. And one of the things that's different about this compared to Relevance AI is it says at the bottom, this email was sent automatically with NAN, and then there's a link to NAN, which is weird. It doesn't do that on Relevance AI. So that's just something that's different. Now we're going to try and retrieve some emails so we can see what emails have So I've just said, what emails have we got in the last week? And we're going to see where it comes out with. Okay, so this is what's come out with some email from Replit, and then one of the ones I sent to myself when I was using the Relevance AI tool, and also from Calendly, just promotional ones. So yeah, I mean, that's worked. You can see the workflow here. This helps input here as we are. Start time 1 week ago, end time today. Request get emails. Perfect. So that's worked how we intended. All right, so that is Relevance AI and NAN compared to each other. I'll be really interested into what you guys think about these two softwares, some of the things you prefer about the softwares, some of the things you dislike, and also which ones you guys are using. In my opinion, I think there's a place for both. I think going forward majority of the time I'm probably going to be still using Relevance AI just because I'm used to it and I think there is a lot you can do with it. I managed to make the exact same tool a lot simpler on Relevance AI. In fairness, it may just be simpler because I'm more used to Relevance AI, not because NAN is worse at making these or anything. But I think, yeah, going forward, majority of the time I'm going to be using Relevance AI. For some of the more complex agents, I might hop onto NAN just because you can connect way more apps. I found to NAN there's a lot more integrations with different softwares and different apps compared to Relevance AI. And also, if there's a tool that you want on there that NAN doesn't have, you can literally just code these tools in and create your own functions, which is very, very cool. And I'm sure it will be very, very useful if the time ever comes I need to do something that isn't on either Relevance AI or NAN. If you were interested in working with me so I can help to integrate AI into your business, then as I said at the start of the video, I've left a link to my website where you can go book in a call with me, or you can just email me directly with any questions you might have about integrating AI into your business. So thank you for making it to the end of the video. As I said, I'd really to hear about what you guys think about these two different AI agent building softwares and which ones you guys are currently using. And also, if you have any suggestions for videos, then please do just drop them in the comments.
More from Rory

Dynamic Workflows are crazy. This is how to actually use them (beginner's guide)










