Lesson 52.6 · 6 of 6 · 6 min read · Reviewed 24 Nov 2026
Graph frameworks compared
By the end, you can
- Compare graph-style orchestration tools on the features that matter for agents.
- Decide when a plain-code graph is enough and when a framework or workflow engine earns its place.
Lesson 51.6 compared framework families. This lesson zooms in on tools for graph-style orchestration and the questions that separate them. Tools change fast, so treat the names as examples and check their current docs.
Three styles
| Style | How you describe the flow | Examples |
|---|---|---|
| Explicit graph | Add nodes, then add fixed and conditional edges over a typed state | LangGraph, pydantic-graph |
| Event-driven steps | Each step listens for an event type and emits new events; the wiring follows from that | LlamaIndex Workflows, CrewAI Flows |
| Durable workflow engine | Ordinary code whose every step is recorded, retried and resumable | Temporal and similar engines |
The first two are built with model calls in mind. The third is general-purpose infrastructure that many teams already run, and agentsAgent: A system where a model decides its own next steps, calling tools in a loop until the task is done. fit inside it well when runs are long and must not be lost.
The questions that matter
- State: is it typed and validated? Can you choose how fields merge (replace or append)?
- Checkpoints: where are they stored? Memory, a local file, a database you already run?
- Interrupts: can a run pause for a person and resumeSession resumption: Continuing an earlier session by reloading its saved history or state. days later, after a deploy?
- StreamingStreaming: Receiving a response as a series of server-sent events while it is generated, instead of waiting for the whole reply.: can you stream node progress, state updates and tokensToken: The unit a model reads and writes: a word, part of a word, a space or a symbol, mapped to an integer id. separately (52.5)?
- Visibility: can you see every prompt and model call (51.1)? Does it plug into your tracingTrace: A record of everything that happened during one request or agent run, as a tree of timed steps.?
- Model features: do caching, thinking and structured outputsStructured outputs: Making a model return data that matches a defined schema, such as JSON with required fields and types. pass through untouched?
- Exit cost: if you leave, how much of your code is framework code?
A worked comparison
A team builds the coding graph from this chapter. Three options:
| Option | Fits when | Watch out for |
|---|---|---|
| Plain-Python graph (52.3) | One service, short runs, team wants full control | You write checkpoints, interrupts and streaming yourself |
| Explicit graph library | Pauses for review, replay, streaming modes wanted soon | Framework concepts to learn; check what calls it makes |
| Durable engine | Runs last hours or days, many approvals, strict retries | Heavier to operate; agent features are yours to add |
Their runs are short and they have no approvals yet, so they start with the plain-Python graph. They write down the trigger for switching: “when we add the merge approval, or runs exceed ten minutes”.
Keep it portable
Whatever you pick, keep the node functions, tools, prompts and evalsEval: A repeatable test that measures how well an AI system performs on a set of cases with defined success criteria. in your own modules. A node should be a normal function that takes state and returns an update. Then moving from a plain graph to a library, or between libraries, is mostly rewiring edges.
Common mistakes
- Picking by star count. Pick by the seven questions and a pilot on your own eval set.
- Adopting a framework for one loop. If the graph is three nodes and a cycle, plain code is clearer.
- Business logic inside framework callbacks. It becomes hard to test and harder to move.
Key points
- Graph-style tools differ mainly in how you declare the graph, how state is stored, and how pauses and streaming work.
- Explicit graph libraries (LangGraph, pydantic-graph and similar) draw nodes and edges; event-driven tools (LlamaIndex Workflows, CrewAI Flows and similar) wire steps by the events they emit.
- Durable workflow engines (Temporal and similar) are not agent-specific but give strong retries and long-running state.
- A plain-Python graph like the one in 102.3 is often enough; adopt a tool when you need its checkpoints, interrupts or tracing.
Port the coding graph to a library
Move the plain-Python graph from 102.3 into a graph library and judge what the library adds.
You will have: The same graph running in a library on your machine, plus a one-page comparison against the seven questions in 102.6.
Steps
- Pick one graph-style tool from the lesson and install it in a fresh virtual environment, following its official docs.
- Copy your 102.3 node functions unchanged and wire them up with the library's nodes and conditional edges.
- Add its checkpointer and an interrupt before a merge node, then pause, inspect and resume a run.
- Turn on its streaming of node updates and print each event as it arrives.
- Answer the seven questions from the lesson for this tool and write a short decision: stay plain or adopt it, and why.
Done when
- The library version reaches passed in the same number of attempts as your plain version.
- A paused run resumes after you restart the script.
- Your node functions needed no changes, only the wiring did.
Finished the chapter? Take the chapter check.