Skip to main 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.

See the Selection Map First

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.

Run a Framework Route Check

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:

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.

Learn in This Order

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

Pass Check

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.