V3 Stateless Agent Protocol

System Design · sequence diagram · unknown license

This diagram shows a stateless agent protocol. An orchestrator manages iterative task execution, feedback loops, confidence-based gating, and a validation

Source: https://github.com/masharratt/claude-flow-novice/blob/19a7b70491c6e348c848600530b7d2465f614d7f/readme/cfn-loop-flow-diagram.md
Curated by masharratt
Orchestration Stateless Agents Feedback Loop Redis Iteration Validation

Mermaid source

sequenceDiagram
    participant O as Orchestrator
    participant R as Redis
    participant A3 as Loop 3 Agent
    participant A2 as Loop 2 Agent

    Note over O: Iteration 1
    O->>R: Store epic context, phase context
    O->>A3: Spawn Loop 3 Agent
    A3->>R: Get context (epic, phase, criteria)
    A3->>A3: Execute task
    A3->>R: Store output + confidence (0.75)
    A3->>A3: Exit (stateless)

    O->>R: Collect confidence scores
    O->>R: Check gate (0.75 < 0.85 = FAIL)

    Note over O: Iteration 2
    O->>R: Store feedback from iteration 1
    O->>A3: Spawn fresh Loop 3 Agent
    A3->>R: Get context + feedback
    A3->>A3: Execute with improvements
    A3->>R: Store output + confidence (0.93)
    A3->>A3: Exit (stateless)

    O->>R: Collect confidence scores
    O->>R: Check gate (0.93 ≥ 0.85 = PASS)

    Note over O: Validation Phase
    O->>A2: Spawn Loop 2 Validators
    A2->>R: Get context + Loop 3 output
    A2->>A2: Review + validate
    A2->>R: Store consensus score
    A2->>A2: Exit (stateless)

    O->>R: Check consensus (≥ 0.90 = PASS)
    O->>R: Store final approved output

What this diagram shows

The diagram details an orchestrator's role in managing stateless agents. It shows how the orchestrator spawns agents, which retrieve context and success criteria from Redis, execute tasks, and store their output and confidence scores back in Redis. The orchestrator then collects these scores, checks against a gate, and provides feedback for subsequent iterations if the confidence is too low. Once a task passes the confidence gate, a validation phase is initiated where different agents review and validate the output, storing a consensus score.

When to use it

Use this protocol for systems requiring iterative task execution, self-correction through feedback loops, confidence-based decision making, and a clear validation phase. It's suitable for AI/ML agent orchestration, complex data processing workflows, or any system where tasks might need multiple attempts to meet a quality threshold.

How to adapt it for your project

This protocol can be adapted by changing the number of iteration loops, modifying the confidence thresholds and gating logic, integrating different types of agents for various tasks and validation steps, or replacing Redis with another distributed cache or database. The feedback mechanism can be made more sophisticated, and the validation phase can include human-in-the-loop steps.

Key concepts