Skip to main content

Pattern · Agents

Plan, execute, reflect

A planner writes the steps, each step runs a short loop, and a check pass reviews the draft before the final answer.

Say it in the interview

For long tasks I would plan first, run each step as a short capped loop, then check the draft with code where possible and a model where not, allowing one revision.

When to use it

  • Long research or multi-part tasks
  • Pure ReAct drifts or loses the goal

How it works

  1. Planner writes steps → Step 1: short tool loop
  2. Step 1: short tool loop → Step 2: short tool loop
  3. Step 2: short tool loop → Draft
  4. Draft → Checks (totals add up, every claim sourced)
  5. Checks (totals add up, every claim sourced) → fail → One revision
  6. One revision → Final
  7. Checks (totals add up, every claim sourced) → pass → Final

Trade-offs

  • Stays on track on long tasks
  • More calls and latency than a single loop

Pitfalls interviewers probe

  • Unlimited revision rounds
  • Checks done only by the same model, never by code

Practise it on these questions

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.