AssayAssay
06 / 08

Lesson 06 · Shapes · 14 min

Loop shapes

The strategies below differ far less than their names suggest. All three are the same loop with a different system prompt, which is worth knowing before adopting a framework that presents them as distinct architectures.

ReActReason, act, observe, repeat. The model decides one step at a time with full knowledge of everything observed so far. Adapts well to surprises; can wander on long tasks.
Plan then executeProduce the whole plan first, then carry it out. Cheaper and more predictable, and the plan is inspectable before anything runs. Struggles when an early observation invalidates the plan.
ReflectionAfter reaching an answer, check it against the observations before replying. Catches unsupported claims; costs an extra call every time, including when the answer was already right.

Choose by failure mode rather than by reputation. If your agent gets lost on long tasks, planning helps. If it answers confidently with things the tools never returned, reflection helps. If it handles the common case well and breaks on surprises, plain ReAct with good stall detection is usually enough.

Run one task through all three in the lab and compare three numbers: iterations used, total tokens, and whether the answer is actually supported by the observations above it. The last one is the only one that matters, and it is the only one you have to judge yourself.

Reflection has a specific weakness worth knowing: a model checking its own work uses the same understanding that produced the work. It reliably catches unsupported claims and missing sub-goals, and reliably misses errors it does not know are errors.

Checkpoint

Find a task where one strategy clearly beats the others, and say what made the difference.

“Where is my order 41902? It hasn't arrived yet.”

The shortest useful loop: one tool, one answer. A model that replies without calling anything is inventing the status.

Run the two-lookup task under all four strategies. Compare iterations, tokens, and whether every claim in the reply is supported by an observation.

Nothing has run yet. Pick a task and press Run — every iteration appears below.