Market research often becomes difficult to manage with a single AI agent. Assigning separate agents to collect data, analyze competitors, identify trends, and compile reports makes the process more efficient. A multi-agent AI system addresses this need.
Rather than relying on one LLM for every task, assign specialized responsibilities to different agents and use a manager to coordinate the workflow.
This tutorial demonstrates how to build a practical market research multi-agent system with CrewAI, using a local Ollama model to avoid paid APIs.
Multi-Agent System for Market Research with CrewAI: What We Are Building
Our system will contain four specialized agents:

Each agent has a defined role, while CrewAI manages the overall workflow.
Step 1: Install the Tools
CrewAI will handle orchestration, and Ollama will run the local LLM. To begin, install CrewAI:
pip install crewai
Install the Ollama Python package:
pip install ollama
Then install Ollama and download a local model:
ollama pull qwen3
Using a local model eliminates paid API costs.
Step 2: Configure the Local LLM
Create a Python file called market_research.py:
import os
os.environ["OPENAI_API_BASE"] = "http://localhost:11434/v1"
os.environ["OPENAI_API_KEY"] = "ollama"
os.environ["OPENAI_MODEL_NAME"] = "qwen3"CrewAI allows LLM configuration through its model interface, though details may vary by version. Ensure all agents use the same local model instead of separate paid APIs.
Step 3: Create the Research Agents
Next, define the four agents:
from crewai import Agent
researcher = Agent(
role="Market Research Specialist",
goal=(
"Research the target market and identify important "
"facts, customer needs, products, and market opportunities."
),
backstory=(
"You are an experienced market researcher who specializes "
"in collecting and organizing reliable market information."
),
verbose=True
)
competitor_analyst = Agent(
role="Competitor Analysis Specialist",
goal=(
"Identify important competitors and analyze their products, "
"positioning, strengths, weaknesses, and differentiation."
),
backstory=(
"You specialize in competitive intelligence and "
"business strategy."
),
verbose=True
)
trend_analyst = Agent(
role="Market Trends Analyst",
goal=(
"Identify important market trends, emerging technologies, "
"customer behavior changes, and future opportunities."
),
backstory=(
"You analyze industry trends and emerging opportunities "
"to help businesses make better decisions."
),
verbose=True
)
report_writer = Agent(
role="Market Research Report Writer",
goal=(
"Combine research findings into a clear, structured, "
"decision-ready market research report."
),
backstory=(
"You are an experienced business writer who transforms "
"complex research into concise strategic reports."
),
verbose=True
)The critical aspect is not the prompt wording, but the clear separation of responsibilities. Each agent has a distinct task.
Step 4: Create the Tasks
Define the objectives for each agent:
from crewai import Task
research_task = Task(
description="""
Research the AI coding assistant market.
Identify:
- Market characteristics
- Major customer segments
- Important use cases
- Customer needs
- Key opportunities
""",
expected_output=(
"A structured overview of the AI coding assistant market "
"with key findings and opportunities."
),
agent=researcher
)
competitor_task = Task(
description="""
Analyze major competitors in the AI coding assistant market.
For each major competitor, identify:
- Main product
- Target users
- Key features
- Positioning
- Strengths
- Potential weaknesses
""",
expected_output=(
"A structured competitor analysis comparing major "
"AI coding assistant products."
),
agent=competitor_analyst
)
trend_task = Task(
description="""
Analyze current and emerging trends in AI coding assistants.
Focus on:
- Agentic coding
- Code generation
- Autonomous software development
- Developer workflows
- Enterprise adoption
- Emerging opportunities
""",
expected_output=(
"A structured analysis of current and emerging market trends."
),
agent=trend_analyst
)Finally, create the report-generation task:
report_task = Task(
description="""
Using the outputs from the other agents, create a comprehensive
market research report.
Include:
1. Executive summary
2. Market overview
3. Customer needs
4. Competitor analysis
5. Market trends
6. Business opportunities
7. Risks and challenges
8. Final recommendations
Clearly distinguish factual findings from assumptions.
""",
expected_output="A professional market research report.",
agent=report_writer
)Step 5: Create the Crew
Bring all components together:
from crewai import Crew, Process
crew = Crew(
agents=[
researcher,
competitor_analyst,
trend_analyst,
report_writer
],
tasks=[
research_task,
competitor_task,
trend_task,
report_task
],
process=Process.sequential,
verbose=True
)This project uses a sequential workflow, where tasks execute in order. For initial projects, starting with a sequential approach is recommended before attempting more complex autonomous architectures.
Consider introducing more complex orchestration after understanding how information flows between agents.
Preparing for AI/ML Interviews?
If you are building projects like this to enhance your AI portfolio, be prepared to explain their functionality in interviews. I recommend, Cracking Your First AI/ML Interview, as a resource for those preparing for their first AI or machine learning interview.
Step 6: Run the Research
Execute the crew:
result = crew.kickoff()
print("\n\n===== FINAL MARKET RESEARCH REPORT =====\n")
print(result)The final output will appear as follows:




How I Would Improve This Project
After establishing the basic workflow, I recommend three enhancements. First, equip agents with research tools instead of relying solely on their built-in knowledge.

Second, implement source verification and citations to distinguish retrieved facts from model-generated conclusions in the final report.
Third, add a manager or reviewer agent to ensure the final report is complete before submission.
The architecture could then become:
This architecture is more suitable for real business workflows.
The Takeaway
A key lesson from working with AI agents is that multi-agent systems are not about maximizing the number of agents.
The goal is to assign each agent a meaningful responsibility and design a workflow where their outputs support a larger objective.
Market research is an effective project for learning this principle, as the workflow naturally divides into research, competitive analysis, trend analysis, and reporting.
Thank you for reading this article on building a market research multi-agent system with CrewAI. For more AI and machine learning tips, you are welcome to follow me on Instagram.





