Lesson 51.6 · 6 of 6 · 4 min read · Reviewed 24 Nov 2026
Choosing for your team
By the end, you can
- Choose an agent framework for a team.
- Avoid lock-in.
A quick guide
| If you need | Consider |
|---|---|
| An agent that works with files, code and commands, with permissions and hooks | Claude Agent SDK (51.2) |
| Explicit control flow, checkpoints, human approval steps | A graph framework (51.3) |
| A quick multi-role prototype | A conversation-style framework (51.4) |
| A small agent with full visibility | A plain loop (51.5) |
Questions for the team
- What do we already know? (Python or TypeScript, existing tooling.)
- How will we traceTrace: A record of everything that happened during one request or agent run, as a tree of timed steps. and evaluate it? (Chapters 19 and 67.)
- Does it support the model features we rely on?
- Who maintains it, and how often does it change?
- How would we leave?
Keep the core portable
your code: tools, business rules, prompts, evals, data access
framework: loop, orchestration, state plumbing
Tools exposed as MCPModel Context Protocol (MCP): An open protocol that standardises how AI applications connect to tools, data and prompts through servers. servers (chapter 35) work across many frameworks and clients, which makes switching easier.
Pilot, then commit
Build the same small task in two candidates, run your eval set, compare quality, cost, latencyLatency: The time from sending a request until you get the response, or until the first token arrives when streaming. and how easy each was to debug.
Key points
- Choose by the job: file and code agents, explicit graphs with checkpoints, role-based prototypes, or a plain loop.
- Weigh your team's skills, observability needs, model features and how hard it would be to leave.
- Keep business logic and tools in your own code, so they move with you.
- Pilot with your eval set before committing.
Score frameworks for your team
Turn your team's needs into weights, rank the options and choose two to pilot.
You will have: A weighted scoring script and a one-line pilot plan.
Steps
- Run the starter: with zero weights every option scores the same.
- Set the weights for a team that needs approval steps, full visibility and an easy exit.
- Print the ranking and the two options to pilot.
- Change the weights for a coding-agent team and see the ranking shift.
- Write down which parts of your code (tools, rules, prompts, evals) must stay outside any framework.
Done when
- The solution's ranking puts Graph framework and Plain loop at the top.
- It prints a pilot line naming two options.
- A coding-heavy weighting moves Agent SDK up.
Open in the Playground No API key needed.
Starter code (Python)
# Weigh framework options for your team, then pick two to pilot on your eval set.
OPTIONS = ["Agent SDK", "Graph framework", "Conversation-style", "Plain loop"]
FIT = { # illustrative fit scores, 0 to 5, for each option above
"files and code": [5, 2, 2, 2],
"explicit flow and approvals": [2, 5, 1, 2],
"quick multi-role prototype": [3, 2, 5, 3],
"full visibility": [3, 3, 2, 5],
"easy to leave": [3, 3, 2, 5],
}
# TODO: set how much each need matters to your team (0 to 5)
WEIGHTS = {"files and code": 0, "explicit flow and approvals": 0, "quick multi-role prototype": 0,
"full visibility": 0, "easy to leave": 0}
def scores(weights):
total = sum(weights.values()) or 1
return {opt: sum(weights[k] * FIT[k][i] for k in FIT) / total for i, opt in enumerate(OPTIONS)}
s = scores(WEIGHTS)
for opt, v in sorted(s.items(), key=lambda kv: -kv[1]):
print(f"{opt:20} {v:.2f}")
# TODO: print "pilot: <top option> vs <second option> on the eval set"
Show a solution
# Weigh framework options for your team, then pick two to pilot on your eval set.
OPTIONS = ["Agent SDK", "Graph framework", "Conversation-style", "Plain loop"]
FIT = { # illustrative fit scores, 0 to 5, for each option above
"files and code": [5, 2, 2, 2],
"explicit flow and approvals": [2, 5, 1, 2],
"quick multi-role prototype": [3, 2, 5, 3],
"full visibility": [3, 3, 2, 5],
"easy to leave": [3, 3, 2, 5],
}
# TODO: set how much each need matters to your team (0 to 5)
WEIGHTS = {"files and code": 1, "explicit flow and approvals": 5, "quick multi-role prototype": 0,
"full visibility": 4, "easy to leave": 3}
def scores(weights):
total = sum(weights.values()) or 1
return {opt: sum(weights[k] * FIT[k][i] for k in FIT) / total for i, opt in enumerate(OPTIONS)}
s = scores(WEIGHTS)
for opt, v in sorted(s.items(), key=lambda kv: -kv[1]):
print(f"{opt:20} {v:.2f}")
top = sorted(s, key=lambda o: -s[o])[:2]
print(f"pilot: {top[0]} vs {top[1]} on the eval set")
Finished the chapter? Take the chapter check.