AssayAssay
06 / 08

Lesson 06 · Structure · 12 min

Cycles and retries

Graphs are usually drawn flowing one way, but an edge may point backwards, and that is how revision works: a check node inspects the draft and either passes it on or sends it back to be rewritten.

This is the agent-loops idea placed under supervision. The cycle is explicit, its entry and exit conditions are drawn, and the number of times round is bounded by structure rather than by hoping the model notices it is repeating.

  • Bound every cycle. Keep a counter in state and route to an exit when it is exceeded.
  • Make the exit useful. Falling out of a revision cycle should hand off or return the best draft, not fail.
  • Change something each pass. A revision node that gets the same input produces the same output — feed the critique back in.
  • Record how many passes ran. A rising average is an early signal that inputs are getting harder.

When most of your graph is cycles, that is a signal worth heeding: the process is more open-ended than the structure implies, and a loop with good stall detection may be the more honest shape.

A cycle that always runs to its bound is not revising. It is oscillating — the same lesson as the agent-loops course, in a different notation.

Checkpoint

Describe where a bounded revision cycle would sit in the guarded graph, and its exit condition.

Identical to the routed graph until money is involved. Refunds pause at an interrupt node and wait for a person. Because the pause is a node rather than a prompt instruction, it cannot be talked around.

“My order 88213 arrived with a cracked base. I'd like a refund please.”

The guarded graph pauses instead of cycling. Run it, then consider where a revision cycle would go and what would bound it.

Graph structure

ClassifyRouteExtract order numberLook up orderRead refunds policyRecommendHuman approvalReply about a refundReply generallySend

Pick a graph and a message, then press Run — the nodes it visits light up.