Skip to main content

Frameworks Deep Dive — Multi-Agent Systems

[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
SEQ. 3
SEQ. 4
SEQ. 5
SEQ. 6
SEQ. 7
SEQ. 8

Frameworks Deep Dive

👥 Multi-Agent Systems⏱ 12 min⭐ 90 BASE XP⌨ HANDS-ON LAB

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.

FrameworkMental ModelBest For
LangGraphState Machine (Graphs)production-ready, stateful, fault-tolerant workflows
CrewAITeam Coordination (Roles)Rapid prototyping, business process automation
Microsoft Agent FrameworkUnified Agents + Workflows (SK + AutoGen)Enterprise Python/.NET orchestration, Entra ID, MCP/A2A
Claude Agent SDKAutonomous Agent Loop (query())Code, bash, file, and MCP agents with permission gates
⌨ HANDS-ON LABAssemble a CrewAI Crew
⭐ +200 XP

Stand up a full multi-agent CrewAI project from the CLI: install the tool, scaffold a crew, then run it.

1Install the CrewAI CLI as a uv tool.
2Scaffold a new crew project called research_crew.
3Install project dependencies, then kick off the crew with crewai run.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 3 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 1
Why is LangGraph often preferred for production systems over higher-level abstractions like CrewAI?
It is much easier to write
It allows deterministic control over the flow of state using graph architecture
It runs entirely on the client side
It is officially maintained by OpenAI