Frameworks Deep Dive — Multi-Agent Systems
Frameworks Deep Dive
CrewAI Flows vs. LangGraph v1.x vs. Microsoft Agent Framework vs. Claude Agent SDK
CrewAI (Crews + Flows) pairs role-based autonomous teams (Agent with role, goal, backstory, Task, and memory=True) with event-driven Flows using @start(), @listen(), and @router() decorators over typed Pydantic state:
from typing import Literal
from pydantic import BaseModel
from crewai.flow.flow import Flow, start, listen, router
class AuditState(BaseModel):
risk_score: float = 0.0
class ComplianceFlow(Flow[AuditState]):
@start()
def ingest_report(self):
self.state.risk_score = 0.82
return self.state.risk_score
@router(ingest_report)
def route_by_risk(self, score: float) -> Literal["escalate", "approve"]:
return "escalate" if score > 0.7 else "approve"
@listen("escalate")
def run_audit_crew(self):
return audit_crew.kickoff() # Triggers multi-agent Crew with memory
LangGraph models agents as state machines using directed graphs. State flows through nodes (agents/functions) connected by edges (conditional logic). It is harder to learn but the gold standard for production because it allows deterministic control flows and easy persistence (saving/resuming state).
Microsoft Agent Framework (microsoft/agent-framework, pip install agent-framework) is the official enterprise successor unifying AutoGen (v0.4+ async autogen-agentchat with AssistantAgent and RoundRobinGroupChat) and Semantic Kernel into one Python & .NET SDK with ChatAgent, @ai_function tools, graph workflows, native MCP/A2A support, and Entra ID governance:
from agent_framework import ChatAgent, ai_function
from agent_framework.openai import OpenAIChatClient
@ai_function
def lookup_sla(tier: str) -> str:
"""Return SLA response target for customer tier."""
return "15m" if tier == "enterprise" else "4h"
agent = ChatAgent(
client=OpenAIChatClient(model_id="gpt-6-astra"),
name="SlaCoordinator",
instructions="Verify customer SLA commitments accurately.",
tools=[lookup_sla],
)
Anthropic Claude Agent SDK (claude-agent-sdk in Python and @anthropic-ai/claude-agent-sdk in TypeScript - renamed from claude-code-sdk / @anthropic-ai/claude-code) embeds Claude Code's autonomous tool-use and context-compaction loop directly via query(), ClaudeSDKClient, and ClaudeAgentOptions.
| Framework | Mental Model | Best For |
|---|---|---|
| LangGraph | State Machine (Graphs) | production-ready, stateful, fault-tolerant workflows |
| CrewAI | Team Coordination (Roles) | Rapid prototyping, business process automation |
| Microsoft Agent Framework | Unified Agents + Workflows (SK + AutoGen) | Enterprise Python/.NET orchestration, Entra ID, MCP/A2A |
| Claude Agent SDK | Autonomous Agent Loop (query()) | Code, bash, file, and MCP agents with permission gates |
Stand up a full multi-agent CrewAI project from the CLI: install the tool, scaffold a crew, then run it.