A full Microsoft Certified: Multi-Agent AI Solutions Expert mock exam: 60 questions in 100 minutes, scored against the real exam's pass mark. Your first one is free.
Think first When should you improve an agent through its prompt and context, and when is fine-tuning the model worth the cost?
Why it matters: Questions describe an agent's prompt, context or model problem and ask which prompt technique, context setting or training approach fits.
Few-shot examples steer a model for one request without changing it. Versioning keeps each prompt tied to the model it was tested on. Fine-tuning changes the model's weights, and you must redo it when you move to a new model revision.
Reported, thanks
Step 2 of 11
Term
Meaning
Few-shot examples
Sample user and assistant turns placed after the system message to show the desired answers.
Recency bias
The tendency for the end of a prompt to sway the output more than its start.
Context provider
An Agent Framework component that injects instructions, messages or tools before a run.
Fine-tuning
Training that adapts a pretrained model's weights with task-specific data.
Reported, thanks
Step 3 of 11
Few-shot examples steer only the current request. With Chat Completions, add them as user and assistant turns after the system message. In RAG prompts, place retrieved context before the user's question, since models attend more reliably to earlier context. Because of recency bias, try repeating key instructions at the end.
Suggested RAG prompt budgets
Part
Budget
Guidance
System message
200 to 500 tokens
Keep it concise
Few-shot examples
300 to 800 tokens
Two to three examples
Example coverage
Not a token limit
A full answer, a partial answer and a no-answer case
Reported, thanks
Step 4 of 11
Tell the model to treat retrieved context as data only. Retrieved documents can hide instructions, which is indirect prompt injection. Also give the model a way out, such as answering "not found" when the text lacks the answer. That alternative path helps it avoid inventing responses.
Exam trap A system message is not a guarantee. It influences the model but does not ensure compliance, so layer it with filtering and evaluation.
Reported, thanks
Step 5 of 11
Tie each prompt version to the model version it targets. Record the prompt text, its evaluation results and settings such as temperature, top-p and max tokens. Saved prompt-agent versions are immutable, so every change creates a new version. To avoid untested upgrades, pin model versions or set Azure OpenAI deployments to No Auto Upgrade. For Azure OpenAI and serverless API models, existing deployments of a retired model return HTTP errors.
Reported, thanks
Step 6 of 11
The optimizer improves instructions, tool descriptions or model choice. It scores the baseline and every candidate on the same dataset. That dataset must already use the evaluators' column names, since the wizard cannot map columns. It rewrites function tool descriptions but cannot run those client-side tools. Ephemeral Responses API agents cannot be optimized.
Exam trap Promoting a candidate creates a new version, but a pinned agent sends it no traffic. Set the new version as active first.
Reported, thanks
Step 7 of 11
Context providers add instructions, messages or tools before a run. They can also extract state after a run. HarnessAgent turns on its todo, mode, file memory and skills providers by default, then adds yours after them. In Python, FileMemoryProvider shares memory across sessions only when you pass a stable scope such as a user ID.
Exam trap Do not keep session state inside an AIContextProvider. One instance serves every session of the agent, so store per-session state in the AgentSession.
Reported, thanks
Step 8 of 11
A sub-agent shares the caller's session only when told to. With as_tool(), add propagate_session=True to share the AgentSession. Application state then flows down and merges back, but approval state stays with its own agent. In C#, keep per-run data in AdditionalProperties and lasting state in the session's StateBag. Only one Python history provider should load messages.
Reported, thanks
Step 9 of 11
Fine-tuning changes weights instead of adding prompt examples. DPO trains on preferred and rejected responses to the same input. RFT suits tasks with many valid answers whose quality you can score reliably.
Preference and reinforcement fine-tuning compared
Method
What you supply
How it is billed
Preference fine-tuning (DPO)
Preferred and rejected responses to the same input
Tokens in the training file times epochs
Reinforcement fine-tuning (RFT)
Prompts and a grader that scores responses
Training time, plus any model-grading costs
Reported, thanks
Step 10 of 11
Reassess a tuned model as data changes or its base model retires. Retraining and redeployment may follow. The Developer training tier saves money on idle capacity but can be preempted. Developer deployments are removed after 24 hours. Failed jobs, queue time and data safety checks are not charged. An RFT job that hits its spending limit pauses with a deployable checkpoint.
Exam trap A fine-tuned model does not carry over to a new model revision. You must fine-tune the new version again before using it.
Reported, thanks
Step 11 of 11
Few-shot examples condition only the current inference; fine-tuning changes the model's weights.
In RAG prompts, place the context before the user's question and treat it as data only.
Version each prompt with its evaluation results and send it only to the model version it targets.
Keep session state in the AgentSession, never in a shared context provider instance.
DPO learns from preferred and rejected responses; RFT learns from a grader's scores.
Think first How do you decide what an agent should remember, what it should look up, and how to keep each user's data apart?
Why it matters: Questions describe an agent's memory, history or retrieval need and ask which memory type, setting or knowledge source fits.
Short-term memory holds the current conversation, while long-term memory keeps durable facts across sessions. Retrieval brings in outside knowledge on demand without storing it as memory. Scopes keep isolated collections of memory items, for example one per customer.
Reported, thanks
Step 2 of 11
Term
Meaning
Short-term memory
The current session's conversation, usually managed by the orchestration framework.
Long-term memory
Durable knowledge Foundry Agent Service extracts from conversations and keeps across sessions.
Scope
A partition of a memory store with its own isolated memory items, such as one per customer.
Knowledge base
What every agentic retrieval scenario needs, together with at least one knowledge source.
Reported, thanks
Step 3 of 11
Foundry Agent Service memory is built for the long term. It turns conversations into durable knowledge available across sessions. It stores three types: user profile, chat summary and procedural memory. Static memories load at the start of each conversation, and contextual memories are fetched every turn. Fetch stable profile details early so answers feel personal.
Exam trap Foundry Agent Service memory is designed for long-term memory across sessions. The current session's conversation is short-term memory, usually managed by the orchestration framework.
Reported, thanks
Step 4 of 11
History lives in the local session or in the service. Local session state keeps the full chat in the session. With service-managed storage, the session keeps only a remote conversation ID. When local history outgrows model limits, apply a reducer. For token-aware reduction, use a compaction strategy instead of message counts.
Exam trap Reducer settings only affect in-memory history providers. With service-managed history, reduction depends on the provider or service.
Reported, thanks
Step 5 of 11
Each scope is an isolated set of memory items. A store allows 100 scopes and 10,000 memories per scope. Setting scope to {{$userId}} reads the x-memory-user-id header, or else the caller's Entra IDs. A store can set a default TTL in seconds. Memory writes complete only after the update_delay quiet period.
Exam trap A remember command does not override TTL. If the store has a TTL, items added that way can still expire.
Reported, thanks
Step 6 of 11
Screen what enters and leaves memory for prompt injection. Use Azure AI Content Safety prompt injection detection on memory traffic. Memory stores do not support virtual network integration. For many users on one key, keep conversation IDs server-side and verify ownership before resuming. In shared hosted sessions, the platform stops cross-user response chains and filters context.get_history().
Exam trap The platform does not partition data your container stores itself in a shared session. Key that data by session ID and user ID, not session ID alone.
Reported, thanks
Step 7 of 11
Chunk by document structure, not fixed character counts. The Document Layout skill keeps headings and splits text by paragraphs and sentences. Its indexer needs allowSkillsetToReadFileData set to true and parsingMode set to default. With Content Understanding, chunkingProperties.method set to semantic follows paragraph and heading boundaries.
Exam trap Do not mix embedding models between indexing and querying. Use the same endpoint, deployment and model in the embedding skill and the query vectorizer.
Reported, thanks
Step 8 of 11
Query planning splits a complex question into subqueries. Every scenario needs a knowledge base and at least one knowledge source. Planning can use chat history. Subqueries run at once as keyword, vector or hybrid search, each semantically reranked. Low or medium planning needs an LLM. In the 2026-10-01 GA contract, set limits on the retrieve request.
Reported, thanks
Step 9 of 11
MCP Server sources query live data with no ingestion. Remote sources have no backing index, so they don't return citation URLs. For document-level permissions, set query_source_credential to the caller's credential to trim results per user. If the SDK lacks query-source authorization, Agent Framework fails closed with a ValueError.
Exam trap MCP Server knowledge sources do not support minimal retrieval reasoning effort. Use low or medium instead.
Reported, thanks
Step 10 of 11
Add Foundry IQ through a toolbox attached as an MCP tool. The tool's default query_type is vector_semantic_hybrid. With a private virtual network, use project managed identity, since keys are not supported. Agent Framework retrieves this content before the model runs, not as memory.
Foundry IQ modes in Agent Framework
Feature
Semantic mode
Agentic mode
What it searches
An existing index
A Foundry IQ knowledge base
How it retrieves
Can combine keyword and vector retrieval
Query planning and multi-hop retrieval
Exam trap The Foundry IQ tool for Foundry agents cannot search several indexes at once. It can only target one index.
Reported, thanks
Step 11 of 11
Foundry Agent Service memory is long-term; the framework handles the current session.
Partition memory with scopes, up to 100 per store.
In shared sessions, key container data by session ID and user ID.
Use the same embedding model for indexing and querying.
MCP Server sources read live data with no ingestion but need low or medium effort.
Think first When an agent needs outside tools, how do you choose where they run, how they are secured and what happens when one fails?
Why it matters: Questions describe a tool integration and ask which hosting option, MCP setting, auth method or error-handling feature fits.
Simple tools can run in-process through function calling. Tools that need separate development and deployment can move to Azure Functions, where an MCP tool trigger defines tool endpoints. Retry policies and error sections then handle failures.
Reported, thanks
Step 2 of 11
Term
Meaning
Function calling
Tools defined in your agent code that run in the same process as the agent.
MCP tool trigger
An Azure Functions trigger that defines tool endpoints that agents and models can call.
Custom handler
How a self-hosted MCP server built with an official MCP SDK runs on Azure Functions.
on-error section
The API Management policy section that runs when request processing hits an error.
Reported, thanks
Step 3 of 11
Host tools on Azure Functions to separate business logic. Hosted tools can be built, tested and deployed apart from the agent. All function calling features, including parallel calls, need a model released after November 6, 2023. A queue-based Functions tool receives a message on an input queue. Its reply carries the original CorrelationId so the agent matches it to the right call.
Exam trap The queue-based Azure Functions tool does not work with the basic agent setup. It needs the standard setup's queue resources and managed network integration.
Reported, thanks
Step 4 of 11
Use the MCP extension or deploy a self-hosted SDK server. Setting configurationProfile to mcp-custom-handler applies the host settings needed to run an MCP server on Functions. The extension supports only the isolated worker model for C# and does not support PowerShell.
MCP extension and self-hosted MCP servers on Azure Functions
Feature
MCP extension
Self-hosted SDK server
How it is built
Functions with MCP tool triggers that define tool endpoints
A server built with an official MCP SDK, run as a custom handler
State and hosting
The option to pick when the server must be stateful
Stateless, streamable-http, Flex Consumption plan (preview)
Key for key-based access
mcp_extension system key
default host key
Reported, thanks
Step 5 of 11
Use Streamable HTTP unless a client needs SSE. The extension serves Streamable HTTP at /runtime/webhooks/mcp. When you do use SSE, the extension relies on Queue storage in the default host storage account, AzureWebJobsStorage.
Exam trap SSE is not the modern default. Newer MCP protocol versions deprecate it, so use Streamable HTTP unless a client specifically needs SSE.
Reported, thanks
Step 6 of 11
Without the mcp_extension key, callers get 401 Unauthorized. Clients send the key in x-functions-key or the code query string. Setting the webhook authorization level to Anonymous removes the key requirement. Built-in MCP authentication also turns off key-based access. For Entra sign-in from Foundry, only project managed identity is supported. Use OAuth identity passthrough when each user needs their own identity.
Exam trap Anonymous access is not for business data. Keep it for tools that return read-only public information, or for private development.
Reported, thanks
Step 7 of 11
Mark a property required only when the tool needs it. MCP Apps combine tool and resource triggers so a tool can return an interactive UI. The tool declares a ui.resourceUri that points to a UI resource. The MCP host renders that resource in a sandboxed iframe in the chat.
Exam trap Tool properties in the MCP extension are optional by default. If you forget to mark a vital property required, clients may omit it.
Reported, thanks
Step 8 of 11
API Management can protect an MCP server with a subscription key. Clients can send a subscription key in Ocp-Apim-Subscription-Key. The credential manager injects OAuth 2.0 tokens into backend calls. Tools can change, by adding, renaming or removing them, with no need to recreate the server. SSE passthrough needs two endpoints, while streamable passthrough needs one.
Exam trap Deleting a REST API operation that an MCP tool still references fails with a dependency error. Delete the tool first.
Reported, thanks
Step 9 of 11
Logic Apps retries on timeouts and 408, 429 or 5xx responses. For most operations, the Default policy is exponential, with up to 4 retries capped between 5 and 45 seconds. Fixed and exponential policies allow 1 to 90 retries. An action runs only after the previous one succeeds, by default. In API Management, an error jumps straight to on-error, where context.LastError holds the details.
Exam trap API Management policies have no on-error section by default. Without one, callers just receive a 400 or 500 response.
Reported, thanks
Step 10 of 11
Turn on payload logging to see tool arguments and results. API Management does not capture them by default; enable frontend and backend logging on the MCP server. Failed requests record error.message and error.type. In Logic Apps, result() returns the top-level action results of a scope. In the playground, review each tool's name and arguments, then select Approve.
Exam trap Do not read context.Response.Body in policies at MCP scope. MCP responses stream, and reading the body breaks the stream.
Reported, thanks
Step 11 of 11
A Functions tool reply must carry the original CorrelationId so the agent can match it.
Self-hosted MCP servers on Functions must be stateless; pick the MCP extension for state.
Use Streamable HTTP; SSE is deprecated in newer MCP protocol versions.
Logic Apps retries timeouts and 408, 429 and 5xx failures under its retry policy.
Add an on-error section in API Management, or callers only see 400 or 500.
Think first How do you choose an orchestration pattern, and where do human approvals, MCP tools and middleware fit around it?
Why it matters: Questions describe a multi-agent task and ask which Agent Framework pattern, approval setting, MCP option or middleware fits.
Agent Framework patterns differ in who decides the next step: a fixed order, parallel work, a shared chat, a manager or direct handoffs. A workflow can pause after an agent responds so a human reviews the work. Middleware wraps every run with shared logic such as logging and security.
Reported, thanks
Step 2 of 11
Term
Meaning
Magentic manager
A planning manager agent that coordinates specialized agents dynamically.
Handoff
A pattern where agents pass control directly to each other based on context.
Hosted MCP tool
An MCP server the AI service calls on the service side, not code that runs locally.
Middleware
Code that intercepts agent interactions to add logging, security or other shared behavior.
Reported, thanks
Step 3 of 11
Pick the pattern by who decides what happens next. Sequential runs agents in a set order, while concurrent runs them all at once. Magentic adds a manager that plans as the work goes.
Agent Framework orchestration patterns compared
Pattern
How agents coordinate
Note
Sequential
One after another in a set order
Each agent gets the previous full conversation by default
Concurrent
In parallel
Suits brainstorming, ensemble reasoning and voting
Group Chat
In one shared conversation
Preferred for simple coordination without planning
Magentic
A manager coordinates specialists as it goes
For tasks whose solution path is unknown upfront
Handoff
Agents pass control to each other
A mesh of agents with no orchestrator
Reported, thanks
Step 4 of 11
The terminal output holds only the last agent's response. Set chain_only_agent_responses=True so each agent reads only the prior agent's reply. Add .with_request_info() to pause after chosen agents for human review. Agent names there must match exactly, including case, or construction raises ValueError.
Exam trap Sequential orchestration has no built-in pause for free-form feedback between agents. It also cannot send control back to an earlier agent.
Reported, thanks
Step 5 of 11
Results merge into one response, one message per agent. A custom aggregator can process the results differently. By default only the aggregator's output is a terminal event. Use intermediate_output_from to surface chosen participants' outputs as intermediate events.
Reported, thanks
Step 6 of 11
Limits stop the manager from looping forever. You can cap coordination rounds, consecutive stalls before replanning and plan resets. Rounds without progress raise a stall counter, and passing its limit forces a reset and replan. In plan review, a human calls approve() or revise(...) with feedback.
Exam trap Two workflows running at once should not share a stateful explicit manager. Use manager_factory so each workflow keeps its own manager state.
Reported, thanks
Step 7 of 11
Handoff is interactive by default. If an agent answers without handing off, the user gets the next turn. A user reply goes back to the agent that asked, unless you disable return-to-previous routing. In autonomous mode, the default cap is 50 turns. Only user and agent messages are shared, not tool calls. Participants must be agents that run tools locally.
Exam trap Handoff is not the same as agents as tools. In handoff the receiving agent owns the task, while with agents as tools the primary agent keeps responsibility.
Reported, thanks
Step 8 of 11
Mark tools that need a person to approve each call. In Python, set approval_mode to "always_require" on the @tool decorator. In .NET, wrap the function in ApprovalRequiredAIFunction. A RequestPort pauses a workflow until an outside reply arrives. Checkpoints keep pending requests and emit them again as RequestInfoEvent objects on restore.
Exam trap A local approval response is not accepted on its own. By default it must match a pending request in the same AgentSession, or it is ignored with a warning.
Reported, thanks
Step 9 of 11
Hosted MCP tools run on the service side. With RequireApproval set to "always", every call needs user approval, while "never" runs tools automatically. OpenAI Responses requires approval for every hosted MCP call by default. For a server that needs authentication, set an Authorization header and load the secret from a store, never source control.
Exam trap Leaving out allowed_tools sends no filter at all. Passing [] sends an explicit empty allowlist instead.
Reported, thanks
Step 10 of 11
Agent middleware wraps run middleware. With agent middleware A1, A2 and run middleware R1, R2, the order is A1, A2, R1, R2, then the agent. Middleware suits error handling, retries and graceful degradation. It can stop early by setting context.result and raising MiddlewareTermination. In .NET, the builder returns a new agent and leaves the original unchanged.
Exam trap Chat middleware does not run only once per request. It runs inside the function invocation loop, so it fires for every model call, including tool-result calls.
Reported, thanks
Step 11 of 11
Use Magentic when the solution path is unknown; prefer Group Chat when no planning is needed.
A sequential workflow returns only the last agent's response as its terminal output.
In handoff the receiving agent owns the task; with agents as tools the primary agent keeps it.
Require approval with approval_mode="always_require" in Python or ApprovalRequiredAIFunction in .NET.
Put logging, security checks and retries in middleware so every agent shares them.
Each topic's Check tested it on its own; this mixes them.
Mixed quiz
Take the Domain 2 quiz
21 questions mixed from every topic in this domain, each answer explained. Mixing topics is harder than one at a time, and it is what the exam does. No account needed; with a free account your answers also build your estimated exam score.
Thank you. It goes straight to the people who write these notes.
Test yourself in exam conditions
A full Microsoft Certified: Multi-Agent AI Solutions Expert mock exam: 60 questions in 100 minutes, scored against the real exam's pass mark. Your first one is free.
Free to start: the study notes and plan, quizzes, flashcards and the first mock exam, no card needed. A free account keeps your place and saves your quiz scores.