Methodology · Agent Constructionemergingverified

Plan-Reason-Evaluate-Feedback Loop

also known as PREF loop, planning-reasoning-evaluation-feedback construction

Applies to: agentcoding-agent

Tags: control-loopplanningreasoningevaluationfeedback

Build the agent's control logic as a loop with four stages. Plan drafts a candidate approach. Reason fills it in using chain-of-thought or tree-of-thoughts. Evaluate scores the result, using self-consistency or a judge. Feedback hands the lessons back to Plan for the next round. Make each stage its own step with its own metrics, so the team can tune them one at a time. The thing to avoid is one giant prompt trying to do all four jobs and doing each one badly.

Methodology process overview

Intent. Split the agent's control loop into Plan, Reason, Evaluate, and Feedback so each one can be written, tested, and tuned on its own instead of crammed into a single prompt.

When to apply. Use this when the task is hard enough to need real planning and self-checking: research agents, coding agents, and multi-step problem solvers. It helps most when one big ReAct prompt has stopped improving. Don't apply it for single-shot generators and simple tool callers, where four stages on a trivial task is overkill. Skip it too when your latency budget cannot absorb the extra round-trips.

Inputs

  • Task specificationWhat the agent must do, in a form you can break into sub-steps.
  • Evaluator definitionThe judge, rubric, or self-consistency check that will score what Reason produces.

Outputs

  • Four-stage control loopPlan, Reason, Evaluate, and Feedback as four separate stages, each with its own metrics.
  • Stage-level metricsA success or failure signal for each stage that your telemetry can graph and alert on.

Steps (6)

  1. Author the Plan stage

    Draft a candidate plan or approach. Use single-path or multi-path plan generation depending on cost and risk.

    usesPlan-and-ExecuteSingle-Path Plan GeneratorMulti-Path Plan Generator

  2. Author the Reason stage

    Fill in the plan with chain-of-thought or tree-of-thoughts. Reasoning generates new detail. Do not fold it back into Plan.

    usesChain of ThoughtTree of Thoughts

  3. Author the Evaluate stage

    Score what Reason produced. Use self-consistency, an LLM judge, or a rubric. Evaluate must be independent enough to disagree.

    usesSelf-ConsistencyAgent-as-a-JudgeEvaluator-Optimizer

  4. Author the Feedback stage

    Turn the score into a clear next step for the planner: accept, reject with reasons, replan, or escalate. Feedback is what closes the loop.

    usesReflexionEvaluator-Optimizer

  5. Instrument each stage independently

    Emit traces and metrics scoped to each stage. You cannot tune the four stages if they share one set of telemetry.

  6. Bound iterations

    Add a max-iterations budget and a test for when to stop. Otherwise the loop can bounce between plan and reflection forever.

    usesStep Budget

Framework-specific instructions

Pick a framework and generate a framework-targeted rewrite of this methodology's steps.

Choose framework

AI-generated for Agent Development Kit (ADK) (Google) — verify against official docs.

Principles

  • Plan, Reason, Evaluate, and Feedback are four jobs. Give each its own prompt and metric.
  • The evaluator must be able to disagree. Same-model self-critique is a failure mode, not a method.
  • Feedback closes the loop, or it is not feedback.
  • Bound the iterations. Set a budget and a test for when to stop.

Known failure modes (3)

Related patterns (8)

Related compositions (2)

Related methodologies (2)

Sources (2)

Provenance

  • Added to catalog:
  • Last updated:
  • Verification status: verified