A unified, composable platform
The Microsoft Agent Framework is the next generation of both Semantic Kernel and AutoGen, combining AutoGen's intuitive agent abstractions with Semantic Kernel's enterprise features. All agents derive from a single Agent base class, giving a consistent interface regardless of the underlying model provider.
Key concept · Seven core components
- Model clients — one interface to many AI providers; switch by changing config, not agent logic.
- Agent session — native state management for persistent multi-turn context.
- Context providers — plug-and-play memory that surfaces relevant info dynamically.
- Function tools — custom functions auto-registered; the framework generates the schema.
- MCP clients — built-in dynamic tool discovery at runtime.
- Middleware — intercept, log, and modify agent actions.
- Workflow orchestration — graph-based multi-agent patterns (sequential, concurrent, group chat, handoff).
What every agent can do
Regardless of provider, every framework agent supports function calling, multi-turn conversations, structured (schema-validated) outputs, streaming responses, and provider-dependent service tools (code execution, file/web search).
Key concept · Why Foundry is the recommended provider
The framework integrates with Azure AI Foundry projects — authenticate with Azure credentials, create agents via the Foundry Agent Service, and get service-side chat history that persists sessions automatically across turns. Because it eliminates manual conversation-state management, Foundry Agent Service is the recommended provider for production. Chat-completion providers (e.g. Azure OpenAI Chat, Anthropic, Bedrock) lack service chat history and must manage state locally.
Design benefits: composability (use components alone or combined), provider flexibility (swap inference services without rewriting logic), enterprise-grade session/telemetry/type-safety, and a consistent developer experience with no manual wiring of separate memory/tool/model libraries.
Give the agent capabilities
Tools let an agent use APIs and services through function calling. Built-in tools (Code Interpreter, File Search, Web Search) need no setup; custom tools are plain functions the agent invokes automatically.
Key concept · The @tool pattern
Decorate a function with @tool (name, description, optional approval mode), describe parameters with Annotated + Pydantic Field, and register it — e.g. ChatAgent(tools=[my_function, ...]). Then don't call it manually: the agent decides which tools to use and when, from the conversation context, and the framework handles orchestration and combining results. Best practices: clear descriptions, type hints, error handling, meaningful returns, and one task per tool.
Chapter 13 quiz
Fourteen questions on the framework, its components and capabilities, and adding tools. Answer first, then expand Show answer.
Part A · Multiple choice
The Microsoft Agent Framework is the next generation of which two projects?
- A LangChain and CrewAI
- B Semantic Kernel and AutoGen
- C ADK and LangGraph
- D Copilot and Power Automate
Show answer
B. It unifies AutoGen's abstractions with Semantic Kernel's enterprise features.
What gives every agent a consistent interface regardless of model provider?
- A A single
Agentbase class - B A vector index
- C A content filter
- D A REST endpoint
Show answer
A. All agents derive from one Agent base class.
Which component lets you switch AI providers by changing only configuration?
- A Model clients
- B Middleware
- C Context providers
- D Function tools
Show answer
A — Model clients. A unified interface across providers.
Why is Foundry Agent Service the recommended production provider?
- A It's the cheapest
- B It provides service-side chat history that persists sessions automatically
- C It's the only one with tools
- D It requires no auth
Show answer
B. Eliminating manual state management. Chat-completion providers lack this.
How do you define a custom tool in the framework?
- A Decorate a function with
@tooland register it with the agent - B Add it to a vector store
- C Fine-tune the model
- D Edit a YAML file only
Show answer
A. With Annotated/Field parameter descriptions; the agent invokes it automatically.
Which is a built-in tool that needs no setup?
- A Code Interpreter
- B A custom CRM function
- C An OpenAPI spec
- D A Logic App
Show answer
A — Code Interpreter. Along with File Search and Web Search.
Part B · True or false
You must manually call custom tools in your code.
Show answer
False. The agent decides which tools to use and when, based on context.
Switching inference providers requires rewriting your agent logic.
Show answer
False. Provider flexibility means only client config changes.
Every framework agent supports streaming responses and structured outputs.
Show answer
True. Plus function calling, multi-turn conversations, and (provider-dependent) service tools.
Clear tool descriptions and type hints help the agent call functions correctly.
Show answer
True. Without metadata the AI can't invoke functions properly.
Part C · Short answer
Name four of the seven core components of the framework.
Show answer
Any four: model clients, agent session, context providers, function tools, MCP clients, middleware, and workflow orchestration.
Name three capabilities every framework agent supports.
Show answer
Any three: function calling, multi-turn conversations, structured outputs, streaming responses, and service-provided tools.
What key advantage does Foundry Agent Service provide over chat-completion providers?
Show answer
Service-side chat history — automatic session persistence, no manual state management.
Give two best practices for defining custom tools.
Show answer
Any two: clear descriptions, type hints, error handling, meaningful returns, and one task per focused function.