Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Microsoft Agent Framework Samples

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.

🚀 What You'll Learn

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

📁 Repository Structure

DirectoryDescription.NET Code SamplesPython Code Samples
00.ForBeginnersBeginner-friendly Microsoft Agent Framework examples extending AI Agents for BeginnersTravel Agent
Basic Agent
Design Patterns
Tool Use
RAG Search
Planning
Multi-Agent
Travel Agent
Basic Agent
Design Patterns
Tool Use
RAG Search
Planning
Multi-Agent
01.AgentFoundationCore concepts and architecture of Microsoft Agent FrameworkDocumentation OnlyDocumentation Only
02.CreateYourFirstAgentBuild your first travel planning agent from scratchTravel Agent with GitHub ModelsTravel Agent with GitHub Models
03.ExploreAgentFrameworkDeep dive into different providers and configurationsAzure OpenAI
GitHub Models
MS Foundry
Foundry Local
Azure OpenAI
GitHub Models
MS Foundry
Foundry Local
04.ToolsVision, code interpretation, and custom tool integrationVision
Code Interpreter
Bing Grounding
File Search
Vision
Code Interpreter
Bing Grounding
File Search
05.ProvidersMCP (Model Context Protocol) and Agent-to-Agent communicationMCP with Microsoft LearnMCP with Microsoft Learn
06.RAGsKnowledge-enhanced agents with file search capabilitiesFile Search RAGFile Search RAG
07.WorkflowComplex agent workflows and orchestration patternsBasic Workflow
Sequential
Concurrent
Conditional(MS Foundry)
Basic Workflow
Sequential
Concurrent
Conditional(MS Foundry)
08.EvaluationAndTracingAgent evaluation, debugging, and observability toolsGitHub Models Workflow DevUISingle MS Foundry Agent DevUI
Multi-Agent GitHub Models DevUI
Multi-Agent MS Foundry DevUI
Multi-Agent Foundry Local DevUI
09.CasesReal-world case studies combining Foundry workflows with production-ready multi-agent applicationsMicrosoft Foundry with AITK & MAF
GHModel Multi-Agent (.NET)
Microsoft Foundry with AITK & MAF
GHModel Multi-Agent (Python)
Agentic Marketing Content Generation
Foundry Local Pipeline
MAF Harness Managed Agent
MAF Harness Managed Hosted Agent

🛠 Prerequisites

⚠️ Important Notice: Microsoft Agent Framework has officially released v1.0 (2026-04-02). You can use either the released version or the build-from-source version to complete the examples, depending on your needs.

📌 Additional Notes:

  1. 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
  2. Microsoft Foundry Agent Service uses the V2 version. V2 is GA now

Option 1: Install Released Version

Python:

pip install agent-framework --pre

.NET:

dotnet add package Microsoft.Agents.AI

Option 2: Build from Source (Latest Features)

If you want the latest features, we recommend building from source.

Python:

pip install -r ./Installation/requirement.txt -U

.NET:

git clone https://github.com/microsoft/agent-framework.git cd agent-framework/dotnet dotnet build agent-framework-dotnet.slnx

Environment Requirements

  • Python: 3.10 or higher
  • .NET: 9.0 or higher, Visual Studio 2022 or VS Code with C# extension

💻 Platform-Specific Setup

Windows ARM64 Configuration

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"

Cross-Platform Compatibility

  • Linux: Standard pip installation
  • macOS: Homebrew for system dependencies
  • Windows x64: Standard Windows installation

Required Services

  • Azure OpenAI Service and Microsoft Foundry
  • GitHub Models (for some examples)
  • Azure CLI (authenticated)
  • Azure Developer CLI (authenticated)

🚀 Quick Start

Environment Setup

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"

📚 Tutorial Progression

Getting Started Level

  1. 00.ForBeginners - Comprehensive beginner tutorials with Microsoft Agent Framework examples

Foundation Level

  1. 01.AgentFoundation - Understand the core concepts and architecture
  2. 02.CreateYourFirstAgent - Build your first travel planning agent

Intermediate Level

  1. 03.ExploreAgentFramework - Explore different providers (Azure OpenAI, GitHub Models, AI Foundry)
  2. 04.Tools - Add vision, code interpretation, and custom tool capabilities
  3. 06.RAGs - Implement knowledge-enhanced agents with file search

Advanced Level

  1. 05.Providers - Master MCP (Model Context Protocol) and Agent-to-Agent communication
  2. 07.Workflow - Create complex agent workflows and orchestration patterns
  3. 08.EvaluationAndTracing - Learn evaluation, debugging, and observability tools for agents

🔧 Key Features Demonstrated

  • 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

🤝 Contributing

We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Resources

🆘 Support

If you encounter any issues or have questions:

  1. Check the individual README files in each chapter directory
  2. Review the code samples for implementation details
  3. Open an issue in this repository
  4. Consult the official Microsoft Agent Framework documentation

Start your journey with Microsoft Agent Framework today! 🚀

关于 About

Agent Framework Samples - showcasing ways in which agent framework can be utilized.
agent-frameworkagents

语言 Languages

Jupyter Notebook43.4%
Python37.7%
C#17.4%
TypeScript1.0%
CSS0.2%
JavaScript0.2%
Dockerfile0.0%
Shell0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
187
Total Commits
峰值: 26次/周
Less
More

核心贡献者 Contributors