Library

Volume 2 · Agentic AI Systems

Notebook
Sign in

Section 30

Orchestration Frameworks Comparison

1,150 words · about 5 min

30.1 Framework Landscape

Framework Architecture State Management Best For Production Readiness
LangGraph Graph-based state machines Checkpoints, persistence Complex production workflows, explicit control flow High
CrewAI Role-based agent crews Sequential / hierarchical process Business workflows, rapid prototyping Medium, growing fast
AutoGen Conversational multi-agent Chat-based memory Research, complex reasoning exploration Medium, research-grade
Semantic Kernel Plugin-based planner Native in .NET/Java/Python, Azure-integrated Enterprise .NET/Java ecosystems High
AWS Bedrock Agents Managed agent service Built-in, AWS-managed AWS-native deployments, managed infra High
Agno (formerly Phidata) Lightweight, model-agnostic agent runtime In-process / pluggable storage Fast, low-overhead agents with native multi-modal & memory support Medium, growing
Swarm / OpenAI Agents SDK Lightweight handoffs between agents Minimal Simple multi-agent handoff patterns Medium, experimental-to-stable

30.2 When to Use Each

  • LangGraph — default choice for production systems needing explicit, debuggable state machines with checkpointing, human-in-the-loop interrupt nodes, and streaming. Python-native; strongest ecosystem maturity for agent orchestration as of 2025-26.
  • CrewAI — fastest to prototype role-based workflows (“Researcher”, “Writer”, “Reviewer” agents with a defined process). Good for business-workflow automation where the roles map cleanly to job functions.
  • AutoGen — best for exploratory multi-agent conversation patterns and research; less commonly the backbone of a hardened production system, but strong for rapid experimentation on agent collaboration strategies.
  • Semantic Kernel — the right choice when the control plane is .NET (or Java) — e.g., an existing enterprise API layer in C#. Plugs agent/tool orchestration directly into that stack without a cross-language bridge.
  • AWS Bedrock Agents — managed, serverless agent hosting when the platform is already AWS-centric and the team wants to minimize infrastructure operations (action groups map to Lambda functions).
  • Agno — lightweight and fast when you need a minimal-overhead agent runtime with built-in memory/knowledge/reasoning primitives and multi-model support without committing to a heavier graph-orchestration framework; popular for cost- and latency-sensitive agent deployments and for teams that want to swap LLM providers easily.
  • Swarm-style handoff SDKs — simplest possible multi-agent pattern (agent A hands the conversation to agent B with shared context) — good for support/triage flows that don’t need a full state machine.

30.3 LangGraph — Production State-Machine Pattern

from langgraph.graph import StateGraph, END
from typing import TypedDict

class AgentState(TypedDict):
    messages: list
    current_step: str
    findings: list
    tools_used: list
    iteration_count: int

def router(state: AgentState) -> str:
    """Route to the appropriate node based on current state."""
    if state["iteration_count"] > 10:
        return "escalate"
    if needs_research(state):
        return "research"
    if needs_analysis(state):
        return "analyze"
    return "respond"

def research_agent(state: AgentState) -> AgentState:
    new_finding = run_research_tools(state)
    return {**state, "findings": state["findings"] + [new_finding],
            "iteration_count": state["iteration_count"] + 1}

def analysis_agent(state: AgentState) -> AgentState:
    return {**state, "current_step": "analysis_complete"}

def human_review(state: AgentState) -> AgentState:
    # LangGraph's built-in interrupt() pauses the graph and waits for external input
    return state

graph = StateGraph(AgentState)
graph.add_node("router", router)
graph.add_node("research", research_agent)
graph.add_node("analyze", analysis_agent)
graph.add_node("human_review", human_review)
graph.add_node("respond", generate_response)

graph.add_conditional_edges("router", router, {
    "research": "research", "analyze": "analyze",
    "respond": "respond", "escalate": "human_review",
})
graph.add_edge("research", "router")
graph.add_edge("analyze", "router")
graph.add_edge("human_review", "router")
graph.add_edge("respond", END)

app = graph.compile(checkpointer=memory_checkpointer)   # enables persistence & resume

