Choosing an agent framework

Raw SDK, LangGraph, OpenAI Agents SDK, smolagents, AutoGen, Semantic Kernel, CrewAI and managed services: what each is for.

Advanced about 3 h

The picture

  1. 01

    Requirements

    state, HITL, scale

  2. 02

    Shortlist

    2 or 3 options

  3. 03

    Spike

    same task in each

  4. 04

    Measure

    reliability, cost, debuggability

  5. 05

    Decide

    and record why

What a framework should give you

A good framework earns its place by providing things you would otherwise rebuild: state and persistence (checkpoints), control flow (branches, loops, parallelism), human-in-the-loop hooks, tracing, and integrations. A bad one hides the prompts and the loop and makes failures hard to debug.

The landscape in one pass

  • Raw SDK plus your own loop: maximum control and transparency, minimal dependencies. Right for simple agents and for learning. You write persistence, retries and tracing.
  • LangGraph: agents as explicit graphs with typed state, conditional edges, checkpoints and interrupts. Strong when you need resumability, branching and human approval.
  • OpenAI Agents SDK: a small set of primitives (agents, tools, hand-offs, guardrails) with built-in tracing. Quick to start; works with other providers through compatible interfaces.
  • smolagents: agents that act by writing and running Python code, which composes tools flexibly but demands a real sandbox.
  • AutoGen: conversation-driven multi-agent systems; Microsoft's agent stack also includes Semantic Kernel, popular in .NET and enterprise settings.
  • CrewAI: role-based "crews" of agents with tasks; quick to prototype a team metaphor.
  • Managed services (such as Azure AI Foundry's agent service): hosted threads, tools, identity and monitoring. Less plumbing, more platform coupling.

APIs in this space change quickly. Pin versions, read the changelog before upgrading, and keep your domain logic outside the framework so you can replace it.

A fair comparison method

Pick one small task (for example "answer a question using a search tool and a calculator") and implement it in each candidate. Score:

  1. Lines and concepts needed to get it working.
  2. Observability: can you see every prompt, tool call and token?
  3. Control: can you add a step limit, an approval gate, a retry policy?
  4. Persistence: can a run resume after a crash?
  5. Reliability and cost on a 20-case test set, repeated five times each.
  6. Escape hatch: how hard is it to drop to the raw API when you need to?
# The same task, three ways, in one table you fill in yourself
results = {
    "raw sdk":        {"loc": 70,  "resumable": False, "pass_rate": None, "cost": None},
    "langgraph":      {"loc": 55,  "resumable": True,  "pass_rate": None, "cost": None},
    "agents sdk":     {"loc": 30,  "resumable": False, "pass_rate": None, "cost": None},
}

Fill in your own numbers; they depend on your task.

Rules of thumb

  • If a single loop with three tools does the job, use the raw SDK.
  • If the process has stages, approvals or long waits, use a graph runtime with checkpoints.
  • If you are inside a Microsoft estate with identity, governance and monitoring requirements, evaluate Semantic Kernel and the managed agent service.
  • If someone proposes five agents, ask what each can do that one agent with five tools cannot.

Common mistakes

  • Adopting a framework because of a tutorial, then fighting its abstractions.
  • Letting framework types leak into your domain code.
  • Comparing frameworks on demo tasks rather than your own workload.

Exercises

  1. Build the same two-tool agent with the raw SDK and one framework. Write a one-page comparison.
  2. Add a step limit and tracing to each and note how much work it took.

You are done when you can…

  • Implement the same small agent in two frameworks and compare them honestly
  • State the criteria you would use to choose between a raw SDK and a framework
  • Describe what a managed agent service adds and what it costs you