π΅ The building blocks
Agents AssistantAgent (an LLM), UserProxyAgent (represents the human, and can execute code/tools). Agents are composed into teams like RoundRobinGroupChat or a SelectorGroupChat that picks who speaks next.
Both frameworks solve the same problem β coordinating several LLM agents so they accomplish more together than one prompt could β but they start from opposite instincts. AutoGen models a conversation between agents; CrewAI models a team with roles and a plan. Pick the mental model that fits your problem, and the framework follows.
A single agent with tools handles a surprising amount. You reach for multiple agents when one context gets overloaded or when the work naturally splits into roles:
AutoGen (originally Microsoft Research, now a community + Microsoft project) treats multi-agent work as a chat. Agents are conversable: they send each other messages, and coordination emerges from that dialogue. Its redesigned core (the 0.4+ line) is an event-driven, actor-style runtime β agents are asynchronous actors exchanging messages, which scales to distributed and long-running systems.
Agents AssistantAgent (an LLM), UserProxyAgent (represents the human, and can execute code/tools). Agents are composed into teams like RoundRobinGroupChat or a SelectorGroupChat that picks who speaks next.
First-class code execution (an agent writes code, another runs it in a sandbox and feeds back the result), flexible conversation topologies, and AutoGen Studio, a low-code GUI for prototyping agent teams.
CrewAI is a standalone framework (notably not built on LangChain) organised around the metaphor of a crew: agents have a role, a goal, and a backstory; work is defined as explicit Tasks; and a Process decides how tasks run. The structure is the point β it nudges you toward a clear division of labour.
Agents + Tasks An Agent is a persona with tools; a Task is a unit of work with an expected_output; a Crew binds agents to tasks under a Process (sequential or hierarchical, where a manager agent delegates).
CrewAI now offers two layers: Crews for autonomous, role-based collaboration, and Flows for event-driven, deterministic control (explicit steps, state, branching) β you can embed a Crew inside a Flow when you need structure and autonomy.
The clearest way to see the philosophies is to line up what each framework asks you to define.
| Concept | AutoGen | CrewAI |
|---|---|---|
| Unit of intelligence | Conversable agent (AssistantAgent) | Role-based agent (role + goal + backstory) |
| Unit of work | A message / turn in the chat | An explicit Task with expected_output |
| Coordination | Group chat + a speaker-selection strategy | Crew under a Process (sequential / hierarchical) |
| Control style | Emergent from conversation | Declared up front (structured) |
| Runtime | Event-driven actor model (0.4+) | Crews (autonomy) + Flows (determinism) |
| Signature feature | Code-writing/executing agents | Opinionated role/task scaffolding |
Same three agents (research β write β review); notice how differently the coordination is expressed.
AutoGen's chat can revisit any agent, loop, and adapt on the fly β flexible but needs a firm termination condition. CrewAI's sequential (or hierarchical, with a manager) process is predictable and easy to reason about β you trade some adaptivity for control. This maps directly onto predetermined vs dynamic routing.
A tiny research-and-summarise crew, sketched in each framework's idiom (illustrative β APIs evolve; check current docs).
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_agentchat.conditions import TextMentionTermination
researcher = AssistantAgent("researcher", model_client=client,
system_message="Find key facts. Hand off to the writer.")
writer = AssistantAgent("writer", model_client=client,
system_message="Write a tight summary. Say TERMINATE when done.")
# the team IS the orchestration; a condition stops the chat
team = RoundRobinGroupChat([researcher, writer],
termination_condition=TextMentionTermination("TERMINATE"))
await team.run(task="Summarise the state of solid-state batteries.")
from crewai import Agent, Task, Crew, Process
researcher = Agent(role="Researcher",
goal="Find key facts on the topic",
backstory="A meticulous analyst.", tools=[search])
writer = Agent(role="Writer",
goal="Write a tight summary",
backstory="A crisp technical writer.")
# work is declared as tasks with expected outputs
t1 = Task(description="Research solid-state batteries",
expected_output="5 bullet facts", agent=researcher)
t2 = Task(description="Summarise the findings",
expected_output="1 paragraph", agent=writer)
crew = Crew(agents=[researcher, writer], tasks=[t1, t2],
process=Process.sequential)
crew.kickoff()
| Dimension | AutoGen | CrewAI |
|---|---|---|
| Philosophy | Flexible, conversation-first | Opinionated, role/task-first |
| Learning curve | Steeper β more concepts & freedom | Gentler β clear scaffolding to fill in |
| Control vs autonomy | High autonomy; you add the guardrails | Structured by default; Flows add determinism |
| Code execution | First-class, a headline feature | Via tools; not the central idea |
| Determinism | Emergent β needs firm stop conditions | Sequential/hierarchical is predictable |
| Tooling | AutoGen Studio (low-code GUI), actor runtime | CLI scaffolding, Crews + Flows, managed platform |
| Sweet spot | Research, code tasks, novel topologies, distributed | Business workflows, fast prototypes, clear pipelines |
Agents must write & run code Β· you want flexible/experimental conversation topologies Β· you need a distributed, event-driven runtime Β· research over rigid structure.
The work splits into clear roles & steps Β· you want a readable, structured pipeline fast Β· you value guardrails & predictability Β· mixing autonomy (Crews) with deterministic control (Flows).
Requirement: turn a topic into a fact-checked blog post using three roles β researcher, writer, editor. Let's decide the framework deliberately rather than by habit.
| Question | Answer | Signal |
|---|---|---|
| Are the roles & order known up front? | Yes: research β write β edit | β structured |
| Does any agent need to run code? | No | β not AutoGen's edge |
| Do we need each step's output shaped? | Yes (facts list, draft, final) | β tasks with expected_output |
| Exotic looping/negotiation needed? | No β a fixed pipeline | β sequential process |
Every signal points at a structured, sequential pipeline β this is a CrewAI shape.
editor = Agent(role="Editor",
goal="Fact-check and tighten the draft",
backstory="A skeptical editor who cuts fluff.")
t3 = Task(description="Fact-check and polish the draft",
expected_output="Publish-ready post, sources verified",
agent=editor, context=[t1, t2]) # sees research + draft
crew = Crew(agents=[researcher, writer, editor],
tasks=[t1, t2, t3], process=Process.sequential)
crew.kickoff(inputs={"topic": "solid-state batteries"})
Change one requirement β "the editor must run the code snippets in the post and confirm they execute" β and the calculus flips. Now an agent needs to write and execute code and feed results back, AutoGen's core strength. You'd model editorβexecutor as a conversation with a code-execution agent and a termination condition.
| Question | Short answer |
|---|---|
| One-line difference? | AutoGen = agents in conversation; CrewAI = a team with roles & tasks. |
| AutoGen's core metaphor? | A group chat; coordination emerges from messages. |
| CrewAI's core metaphor? | A crew: role + goal + backstory, running defined tasks in a process. |
| AutoGen's headline feature? | First-class code writing & execution; actor runtime. |
| CrewAI's headline feature? | Opinionated role/task scaffolding; Crews + Flows. |
| Which is more deterministic? | CrewAI (sequential/hierarchical, plus Flows). |
| Which for novel topologies / code? | AutoGen. |
| Which for a fast, structured pipeline? | CrewAI. |
| Best default before either? | Ask whether one agent or a plain workflow suffices. |
Six questions. Pick an answer for each, then check your score.
When not to swarm β the workflow patterns most "agent" tasks actually need.
Predetermined vs dynamic β the lens behind CrewAI's process and AutoGen's chat.
More frameworks β Google ADK vs AWS Strands vs LangGraph.
Keep it honest β trace and eval multi-agent systems.