Part 2 of 12 · 3 min read
A framework is paradigms plus plumbing, and durable execution is the property checkpointing buys
Recap: Level 5, module 8 covered what a framework decides for you. This module compares several frameworks side by side.
Think of a ready-made meal kit versus buying the ingredients. The kit saves time, but you have to cook the way the kit expects, and it is harder to change.
In plain words: a framework is a library that supplies structure for building agents (a loop, a graph, or roles) plus helpers, and the specific structural choice that matters most under failure is whether the run checkpoints its progress -- durable execution means a crash resumes from saved progress rather than starting over, and checkpointing is one way to get it.
A worked example. Simulating 2,000 runs of a five-step task with a 15% chance of crashing after each step's work, a plain loop that restarts from the first step on any crash needs 9.1 model calls per run and finishes 96.9% of runs. A graph that checkpoints progress after each step needs only 6.9 calls and finishes 99.7% of runs. At 30% crash risk the gap widens: 11.6 calls and 67.5% finished for the loop, against 8.0 calls and 94.5% finished for the checkpointed graph -- the loop used 45% more calls and finished 27 points fewer runs.
The key lines. From code/mini-paradigms/paradigms.py:
# from code/mini-paradigms/paradigms.py
def run_graph(rng, p, max_attempts=6, idem=False, run_id="r", checkpoint_every=1):
world, c = World(), Counter()
saved = [] # durable store
for _ in range(max_attempts):
c.attempts += 1
done = list(saved) # resume from the last checkpoint
Read it as: done = list(saved) restarts the step list from the last checkpoint, not from an empty list. Compare this to run_loop, where done = [] is reset every attempt. That one-line difference is the entire mechanism behind two gaps at the two crash rates above. One is the gap between 9.1 and 6.9 calls. The other is the gap between 67.5% and 94.5% finished.
Framework, SDK, runtime, checkpoint, thread, durable execution
A framework is a library that supplies structure for building agents (a loop, a graph, or roles) plus helpers. An SDK is a vendor library for using that vendor's service; the agent SDKs here also include a loop. A runtime is the process that executes the loop, executes tools and holds state while it runs. A checkpoint is a saved snapshot of the agent's state after a step; a thread is the identifier that groups the checkpoints of one run. Durable execution is running so that a crash resumes from saved progress -- checkpointing is one way to get it.
Example: saved = list(done) after every step is a checkpoint in the most literal sense -- a snapshot taken at a specific point, written to a durable store, and read back by done = list(saved) on the next attempt, which is exactly what gives the graph its advantage over the loop above.