30.4 Semantic Kernel — .NET Control Plane Pattern

// .NET control plane orchestrating AI agents
var kernel = Kernel.CreateBuilder()
    .AddAzureOpenAIChatCompletion(deploymentName, endpoint, apiKey)
    .Build();

// Register domain tools as plugins
kernel.ImportPluginFromType<ClaimsPlugin>();
kernel.ImportPluginFromType<CodingPlugin>();
kernel.ImportPluginFromType<CaseManagementPlugin>();

var agent = new ChatCompletionAgent
{
    Name = "CaseAgent",
    Instructions = "You are a case-processing agent. Validate, classify, and route cases.",
    Kernel = kernel,
    ExecutionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions }
};

30.5 AWS Bedrock Agents — Managed Pattern

agent = bedrock.create_agent(
    agentName="case-processing-agent",
    foundationModel="anthropic.claude-sonnet-4-5",
    instruction="""You are a case-processing agent. You validate cases,
    suggest classifications, and flag risk indicators.""",
    actionGroups=[
        {
            "actionGroupName": "case-tools",
            "apiSchema": case_api_schema,
            "actionGroupExecutor": {"lambda": lambda_arn},
        }
    ],
)

30.6 Hybrid, Polyglot Orchestration

Large enterprises rarely standardize on a single framework end-to-end. A common, defensible pattern:

  • A statically-typed control plane (Semantic Kernel on .NET, or a plain API gateway) handles authentication, request routing, and simple deterministic workflows.
  • A Python-based orchestration layer (LangGraph, or Agno for lighter-weight agents) handles complex, ML-ecosystem-dependent agent workflows (NLP pipelines, RAG, data science tooling).
  • The two layers communicate over REST or a message queue, keeping each framework in the domain it’s strongest in rather than forcing one framework to do everything.

Section 30 — Interview Q&A

Q1: Why is LangGraph generally preferred over AutoGen or CrewAI for hardened production systems? LangGraph models the agent workflow as an explicit graph/state machine rather than an open-ended conversation. That gives you: deterministic, inspectable transitions; built-in checkpointing so a workflow can be paused/resumed (critical for human-in-the-loop and long-running tasks); and first-class support for interrupt nodes. AutoGen’s conversational multi-agent pattern is powerful for exploration but harder to constrain and audit; CrewAI’s role-based abstraction is faster to prototype but has historically offered less granular control over state and error recovery than LangGraph’s graph primitives.

Q2: A client’s stack is entirely .NET. What’s your orchestration recommendation, and why not just force everything into LangGraph? Use Semantic Kernel as the primary orchestration layer since it’s native to .NET/C#, integrates cleanly with the existing API surface and Azure identity/auth stack, and avoids the operational and hiring cost of introducing a second language runtime purely for orchestration. Reserve a Python layer (LangGraph or Agno) only for the pieces that genuinely need the Python ML ecosystem (e.g., a custom NLP/classification pipeline), bridged via REST or a queue — don’t rewrite the whole control plane in Python just because most orchestration tutorials are Python-first.

Q3: What is Agno and when would you pick it over LangGraph? Agno is a lightweight, model-agnostic agent framework (successor to Phidata) built for fast, low-overhead agent construction with built-in memory, knowledge, and reasoning primitives and easy multi-model/multi-provider swapping. Favor it when you want a simple agent or small agent team stood up quickly without adopting a full graph-based state machine, when minimizing runtime overhead/latency matters, or when you expect to switch LLM providers frequently. Favor LangGraph instead when the workflow genuinely needs an explicit, checkpointed state machine with complex conditional routing and long-running human-in-the-loop interrupts.

Q4: How do you evaluate a new orchestration framework before adopting it for a production system? Check: (1) checkpoint/persistence support for resuming long-running tasks, (2) human-in-the-loop primitives (native interrupt/approval nodes vs. bolt-on), (3) observability — can you trace every LLM call and tool invocation out of the box, (4) community/vendor maturity and release cadence, (5) whether it locks you into a single model provider, and (6) total cost of operating it at your expected concurrency (some frameworks re-invoke the LLM more than necessary per step).