Illustrates a stateless agent protocol involving a Coordinator, Worker, and Reviewer, utilizing Redis for context transfer and task orchestration.
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
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.
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.
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.