PEOP Loop
The PEOP Loop (Plan-Execute-Observe-RePlan) is an extension of the Control Loop, implementing an adaptive plan-execute cycle.
State Machine
The PEOP Loop operates through 5 explicit states:
- OBSERVE - Analyze user input, understand task goals and context
- PLAN - LLM generates structured plan with tool names, parameters, purposes, and expected results
- EXECUTE - Execute plan steps sequentially with automatic validation
- Validation Success - Continue to next step
- Validation Failed - Enter REPLAN phase
- REPLAN - Preserve successful steps, only regenerate plan for failed and subsequent steps
- DONE - All steps completed or max replanning reached
Core Mechanisms
| Mechanism | Description |
|---|---|
| Batch Planning | Generate multi-step plan at once (1-5 steps), reducing LLM calls |
| State-Driven | 5-phase explicit state machine for clear execution trace |
| In-Execution Validation | Automatic result validation using semantic matching + Jaccard similarity |
| Local Replanning | Preserve successful steps, only replan failed portions |
Design Characteristics
- Efficient - Multi-step plan generated once, zero LLM calls during execution
- Reliable - Semantic matching prevents misjudgment
- Stable - Local replanning avoids total overhaul, maintains context continuity
- Observable - Clear execution trace for debugging and monitoring
- Collaborative - State synchronized to Control Loop, replanning triggers redirect
Configuration
# PEOP Loop settings
max_plan_steps: 5 # Maximum steps per plan
max_replans: 3 # Maximum replanning attempts