This Multi-Agent system can research ANYTHING (free n8n template)

Rory Ridgers builds a multi-agent research system in n8n that routes queries to specialized agents for market, company, and social media research. The delegator agent uses GPT-4o Mini to direct tasks, while specialized agents scrape websites, pull reviews, and extract data using tools like Tavily search and Apify. A live example with Gymshark shows how it finds profiles, scrapes sites, and returns summarized insights.
Chapters
What's up guys, in this video I'm going to be teaching you how you can research pretty much anything with this multi-agent system in NAN. This is going to range from company research, social media research, and even market research. So you can literally do a deep dive on any person or any company and get all the insights you might need on them. Just quickly before we jump into it, if you haven't seen me before, my name is Rory Ridgers and I help business owners to integrate AI agent systems into their businesses. So if that's something you might be interested in, I've left a link to my website in the description. You go ahead and book up a call, we can talk about some ways to integrate AI into your business. Also, I just want to mention as well that the templates I use in this video will be available for completely free. There should be a link in the description, says something like free template. You can go ahead, grab all the templates free and get started with it straight away. But let's not waste any more time, let's get into the video and I can show you how it all works. Okay, so we're inside of an AI now, and as you can see right now, this looks pretty simple. This just looks like one agent with a couple of tools, but this is actually a multi-agent system. So these tools that it has here is actually calling upon different agents. You can see we have a market research agent, company research agent, and then a social media research agent. So what I'm going to do is I'm going to break down this main agent, and then we're going to have a look at some of these other agents, break down them. And then each of these agents have different tools, and we're going to have a look at some of them as well, so you can sort of see what's going on behind the scenes with this agent. So to begin with, obviously just connected up the chat model to power the agent. So we just have GPT-4o Mini powering this. And then we have a simple memory node that this is literally just going to— if you don't know what this does, it's just a buffer memory. So basically when we get an input come in, it's going to save it in the buffer memory. And as you can see at the moment, it's 5, so it's context windows, 5 messages, which just means it's going to remember the last 5 messages you send it. So it just makes conversations flow a little bit more naturally, and it's a really, really simple node to just add in there. So now, like I said, we've got these 3 agents here. We've got Market Research, Company Research, Social Media Research. We'll have a look at them in a minute. Right now we're going to look at the prompt for this agent. So this agent is basically, all it's doing is it's going to be taking the inputs that we receive from the user, user being us, and then it's just going to delegate to the different agents based on what our input is. So our input may be something like, I want to do some research on Gymshark's LinkedIn account. And then obviously the AI agent is going to have to pass that to the social media agent to find the LinkedIn, find their Instagram, find their social medias. I'll show you how it all works in a minute. But basically this agent is just delegating our input to the different agents it has access to. So if we have a look at the prompt here, I've got a couple comments on my past video saying I don't show all my prompts. So I want to show all my prompts and kind of break them down and sort of show you what the prompt actually does and how we structure these. So this prompt is pretty simple, it's just role and task. The role is you're an agent that can research anything for me. Your main job is to delegate my request to one of the 3 agents you have access to. And then for task, we've just said you have 3 agents you can talk to to send my request to: social media agent, company research agent, and then market research agent. You may have to use one of these or all of them based on my input. If you aren't sure which one to use— I should say sure, let me change that quickly— if you aren't sure which one to use, then just ask what exactly it is I'm trying to do and then go from there. So as you can see, this prompt's quite short, and this is kind of one of the powers of these multi-agent systems. These prompts don't have to be really, really long because all this agent needs to know, and all it really needs to do is just take my input and then, like I said, delegate that to one of his agents. Doesn't actually have to do anything. If we say, like I said, find Gymshark's LinkedIn and give us a summary on it, doesn't actually have to find their LinkedIn or really do anything. It just has to pass all of that to, in this case, the social media agent. That's why the prompts for these are quite short, just because each agent isn't actually doing too much, but the whole system kind of all works together, which means the agents don't have to do that much because it's sort of efficient, and all the agents just have their specific tasks that they do and and then the whole system just works. So let's just work our way around. Let's have a look at the market research agent first. So it's basically to connect another workflow, by the way, you just go to tool and then you click call NAN workflow, and then you can name it, give it a name, and then the actual workflow that you're gonna be calling, you just pick it from the list here and you see all the workflows here. You just pick the one that you wanna call on. So let's get rid of that. And if we have a look in this one, we've obviously picked the, uh, market research agent. and then we can have an actual look at this agent. To begin with, for all of these, you're gonna have to do when executed by another workflow node, and this just means that this agent is going to trigger when executed by another workflow, that workflow being this workflow here. So when the agent calls on the market research agent, it'll call this tool, which will trigger this node here, and then obviously execute this agent. So this agent, again, obviously we've hooked up to ChatGPT, GPT-4, and Mini, and this agent has 3 tools here as general search, RSS feed, and then Scrape URL. And each of these tools obviously doing their own thing. The general search, you'll see this a couple times in this video. Basically what we're doing here is we're using something called Tavli. If you haven't heard of Tavli before, it's basically just like a Google API is a nice way to think about it, but it gives you a little bit more of an in-depth look and you can kind of tailor all of your searches a little bit more. And it's got a really, really easy API to use. So we sort of use it in NAN and other automation platforms all the time. It's called Tavelly. Basically what we're doing is we're sending a POST request to this URL here, which is just tavelly/search, setting the headers to authorization, then our API key. The other header is going to be content-type application/json. And then this is the body that we send over. I'm actually going to show you Tavelly quick. I use it in pretty much all my videos, but if you're new around here, then I'll kind of show you how it looks. So this is Tavelly dashboard. This is our API key here. We can copy this. And then if we want to look at the actual request that we want to send over we go to documentation, API reference, and you can see here Tavli search. This is what we're going to be sending over. So this is the curl here, which means we get our URL, which I just showed you. It's going to be— so this here is the URL that we put in, and then authorization bearer API key, content type application/json for the headers like I just showed you. And then the body, the body is going to be this here. We just copy all of this over and then we paste it into an AN, and this is what this looks like. So we've just pasted that in here, and you can see there are a bunch of different things that, um, we can kind of search for, and we can tailor these searches for. So the topic, search depth, chunks per source, max results, time range, days, everything like this. You don't really have to worry too much about this. I rarely, uh, tweak these. Sometimes I'll see if I need to tweak them, then I'll tweak them. But most of the time, the main thing that you've got to worry about is the query here, and this is basically like the Google search. So what you do is you put in placeholder like this, and all this means is that the AI agent can just define this variable here. So, so the AI agent can just define based on the input it gets what the query is going to be, and then we're basically going to do sort of like a Google search for that query. And then this agent is going to use this tool because it's a market research tool. It's going to have to be scraping like, uh, forums like Skool, uh, Reddit. It's going to have to be scraping them to get some information. Also just scraping Google in general, scraping articles and blogs and news feeds, things like that. So basically, most of the time when it's using this tool, it's either to get actual insights, like just searching things up, or to get URLs for, like I said, things like Reddit, school, or articles, anything like that. A lot of time it's going to be getting URLs from here. So it might search for something. Let's say our input was, I want to start a gymwear clothing brand, can you research the market for me as of 2025? It might put in here, um, Reddit forum for what people are wearing for the gym in the summer. Let's just say something like that. And then from there, it should get a URL to a Reddit forum, and then we can scrape that. And then the next tool, really, really simple— RSS feed. All we do in here is put in a URL for an RSS feed, and then we're just going to scrape it and get the information from there. Really, really simple tool. And you can see what we've done is we've done it so the AI can actually define the input of this. So this little button here, let the model define this parameter. If we hit that, it's basically doing the same thing as that placeholder thing that I just showed you. It's just letting our model, so our agent here, just define the parameter, which should be one of the URLs that it gets from this step here. And then we have another tool here called Scrape URL. And this tool, again, we're calling on another workflow. So this isn't another agent we're calling on, this is just a workflow that we're calling on, which I'll show you now. So again, the same thing, as in this one here, we're executing another workflow. So we put that same node down, and if we have a look at this actual workflow, basically what this one's doing here is it's just allowing us to scrape URLs. So it's a really, really simple scenario. Again, at the beginning we have when executed by another workflow, then we just have a HTTP request that's just going to do GET. And when you do a HTTP request that's just GET and then a URL, basically it's just going to get all the HTML from that page. So let's just say let's use the same example, the Reddit forum about, uh, gym wear in the summer in 2025. Let's say we got a link to a Reddit forum for that. We would put that into this node, which will get all the HTML from that page. And then we have a Markdown step, which is going to convert that HTML into Markdown, which is basically going to condense it a lot, take out a lot of the fluff that we don't really need. And then we pass that to an OpenAI model, and all we're saying to it here is, your job is to get key insights from scraped web data You are looking to find some key piece of info based on the scraped web data and output summary of what you found. The key info is going to be the input that we get in the tool, and then the data is also going to be that scraped data, the markdown data from the Reddit forum in this case. So it's going to be the markdown data from that Reddit forum and the key information that the user actually wants to find. So in this step here, when this is, uh, executed, this workflow The agent's going to have to pass through query and URL. The URL is going to be the URL we're scraping, and then the query is going to be what it's initially passed. So let's just use again the Reddit forum thing. The URL is going to be the URL for that Reddit forum, and the query might be, um, like gym wear trends in 2025, something like that. So basically the agent knows in here what it's actually looking for from these URLs that it's scraping. So it's a really, really simple tool, but it's really, really handy. It allows you to scrape pretty much any URL and get insights from that webpage. So that is that agent. We'll have a look at the prompt really quickly. So, role: you're an agent that can assist in market research using your tools. Based on the user's input, you will have to use your tools to perform market research. Always start with the general search tool. This will allow you to search Google to find URLs that you can use for other tools. You have to use all your tools more than once to get the desired outcome. And then in here we also put in examples, little paragraphs. So for example, if the input is I want to research the AI SaaS market and find some good opportunities. You may use the general search tool to find Reddit forums, school convos, articles, etc., and then use the scrape URL tool to get insights from those pages. I just said bear in mind today's date is, and then today's date. You can see here this little JavaScript function. If you don't know about this, by the way, if you do two curly brackets and then it should pop up here, it's just dollar sign now. And basically this just tells our agent or whatever tool we're using what, um, today's date and time is. So that's that there, because I found that it was sort of getting insights from like 2023 or something, because that's what I thought was up to date. Obviously that's no good for us. So, um, yeah, we just give it today's date to get the most up-to-date, uh, insights on whatever market is we're researching. So that's a market research agent. Quite simple but very, very useful, very powerful. Based on the tools we give it, it can pretty much search anything it likes. It can get any URL for any forum, any school conversation, any article, anything on Google, and then it can scrape those URLs, get insights, also get insights from RSS feeds. Okay, so back in the main agent now, we can have a look at one of these other agents. So the company research one, let's have a look at that. Again, same thing. By the way, for all of these, the only input we're passing through to the agent is just query. You can see for all of these I've just done query and then let the model define the parameter. So it's basically going to be what is inputted into here. It's going to go through the agent, it's going to kind of break that down, make it a little bit simpler, and then pass it to one of our agents here. So let's have a look at the company research one. So for this, we only get two tools here. And then again, this is the exact same thing, you already know this by now. And then opening our chat model, again, exact same thing. This one is going to be website and review scraping tool. So this website tool here, really, really simple. All it does is basically kind of like that website scraper tool I showed you before, this one will actually find the URL for the website. So in this case, you just input something like, I want to find Gymshark's website and see what products they're offering at the moment. The agent would use this tool, and if we have a look at the actual tool, you can see it looks pretty similar to the other one, but we have one more step in here. We have a Tavli step again, and you're familiar with Tavli by now because I've already showed you. This time in the query section we're passing through the data that we get from the input and then main site. So the input would be, um, like I said, using the same example, Gymshark, because the input is company name. So the agent, this agent is going to be passing through the company name of the website that we want to find. Let's just say Gymshark. So it's going to pass through the company name, which is Gymshark, take it over to Tavily, which is going to do a search for Gymshark's main site, and then it's going to find their website URL And then same thing as that other one, GET request for the URL, get all the HTML, and then we have a Markdown step, convert that to Markdown, and then we have an LLM step here that we can have a look at the prompt. I want you to look through the scraped website data and output to me a summary of the business whose website has been scraped. Output just a summary, no explanation. Here is the data. And obviously we give it that Markdown data. So all this tool is doing is you input a company name, it'll find their website URL, scrape their website, output a summary of their website. And then the reviews tools, this is kind of what it says on the tin. It's going to find their reviews. And it's going to scrape their reviews so you can get some insights on their reviews. We have a look at this tool again. The input is company name, and this is pretty similar to that tool that I just showed you. You can see it pretty much looks the same, and it pretty much is the same inputs, the same company name, and then these three nodes here are exactly the same. But the only difference in here, in this case in Taverly, we're searching for the company name's Trustpilot. So I've just done on Trustpilot You can do whatever review platform you like, but I just thought Trustpilot made the most sense. So basically, again, let's say we're doing Gymshark. It's going to do a search for Gymshark's Trustpilot, give us the URL. We're going to scrape that, get all the HTML data, convert that to markdown using LLM step to just go through here. And then this is pretty much the same prompt. I want you to look through the scraped Trustpilot data and output to me a summary of the reviews that have been scraped. Output just a summary, no explanation. Here is the data. So pretty similar to that website one, except for this time it's obviously finding their Trustpilot, scraping the Trustpilot, and it's going to output to us all the sort of like the top, um, reviews, sort of an average of the reviews, average star rating, some of the bad reviews, everything like that. So that is basically the company research agent. Again, I'll show you the prompt actually, because getting comments on my videos about not showing my prompts. So I'll show the prompt. So the role: you are able to find a company's websites and company reviews you receive an input containing a company name and what they want to do. Your job is to input that company name into the correct tool. For example, the input might be, I want to find Gymshark's reviews. You would use the review scraper tool and then put the word Gymshark. So really, really simple. Like I said earlier, because all of these agents are just kind of doing their own thing and they're just doing their tasks that they have to do, the prompts are really, really simple. Because like for that company research one, all we do— this agent is just going to pass through Gymshark, wants to refine the reviews. And then all that— and then all the company research agent has to do is use a review tool and just input, uh, Gymshark, and then it'll just get all the reviews back, send that back to the main agent. So every agent is kind of doing their own thing, which means the prompts are really, really simple, and it just makes the whole system way more efficient, way less room for error. So now I've saved the best for last, the social media agent. You can see I've got Apify open here, so we're going to be using some Apify scrapers. Come into this again, input is just query. And then let's open this. So we have two tools in here. Again, you know all of this by now, the executed by another workflow, opening our chat model. So I don't have to show you that, but the two tools we have is LinkedIn and Instagram, and we're going to be scraping LinkedIn and Instagram. So let's use Gymshark again. Let's say I said to the agent, I want to find, uh, Gymshark's LinkedIn profile and see how many followers they got, or see what their last post was, or same thing with Instagram. We'd pass it to this agent. It's going to find their LinkedIn and their Instagram, and I'll show you exactly how it does that. So LinkedIn, let's open up this workflow here. And basically what we're doing here is we are getting the LinkedIn from Tavli. So again, when executed by another workflow, the input is going to be query. And then Tavli, we're going to be finding this company's LinkedIn profile URL. So Gymshark, again, it would be Gymshark's LinkedIn profile URL, and Tavli will just give us their main, uh, company URL. Has to be companies in this case just because of the Apify scraper, but you can just use a different scraper if you want to do more people. And then the validate agent is basically going to look at that URL that outputs from Tavli and just ensure that that's like a legitimate URL, and it's also a company URL in our case, and then scrape LinkedIn. And this is how we're actually going to scrape their LinkedIn and get some data from it. So the way we do that is we use something called Apify. And if you haven't used Apify before or you haven't heard of it, Basically, it's just a massive marketplace of all these different scraping APIs. You can see here, uh, website scraper, TikTok scraper, LinkedIn job scraper, Instagram, Google Maps, Twitter, Cheerio, web puppeteer, loads of different stuff. Pretty much any scraper you can think of, you can find it on Apify. It's really, really easy to connect up to your agents built on whatever platform you like. So use Apify all the time to scrape stuff, and in this case, we're going to be using LinkedIn company profile scraper. And all we have to do for this is just input a URL here. So you can see back in NAN, the way we have this structured is it's literally just a POST request to this URL. I'll show you how you get this URL. When you have an actor that you want to use, you just go to API, API endpoints, scroll down to run actor and get dataset items, copy that. And the really, really nice thing about Apify is all of your information, all the headers, and all of your API keys, or your API key is just in this URL. So all you have to do is just copy this over and then you just paste it into the input box here. So of course I've already done that, so copy it, paste it into there so I can close this. And then we have to actually send over some JSON to get to do what we want to do. And to find that JSON, you just flick this from manual to JSON, and you can see here this is what we have to send over. So we've already got Gymshark in here, which is nice. Uh, if we copy this, come back over, and then we just go to send body JSON using JSON below. Paste that in here. And of course, I have the variable which is going to be this URL. So it's going to be their company's URL. It's been validated here to say yes, that's legit company LinkedIn URL. And then we send this over to Apify, which basically just going to scrape their, uh, company LinkedIn profile. And then we just have another agent here that's going to summarize all of that. So we've said I want to summarize the LinkedIn profile of a personal company You'll receive markdown data of their scraped LinkedIn profile, outline all of the key data points, as well as an overall summary of the company. And then this is some of the data points I've chosen to give it. We'll get back loads of different data points. You'll see when we run this through, you get back loads of different data points from Apify scraped from their LinkedIn profile. These are the ones that I thought were sort of the most relevant. So the name, description, employees, followers, founded, address, and industry. You'll see when we run this, you get way more than this, and you can sort of choose which ones fit you and make the most sense for you. But these were the ones I thought were the most relevant. It's basically the agent that's going to go for all of these and just give us a summary based on all these data points. So that is the LinkedIn Scraper tool. Come back to the agent here. Now let's have a look at the Instagram Scraper tool. So pretty much a similar thing here with the Instagram Scraper tool. You can see it looks exactly the same. Input again is going to be query. So send this over to Taverly to find their— so Gymshark's Instagram profile URL, get their URL. Exact same thing, we have an agent here that's going to validate it and just say, yep, that's a legit Instagram URL or a legit profile URL. And then again, we're using Apify, and I'll show you the other actor. This is of course an Instagram scraper, so this one here, uh, Instagram Complete Profile Scraper, PayPal results. So same thing again, to get the endpoint, we just go to API API endpoints, run actor and get dataset items. Copy this, put it into this input here. Method is always going to be POST pretty much for your actors on Apify. And then JSON, using JSON below, we copy over this JSON here. So we copy this. You can see on this one there are a couple different data points and pretty much don't really have to worry about all of them. Apart from the direct URLs, it's going to be the URL of obviously person or the company that we want to scrape. So you kind of ignore all of this stuff, but we copy it into here and then we change out this bit here for the variable that we get from Tavli, which is just going to be our Instagram URL. And then exact same thing, pretty much working the same as the LinkedIn one. We just get a bunch of different data points, pass that over to an LLM and just say go through these and give us a summary. With Instagram you get a lot less data points obviously because On LinkedIn, there's like everything about the company there— founded date, their number of employees, the followers, the industry they're in. Some even have like revenue and things like that. On Instagram, it's not kind of the same thing. So what I've given it is the Instagram URL, the username, and then the followers count. You can also do like description, things like that, but I just did these ones. Obviously, when you download the template, you can just change all of this to fit your liking. But this just kind of does the same thing as the LinkedIn one— finds your Instagram URL, validates it to make sure it's legit, scrapes their Instagram to get different data points. And then we use an LLM to summarize it. So that's the social media agent. Again, show you the prompt quickly. It's pretty much the same as the other ones. So you are able to find and summarize LinkedIn and Instagram profiles. You'll receive an input that will contain a company or person, user wants to scrape, and on what platform. Your job is to extract just the name slash company name and use the correct platform tool. For example, the input may be, I want to find Gymshark's LinkedIn. Then you would use the LinkedIn scraper tool and then put just the word Gymshark. So for these tools, by the way, the query is just gonna be the company name, the same as the other one. So query, it's just going to be company name. The agent is just going to be inputting the company name into these tools. Okay, so we can test this out quickly. Let's say something like, um, I want to find Gymshark's, uh, reviews. So I want to find Gymshark's reviews, and it's come back to us saying, to find Gymshark's reviews, should I look for general consumer reviews on social media, or would you like— or would you prefer detailed company-specific reviews or market research on Gymshark's brand perception? Please clarify your preference. So I'm going to say something like I want to find General Company reviews. And I mean, you can kind of turn this down a bit with like the clarification and stuff of it. I've left it open because I found that sometimes if your agent doesn't clarify, then it gets confused. So you can kind of turn it down about how much it clarifies, how much it doesn't. I've just kind of left it open to you guys to customize when you, uh, download this template, if you download the template. So you can see right now it's using the company research agent. It should come back to us in a second. Okay, so it looks like it's finished with that. It's just using this note. Then it said to us, Gymshark has a total of 37,682 reviews on Trustpilot with an average rating of 3.6 out of 5. Here is the ratings breakdown: 76, 4%, 3, 3, 14. Common themes and reviews: many customers appreciate the product quality, customer service complaints, shipping delays, poor community communication, yada yada. So absolutely perfect, really, really cool, giving us some quite sort of valuable insights here. And now let's say to it, let's pretend that we are actually going to start our own gym wear clothing brand. Let's say, I want to start my own gym wear clothing brand, do some market research on what people are looking for. This summer. So I said I want to start my own gym wear clothing brand, do some market research on what people are looking for this summer. So of course, using the market research agent, and we'll give it a minute, it should come back to us with some market insights. Okay, so it's come back to us. Here are some gym wear clothing trends for summer '24. Obviously got the date wrong, which is a little bit weird. Might have to go in and tweak the prompt a little bit, but I mean, it's not a massive thing. It still shows you Some pretty cool insights here. So gymwear clothing trends for 2024: the essentials remain strong, high-waisted leggings, sports bras. Maybe should have specified that I'm, I'm a man, not a woman, but oh well. Nature-inspired prints, prints inspired by nature, bold patterns, abstract designs, coffee color palette, innovation of existing styles, compression gymwear, seamless technology, diversity and inclusivity, eco-friendly sustainable activewear, gym sneakers, gym accessories. Conclusion: the landscape is increasingly focused on inclusivity, sustainability, and innovation. They can— fitness apparel, an essential part of everyday fashion. You have the opportunity to tap your brand to these trends by offering diverse and stylish options that emphasize, that emphasize and comfort your performance. Absolutely perfect. Now let's say something to it. Let's use a social media agent and say, I want to find Gymshark's, uh, LinkedIn profile and get some insights. So I want to find Gymshark's LinkedIn profile and get some invites. Spelled Gymshark wrong, but it shouldn't matter too much. Send this over to our social media agent, should just know that I spelled it wrong and obviously know who I'm talking about here. But, uh, yeah, give this a minute and come back when it's done. Okay, perfect. So this is what it said. It said the name's Gymshark, industry is retail, it was founded in 2012. It's got 2,188 employees, 377,000 followers. The headquarters are this address here. And then an overview: Gymshark, Gymshark is a well-established retail company with a substantial online presence and significant workforce, yada yada. If you need more specific insights or additional information, please feel free to ask. So absolutely perfect, use all the agents absolutely flawlessly. And of course Having this, just if you actually needed this in your business, say you were researching leads, research competitors, you were starting a new company and you wanted to do some market research, then this would be absolutely perfect for you. A really quick and efficient way of sort of researching pretty much anything you like. Okay, so that is it for the video, guys. I hope you learned something about either how to research things with agents or how to use these multi-agent systems, because obviously there's benefits to both of these. You're going to be researching stuff all the time when you're building agents. Your agents are always going to have to be researching stuff, and multi-agent systems are a really, really cool feature, and they're really, really useful if you know when and how to use them. Like I said, if you want to grab the free templates for this and get started with this straight away, just go into the description of this video and there'll be a link that says free templates. And also, like I said, if you do want to work for me so we can implement some AI systems into your business, then I'll have the link to my website in the description. You go ahead and book up a call, we can talk about some ways to integrate AI into your business. But that is it for this video, guys, and I'll see you in the next one. If you've got any video suggestions you'd like to see, just drop them in the in the comments or shoot me over an email, and I'll try my best to get around to doing them.
More from Rory

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










