Lesson 11 Choosing the Right Framework
Theme:

Lab 11 — Running the cross-framework scorecard

Lesson 11 · Module 6 · Choosing & Shipping · ~30 min hands-on, ~$0.30 budget

Goal: by the end of this lab you will have (a) run agents/_eval/run_all.py end-to-end (~5 min, ~$0.30), (b) opened results.md and read each row, (c) modified the question set in run_all.py to add a question that matters to you, and (d) re-run the harness and observed which dimensions shift the most. By the end you’ll have your own apples-to-apples scorecard for the four sweet-spot agents shipped in Modules 2–5.

Prereqs

Step 1 — Sanity-check the harness imports cleanly

Before paying for any API calls, make sure all four agent modules can be imported. The cheapest way is to ask the runner for its argparse help text — that exercises every import without firing any LLM calls.

python agents/_eval/run_all.py --help

Expected: argparse help text listing --questions, --runs, and --out-dir (or similar) flags. No traceback.

If you see ModuleNotFoundError, one of the four agent modules failed to import — most likely an __init__.py missing from a lesson directory. Fix by running:

for d in agents/lesson0{4,6,8}-*/ agents/lesson10-*/; do touch "$d/__init__.py"; done

✓ Self-check: --help prints flags and exits 0.

Step 2 — Run the harness with defaults

Now the expensive part. From the repo root:

python agents/_eval/run_all.py

Expected:

If a framework fails mid-run

If any framework raises during its run, the harness logs the error and keeps going — the failed framework’s row will show $0.0000 / 0.0s latency / its real LoC and rubric scores. Don’t claim victory until all four ran. Re-run the failing framework’s standalone lab (e.g. python agents/lesson06-graph-shaped-agent/agent.py) to debug it in isolation, then re-run the harness.

✓ Self-check: results.json and results.md both exist; all 4 frameworks have non-zero cost_usd.

Step 3 — Read results.md

cat agents/_eval/results.md

You should see:

Step 4 — Pick a winner per dimension

Walk through the table column by column and name a winner for each. You should see roughly this shape (exact numbers vary with model + question set):

The whole point of this lab

No single framework wins everything. That’s by design. Pick a winner per the dimension that matters for your hypothetical project. If cost-per-task is dominant, you pick one column’s winner. If you need audit-grade observability, you pick a different one. The scorecard exists so you can have that conversation with numbers in hand instead of vibes.

Step 5 — Modify the question set

Open agents/_eval/run_all.py in your editor. Find the DEFAULT_QUESTIONS list (or similar — check the runner’s docstring for the exact name). Replace one of the default questions with something realistic for your domain. Examples:

Then re-run with a smaller question set so iteration is fast:

python agents/_eval/run_all.py --questions 3

Expected behaviour

The rubric scores don’t change — observability, lock-in, and LoC are per-framework, not per-task. But cost and latency probably shift, possibly by 30%+. That’s the lesson: the scorecard is a function of your tasks, not just your framework. If you’re picking a framework for production, use production-realistic questions in the harness — not the demo defaults.

✓ Self-check: results.md shows different cost/latency numbers than Step 2; rubric columns are unchanged.

Step 6 — Bump --runs and check stability

A single run per question is noisy — especially for latency. If you’re going to present these numbers to a team, re-run with more samples:

python agents/_eval/run_all.py --runs 5

Expected:

Step 7 — Optional: install cloc for tighter LoC counts

The harness has a Python fallback for line-counting that excludes the mocked PKB / WEB_INDEX data dicts using a regex heuristic. It’s good but not perfect. For more accurate numbers, install cloc:

brew install cloc                    # macOS
sudo apt install cloc                # Debian / Ubuntu
python agents/_eval/run_all.py --questions 1 --runs 1   # quick re-run

Expected: LoC numbers may shift by ±10 lines per framework. If you’re going to cite LoC publicly (a blog post, a conference talk), use cloc so nobody can nitpick the heuristic.

What you should leave with

Troubleshooting

Common stumbles