Skip to content

Commit 4d71395

Browse files
authored
Merge pull request #792 from MicrosoftDocs/main
Merge main to live
2 parents f2ffe94 + 1b8141b commit 4d71395

46 files changed

Lines changed: 913 additions & 448 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent-framework/integrations/ag-ui/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,13 @@ The AG-UI server hosts your AI agent and exposes it via HTTP endpoints using Fas
387387
Install the necessary packages for the server:
388388

389389
```bash
390-
pip install agent-framework-ag-ui
390+
pip install agent-framework-ag-ui --pre
391391
```
392392

393393
Or using uv:
394394

395395
```bash
396-
uv pip install agent-framework-ag-ui
396+
uv pip install agent-framework-ag-ui --prerelease=allow
397397
```
398398

399399
This will automatically install `agent-framework-core`, `fastapi`, and `uvicorn` as dependencies.
@@ -425,7 +425,7 @@ if not deployment_name:
425425
chat_client = AzureOpenAIChatClient(
426426
credential=AzureCliCredential(),
427427
endpoint=endpoint,
428-
deployment_name=deployment_name,
428+
deployment_name=deployment_name,
429429
)
430430

431431
# Create the AI agent
@@ -488,7 +488,7 @@ The AG-UI package is already installed, which includes the `AGUIChatClient`:
488488

489489
```bash
490490
# Already installed with agent-framework-ag-ui
491-
pip install agent-framework-ag-ui
491+
pip install agent-framework-ag-ui --pre
492492
```
493493

494494
### Client Code
@@ -513,7 +513,7 @@ async def main():
513513

