Skip to content

9.6.1 Frameworks Roadmap: Choose Only When Needed

Frameworks do not make an Agent smarter. They organize state, tools, workflows, memory, logs, and collaboration once the task has enough complexity to justify the abstraction.

Agent framework position map

Agent framework selection map

Agent framework selection decision map

If a task has three fixed steps, plain Python functions may be better. Add a framework when state, branching, recovery, data connection, or role collaboration becomes hard to manage.

Use this check before choosing a framework because it is popular.

task = {
"needs_state": True,
"needs_rag": False,
"needs_roles": False,
"needs_resume": True,
}
if task["needs_state"] or task["needs_resume"]:
route = "LangGraph-style state graph"
elif task["needs_rag"]:
route = "LlamaIndex-style data app"
elif task["needs_roles"]:
route = "CrewAI or AutoGen-style collaboration"
else:
route = "plain functions first"
print("route:", route)
print("reason:", "choose the smallest abstraction that exposes state")

Expected output:

Terminal window
route: LangGraph-style state graph
reason: choose the smallest abstraction that exposes state

Framework choice should be written into the README as a trade-off, not hidden inside dependencies.

StepReadPractice Output
1Framework overviewExplain what a framework abstracts
2LangChain / LangGraphModel state, nodes, edges, branches, recovery
3LlamaIndexConnect documents, indexes, retrieval, evaluation
4CrewAI / AutoGenCompare role collaboration and multi-Agent conversation
5Framework selectionWrite a decision table and a no-framework baseline

Keep this page’s proof of learning as a small evidence card:

Problem Shape
workflow graph, retrieval app, role team, or experiment
Framework Choice
what abstraction it adds and what control it hides
Trace
state, node, tool call, message, or run id
Failure Check
framework magic hides state, retries, or permissions
Decision
choose framework only after the single-agent loop is clear

You pass this chapter when you can implement the same small task with plain functions and with one framework, then explain which version is easier to debug and why.

Check reasoning and explanation
  1. A passing answer describes the agent loop: goal, plan, tool call, observation, memory or state update, and stop condition.
  2. The evidence should include a trace that another developer can inspect, not only the final answer.
  3. A good self-check names one safety or reliability control such as tool schemas, permission boundaries, retries, evaluation cases, or a human-review point.