Microsoft Foundry introduces an optimization loop for production AI agents, enabling continuous improvement through automated evaluation, candidate generation, and developer-approved deployment. This system integrates various components like evaluators, optimizers, and training mechanisms to refine agent behavior based on real-world performance. The architectural design emphasizes human-in-the-loop validation for critical changes.
Read original on InfoQ ArchitectureMicrosoft Foundry's new feature provides a closed-loop system for improving AI agents in production. This system automates the process of identifying agent shortcomings, proposing fixes, and validating changes before deployment. It represents a sophisticated MLOps approach to ensure agents remain effective and reliable over time, directly addressing challenges of maintaining AI system performance in dynamic environments.
Key Components in the Loop
The agent optimizer evaluates hosted agents against predefined criteria, generating and ranking candidate configurations. A crucial part of this is the reflector model, a separate AI that diagnoses why agents fail, influencing results more significantly than the agent's own model choice. This highlights an interesting architectural decision to externalize failure analysis.
The system leverages a model router for efficient model selection, claiming up to 65% cost savings by intelligently directing requests. For more complex fixes, Managed Training or Programmed Training can be employed, which involve changing model weights. Programmed Training allows customers to implement custom supervised fine-tuning or reinforcement learning, with Foundry handling the underlying GPU operations, offering flexibility while maintaining platform control.
azd ai agent eval init # generate dataset & evaluator
azd ai agent eval run # score current version
azd ai agent optimize # search over candidates
azd ai agent optimize apply --candidate <id> # apply winner locally
azd deploy # ship as next versionA critical aspect emphasized by practitioners is the human-in-the-loop for approval before deploying optimized agents. This mitigates risks associated with self-modifying agents, especially for high-risk actions. Robust review processes, including diff inspection, analysis of improved/regressed examples, and staged rollouts with rollback capabilities, are essential for maintaining system stability and reliability.