514514
# Create AG-UI chat client
515515
chat_client = AGUIChatClient(server_url=server_url)
516-
516+
517517
# Create agent with the chat client
518518
agent = ChatAgent(
519519
name="ClientAgent",

agent-framework/integrations/ag-ui/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The Agent Framework AG-UI integration supports all 7 AG-UI protocol features:
4848

4949
## Build agent UIs with CopilotKit
5050

51-
[CopilotKit](https://copilotkit.ai/) provides rich UI components for building agent user interfaces based on the standard AG-UI protocol. CopilotKit supports streaming chat interfaces, frontend & backend tool calling, human-in-the-loop interactions, generative UI, shared state, and much more. You can see a examples of the various agent UI scenarios that CopilotKit supports in the [AG-UI Dojo](https://dojo.ag-ui.com/microsoft-agent-framework-dotnet) sample application.
51+
[CopilotKit](https://copilotkit.ai/) provides rich UI components for building agent user interfaces based on the standard AG-UI protocol. CopilotKit supports streaming chat interfaces, frontend & backend tool calling, human-in-the-loop interactions, generative UI, shared state, and much more. You can see a examples of the various agent UI scenarios that CopilotKit supports in the [AG-UI Dojo](https://dojo.ag-ui.com/microsoft-agent-framework-dotnet) sample application.
5252

5353
CopilotKit helps you focus on your agent’s capabilities while delivering a polished user experience without reinventing the wheel.
5454
To learn more about getting started with Microsoft Agent Framework and CopilotKit, see the [Microsoft Agent Framework integration for CopilotKit](https://docs.copilotkit.ai/microsoft-agent-framework) documentation.
@@ -233,7 +233,7 @@ Understanding how Agent Framework concepts map to AG-UI helps you build effectiv
233233
Install the AG-UI integration package:
234234

235235
```bash
236-
pip install agent-framework-ag-ui
236+
pip install agent-framework-ag-ui --pre
237237
```
238238

239239
This installs both the core agent framework and AG-UI integration components.

agent-framework/integrations/ag-ui/state-management.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ agent = ChatAgent(
488488
chat_client=AzureOpenAIChatClient(
489489
credential=AzureCliCredential(),
490490
endpoint=endpoint,
491-
deployment_name=deployment_name,
491+
deployment_name=deployment_name,
492492
),
493493
tools=[update_recipe],
494494
)
@@ -614,7 +614,7 @@ async def main():
614614

615615
# Create AG-UI chat client
616616
chat_client = AGUIChatClient(server_url=server_url)
617-
617+
618618
# Wrap with ChatAgent for convenient API
619619
agent = ChatAgent(
620620
name="ClientAgent",
@@ -624,7 +624,7 @@ async def main():
624624

625625
# Get a thread for conversation continuity
626626
thread = agent.get_new_thread()
627-
627+
628628
# Track state locally
629629
state: dict[str, Any] = {}
630630

@@ -647,7 +647,7 @@ async def main():
647647
# Handle text content
648648
if update.text:
649649
print(update.text, end="", flush=True)
650-
650+
651651
# Handle state updates
652652
for content in update.contents:
653653
# STATE_SNAPSHOT events come as DataContent with application/json
@@ -656,7 +656,7 @@ async def main():
656656
state_data = json.loads(content.data.decode() if isinstance(content.data, bytes) else content.data)
657657
state = state_data
658658
print("\n[State Snapshot Received]")
659-
659+
660660
# STATE_DELTA events are handled similarly
661661
# Apply JSON Patch deltas to maintain state
662662
if hasattr(content, 'delta') and content.delta:
@@ -672,7 +672,7 @@ async def main():
672672

673673

674674
if __name__ == "__main__":
675-
# Install dependencies: pip install agent-framework-ag-ui jsonpatch
675+
# Install dependencies: pip install agent-framework-ag-ui jsonpatch --pre
676676
asyncio.run(main())
677677
```
678678

@@ -913,7 +913,7 @@ Always write the complete state, not just deltas:
913913
def update_recipe(recipe: Recipe) -> str:
914914
"""
915915
You MUST write the complete recipe with ALL fields.
916-
When modifying a recipe, include ALL existing ingredients and
916+
When modifying a recipe, include ALL existing ingredients and
917917
instructions plus your changes. NEVER delete existing data.
918918
"""
919919
return "Recipe updated."

agent-framework/migration-guide/from-autogen/index.md

Lines changed: 105 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: AutoGen to Microsoft Agent Framework Migration Guide
33
description: A comprehensive guide for migrating from AutoGen to the Microsoft Agent Framework Python SDK.
4-
author: ekzhu
4+
author: moonbox3
55
ms.topic: reference
6-
ms.author: ekzhu
6+
ms.author: evmattso
77
ms.date: 09/29/2025
88
ms.service: agent-framework
99
---
@@ -1195,85 +1195,134 @@ result = await team.run("Complex research and analysis task")
11951195
**Agent Framework Implementation:**
11961196

11971197
```python
1198+
from typing import cast
11981199
from agent_framework import (
1199-
MagenticBuilder, MagenticCallbackMode, WorkflowOutputEvent,
1200-
MagenticCallbackEvent, MagenticOrchestratorMessageEvent, MagenticAgentDeltaEvent
1200+
MAGENTIC_EVENT_TYPE_AGENT_DELTA,
1201+
MAGENTIC_EVENT_TYPE_ORCHESTRATOR,
1202+
AgentRunUpdateEvent,
1203+
ChatAgent,
1204+
ChatMessage,
1205+
MagenticBuilder,
1206+
WorkflowOutputEvent,
12011207
)
1208+
from agent_framework.openai import OpenAIChatClient
12021209

1203-
# Assume we have researcher, coder, and coordinator_client from previous examples
1204-
async def on_event(event: MagenticCallbackEvent) -> None:
1205-
if isinstance(event, MagenticOrchestratorMessageEvent):
1206-
print(f"[ORCHESTRATOR]: {event.message.text}")
1207-
elif isinstance(event, MagenticAgentDeltaEvent):
1208-
print(f"[{event.agent_id}]: {event.text}", end="")
1209-
1210-
workflow = (MagenticBuilder()
1211-
.participants(researcher=researcher, coder=coder)
1212-
.on_event(on_event, mode=MagenticCallbackMode.STREAMING)
1213-
.with_standard_manager(
1214-
chat_client=coordinator_client,
1215-
max_round_count=20,
1216-
max_stall_count=3,
1217-
max_reset_count=2
1218-
)
1219-
.build())
1210+
# Create a manager agent for orchestration
1211+
manager_agent = ChatAgent(
1212+
name="MagenticManager",
1213+
description="Orchestrator that coordinates the workflow",
1214+
instructions="You coordinate a team to complete complex tasks efficiently.",
1215+
chat_client=OpenAIChatClient(),
1216+
)
1217+
1218+
workflow = (
1219+
MagenticBuilder()
1220+
.participants(researcher=researcher, coder=coder)
1221+
.with_standard_manager(
1222+
agent=manager_agent,
1223+
max_round_count=20,
1224+
max_stall_count=3,
1225+
max_reset_count=2,
1226+
)
1227+
.build()
1228+
)
12201229

12211230
# Example usage (would be in async context)
12221231
async def magentic_example():
1232+
output: str | None = None
12231233
async for event in workflow.run_stream("Complex research task"):
1224-
if isinstance(event, WorkflowOutputEvent):
1225-
final_result = event.data
1234+
if isinstance(event, AgentRunUpdateEvent):
1235+
props = event.data.additional_properties if event.data else None
1236+
event_type = props.get("magentic_event_type") if props else None
1237+
1238+
if event_type == MAGENTIC_EVENT_TYPE_ORCHESTRATOR:
1239+
text = event.data.text if event.data else ""
1240+
print(f"[ORCHESTRATOR]: {text}")
1241+
elif event_type == MAGENTIC_EVENT_TYPE_AGENT_DELTA:
1242+
agent_id = props.get("agent_id", event.executor_id) if props else event.executor_id
1243+
if event.data and event.data.text:
1244+
print(f"[{agent_id}]: {event.data.text}", end="")
1245+
1246+
elif isinstance(event, WorkflowOutputEvent):
1247+
output_messages = cast(list[ChatMessage], event.data)
1248+
if output_messages:
1249+
output = output_messages[-1].text
12261250
```
12271251

12281252
**Agent Framework Customization Options:**
12291253

12301254
The Magentic workflow provides extensive customization options:
12311255

1232-
- **Manager configuration**: Custom orchestrator models and prompts
1256+
- **Manager configuration**: Use a ChatAgent with custom instructions and model settings
12331257
- **Round limits**: `max_round_count`, `max_stall_count`, `max_reset_count`
1234-
- **Event callbacks**: Real-time streaming with granular event filtering
1258+
- **Event streaming**: Use `AgentRunUpdateEvent` with `magentic_event_type` metadata
12351259
- **Agent specialization**: Custom instructions and tools per agent
1236-
- **Callback modes**: `STREAMING` for real-time updates or `BATCH` for final results
1237-
- **Human-in-the-loop planning**: Custom planner functions for interactive workflows
1260+
- **Human-in-the-loop**: Plan review, tool approval, and stall intervention
12381261

12391262
```python
12401263
# Advanced customization example with human-in-the-loop
1264+
from typing import cast
1265+
from agent_framework import (
1266+
MAGENTIC_EVENT_TYPE_AGENT_DELTA,
1267+
MAGENTIC_EVENT_TYPE_ORCHESTRATOR,
1268+
AgentRunUpdateEvent,
1269+
ChatAgent,
1270+
MagenticBuilder,
1271+
MagenticHumanInterventionDecision,
1272+
MagenticHumanInterventionKind,
1273+
MagenticHumanInterventionReply,
1274+
MagenticHumanInterventionRequest,
1275+
RequestInfoEvent,
1276+
WorkflowOutputEvent,
1277+
)
12411278
from agent_framework.openai import OpenAIChatClient
1242-
from agent_framework import MagenticBuilder, MagenticCallbackMode, MagenticPlannerContext
1243-
1244-
# Assume we have researcher_agent, coder_agent, analyst_agent, detailed_event_handler
1245-
# and get_human_input function defined elsewhere
1246-
1247-
async def custom_planner(context: MagenticPlannerContext) -> str:
1248-
"""Custom planner with human input for critical decisions."""
1249-
if context.round_count > 5:
1250-
# Request human input for complex decisions
1251-
return await get_human_input(f"Next action for: {context.current_state}")
1252-
return "Continue with automated planning"
1253-
1254-
workflow = (MagenticBuilder()
1255-
.participants(
1256-
researcher=researcher_agent,
1257-
coder=coder_agent,
1258-
analyst=analyst_agent
1259-
)
1260-
.with_standard_manager(
1261-
chat_client=OpenAIChatClient(model_id="gpt-5"),
1262-
max_round_count=15, # Limit total rounds
1263-
max_stall_count=2, # Prevent infinite loops
1264-
max_reset_count=1, # Allow one reset on failure
1265-
orchestrator_prompt="Custom orchestration instructions..."
1266-
)
1267-
.with_planner(custom_planner) # Human-in-the-loop planning
1268-
.on_event(detailed_event_handler, mode=MagenticCallbackMode.STREAMING)
1269-
.build())
1279+
1280+
# Create manager agent with custom configuration
1281+
manager_agent = ChatAgent(
1282+
name="MagenticManager",
1283+
description="Orchestrator for complex tasks",
1284+
instructions="Custom orchestration instructions...",
1285+
chat_client=OpenAIChatClient(model_id="gpt-4o"),
1286+
)
1287+
1288+
workflow = (
1289+
MagenticBuilder()
1290+
.participants(
1291+
researcher=researcher_agent,
1292+
coder=coder_agent,
1293+
analyst=analyst_agent,
1294+
)
1295+
.with_standard_manager(
1296+
agent=manager_agent,
1297+
max_round_count=15, # Limit total rounds
1298+
max_stall_count=2, # Trigger stall handling
1299+
max_reset_count=1, # Allow one reset on failure
1300+
)
1301+
.with_plan_review() # Enable human plan review
1302+
.with_human_input_on_stall() # Enable human intervention on stalls
1303+
.build()
1304+
)
1305+
1306+
# Handle human intervention requests during execution
1307+
async for event in workflow.run_stream("Complex task"):
1308+
if isinstance(event, RequestInfoEvent) and event.request_type is MagenticHumanInterventionRequest:
1309+
req = cast(MagenticHumanInterventionRequest, event.data)
1310+
if req.kind == MagenticHumanInterventionKind.PLAN_REVIEW:
1311+
# Review and approve the plan
1312+
reply = MagenticHumanInterventionReply(
1313+
decision=MagenticHumanInterventionDecision.APPROVE
1314+
)
1315+
async for ev in workflow.send_responses_streaming({event.request_id: reply}):
1316+
pass # Handle continuation
12701317
```
12711318

12721319
For detailed Magentic examples, see:
12731320

12741321
- [Basic Magentic Workflow](https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/workflows/orchestration/magentic.py) - Standard orchestrated multi-agent workflow
12751322
- [Magentic with Checkpointing](https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/workflows/orchestration/magentic_checkpoint.py) - Persistent orchestrated workflows
1276-
- [Magentic Human Plan Update](https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/workflows/orchestration/magentic_human_plan_update.py) - Human-in-the-loop planning
1323+
- [Magentic Human Plan Update](https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/workflows/orchestration/magentic_human_plan_update.py) - Human-in-the-loop plan review
1324+
- [Magentic Agent Clarification](https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/workflows/orchestration/magentic_agent_clarification.py) - Tool approval for agent clarification
1325+
- [Magentic Human Replan](https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/workflows/orchestration/magentic_human_replan.py) - Human intervention on stalls
12771326

12781327
#### Future Patterns
12791328

agent-framework/migration-guide/from-semantic-kernel/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ from semantic_kernel.agents import ChatCompletionAgent
321321
### Agent Framework
322322

323323
Agent Framework package is installed as `agent-framework` and imported as `agent_framework`.
324-
Agent Framework is built up differently, it has a core package `agent-framework-core` that contains the core functionality, and then there are multiple packages that rely on that core package, such as `agent-framework-azure-ai`, `agent-framework-mem0`, `agent-framework-copilotstudio`, etc. When you run `pip install agent-framework` it will install the core package and *all* packages, so that you can get started with all the features quickly. When you are ready to reduce the number of packages because you know what you need, you can install only the packages you need, so for instance if you only plan to use Azure AI Foundry and Mem0 you can install only those two packages: `pip install agent-framework-azure-ai agent-framework-mem0`, `agent-framework-core` is a dependency to those two, so will automatically be installed.
324+
Agent Framework is built up differently, it has a core package `agent-framework-core` that contains the core functionality, and then there are multiple packages that rely on that core package, such as `agent-framework-azure-ai`, `agent-framework-mem0`, `agent-framework-copilotstudio`, etc. When you run `pip install agent-framework --pre` it will install the core package and *all* packages, so that you can get started with all the features quickly. When you are ready to reduce the number of packages because you know what you need, you can install only the packages you need, so for instance if you only plan to use Azure AI Foundry and Mem0 you can install only those two packages: `pip install agent-framework-azure-ai agent-framework-mem0 --pre`, `agent-framework-core` is a dependency to those two, so will automatically be installed.
325325

326326
Even though the packages are split up, the imports are all from `agent_framework`, or it's modules. So for instance to import the client for Azure AI Foundry you would do:
327327

agent-framework/overview/agent-framework-overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Introduction to Microsoft Agent Framework
33
description: Learn about Microsoft Agent Framework
4-
author: ekzhu
4+
author: markwallace-microsoft
55
ms.topic: reference
6-
ms.author: ekzhu
6+
ms.author: markwallace
77
ms.date: 10/01/2025
88
ms.service: agent-framework
99
---
@@ -57,7 +57,7 @@ and the same is expected for Agent Framework. Microsoft Agent Framework welcomes
5757
Python:
5858

5959
```bash
60-
pip install agent-framework
60+
pip install agent-framework --pre
6161
```
6262

6363
.NET:

agent-framework/support/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Support for Agent Framework
33
description: Support for Agent Framework
44
author: TaoChenOSU
5-
ms.topic: conceptual
5+
ms.topic: article
66
ms.author: taochen
77
ms.date: 10/30/2025
88
ms.service: agent-framework
@@ -13,7 +13,7 @@ ms.service: agent-framework
1313

1414
| Your preference | What's available |
1515
|---|---|
16-
| Read the docs | [This learning site](/agent-framework/overview) is the home of the latest information for developers |
16+
| Read the docs | [This learning site](/agent-framework/) is the home of the latest information for developers |
1717
| Visit the repo | Our open-source [GitHub repository](https://github.com/microsoft/agent-framework) is available for perusal and suggestions |
1818
| Connect with the Agent Framework Team | Visit our [GitHub Discussions](https://github.com/microsoft/agent-framework/discussions) to get supported quickly with our [CoC](https://github.com/microsoft/agent-framework/blob/main/CODE_OF_CONDUCT.md) actively enforced |
19-
| Office Hours | We will be hosting regular office hours; the calendar invites and cadence are located here: [Community.MD](https://github.com/microsoft/agent-framework/blob/main/COMMUNITY.md) |
19+
| Office Hours | We will be hosting regular office hours; the calendar invites and cadence are located here: [Community.MD](https://github.com/microsoft/agent-framework/blob/main/COMMUNITY.md) |

agent-framework/tutorials/agents/enable-observability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ For prerequisites, see the [Create and run a simple agent](./run-agent.md) step
143143
To use Agent Framework with Azure OpenAI, you need to install the following packages. Agent Framework automatically includes all necessary OpenTelemetry dependencies:
144144

145145
```bash
146-
pip install agent-framework
146+
pip install agent-framework --pre
147147
```
148148

149149
The following OpenTelemetry packages are included by default:

agent-framework/tutorials/agents/run-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Before you begin, ensure you have the following prerequisites:
186186
To use Microsoft Agent Framework with Azure OpenAI, you need to install the following Python packages:
187187

188188
```bash
189-
pip install agent-framework
189+
pip install agent-framework --pre
190190
```
191191

192192
## Create the agent

0 commit comments

Comments
 (0)