Evaluator-Optimizer Refinement Loop
One model generates, another grades against a rubric, and the loop repeats until the rubric passes or a limit is hit.
Useful when quality criteria are clear and checkable (translations, code that must pass tests, copy with constraints).
Steps
- Generator produces a draft.
- Evaluator scores it against an explicit rubric and returns structured feedback.
- If
passis false, feed the feedback to the generator and regenerate. - Stop at
pass: trueor after N rounds; return the best-scoring draft.
Evaluator prompt
You are a strict reviewer. Grade the DRAFT against each criterion.
Return JSON only:
{"scores":{"accuracy":0-5,"constraints":0-5,"clarity":0-5},
"pass": true|false,
"fixes": ["specific, actionable change", ...]}
pass is true only if every score >= 4.
CRITERIA: {{rubric}}
DRAFT: {{draft}}Config
max_rounds: 3
keep: best_score
prefer_programmatic_checks: true # run tests/linters before the LLM judgeFailure modes
- Evaluator and generator share blind spots when they are the same model.
- Loops oscillate without converging; enforce a max-iteration limit.
- Vague rubrics give inconsistent scores; use concrete pass/fail criteria.
Markdown version: /blueprints/evaluator-optimizer.md
Want a deeper build of this?
Vote for an extended, fully tested version (more tools, a full workflow file). Votes decide what we build next.
Get one fully built blueprint a week
A weekly email: one blueprint with config, cost, setup time and failure modes, plus a vote on what we build next.
Related blueprints
Agent Tracing and Evaluation Setup
Capture structured traces of every LLM and tool call and run a small regression eval suite on each change.
Human-in-the-Loop Approval Gate
Let agents draft freely but require explicit human approval before any irreversible or external action.
Planner-Executor Agent
Split a task into an explicit plan, execute steps one at a time, and re-plan only when a step fails.