Microsoft Agent Framework: Python setup and tools

Build a Python agent with Azure Foundry, inspect tool calls in Dev UI, and add an MCP documentation server plus memory across conversations.

Player not loading? Watch on YouTube

This tutorial introduces Microsoft Agent Framework through a small Python project. The presenter starts in an empty VS Code folder with uv installed and an existing Azure login, then uses Azure Foundry to serve models. The example relies on a remote model service; it does not demonstrate how to run models locally.

The initial setup installs the full Agent Framework package. The presenter recommends choosing specific integration packages once you know which features your project needs. A basic agent uses a Foundry chat client and Dev UI, which starts a FastAPI service and provides a chat interface with token counts.

The next step adds a Python function as a weather tool. Its results are fabricated for the demonstration. The presenter explains how function and parameter descriptions inform the model's tool selection, and how approval settings can require user consent before a tool runs. Dev UI exposes tool calls and traces during the interaction.

An MCP connection to learn.microsoft.com lets the AI agent search Microsoft documentation. Finally, a built-in memory provider writes profile information to a memory file. In the demonstration, the agent recalls the presenter's name in a new conversation. The closing discussion identifies context providers as extension points for memory and other functionality.