microsoft-agent-framework
БесплатноБез исполняемых скриптовНе проверенMicrosoft Agent Framework is an open-source framework for building AI agents and multi-agent workflows in Python and .NET, the successor to Semantic Kernel…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Microsoft Agent Framework
Overview
Microsoft Agent Framework (MAF) builds production agents and graph-based multi-agent workflows in Python and .NET. It lives in its own repository, microsoft/agent-framework, and replaces the older Semantic Kernel agent classes (ChatCompletionAgent, AgentGroupChat, kernel_function) and AutoGen. Checked on 2026-10-24: PyPI agent-framework 1.23.0, agent-framework-orchestrations 1.4.0, NuGet Microsoft.Agents.AI 1.26.0. Imports and builders below were exercised in a clean virtualenv; calls to a model were not run (they need a key or a Foundry project).
Docs: https://learn.microsoft.com/agent-framework/ , migration guides: "from Semantic Kernel" and "from AutoGen" on the same site.
Instructions
Install
pip install agent-framework agent-framework-orchestrations # Python 3.10+
dotnet add package Microsoft.Agents.AI # .NET
An agent with a tool (Python)
An Agent is a chat client plus instructions and tools. Tools are plain functions decorated with @tool; approval_mode="never_require" runs them without asking, so use "always_require" for side effects. Clients live under agent_framework.openai (OpenAIChatClient) and agent_framework.foundry (FoundryChatClient, which authenticates with azure-identity, for example AzureCliCredential after az login).
# support_agent.py
import asyncio
import os
from typing import Annotated
from agent_framework import Agent, tool
from agent_framework.openai import OpenAIChatClient
@tool(approval_mode="never_require")
def get_order_status(order_id: Annotated[str, "Order number such as A-10492"]) -> str:
"""Look up the shipping status of an order."""
return f"Order {order_id} shipped on 2026-10-21."
agent = Agent(
client=OpenAIChatClient(model=os.environ["OPENAI_MODEL"]), # reads OPENAI_API_KEY
name="support",
instructions="Answer shipping questions using the tool.",
tools=[get_order_status],
)
print(asyncio.run(agent.run("Where is order A-10492?")))
With Foundry the client becomes FoundryChatClient(project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"], model=os.environ["FOUNDRY_MODEL"], credential=AzureCliCredential()).
Multi-agent orchestrations (Python)
Orchestrations are builders in agent_framework.orchestrations that return a Workflow; run it with await workflow.run(prompt) and read result.get_outputs().
# pipeline.py
from agent_framework.orchestrations import (
SequentialBuilder, ConcurrentBuilder, GroupChatBuilder, HandoffBuilder,
)
# Sequential: writer -> reviewer, the conversation is shared and each reply is appended
seq = SequentialBuilder(participants=[writer, reviewer], output_from="all").build()
# Concurrent: same prompt fanned out to all agents, results aggregated
par = ConcurrentBuilder(participants=[researcher, marketer, legal]).build()
# Group chat: a function (or an orchestrator agent) picks the next speaker
def round_robin(state): # GroupChatState
names = list(state.participants.keys())
return names[state.current_round % len(names)]
chat = GroupChatBuilder(participants=[expert, verifier, skeptic],
selection_func=round_robin, max_rounds=6).build()
# Handoff: mesh of agents that transfer control to each other (triage -> specialists)
hand = HandoffBuilder(participants=[triage, refunds, orders]).build()
Handoff workflows pause for user input between turns (HandoffAgentUserRequest events); see python/samples/03-workflows/orchestrations/ in the repository for the request/response loop. Workflows also support checkpointing (checkpoint_storage), streaming and human-in-the-loop requests.
A basic agent (.NET)
// Program.cs (dotnet add package Microsoft.Agents.AI.Foundry --prerelease; the package is preview-only on NuGet.
// also add Azure.AI.Projects and Azure.Identity)
using Azure.AI.Projects;
using Azure.Identity;
using Microsoft.Agents.AI;
string endpoint = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_ENDPOINT")
?? throw new InvalidOperationException("FOUNDRY_PROJECT_ENDPOINT is not set.");
string model = Environment.GetEnvironmentVariable("FOUNDRY_MODEL")
?? throw new InvalidOperationException("FOUNDRY_MODEL is not set.");
AIAgent agent = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
.AsAIAgent(model: model, instructions: "You are a support assistant.", name: "support");
Console.WriteLine(await agent.RunAsync("Summarize the refund policy in two sentences."));
Migrating from Semantic Kernel agents
| Semantic Kernel | Agent Framework |
|---|---|
ChatCompletionAgent(kernel=..., ...) |
Agent(client=..., instructions=..., tools=[...]) |
@kernel_function plugin classes |
@tool functions passed in tools= |
AgentGroupChat + selection/termination strategies |
SequentialBuilder, `GroupChatBuilder(selection_func=..., termination_co |
Установить microsoft-agent-framework в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл microsoft-agent-framework?
Microsoft Agent Framework is an open-source framework for building AI agents and multi-agent workflows in Python and .NET, the successor to Semantic Kernel agents and AutoGen. Use this skill when a user asks to build an agent with tools, run sequential, concurrent, handoff or group-chat orchestrations, host agents on Microsoft Foundry or OpenAI, or migrate from Semantic Kernel agents (AgentGroupChat) to Agent Framework.
Как установить скилл microsoft-agent-framework?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл microsoft-agent-framework запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic