CrewAI builds role-based agent teams with specialised tools — sequential or hierarchical task execution.
CrewAI: Role-Based Multi-Agent
pip install crewai
from crewai import Agent, Task, Crew, Process
from crewai_tools import SerperDevTool, FileWriterTool
# Define agents with roles
researcher = Agent(
role="Senior Research Analyst",
goal="Research the latest AI trends and compile a detailed report",
backstory="Expert at finding and synthesising technical information",
tools=[SerperDevTool()],
verbose=True
)
writer = Agent(
role="Technical Writer",
goal="Write a compelling blog post from research findings",
backstory="Expert at turning complex research into readable content",
tools=[FileWriterTool()]
)
# Define tasks
research_task = Task(
description="Research the top 5 AI agent frameworks in 2025",
agent=researcher,
expected_output="A structured report with framework comparisons"
)
write_task = Task(
description="Write a 1000-word blog post from the research",
agent=writer,
expected_output="A markdown blog post file"
)
# Run crew
crew = Crew(agents=[researcher,writer],
tasks=[research_task,write_task],
process=Process.sequential)
result = crew.kickoff()