Evaluation & Optimization





Pattern
Evaluator-Optimizer Pattern
Improve output quality with dual agents. Evaluator analyzes quality while optimizer refines results through iterative feedback.
AdvancedOct 2025View the full pattern on desktop


Problems solved
- Evaluate draft quality with a dedicated evaluator tool
- Optimize content iteratively from evaluation feedback
- Loop evaluator and optimizer tools under one orchestrator agent
- Stop once quality thresholds or step limits are reached
Use cases
- Marketing copy optimization loops
- Technical documentation review agents
- Translation quality control workflows
- Creative writing refinement assistants
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 the 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 pattern β


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



