Back to Catalog
Agentic AI
Planning & Control Flow
Replan on Failure
Trigger a fresh planning step when execution evidence contradicts the current plan.
Intent & Description
🎯 Intent
Trigger a fresh planning step when execution evidence contradicts the current plan.
📋 Context
A team runs a Plan-and-Execute agent where the planner commits to a plan up front and the executor walks it step by step. The world is not perfectly predictable: a tool returns an error, an observation contradicts an assumption, or an observer disagrees with the direction. The team wants the agent to repair the plan from that evidence instead of grinding through to failure.
💡 Solution
- Define replan triggers: tool error, unexpected observation, observer dissent. - When a trigger fires, the executor pauses and the planner runs again with the failure context (the failed step, the error, the contradicting observation). - The new plan replaces the old one; partial progress compatible with the new plan is preserved.
Real-world Use Case
- Plans are made under incomplete information and execution evidence may contradict them.
- Clear replan triggers exist (tool error, unexpected observation, observer dissent).
- Partial progress can be preserved when compatible with the new plan.
Source
Advantages
- Recovers from plan failures gracefully without restarting from scratch.
- The planner gets feedback; future plans improve over time.
Disadvantages
- Replanning thrash if triggers are too sensitive.
- Compatibility logic between old and new plans is non-trivial.