Improve output quality with dual agents. Evaluator analyzes quality while optimizer refines results through iterative feedback.
Use this when you want one orchestrator agent to loop evaluator and optimizer tools over a draft until it meets a quality bar or hits a step limit.
Similar patterns, and when each one is the better fit.

Evaluator Workflow PatternFreeUse this when you want an evaluator-optimizer loop to run as Workflow DevKit durable steps, so iterative scoring and refinement survive restarts.
Jev EvalsUse this when you need per-PR eval checks for an agent that diff a candidate run against a stored baseline to flag fractional drops.
Research Agent ChainUse this when one agent doing all the research is too broad and you want separate gather, expand, and synthesize agents run in order with Exa search.
Orchestrator-Worker PatternUse this when an orchestrator agent built with Experimental_Agent must assign tasks to typed worker tools and report progress as it streams.Requirements, wiring steps, and what this pattern adds to your project.
Pick how you want to pull this pattern in. Then wire env vars and routes the same way.
Download → Next.js app
Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).
Extract the zip and install dependencies
Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.
Fill .env.local
The download includes .env.local placeholders when needed. Add real values for: OPENAI_API_KEY.
Customize the agent and tool files
Adapt prompts, tools, and stop conditions in the generated project for your product.
Run the app and open the pattern route
Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.
OPENAI_API_KEYGet keyAI SDK APIs
AgenttoolstepCountIsExperimental_AgentgatewayInferAgentUIMessagevalidateUIMessagesProviders
app/page.tsxapp/layout.tsxapp/api/evaluator-optimizer/route.tslib/multi-agent-orchestrator.tslib/multi-agent-tool-types.tslib/ai-agent-evaluator-optimizer-tools/evaluator.tslib/ai-agent-evaluator-optimizer-tools/optimizer.tslib/ai-agent-evaluator-optimizer-tools/schema.tslib/ai-agent-evaluator-optimizer-tools/communication.tscomponents/evaluator-optimizer-chat.tsxcomponents/tool-views/evaluator-view.tsxcomponents/tool-views/optimizer-view.tsxREADME.mdAGENT_FLOW.mdnpm packages
6
Registry components
lib/multi-agent-orchestrator.tsCore orchestrator agent definition using Experimental_Agent. Configures the evaluator-optimizer coordination loop with model, instructions, tools, and stepCountIs(15) stop condition.
ai-agent-evaluator-optimizer-tools/evaluator.tsEvaluator tool that assesses content quality against criteria. Uses generator pattern to yield loading/ready states. Returns quality scores, issues, suggestions, and threshold checks.
ai-agent-evaluator-optimizer-tools/optimizer.tsOptimizer tool that takes evaluation feedback and iteratively improves content. Uses generator pattern for streaming state transitions.
ai-agent-evaluator-optimizer-tools/communication.tsInter-agent communication tools (sendEvaluation, requestEvaluation, sendOptimization) that enable the evaluator-optimizer message passing loop.
ai-agent-evaluator-optimizer-tools/schema.tsShared Zod schemas (EvaluationResult, OptimizationParams, OptimizationResult, EvaluationCriteria) defining data contracts between evaluator and optimizer agents.
Improve output quality with dual agents. Evaluator analyzes quality while optimizer refines results through iterative feedback.
Use this when you want one orchestrator agent to loop evaluator and optimizer tools over a draft until it meets a quality bar or hits a step limit.
Similar patterns, and when each one is the better fit.

Evaluator Workflow PatternFreeUse this when you want an evaluator-optimizer loop to run as Workflow DevKit durable steps, so iterative scoring and refinement survive restarts.
Jev EvalsUse this when you need per-PR eval checks for an agent that diff a candidate run against a stored baseline to flag fractional drops.
Research Agent ChainUse this when one agent doing all the research is too broad and you want separate gather, expand, and synthesize agents run in order with Exa search.
Orchestrator-Worker PatternUse this when an orchestrator agent built with Experimental_Agent must assign tasks to typed worker tools and report progress as it streams.Requirements, wiring steps, and what this pattern adds to your project.
Pick how you want to pull this pattern in. Then wire env vars and routes the same way.
Download → Next.js app
Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).
Extract the zip and install dependencies
Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.
Fill .env.local
The download includes .env.local placeholders when needed. Add real values for: OPENAI_API_KEY.
Customize the agent and tool files
Adapt prompts, tools, and stop conditions in the generated project for your product.
Run the app and open the pattern route
Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.
OPENAI_API_KEYGet keyAI SDK APIs
AgenttoolstepCountIsExperimental_AgentgatewayInferAgentUIMessagevalidateUIMessagesProviders
app/page.tsxapp/layout.tsxapp/api/evaluator-optimizer/route.tslib/multi-agent-orchestrator.tslib/multi-agent-tool-types.tslib/ai-agent-evaluator-optimizer-tools/evaluator.tslib/ai-agent-evaluator-optimizer-tools/optimizer.tslib/ai-agent-evaluator-optimizer-tools/schema.tslib/ai-agent-evaluator-optimizer-tools/communication.tscomponents/evaluator-optimizer-chat.tsxcomponents/tool-views/evaluator-view.tsxcomponents/tool-views/optimizer-view.tsxREADME.mdAGENT_FLOW.mdnpm packages
6
Registry components
lib/multi-agent-orchestrator.tsCore orchestrator agent definition using Experimental_Agent. Configures the evaluator-optimizer coordination loop with model, instructions, tools, and stepCountIs(15) stop condition.
ai-agent-evaluator-optimizer-tools/evaluator.tsEvaluator tool that assesses content quality against criteria. Uses generator pattern to yield loading/ready states. Returns quality scores, issues, suggestions, and threshold checks.
ai-agent-evaluator-optimizer-tools/optimizer.tsOptimizer tool that takes evaluation feedback and iteratively improves content. Uses generator pattern for streaming state transitions.
ai-agent-evaluator-optimizer-tools/communication.tsInter-agent communication tools (sendEvaluation, requestEvaluation, sendOptimization) that enable the evaluator-optimizer message passing loop.
ai-agent-evaluator-optimizer-tools/schema.tsShared Zod schemas (EvaluationResult, OptimizationParams, OptimizationResult, EvaluationCriteria) defining data contracts between evaluator and optimizer agents.
Loading preview…
Early-bird pricing — limited time


Open on desktop for the interactive preview.
Improve output quality with dual agents. Evaluator analyzes quality while optimizer refines results through iterative feedback.
Loading preview…
Early-bird pricing — limited time


Open on desktop for the interactive preview.
Improve output quality with dual agents. Evaluator analyzes quality while optimizer refines results through iterative feedback.