CrewAI: Build Multi-Agent Teams Where Each Agent Has a Role and Goal
CrewAI structures multi-agent AI around roles, goals, and backstories — giving each agent a defined identity and letting them collaborate on complex tasks autonomously.
Mahmudul Haque Qudrati
CEO & ML Engineer
One AI engineering post, weekly
LLM benchmarks, prompt techniques, and token-cost breakdowns — not another AI news roundup.
CrewAI is a Python framework for building multi-agent AI systems where each agent has a defined role, goal, and backstory. Rather than writing a single monolithic prompt, you decompose complex work into a crew of specialized agents that collaborate sequentially or hierarchically.
The mental model is close to a real team: a researcher, a writer, and an editor each do distinct work, hand off results, and produce a final output that none could produce alone.
Core Concepts
Agent — defined by role (job title), goal (what it optimizes for), and backstory (context that shapes its behavior). The backstory is surprisingly powerful for steering tone and expertise level.
Task — a discrete unit of work assigned to an agent, with a description, expected output, and optional context from previous tasks.
Crew — the collection of agents and tasks, plus a process (sequential or hierarchical) that defines execution order.
from crewai import Agent, Task, Crew, Process
researcher = Agent(
role="Senior Research Analyst",
goal="Uncover cutting-edge developments in AI and data science",
backstory="You work at a leading tech think tank. Your expertise lies in "
"identifying emerging trends and synthesizing complex information.",
verbose=True,
allow_delegation=False,
)
writer = Agent(
role="Tech Content Strategist",
goal="Craft compelling content on tech advancements",
backstory="You are a renowned Content Strategist, known for your insightful "
"and engaging articles. You transform complex concepts into clear prose.",
verbose=True,
allow_delegation=True,
)
research_task = Task(
description="Conduct a comprehensive analysis of the latest advancements in AI. "
"Identify key trends, breakthrough technologies, and potential industry impacts.",
expected_output="Full analysis report with trends, technologies, and impacts",
agent=researcher,
)
write_task = Task(
description="Using the researcher's findings, develop an engaging blog post "
"that highlights the most significant AI advancements.",
expected_output="Full blog post of at least 4 paragraphs",
agent=writer,
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
process=Process.sequential,
verbose=True,
)
result = crew.kickoff()
Team workspace
Ship faster with chat, meetings, and projects in one place — Zlyqor.
Memory System
CrewAI supports three memory types: short-term (in-context for the current run), long-term (persisted across runs via SQLite), and entity (knowledge about specific people, places, and concepts extracted from interactions). Long-term memory lets agents build up institutional knowledge over repeated use.
Tool Integration
Agents can use tools including web search (via SerperDev or Tavily), code interpreter (runs Python in a sandbox), file read/write, and custom tools you define as Python functions decorated with @tool.
CrewAI vs AutoGen vs LangGraph
CrewAI is the most approachable for role-based workflows with clear handoffs. AutoGen excels at code generation with back-and-forth agent conversation. LangGraph gives you the most control via explicit state machines but requires more code. For document research + writing pipelines, CrewAI is typically the fastest to build.
Resources

Mahmudul Haque Qudrati
CEO & ML Engineer
Visionary technologist, software engineer, and machine learning specialist. Founder and CEO of Pristren, directing engineering teams that ship production-grade AI/ML pipelines, mission-critical full-stack applications, and developer tooling. Creator of Zlyqor, the unified team workspace platform. Author of 540+ technical guides and benchmark research reports on large language models, agentic workflows, Model Context Protocol (MCP), and modern web stacks.
More from Mahmudul
Related Articles
GPT-6 Astra AGI: How to Actually Use It and Get Its Best Performance
GPT-6 Astra is OpenAI's most capable model, but 'AGI' is a marketing claim. This guide shows you how to access, use, and get the best from it with practical endpoints, pricing, and agent patterns.
What is Codex starts encrypting sub-agent prompts? A Practical Overview
OpenAI Codex now encrypts sub-agent prompts by default. This change affects how agentic systems share context between sub-agents. Here's what it means for your AI pipelines.
Building reliable agentic AI systems: A Practical Overview
A practical guide to building reliable agentic AI systems covering structured outputs, observability, fallbacks, and cost controls with real code examples.
// discussion
Comments