Stateless Agent Protocol with Coordinator, Worker, Reviewer

System Design · sequence diagram · unknown license

Illustrates a stateless agent protocol involving a Coordinator, Worker, and Reviewer, utilizing Redis for context transfer and task orchestration.

Source: https://github.com/masharratt/claude-flow-novice/blob/19a7b70491c6e348c848600530b7d2465f614d7f/readme/cfn-loop-flow-diagram.md
Curated by masharratt
Agent Protocol System Design Sequence Diagram Redis Orchestration Workflow Review Process

Mermaid source

sequenceDiagram
    participant C as Coordinator
    participant R as Redis
    participant W as Worker
    participant V as Reviewer

    Note over C,R: Transfer Point 1
    C->>R: Store task context
    C->>W: Spawn worker
    R->>W: Inject context into system prompt
    Note over W: "You are implementing: {description}<br/>Requirements: {requirements}"

    Note over W,R: Transfer Point 2
    W->>W: Execute task
    W->>R: Store output + confidence
    W->>W: Exit

    Note over R,V: Transfer Point 6
    C->>V: Spawn reviewer
    R->>V: Inject handoff context
    Note over V: "Review code: {code}<br/>Address: {feedback}<br/>Original confidence: {confidence}"

    Note over V,R: Transfer Point 7
    V->>V: Review + approve
    V->>R: Store final output
    V->>V: Exit

What this diagram shows

This sequence diagram outlines a stateless agent protocol. A Coordinator initiates a task by storing context in Redis and spawning a Worker. The Worker receives context from Redis, executes the task, and stores its output and confidence back into Redis. Subsequently, the Coordinator spawns a Reviewer, which receives handoff context from Redis, reviews the Worker's output, approves it, and stores the final result in Redis.

When to use it

Useful for designing automated task execution and review systems, agent-based architectures, or workflows requiring distinct stages for task processing and human/automated validation, especially when leveraging a shared, stateless context store like Redis.

How to adapt it for your project

This protocol can be adapted by introducing multiple workers for parallel processing, adding more review stages, integrating different persistent storage solutions instead of Redis, or implementing a feedback loop from the Reviewer back to the Worker for iterative refinement.

Key concepts