Multi-agent frameworks, CrewAI and Microsoft Agent Framework
"Multi-agent" is the most hyped and most misused idea in this space, so it helps to look at two frameworks that take it seriously in different ways. CrewAI models a team of role playing agents (a "crew") inside an event driven process (a "flow"). Microsoft Agent Framework is the direct successor to both AutoGen and Semantic Kernel, built by the same teams, and pairs simple agents with typed, graph based workflows. As of October 2026 CrewAI is on 1.15 and the Python agent-framework package is on 1.22, with .NET support and a Go preview.
Why it matters
Some problems genuinely decompose into roles: a researcher gathers facts, a writer drafts, a reviewer checks. Splitting them can help because each agent gets a focused prompt, a smaller tool set and its own context window. It can also hurt, because every hop adds latency, cost and a chance for information to get lost.
Both frameworks have converged on the same lesson: free form agent chatter is not enough for production; you need an explicit process around the agents.
- CrewAI recommends starting any production app with a Flow (the process definition: state, steps, branching, event driven execution) and using a Crew inside a flow step when that step benefits from a team of autonomous agents.
- Microsoft Agent Framework separates agents (open ended, tool using) from workflows (explicit execution paths connecting agents and functions), and its docs say plainly: if you can write a function to handle the task, do that instead of using an AI agent. It also adds a "harness agent" with planning, context compaction, file access, memory and tool approvals for long tasks.
How it works
CrewAI's model: a flow owns state and control; crews do the collaborative work.
Rendering diagram…
A crew has agents (each with a role, goal, backstory, optional tools and LLM), tasks (each with a description, expected_output, assigned agent and optional context from earlier tasks), and a process, such as sequential or hierarchical. Flows use @start() and @listen(...) decorators on methods of a Flow subclass, with typed state as a Pydantic model.
Microsoft Agent Framework's model: agents with a common interface, composed by workflows made of executors and edges.
Rendering diagram…
In Python you can build workflows two ways: a graph API (WorkflowBuilder, with typed message routing, fan out and fan in, and checkpoints at superstep boundaries) or an experimental functional API (@workflow with native Python control flow). Human in the loop uses request info primitives, and a workflow can be wrapped as an agent with .as_agent(). Built-in orchestration patterns cover common multi agent shapes such as sequential, concurrent, handoff and group chat.
Reference architecture
Either way, I recommend the same layered shape: a deterministic process on the outside, agents only where judgment is needed, and observability across both.
Rendering diagram…
Code
A CrewAI crew defined directly in Python, following the crews concept page:
from crewai import Agent, Crew, Process, Task
researcher = Agent(
role="{topic} Researcher",
goal="Find accurate information about {topic}.",
backstory="A careful researcher who cites clear evidence.",
)
writer = Agent(
role="Technical Writer",
goal="Turn research notes about {topic} into a clear summary.",
backstory="An experienced writer who explains complex topics simply.",
)
research_task = Task(
description="Research {topic} and collect the most relevant facts.",
expected_output="Structured research notes about {topic}.",
agent=researcher,
)
write_task = Task(
description="Write a short summary of the research on {topic}.",
expected_output="A concise summary in markdown.",
agent=writer,
context=[research_task],
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
process=Process.sequential,
)
result = crew.kickoff(inputs={"topic": "vector databases"})
print(result)
Wrapping it in a flow, so the crew is one step of a controlled process:
from pydantic import BaseModel
from crewai.flow.flow import Flow, listen, start
class BriefState(BaseModel):
topic: str = ""
summary: str = ""
class BriefFlow(Flow[BriefState]):
@start()
def pick_topic(self):
self.state.topic = "vector databases"
@listen(pick_topic)
def research_and_write(self):
result = crew.kickoff(inputs={"topic": self.state.topic})
self.state.summary = result.raw
return self.state.summary
print(BriefFlow().kickoff())
And a Microsoft Agent Framework agent in Python, using the overview's Foundry client plus a plain function tool:
import asyncio
from agent_framework import Agent
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
def get_ticket_status(ticket_id: str) -> str:
"""Return the status of a support ticket."""
return f"Ticket {ticket_id} is waiting on engineering."
agent = Agent(
client=FoundryChatClient(
project_endpoint="https://your-foundry-service.services.ai.azure.com/api/projects/your-project",
model="gpt-5.4-mini",
credential=AzureCliCredential(),
),
name="SupportAgent",
instructions="You are a friendly support assistant. Keep answers brief.",
tools=[get_ticket_status],
)
async def main():
result = await agent.run("What's happening with ticket 512?")
print(result)
asyncio.run(main())
Agent Framework supports many model providers beyond Foundry (Azure OpenAI, OpenAI, Anthropic, Ollama and more), and does not load .env files automatically.
Trade-offs and pitfalls
- Multi agent is not free. Every agent hop is more tokens, more latency and another place for context to be lost. Measure a single agent baseline first.
- Role prompts are not architecture. A "backstory" makes demos charming but does not replace clear task boundaries, typed outputs and tests.
- Hierarchical and group chat patterns are hard to debug. A manager agent delegating to workers can loop or stall. Cap iterations and trace everything.
- Migration paths. AutoGen and Semantic Kernel users should follow Microsoft's migration guides; new projects should start on Agent Framework rather than its predecessors.
- Azure gravity. Agent Framework works with many providers, but its smoothest path (identity, Foundry, telemetry) is on Azure. Check the fit if you are elsewhere.
- CrewAI config styles. CrewAI supports plain Python, YAML with
@CrewBasedecorators and JSON based configuration in its guides. Pick one style per project.
When to pick CrewAI: content and research pipelines that map naturally to roles, teams that want a quick, readable way to express "who does what", and Python shops that like flows as the outer process.
When to pick Microsoft Agent Framework: .NET or mixed .NET and Python organizations, Azure and Foundry users, teams migrating from Semantic Kernel or AutoGen, and anyone who wants typed, checkpointed workflows with human review from the same vendor.
When not to use either: a single agent with good tools solves the problem (most of the time), or you need a minimal dependency footprint.
Checklist
- Build and measure a single agent baseline before adding more agents.
- Put an explicit flow or workflow around any crew or agent team.
- Give each agent a narrow tool set and a typed expected output.
- Cap iterations, delegation depth and total tokens per run.
- Add human review steps where actions are irreversible.
- Trace every agent hop with OpenTelemetry or your tracing tool.
- Follow official migration guides if you are coming from AutoGen or Semantic Kernel.