Choose a planner pattern: workflow, ReAct, plan-and-execute, reflexion or orchestrator-worker¶
Draft outline: not validated
Drafted with AI from official sources on 16 Oct 2026. Do not use on a live system until it is written, dry-run by someone other than the author and signed off (planned 2026-12-11). Author: James · dry-run: Sanjay Sarvesh · sign-off: Prasanna. Work items: AGT-03-T01, AGT-03-T02, AGT-03-T03, AGT-03-T04.
1. Summary¶
During solution design, or when an agent is too slow, too costly or too unreliable and the planner is suspected.
Risk: Medium (over-engineered planners raise cost and failure modes). Typical duration: 2-3 hours.
2. When to use and when not to¶
Use it when: During solution design, or when an agent is too slow, too costly or too unreliable and the planner is suspected.
Do not use it when: to be written by the author.
3. What you must know first¶
- Workflows have fixed paths; agents choose their own steps
- ReAct interleaves reasoning and tool actions
- Plan-and-execute separates a planning call from execution steps
- Reflexion uses self-critique and memory to retry
- Each extra planning or critique call adds cost and latency
4. Options¶
Outline of the decision process; the author describes each option.
- Classify the task: fixed steps, dependent steps, independent subtasks or checkable output
- Start from the cheapest pattern in the decision table that fits
- Estimate model calls per task for the chosen pattern
- Prototype on ten examples and measure success, calls and latency
- Move one level up only if the quality gap is shown
- Write the expected autonomy and limits for the client
- Record the decision YAML
Draft snippet: Planner decision table and record
# docs/decisions/planner-pattern.yaml
use_case: ${USE_CASE}
inputs:
steps_known_in_advance: false
max_tools_per_task: 6
latency_budget_seconds: 20
cost_budget_per_task: low
quality_gate_available: true
decision_table:
- when: one tool call or a fixed sequence answers it
choose: deterministic workflow (prompt chaining or routing)
- when: few tools, short tasks, steps depend on tool results
choose: ReAct tool loop with step budget
- when: long tasks with known sub-goals and a need to show the plan
choose: plan-and-execute with bounded replanning
- when: an automatic check can score the output
choose: evaluator-optimizer or reflexion loop with max iterations
- when: subtasks are independent
choose: orchestrator-worker with parallel fan-out
chosen: ReAct tool loop with step budget
client_expectation_note: autonomy is bounded; humans approve side effects
Snippets to add:
snippets/docs/decisions/planner-pattern.yaml: Planner decision record (yaml)snippets/docs/client/autonomy-statement.md: Client autonomy statement template (markdown)
5. Decision table¶
| Situation | Choose | Why |
|---|---|---|
| to be written |
6. Recommended default and when to deviate¶
To be written by the author from the outline above.
7. Known issues and fixes¶
| Symptom | Likely cause | Fix |
|---|---|---|
| Plan-and-execute slower than expected | Planning call plus replans on every task | Use ReAct for short tasks; bound replans |
| Reflexion loop never converges | No reliable evaluator | Use a checkable criterion or drop reflexion |
| Client expects fully autonomous handling | Autonomy not discussed early | Share the limits section of the decision record at design sign-off |
8. Monitoring and alerts¶
| Signal | Alert when | Action |
|---|---|---|
| Model calls per task in production versus design estimate | More than 2x the estimate weekly | Revisit the planner choice |
9. AWS and open-source equivalents¶
The patterns are framework-neutral. AgentCore and OpenAI Agents SDK run the same loops; LangGraph documents prompt chaining, routing, orchestrator-worker and evaluator-optimizer patterns.
10. Validation record¶
Pending. Planned dry-run scenario: A second engineer applies the guide to three sample tasks and must choose the same patterns as the agent lead, with call estimates within 30 percent of a measured prototype.