Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Deploy, evaluate, and manage AI agents end-to-end on Microsoft Azure AI Foundry
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
foundry-agent/agent-optimizer/references/optimize-workflow.md
1# Optimize Workflow23Use this after azd setup and scaffold review are complete.45## 1. Prepare context671. Resolve the hosted agent with [azd Setup](azd-setup.md).82. If SDK wiring or `.agent_configs/baseline/` is missing, run [Scaffold Workflow](scaffold.md) first.93. If scaffolding changed files, stop and ask the user to review before optimization.104. Ensure `eval.yaml` exists using [eval.yaml Guidance](eval-yaml.md), generate it with `azd ai agent eval generate`, or ask whether to use built-in optimize defaults.115. Before setting `--optimize-model` or `options.optimization_model`, verify the project has an existing deployment from the allowed optimizer list: `GPT-5`, `GPT-5.1`, `GPT-5.2`, `GPT-5.4`, `GPT-5.5`, `DeepSeek-V4-Pro`, or `DeepSeek-V-3.2`.1213When evaluation inputs are not already selected, generate them from a reviewed seed dataset or regenerate defaults:1415```bash16azd ai agent eval generate --dataset <path-to-jsonl>17azd ai agent eval generate --reset-defaults18```1920## 2. Run optimize2122Run from the azd project/agent root:2324```bash25azd ai agent optimize --optimize-model <allowed-optimizer-model-deployment-name>26```2728If multiple services are detected, let azd prompt or ask the user which service to use. If `eval.yaml` exists or was generated, use it when it matches the selected agent; otherwise ask before regenerating or ignoring it.2930## 3. Monitor3132Use these when the job is long-running or the user asks:3334```bash35azd ai agent optimize status <operation-id> --watch36azd ai agent optimize list37azd ai agent optimize cancel <operation-id>38```3940Capture the operation ID, portal URL, scores, and candidate IDs from output.4142## 4. Apply locally4344Recommend the best candidate, then ask before applying:4546```bash47azd ai agent optimize apply --candidate <candidate-id>48```4950After apply, show the source diff and summarize changed files, prompts, model/temperature, tools, and skills.5152## 5. Deploy after review5354In azd environments, prefer local apply plus:5556```bash57azd deploy58```5960Do not use `azd ai agent optimize deploy --candidate <candidate-id>` unless the user explicitly requests it. Local apply keeps optimized changes visible for source control review.61