Essam ShaabanSr Software Engineer
Agentic AI pattern · Quality control pattern

Evaluator–optimizer orchestration

A generator produces a result and an evaluator scores it. Feedback loops back to the generator until the quality bar is met.

In plain terms Like a writer and an editor who scores each draft and sends it back until it meets the bar.

Last reviewed · Build from primitives Documented by Microsoft as a form of the maker-checker loop; build with group chat or custom loops.

How it works

A generator produces output and an evaluator scores it against criteria; failing outputs return with feedback until they pass or an iteration cap is reached.

Workflow: Input, then a generator, then an evaluator and a quality check: pass goes to the output, fail sends feedback to the generator and repeats.

Roles in the example

  • Nova · Generator Drafts, then improves from feedback.
  • Pixel · Evaluator Scores each version against criteria.

At a glance

Pattern type
Quality control pattern
Execution model
Generate–evaluate loop
Coordination
Score threshold controls the loop
Runs agents in parallel
No, one step at a time
Implementation complexity
Medium
Relative latency
High · Each iteration repeats generation and evaluation
Relative operational cost
Medium · At least two calls per iteration (generate and evaluate); the iteration cap bounds the total.
Predictability
Medium · Bounded by the iteration cap
Scalability
Cost grows with iterations; cap iterations per request.

Complexity, latency, cost and predictability are qualitative ratings that compare these patterns with each other, not measured benchmarks.

When to use it

Good for: Content and code where quality can be measured.

Use when

  • Quality can be measured with clear criteria
  • Output quality matters more than speed
  • Iterative improvement of drafts or code

Avoid when

  • No reliable evaluation criteria
  • Latency-critical responses
  • Single-pass output is already good enough

Enterprise use cases

  • Marketing or proposal copy refinement
  • Code generation with test-based evaluation
  • Translation quality improvement

Advantages and limitations

Advantages

  • Measurable quality improvements
  • Separates creation from judgement
  • Evaluator criteria are auditable

Limitations and trade-offs

  • Evaluator can be miscalibrated
  • Loops add cost and latency
  • Risk of overfitting to the evaluator

Security, oversight and failure handling

Security and governance

  • Evaluator should not see secrets it doesn’t need
  • Guard against prompt injection in generated content
  • Record scores for audit

Human oversight

Optional. Not in the loop: people define the quality criteria and periodically audit the evaluator.

Failure handling and recovery

  • Iteration cap with best-so-far fallback
  • Escalate to a human when the cap is reached
  • Return a quality warning with the result

Implementation guidance

Decisions to settle before building

  • Write explicit, testable acceptance criteria for the evaluator; vague criteria produce inconsistent scores.
  • Set an iteration cap and a fallback for when it is reached, such as the best version with a quality warning, or escalation to a person.
  • Consider a different model or prompt for the evaluator so it does not share the generator’s blind spots.

Supported technologies

TechnologySupportHow
Microsoft Agent FrameworkBuild from primitivesGroup chat with a custom manager, or custom workflow loop
Microsoft FoundryBuild from primitivesAgent evaluators for scoring criteria
Copilot StudioCustom implementationCustom topic/flow logic

Availability notes

  • Released Agent Framework orchestrations (Python package). Released package since the 1.23 cohort (October 2026). Source

Code samples and step-by-step guides for Python, C#, Microsoft Foundry and Copilot Studio are in the interactive explorer’s Developer implementation section.

Official references

Last reviewed 5 December 2026 against Microsoft Agent Framework (Python 1.26 release line), Microsoft Foundry Agent Service, Copilot Studio. Platforms change often: confirm details in the linked documentation.