Azure-Samples/python-ai-agent-frameworks-demos
A repository of examples using Python AI Agent frameworks that work with GitHub Models and Azure OpenAI.
What it solves
Developers often struggle to compare and choose among the many Python AI agent frameworks. This repository provides ready-to-run examples for several popular frameworks, all wired to Azure OpenAI models (or alternatives like OpenAI.com and local Ollama). It removes the guesswork of setting up each framework’s environment and shows how to use common patterns such as tool calling, supervisor agents, and MCP servers.
How it works
The project contains a set of Python scripts in the examples directory. Each script showcases a different framework or agent pattern. The examples are meant to be run in a prepared environment: you can open the repo in GitHub Codespaces (a default setup uses Azure OpenAI, and an optional Ollama setup pre-installs local models), use VS Code Dev Containers, or set up a local Python environment with uv. All scripts read their model connection details from a .env file. The README explains how to configure three model providers: Azure OpenAI (using the Azure Developer CLI to provision resources), OpenAI.com (simply set your API key and model), or Ollama (a local server). Once configured, you run any example script directly, and each one demonstrates a specific capability: basic agents, agents with one or multiple tools, supervisor orchestrating sub-agents, workflow-based agents, graph-based state machines, function calling, and integration with MCP servers for external tools.
Who it’s for
Python developers who want practical, side-by-side examples of AI agent frameworks before committing to one. It is also useful for teams already using Azure OpenAI who want to explore different agent patterns or evaluate how frameworks like Microsoft Agent Framework, LangChain v1 + LangGraph, OpenAI Agents, PydanticAI, and LlamaIndex handle similar tasks.
Highlights
- Covers six major Python agent ecosystems: Microsoft Agent Framework, LangChain v1 + LangGraph, OpenAI Function Calling and OpenAI Agents, PydanticAI, and LlamaIndex.
- Example scripts illustrate common agent patterns: basic agents, tool‑using agents, multi‑tool planners, supervisor orchestration, workflow graphs, and MCP (Model Context Protocol) integrations.
- Run the same examples against Azure OpenAI, OpenAI.com, or a local Ollama server by changing environment variables.
- Infrastructure-as-code scripts provision Azure OpenAI resources automatically (via the Azure Developer CLI) when you choose the Azure path.
- Offers multiple quick-start routes: GitHub Codespaces with a default or Ollama container, VS Code Dev Containers, or a local
uv-based setup.
Related
- Project
- Project
- Project
- Project