Patterns
๐Ÿ‘ฅ

Producer-Critic Pattern(PC)

Architectural pattern where separate producer and critic agents collaborate for quality improvement

Complexity: mediumReflection

๐ŸŽฏ 30-Second Overview

Pattern: Separate producer and critic agents for unbiased quality improvement

Why: Prevents self-evaluation bias, enables specialized critique, improves output quality

Key Insight: Producer focuses on creation, Critic provides objective evaluation โ†’ Higher quality

โšก Quick Implementation

1Define Roles:Producer generates, Critic evaluates
2Separate Prompts:Distinct system prompts for each agent
3Producer Executes:Initial content generation
4Critic Analyzes:Structured evaluation & feedback
5Iterate:Producer refines based on critique
Example: Producer(draft_code) โ†’ Critic(review) โ†’ Producer(refined_code)

๐Ÿ“‹ Do's & Don'ts

โœ…Use distinct personas (e.g., "Senior Engineer" for critic)
โœ…Provide structured evaluation criteria to the critic
โœ…Separate concerns completely between producer and critic
โœ…Consider different critic implementations (LLM, rules, human)
โœ…Implement stopping conditions to prevent infinite loops
โŒUse the same prompt/persona for both roles
โŒLet producer see critic instructions (bias prevention)
โŒSkip validation of critic feedback quality
โŒAllow unlimited iterations without convergence checks
โŒIgnore computational costs of dual-agent approach

๐Ÿšฆ When to Use

Use When

  • โ€ข High-quality content generation
  • โ€ข Code review and optimization
  • โ€ข Complex reasoning validation
  • โ€ข Creative work refinement

Avoid When

  • โ€ข Simple, straightforward tasks
  • โ€ข Real-time applications
  • โ€ข Limited computational budget
  • โ€ข Well-defined single-pass solutions

๐Ÿ“Š Key Metrics

Quality Delta
Improvement from v1 to final
Critique Precision
Valid issues / Total critiques
Convergence Rate
Iterations to acceptable quality
Cost Efficiency
Quality gain / Token cost
Bias Reduction
Objective evaluation score
Error Detection
% of actual errors caught

๐Ÿ’ก Top Use Cases

Code Generation: Developer writes โ†’ Senior Engineer reviews โ†’ Developer refines
Content Creation: Writer drafts โ†’ Editor critiques โ†’ Writer polishes
Research Analysis: Analyst presents โ†’ Peer reviews โ†’ Analyst strengthens
Design Documents: Architect proposes โ†’ Tech Lead evaluates โ†’ Architect improves
LLM-as-Judge Implementation: Multiple outputs โ†’ LLM critic ranks/scores โ†’ Select best

References & Further Reading

Deepen your understanding with these curated resources

Contribute to this collection

Know a great resource? Submit a pull request to add it.

Contribute

Patterns

closed

Loading...

Built by Kortexya