Coding a Multi-Agent Market Research Team with SERP Tool

Analytics Vidhya · Intermediate ·🤖 AI Agents & Automation ·3mo ago

Key Takeaways

Codes a multi-agent market research team using SERP DevTool for internet trends and strategist agent for product launch positioning

Full Transcript

Hi. Let's move to the first agent. We say that we need an agent which has the role of a marketing researcher. So, let's call it marketing researcher, which is still based on agent. And as we saw in the recipe recommendation, we will define the role, the goal, the backstory, and plus the tools that that this specific agent can use. The role of this agent is simply market researcher. Now, the goal is we say that we want to analyze trends. So, we can say something like analyze market trends for the product launch. All right. Now, we need a backstory. The backstory can be something like experience in market trends. Let's keep it simple and consumer behavior analysis. All right. I think this is enough. Now, we move to one of the most interesting capabilities we have in Crew AI, which is the possibility of use of using external age external tools. In this case, we want to give the marketing researcher agent the possibility, so the extra functionality to browse the internet. So, the idea is that the marketing res- the market researcher the goal of the market researcher is to analyze the market trends. And we can rely on the LLM that we're going to use, but we can also give to the agent something more. In this case is the functionality of browsing the internet and if needed, look for external information that are going to be part of the final output. How do we do it? We just define the set of tools that can be used by this agent. This case, we just have the Serper tool. And that's it. We don't have to do anything more. If we have the Serper API key defined in our machine, we don't have to do anything more. This is going to work out of the box. And once again, this means that this agent is going to browse the internet, get information, analyze, exploit this information that are going to be part of the output. We can use our very nice para- parameter verbose just to make everything more clear for the sake of this exercise. And now it's time to move to our second agent. This agent is our strategist. So, we can actually call it strategist agent. And uh this is actually the product strategist. And as we said, this agent is going to create the positioning for our product. What we need is a role, product strategist, a goal, something like create effective positioning, oops, for the product. I'm not going really I'm not really diving into how effective the the strings all this information that you're passing to the agent. So, this is we cannot really call it prompt, but the let's call it with their names, the roles, the goals, and the backstories. I'm not really diving into how good they can be and I'm not I'm not really optimizing this. Sometimes I do it and I actually want to share a very small trick. Very This is not a trick. It's just like a way to parameterize the backstory. So, I tried to run different experiments with different backstory. But in this case, I don't want to dive too much into this because this is something that you can easily do it yourself and it's definitely out of the scope of this but I still want to share something that can be useful. Let's start with the backstory. So, we say like skilled in competitive positioning. And now, there's something interesting because we can basically parameterize the backstory. We can also parameterize the goal and the role, but it's really useful at least for me in my opinion to for the backstory. So, let's assume that this is our backstory. So, we start with something like this. But then, we also want to parameterize the backstory with some sort of input because maybe perhaps we have in some cases we have different executions of this Python script, of this Crew AI script, and we want to test different backstories. But still, we want to keep the the the initial root, so the initial backstory. We just want to add on top of this some other informations or conditions. What do I do is just adding a parameter which can be empty. That's the nice part of it. So, we can actually write nothing here. So, we can write something like strategist backstory equal to nothing. And this is interesting because imagine this is a user input, and based on these, you're going to change the way this agent behaves. In this specific case, we're not really giving anything to this agent. So, we're just like giving an empty string, and giving an empty empty string means that this will be the backstory of the agent strategist. So, in some cases, I like to add these variables in order to change the story of the backstory of the agent based on some conditions or user inputs. In this case, we can write something like and marketing strategy. Imagine to have even more strategies backstories. You can add them on top of this and perhaps perhaps run different experiments against these strategies. All right, another thing we want to have is verbose, as usual. Perfect. Now, it's time to move to the definition of the tasks. And at this point, as we said, we have two tasks. One is for browsing the internet and get all the information that we need for the second task, which is the creation of the positioning. So, the first task can be called get market inside task. All right, still based on task. And if you remember, the task requires a description, an expected output, and agent we are going to assign this task to. The description in this case is something like which is parameterized and we will see why. Something like browse the internet to gather insights on current market trends for the launch of the of the product and the product in this case, so we can do something like this of the of the product in this case, energy drink product. So, this will be something like for the launch of the energy drink product. So, we don't have to fix the product name, but we can decide which product we want to get the positioning for. And now we move to expected output. We also need a product name here. We need a product name as well. This is list of relevant market trends and consumer preferences. Consumer preferences. Relevant We can say relevant to the product. In this case, product name. All right. And finally, the agent. This task is for the agent market researcher. That's it. Let's move to the second task. As we said, the second task is going to be about positioning, the positioning strategy. So, develop positioning strategy task. We use our task from Crew AI and we start with the description. We can say something like base on the market insight. I'm saying this because I'm Of course I I do have experience with this, so I I I know what I'm kind of looking for. I know what I'm looking for whenever I'm writing a description or a backstory or a goal. In this case, based on the market insights. This is important because I know that I'm going to get something from the previous agent thanks to this task. And I want to be sure that the second agent's task is going to be aware of these insights and is going to be create the positioning based on whatever I'm getting from the first task. So, this is really important. As I said, I don't want to optimize the descriptions and expected output too much, but of course, there are some concepts that I consider basic concepts that you need whenever you want to write a description or a backstory. We can say create positioning strategy for the In In this case, we need a product name, product. All right. We can also add including analysis for impact and target audience. Perfect. Now, expected output. This is just a positioning, so we can say a positioning um strategy with target audience and impact notes. Perfect. The agent, once again, is the strategies. Let's also add verbals. Let's actually add agent. I think this is fine. Let's see. All right. So, now what I want to do is put everything together into our crew. This is, as you remember, is is going to be the last step. And then after that, we can just kick off the crew and see check the final output easily. Crew equal to crew. And inside the crew, we have to pass all the agents that we have created so far. We have the marketing the marketing researcher. No, market researcher, the strategist, which is the product strategist, and then the tasks. Forget their marketing insights and develop positioning. We can use planning tool. Let's have a look at what we have here. As we said, we have two agents, one for the marketing one for the market trends analysis, one for creating the positioning, and then the two tasks, marketing insights and positioning positioning strategy. Now, finally, we can call crew kickoff, and that's it. It's time to see if everything is working. So, python source marketing research, and let's see what happens. All right. We started with some information from the market researcher, and then we get some kind of planning about the strategy that we want to that we're going to have in place. Then we move to what the market researcher is actually providing as an output. As you can see, we're using the tool. So, we're using the tool separate AI, and all this information are actually coming from the internet. Then we move to the Okay, perfect. So, these are all the information that we get from the from the marketing researcher. All right. All right. All right. Okay, until this point, we're done with the marketing researcher, and we get after using the tool and collecting all the information that you see here. So, as you can see, we have the marketing Let's start from the beginning. So, we have marketing researcher querying the browser, marketing researcher querying the browser, and so forth. So, we have all the information about what is happening. And then after this, we move to the final answer of the marketing researcher, which is a list of energy drink trends from the market, whatever this agent found. All right. And now it's time to move to the product strategist, which is not browsing the internet. It's using all the information we got from the previous agent to create the product strategy. And it's going to explain what he's going to do. And finally, we get the final answer from the product strategist, which is the positioning of our energy drink product here. So, we have identified the target audience, consumer personas, develop positioning strategies, and so forth, so on. And that's it. As you saw, this is a very huge and important output with a lot of information and a lot of things that are really complicated to automate, and we didn't have to do it. We just let the agent decide how to tackle this task based on tackle this goal and whatever we wanted to get out of this strategy without giving specific details regarding the solution and how to do it. But instead, we gave the agent the right tools, the right backstory description, and that's it. And the product name and we got our output. I hope everything was clear and thanks. Thanks for listening. We reached the end of the module number two. At this point, we know about putting in practice what we did learn until now. Thank you.

