A comprehensive hands-on guide to building intelligent agents using the Microsoft Agent Framework. This repository contains practical examples, tutorials, and code samples that demonstrate how to create powerful AI agents using both Python and .NET implementations.
This repository provides step-by-step tutorials and real-world examples covering:
- Agent Foundations: Core concepts and architecture of the Microsoft Agent Framework
- Creating Your First Agent: Build a simple travel planning agent from scratch
- Framework Exploration: Deep dive into different providers and configurations
- Tools Integration: Implement vision, code interpretation, and custom tools
- Provider Patterns: Work with MCP (Model Context Protocol) and Agent-to-Agent communication
- RAG Implementation: Build knowledge-enhanced agents with file search capabilities
- Multi-Agent Systems: Orchestrate multiple agents working together
- Workflow Management: Create complex agent workflows and pipelines
Note: This is installation guideline
β οΈ Important Notice: Microsoft Agent Framework is currently in the development/preview stage. Since the framework APIs and features may change frequently, we strongly recommend building from source rather than using NuGet packages to ensure you have the latest updates and bug fixes.
π Additional Notes:
- The examples in this repository are primarily based on GitHub Models and Microsoft Foundry. You can access GitHub Models directly at https://gh.io/models
- Microsoft Foundry Agent Service uses the V2 version. Please access it at https://ai.azure.com and select V2 when creating or managing your Microsoft Foundry projects.
- Python 3.10 or higher
- Install dependencies:
pip install -r ./Installation/requirement.txt -UBuild from Source (Recommended):
git clone https://github.com/microsoft/agent-framework.git
cd agent-framework/python
pip install -e .- .NET 9.0 or higher
- Visual Studio 2022 or VS Code with C# extension
Build from Source (Recommended):
git clone https://github.com/microsoft/agent-framework.git
cd agent-framework/dotnet && dotnet build agent-framework-dotnet.slnxAfter building, reference the local project in your notebooks or applications instead of NuGet packages. This ensures compatibility with the latest framework changes.
If you're running on Windows ARM64, you may need to configure OpenSSL for certain dependencies:
git config --global core.longpaths true
winget install ShiningLight.OpenSSL.Dev
$env:OPENSSL_DIR="C:\Program Files\OpenSSL-Win64-ARM"
$env:OPENSSL_LIB_DIR="C:\Program Files\OpenSSL-Win64-ARM\lib\VC\arm64\MT"
$env:OPENSSL_STATIC="1"- Linux: Standard pip installation
- macOS: Homebrew for system dependencies
- Windows x64: Standard Windows installation
- Azure OpenAI Service and Microsoft Foundry
- GitHub Models (for some examples)
- Azure CLI (authenticated)
- Azure Developer CLI (authenticated)
Create a .env file in the root directory with your configurations:
GITHUB_TOKEN="Your GitHub Models Token"
GITHUB_ENDPOINT="Your GitHub Models Endpoint"
GITHUB_MODEL_ID="Your GitHub Model ID"
AZURE_OPENAI_ENDPOINT="Your Azure OpenAI Endpoint"
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME ="Your Azure OpenAI Model Deployment Name"
FOUNDRYLOCAL_ENDPOINT="Your Foundry Local Endpoint http://localhost:5272/v1"
FOUNDRYLOCAL_MODEL_DEPLOYMENT_NAME="Your Foundry Local Model Deployment Name"
AZURE_AI_PROJECT_ENDPOINT ="Your Azure AI Foundry Project Endpoint"
AZURE_AI_MODEL_DEPLOYMENT_NAME ="Your Azure AI Foundry Project Deployment Name"
BING_CONNECTION_ID="Your Bing Connection ID"
BING_CONNECTION_NAME="Your Bing Connection Name"
OTEL_EXPORTER_OTLP_ENDPOINT="Your OpenTelemetry Collector Endpoint e.g. http://localhost:4317"- 00.ForBeginners - Comprehensive beginner tutorials with Microsoft Agent Framework examples
- 01.AgentFoundation - Understand the core concepts and architecture
- 02.CreateYourFirstAgent - Build your first travel planning agent
- 03.ExploreAgentFramework - Explore different providers (Azure OpenAI, GitHub Models, AI Foundry)
- 04.Tools - Add vision, code interpretation, and custom tool capabilities
- 06.RAGs - Implement knowledge-enhanced agents with file search
- 05.Providers - Master MCP (Model Context Protocol) and Agent-to-Agent communication
- 07.Workflow - Create complex agent workflows and orchestration patterns
- 08.EvaluationAndTracing - Learn evaluation, debugging, and observability tools for agents
- Multiple Provider Support: Azure OpenAI, GitHub Models, Microsoft Foundry
- Tool Integration: Vision analysis, code interpretation, custom functions
- RAG Capabilities: File search and knowledge base integration
- Multi-Agent Orchestration: Sequential and collaborative agent patterns
- MCP Integration: Model Context Protocol for enhanced capabilities
- Streaming Responses: Real-time agent interactions
- Persistent Agents: Stateful agent conversations
- Evaluation & Debugging: DevUI for visual debugging and observability tools for tracing
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the individual README files in each chapter directory
- Review the code samples for implementation details
- Open an issue in this repository
- Consult the official Microsoft Agent Framework documentation
Start your journey with Microsoft Agent Framework today! π