Pattern
ADV·Oct 25
Evaluator-Optimizer Pattern
Improve output quality with dual agents. Evaluator analyzes quality while optimizer refines results through iterative feedback.
View Full Pattern on Desktop

Problems Solved
- Quality assurance through systematic evaluation and optimization using AI SDK v6
- Single orchestrator agent coordinating specialized evaluator and optimizer tools
- Automated content quality assessment with strongly typed tools
- Iterative content improvement based on evaluation feedback
- Error recovery and self-improvement capabilities with Experimental_Agent
- Quality threshold management and optimization strategies
- Modern AI agent quality control patterns with UIToolInvocation
Use Cases
- Content quality assurance and optimization
- Professional writing and documentation
- Translation and localization quality control
- Marketing copy optimization
- Technical documentation review
- Creative writing enhancement
- Quality control for AI-generated content
AI SDK APIs
new Agenttool(stepCountIsExperimental_Agenttools:gateway
Tags
aiagentsorchestratorevaluatoroptimizerquality-assurancecontent-optimizationai-sdk-v5streamingerror-recoverytool-coordination
Requirements
- Node.js
- 24+
- Memory
- 1GB
- Other
- OpenAI API key
Environment Variables
OPENAI_API_KEYGet key →
External Services
openai
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View Pattern on DesktopRelated Patterns


Orchestrator-Worker Pattern
Coordinate multiple worker agents for project management. Handles task distribution, progress tracking, and result synthesis.
aiagents+8
View →


Multi-Step Tool Pattern
Execute multi-step workflows with typed tools. Includes streaming, tool chaining, and decision-making for automated tasks.
aiagents+8
View →
End of Pattern



