mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
f19ebf5b1b
* Update README with links to video content. Include initial code samples as a quickstart. * Include import * Fix .net code * Simplify sample * Fix python spacing * updates * Remove .DS_Store file.
127 lines
5.7 KiB
Markdown
127 lines
5.7 KiB
Markdown

|
|
|
|
# Welcome to Microsoft Agent Framework!
|
|
[](https://discord.gg/b5zjErwbQM)
|
|
|
|
Welcome to Microsoft's comprehensive multi-language framework for building, orchestrating, and deploying AI agents with support for both .NET and Python implementations. This framework provides everything from simple chat agents to complex multi-agent workflows with graph-based orchestration.
|
|
|
|
<p align="center">
|
|
<a href="https://www.youtube.com/watch?v=AAgdMhftj8w" title="Watch the full Agent Framework introduction (30 min)">
|
|
<img src="https://img.youtube.com/vi/AAgdMhftj8w/hqdefault.jpg"
|
|
alt="Watch the full Agent Framework introduction (30 min)" width="480">
|
|
</a>
|
|
</p>
|
|
<p align="center">
|
|
<a href="https://www.youtube.com/watch?v=AAgdMhftj8w">
|
|
Watch the full Agent Framework introduction (30 min)
|
|
</a>
|
|
</p>
|
|
|
|
## 📋 Getting Started
|
|
|
|
**Quick Installation:**
|
|
|
|
- **Python**: `pip install agent-framework`
|
|
- **.NET**: `dotnet add package Microsoft.Agents.AI`
|
|
|
|
**Getting started documentation:**
|
|
|
|
- **[Quick Start Guide](https://learn.microsoft.com/agent-framework/tutorials/quick-start)** - Simple getting started instructions
|
|
- **[Tutorials](https://learn.microsoft.com/agent-framework/tutorials/overview)** - Step by step tutorials
|
|
|
|
### ✨ **Highlights**
|
|
|
|
- **Graph-based Workflows**: Connect agents and deterministic functions using data flows with streaming, checkpointing, human-in-the-loop, and time-travel capabilities
|
|
- [Python workflows](./python/samples/getting_started/workflow/) | [.NET workflows](./dotnet/samples/GettingStarted/Workflows/)
|
|
- **AF Labs**: Experimental packages for cutting-edge features including benchmarking, reinforcement learning, and research initiatives
|
|
- [Labs directory](./python/packages/lab/)
|
|
- **DevUI**: Interactive developer UI for agent development, testing, and debugging workflows
|
|
- [DevUI package](./python/packages/devui/)
|
|
|
|
<p align="center">
|
|
<a href="https://www.youtube.com/watch?v=mOAaGY4WPvc">
|
|
<img src="https://img.youtube.com/vi/mOAaGY4WPvc/hqdefault.jpg" alt="See the DevUI in action" width="480">
|
|
</a>
|
|
</p>
|
|
<p align="center">
|
|
<a href="https://www.youtube.com/watch?v=mOAaGY4WPvc">
|
|
See the DevUI in action (1 min)
|
|
</a>
|
|
</p>
|
|
|
|
- **Python and C#/.NET Support**: Full framework support for both Python and C#/.NET implementations with consistent APIs
|
|
- [Python packages](./python/packages/) | [.NET source](./dotnet/src/)
|
|
- **Observability**: Built-in OpenTelemetry integration for distributed tracing, monitoring, and debugging
|
|
- [Python observability](./python/samples/getting_started/workflow/observability/) | [.NET telemetry](./dotnet/samples/GettingStarted/AgentOpenTelemetry/)
|
|
- **Multiple Agent Provider Support**: Support for various LLM providers with more being added continuously
|
|
- [Python examples](./python/samples/getting_started/agents/) | [.NET examples](./dotnet/samples/GettingStarted/AgentProviders/)
|
|
- **Middleware**: Flexible middleware system for request/response processing, exception handling, and custom pipelines
|
|
- [Python middleware](./python/samples/getting_started/middleware/) | [.NET middleware](./dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/)
|
|
|
|
### 💬 **We want your feedback!**
|
|
|
|
- For bugs, please file a [GitHub issue](https://github.com/microsoft/agent-framework/issues).
|
|
|
|
## Quickstart
|
|
|
|
### Basic Agent - Python
|
|
|
|
Create a simple Azure Responses Agent that writes a haiku about the Microsoft Agent Framework
|
|
|
|
```python
|
|
import asyncio
|
|
from agent_framework.azure import AzureOpenAIResponsesClient
|
|
from azure.identity import AzureCliCredential
|
|
|
|
async def main():
|
|
# Initialize a chat agent with basic instructions
|
|
agent = AzureOpenAIResponsesClient(credential=AzureCliCredential()).create_agent(
|
|
name="HaikuBot",
|
|
instructions="You are an upbeat assistant that writes beautifully.",
|
|
)
|
|
|
|
print(await agent.run("Write a haiku about Microsoft Agent Framework."))
|
|
|
|
asyncio.run(main())
|
|
```
|
|
|
|
### Basic Agent - .NET
|
|
|
|
```c#
|
|
using System;
|
|
using Azure.AI.OpenAI;
|
|
using Azure.Identity;
|
|
using Microsoft.Agents.AI;
|
|
|
|
var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!;
|
|
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME")!;
|
|
|
|
var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
|
|
.GetOpenAIResponseClient(deploymentName)
|
|
.CreateAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
|
|
|
|
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
|
|
```
|
|
|
|
## More Examples & Samples
|
|
|
|
### Python
|
|
|
|
- [Getting Started with Agents](./python/samples/getting_started/agents): basic agent creation and tool usage
|
|
- [Chat Client Examples](./python/samples/getting_started/chat_client): direct chat client usage patterns
|
|
- [Getting Started with Workflows](./python/samples/getting_started/workflows): basic workflow creation and integration with agents
|
|
|
|
### .NET
|
|
|
|
- [Getting Started with Agents](./dotnet/samples/GettingStarted/Agents): basic agent creation and tool usage
|
|
- [Agent Provider Samples](./dotnet/samples/GettingStarted/AgentProviders): samples showing different agent providers
|
|
- [Workflow Samples](./dotnet/samples/GettingStarted/Workflows): advanced multi-agent patterns and workflow orchestration
|
|
|
|
## Agent Framework Documentation
|
|
|
|
- [Documentation](https://learn.microsoft.com/agent-framework/)
|
|
- [Agent Framework Repository](https://github.com/microsoft/agent-framework)
|
|
- [Design Documents](./docs/design)
|
|
- [Architectural Decision Records](./docs/decisions)
|
|
- [MSFT Learn Docs](https://learn.microsoft.com/agent-framework/overview/agent-framework-overview)
|