Original Description

Description: Watch the step-by-step implementation of a multi-agent marketing crew. We use the SERP DevTool to browse internet trends and feed that data into a strategist agent to build a comprehensive product launch positioning strategy. Chapters: 0:00 Coding Start & Recap 1:10 Setting up SERP DevTool 2:45 Parameterizing Product Names 4:00 Giving Agents Internet Access 6:20 Connecting the Researcher to the Strategist 8:40 Running the Crew & Analyzing Output #PythonCoding #WebScraping #AIStrategy #CrewAI #DataScience
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
How to run Hermes, a self-improving personal AI agent, fully local with QVAC
Run a self-improving personal AI agent, Hermes, locally with QVAC and learn how it differs from traditional task-oriented AI tools
Dev.to · Thomas
📰
Build With a Memory Is Now a Public Repo
Learn to build an agent with a memory using a newly open-sourced repository, enabling more efficient task management
Dev.to · Andrew Detwiler
📰
Agent vocal IA sous 500 ms : l'architecture réelle STT LLM TTS
Learn how to build a real-time vocal AI agent with STT, LLM, and TTS pipeline under 500ms
Dev.to · Olivier
📰
"Not Another Model Aggregator: How FlintAPI Uses McKinsey-Style Structured Thinking for Smart Routing"
Learn how FlintAPI uses structured thinking for smart routing, improving model aggregation and efficiency
Dev.to · Mooze

Chapters (6)

Coding Start & Recap
1:10 Setting up SERP DevTool
2:45 Parameterizing Product Names
4:00 Giving Agents Internet Access
6:20 Connecting the Researcher to the Strategist
8:40 Running the Crew & Analyzing Output
Up next
Build Agentic AI End-to-End Real-Time Projects | 2026
Rajeev Kanth | BEPEC
Watch →