Lesson 11 Choosing the Right Framework
Theme:

Choosing the Right Framework

Lesson 11 · Module 6 · Choosing & Shipping · ~12 min read

Why this lesson exists

You’ve now seen four agent frameworks at each one’s sweet spot — the Claude Agent SDK on a tool-heavy assistant (L04), LangGraph on a graph-shaped workflow (L06), the OpenAI Agents SDK on a triage-with-handoff (L08), and CrewAI on a role-played multi-agent crew (L10). The first instinct when comparing them is to argue from taste: “CrewAI is just LangChain with extra roles,” “the OpenAI SDK is too tied to OpenAI,” “LangGraph is overkill for anything under five nodes.” That conversation is unwinnable in the abstract because every framework has a real strength somewhere. This lesson does the comparison from numbers — a small eval harness runs each sweet-spot agent against the same task set and records seven dimensions of behaviour. The reader’s job in the lab is to run the harness, look at the table, and form their own opinion. The scorecard isn’t the answer — it’s the apparatus that gives you the answer for your own context.

The seven scorecard dimensions, defined precisely

Three of the seven are measured directly by the harness from the live run. Four are scored against a short rubric encoded in scorecard.py. Defined one by one:

Why “measured” vs “scored” matters

Cost, latency, and LoC are measured — the harness reads them and reports them, and a different reviewer running the same harness on the same day should get the same numbers within noise. Observability, eval surface, lock-in, and failure-recovery are scored 0–3 by rubric — the harness encodes a defensible heuristic in roughly twenty lines of Python per dimension.

The rubrics are short on purpose: anyone can read agents/_eval/scorecard.py, see the rules, and disagree (or replace them). What the rubrics are not: arbitrary editorial assertions. The lesson explicitly invites the reader to challenge a rubric by changing the code — that’s the whole point of having the harness under version control rather than as a static PDF chart. If you think LangGraph deserves a 3 on failure-recovery instead of a 2, edit the rubric, re-run, and ship a PR. The scorecard improves with use.

How the harness works

agents/_eval/run_all.py is the entry point. Its job, in six steps:

  1. Import the four sweet-spot agents’ run_* functions — one per framework, from lesson04-tool-heavy-agent/agent.py, lesson06-graph-shaped-agent/agent.py, lesson08-handoff-agent/agent.py, and lesson10-multi-agent-crew/agent.py.
  2. Define a small question set (3 questions in the default config; configurable at the top of the file).
  3. For each (agent, question) pair: run the agent under a timer, capture the returned dict’s cost_usd and final_text, repeat 3 times for a median latency.
  4. Run cloc (or the Python fallback) on each agent’s agent.py to get LoC.
  5. Score the four rubric dimensions per agent based on hardcoded knowledge of each framework’s primitives — the rubric scores don’t depend on the live run, they depend on the framework.
  6. Build a ScorecardRow per framework. Render the rows as JSON (results.json) and Markdown (results.md).

The Markdown output is what this lesson includes as a snapshot. The JSON is what downstream tooling (e.g., a CI dashboard) would consume.

Budget for one full run

The harness’s 3-question, 3-runs-per-question default takes ~5 minutes and costs ~$0.25–$0.50 across all four agents combined. Bump these defaults only if you need tighter confidence intervals — cost scales linearly with both knobs.

Reading the 2026 Q2 snapshot

Slide 9 shows the populated table; the same table renders into agents/_eval/results.md when you run the harness. Three patterns are worth calling out before you skim the cells:

Treat the snapshot as a starting hypothesis

These numbers are from one run, on one question set, on one date. The lab will let you re-run on your own questions, and the picture may shift. The pattern that’s durable is the rank-order within each row — absolute numbers will drift as model prices and SDK versions move.

Decision matrix in prose

Tie the scorecard to actionable recommendations. The five short cases below cover >90% of new-project decisions:

What the lab gives you

By the end of the lab you’ll have:

You’ll leave with a runnable, reproducible artefact — not a static editorial table. The homework asks you to (a) add a question to the set, (b) add a fifth scorecard dimension of your own with a documented rubric, and (c) write a two-paragraph recommendation for a hypothetical project based on your re-run numbers. The exercise closes the loop: you don’t just read the comparison, you own it.

References

LAST-REVIEWED: 2026-05-25