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:

  1. OBSERVE - Analyze user input, understand task goals and context
  2. PLAN - LLM generates structured plan with tool names, parameters, purposes, and expected results
  3. EXECUTE - Execute plan steps sequentially with automatic validation
    • Validation Success - Continue to next step
    • Validation Failed - Enter REPLAN phase
  4. REPLAN - Preserve successful steps, only regenerate plan for failed and subsequent steps
  5. DONE - All steps completed or max replanning reached

Core Mechanisms

MechanismDescription
Batch PlanningGenerate multi-step plan at once (1-5 steps), reducing LLM calls
State-Driven5-phase explicit state machine for clear execution trace
In-Execution ValidationAutomatic result validation using semantic matching + Jaccard similarity
Local ReplanningPreserve 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