Domain 2: Develop Multi-Agent Solutions in Azure (Part 3 of 4)
This lesson covers 4 exam topics: Tool Errors, Fallbacks and Result Validation, Multi-Agent Orchestration Patterns, Human-in-the-Loop Processes, Caching Strategies for Agents. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Tool Errors, Fallbacks and Result Validation
Central question: What happens when a tool fails or returns bad data?
Facts (verified and design guidance)
- Foundry process evaluators measure tool call success (no technical errors), tool input accuracy, tool selection and tool output utilization.
- Agent Framework middleware is the natural place for error handling, retry logic and graceful degradation; function-calling middleware can inspect and modify tool inputs and outputs.
- Guardrails can scan tool responses (preview) for risks such as indirect prompt injection.
Design guidance
- Classify errors: transient (retry with backoff and limits), invalid input (ask the model to correct arguments), permanent (fall back to another tool or a person).
- Validate tool results against a schema and business rules (ranges, required fields, freshness) before the agent uses them; return structured errors the model can reason about.
- Use circuit breakers and timeouts so one failing tool can't stall a workflow.
Exam traps
- Unlimited retries on a failing tool.
- Passing raw tool errors or untrusted tool text straight to users.
- Trusting tool output without validation.
2. Multi-Agent Orchestration Patterns
Central question: Which orchestration pattern fits the problem?
Facts
| Agent Framework pattern | Topology | Use |
|---|---|---|
| Sequential | Pipeline | Ordered steps, each building on the last |
| Concurrent | Fan-out, aggregate | Independent perspectives in parallel |
| Handoff | Mesh, no orchestrator | Transfer full control to the right specialist |
| Group chat | Star, orchestrator picks speaker | Iterative refinement with shared context |
| Magentic | Manager plans and delegates | Complex open-ended tasks |
- Handoff vs agent-as-tools: in handoff, the receiving agent takes full ownership and context; in agent-as-tools, a primary agent keeps responsibility and calls others as tools (orchestrator-subagent).
- Group chat speaker selection: round-robin, prompt-based or custom; Magentic adds a planning manager (based on Magentic-One) and supports human plan review.
- Orchestrations support HITL through tool approval and request info.
Design guidance
- Map study-guide names: hub-and-spoke = group chat or orchestrator-subagent; parallel = concurrent; peer-to-peer = handoff.
Exam traps
- Magentic for a simple fixed pipeline. Use sequential.
- Handoff when the main agent must keep ownership. Use agent-as-tools.
- Sequential for independent analyses. Use concurrent.
3. Human-in-the-Loop Processes
Central question: How do people approve, override and handle edge cases?
Facts
- Agent Framework: approval-required function tools; workflow RequestPort for human input; Magentic plan review.
- Foundry MCP tool require_approval returns an approval request; your app sends an approval response before the call runs.
- Long-running hosted agents (preview) can suspend a multi-turn task and resume on the same task_id when a person replies, surviving restarts; the wait can last minutes to days.
- The Durable Extension lets agents pause for human input or external events without consuming compute or tokens while waiting.
Design guidance
- Approval UX: show the proposed action, inputs and impact; allow approve, reject or edit (override); log who decided.
- Route low-confidence or policy edge cases to a person; set timeouts and escalation for unanswered approvals.
Exam traps
- Holding a request open while waiting for a person.
- Approval for every action (fatigue). Reserve it for high-risk actions.
- No audit trail of approvals.
4. Caching Strategies for Agents
Central question: Which cache: prompt, semantic or response?
Facts
| Cache | Where | Hits when |
|---|---|---|
| Prompt caching | Model service | Identical prompt prefix (at least 1,024 tokens) |
| Semantic caching | API Management (llm-semantic-cache-lookup/store) with Azure Managed Redis + RediSearch and an embeddings deployment | Similar prompts within a score threshold |
| Response caching | Your app or gateway | Exact repeat requests (design guidance) |
- Prompt caching discounts cached input tokens on Standard deployments and up to 100% on Provisioned; put static content (instructions, tools, documents) first.
- On GPT-5.6 and later: prompt_cache_key improves matching (beyond about 15 requests per minute per key-prefix, spread across keys); explicit cache breakpoints; cache writes can be charged.
- Semantic cache vary-by (for example subscription ID) partitions the cache; RediSearch can be enabled only when creating the Redis cache.
Exam traps
- Variable content at the start of the prompt, breaking prefix caching.
- Semantic cache shared across tenants without vary-by.
- Adding RediSearch to an existing cache. Only at creation.
References
- AI-500 study guide — checked Oct 22, 2026
- Agent evaluators — checked Oct 22, 2026
- Middleware exception handling — checked Oct 22, 2026
- Guardrails overview — checked Oct 22, 2026
- Orchestrations overview — checked Oct 22, 2026
- Handoff — checked Oct 22, 2026
- Group chat — checked Oct 22, 2026
- Magentic — checked Oct 22, 2026
- Workflows HITL — checked Oct 22, 2026
- Tool approval — checked Oct 22, 2026
- Add HITL approval (hosted) — checked Oct 22, 2026
- Durable Extension — checked Oct 22, 2026
- Prompt caching — checked Oct 22, 2026
- Semantic caching in API Management — checked Oct 22, 2026
Check your understanding
Measure whether tool calls errored?Show answerHide answer
Answer
Tool call success evaluator.Specialist takes over the conversation?Show answerHide answer
Answer
Handoff.Pause days for a manager's approval?Show answerHide answer
Answer
Durable/long-running pause and resume.Reuse long identical instructions cheaply?Show answerHide answer
Answer
Prompt caching.Central retry logic?Show answerHide answer
Answer
Middleware.