Microsoft、エージェントのオーケストレーションをコードから分離
本文の状態
日本語全文を表示中
詳細モードで約6分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Microsoft Agent Framework
Microsoft はマルチエージェントアプリケーションのオーケストレーションをコードから分離し、YAML で定義する宣言型ワークフロー 1.0 を Python と .NET の Agent Framework SDK に正式に導入した。
AI深層分析を開く2026年8月4日 17:22
AI深層分析
キーポイント
コードとオーケストレーションの分離
従来のようにフローをアプリケーションコード内に記述するのではなく、YAML ファイルでエージェントの連携や分岐ロジックを明示的に定義することで、レビューやバージョン管理を容易にする。
マルチプラットフォーム対応の 1.0 リリース
Python の agent-framework-declarative パッケージと .NET の Microsoft.Agents.AI.Workflows.Declarative パッケージの両方で宣言型ワークフローが正式にバージョン 1.0 に到達した。
非技術者によるレビューの実現
ワークフローをコード呼び出しグラフではなく文書として扱うため、製品オーナーやソリューションアーキテクトがフレームワークのコードを読まずに動作を確認できる。
ランタイムでの互換性維持
宣言型で定義されたワークフローも、従来のコードファースト方式と同じ Workflow タイプとして読み込まれ、実行やストリーミング、組み合わせにおいて何ら制限がない。
YAML を使用した宣言的ワークフローの定義
コードではなくデータとしてオーケストレーションを定義し、YAML で記述して設定ファイルのようにレビューおよびバージョン管理できる。
重要な引用
Most multi-agent apps wire every flow in application code: the sequence of steps, branching, and handoffs between agents all live inside the program, making the orchestration harder to review, version, and change.
Declarative workflows separate orchestration from application logic, and that separation pays off well beyond cleaner code.
Updating an approval step, adding a new agent handoff, or changing branching logic often becomes a YAML change rather than a code change; something you can diff, review, and ship on its own.
Declarative workflows give you a way to define orchestration as data rather than code.
編集コメントを表示
編集コメント
マルチエージェントアプリケーションの複雑さが顕在化する中、コードからオーケストレーションを分離する宣言型アプローチは実用化の重要な転換点となる。特に非技術ステークホルダーが直接関与できる点は、大規模な AI システム導入におけるボトルネック解消に寄与するだろう。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
マルチエージェントアプリケーションの多くは、ステップシーケンスや分岐、エージェント間のハンドオフなど、すべてのフローをアプリケーションコード内に記述しています。これにより、オーケストレーションの見直し、バージョン管理、変更が困難になっています。
宣言型ワークフローはこのオーケストレーションを明確にします。YAML で、エージェントの調整方法、状態の変化、実行の分岐点、そして人間の介入タイミングを定義できます。Agent Framework はこの定義を読み込み、コードで実行・ストリーミング・組み合わせ可能な標準的なワークフローとして提供します。
本日、宣言型ワークフローが Agent Framework SDK 両方でバージョン 1.0 に到達しました。Python の agent-framework-declarative パッケージが 1.0.0 となり、すでに安定している .NET の Microsoft.Agents.AI.Workflows.Declarative パッケージに加わりました。
なぜチームは宣言型ワークフローを選ぶのか
宣言型ワークフローはオーケストレーションとアプリケーションロジックを分離します。この分離はコードの整理以上の価値をもたらします。ワークフローが呼び出しグラフではなく文書であるため、プロダクトオーナー、ソリューションアーキテクト、開発者はフレームワークコードを読むことなく、ワークフローの動作を確認できます。承認ステップの更新や新しいエージェントハンドオフの追加、分岐ロジックの変更は、多くの場合 YAML の変更として行われます。これは独自に差分比較・レビューし、リリースできる変更です。
実行時に何も失われません。宣言型ワークフローもコードファーストのものと同じ Workflow タイプに読み込まれるため、実行・ストリーミング・組み合わせの動作は全く同じです。
YAML で記述し、通常のワークフローとして実行
サポートデスクを例に考えてみましょう。着信した問い合わせを適切な専門家に振り分ける仕組みです。このオーケストレーション全体は、読みやすい短いステップのリストで表現できます。
まずトライアージエージェントが問い合わせを分類し、条件に応じて請求、営業、またはサポート担当者にルーティングします。
kind: Workflow
trigger:
kind: OnConversationStart
id: support_router
actions:
# A triage agent classifies the incoming request.
- kind: InvokeAzureAgent
id: triage
conversationId: =System.ConversationId
agent:
name: TriageAgent
output:
responseObject: Local.Triage
# Route to the specialist that matches the category.
- kind: If
id: route
condition: =Local.Triage.Category = "Billing"
then:
- kind: InvokeAzureAgent
id: billing
agent:
name: BillingAgent
else:
- kind: If
condition: =Local.Triage.Category = "Sales"
then:
- kind: InvokeAzureAgent
id: sales
agent:
name: SalesAgent
else:
- kind: InvokeAzureAgent
id: support
agent:
name: SupportAgent
ルーティングのロジックは、アプリケーションの制御フローではなく定義の中に記述されます。カテゴリを追加したりチェックの順序を変更したい場合でも、リストを編集するだけで済み、実行器の配線変更は不要です。
Python では WorkflowFactory を使用して YAML 定義を読み込み、Workflow インスタンスを作成します:
agent_framework.declarative モジュールから WorkflowFactory をインポートします。
from agent_framework.declarative import WorkflowFactory
factory = WorkflowFactory()
workflow = factory.create_workflow_from_yaml_path("support_router.yaml")このようにして作成された workflow は、標準的なワークフローです。他のどのワークフローと同様に、実行(run)、ストリーミング、または組み合わせ(compose)が可能です。
ここで参照されているエージェント(TriageAgent, BillingAgent など)は、Foundry プロジェクト内に定義されています。
.NET 環境では、DeclarativeWorkflowBuilder を使用してワークフロー定義を読み込み、Workflow インスタンスを作成します。
using Microsoft.Agents.AI.Workflows;
using Microsoft.Agents.AI.Workflows.Declarative;
// options にはエージェントプロバイダーと設定が含まれます。セットアップの詳細はサンプルを参照してください。
Workflow workflow = DeclarativeWorkflowBuilder.Build("CustomerSupport.yaml", options);
// ここから、他のワークフローと同様に `workflow` を実行またはストリーミングできます。上記のスニペットは、主にワークフロー定義の読み込み方法に焦点を当てています。チケット管理、エスカレーション処理、人間によるハンドオフを含む、このパターンを使用した完全な動作サンプルについては、Python と .NET の両方に対応した「カスタマーサポート」サンプルをご参照ください。
構築できること
上記のルーターワークフローは意図的に簡素化されていますが、同じビルディングブロックを用いて、本格的なマルチエージェント作業を構築できます。各機能には、リポジトリ内に実行可能なサンプルが用意されています:
- 状態と式: ワークフローの状態に値を保存し、Power Fx 式を使用して新しい値を計算します。例:=If(IsBlank(inputs.name), "World", inputs.name)(サンプルあり)。
- 制御フロー: 条件分岐、ループ、ジャンプを用いて、ワークフローの状態やエージェントの結果に基づいて処理を分岐させます(サンプルあり)。
エージェントの呼び出し:マーケティング向けに順次パイプラインを、カスタマーサポート向けに条件分岐ルートを組み合わせて、エージェントを呼び出して応答をルーティングします。
関数・MCP・HTTP ツール:ステップからアプリケーションコード(関数ツール、MCP、HTTP)を呼び出せます。
人間が介在するループ:入力を待つか承認を求め、担当者が回答したら処理を続行します(サンプル)。
チェックポイントと再開:ワークフローの状態を保存し、後で実行を再開できます(サンプル)。
宣言的定義は標準的な Workflow インスタンスとして読み込まれるため、コードファーストのワークフローと同様に実行・組み合わせが可能です。YAML が適している場合は YAML を使い、カスタム動作が必要な場合は低レベル API を利用します。
始め方
SDK 用のパッケージをインストールしてください:
pip install agent-framework-declarative
dotnet add package Microsoft.Agents.AI.Workflows.Declarative
主なポイント
宣言的ワークフローを使えば、オーケストレーションをコードではなくデータとして定義できます。YAML でワークフローを作成し、設定ファイルのようにレビューし、アプリケーションと一緒にバージョン管理し、コードファーストのワークフローと同じランタイムで実行します。1.0 が Python と .NET の両方で利用可能になったことで、チームに最適な作成スタイルを選びながら、本番環境向けのマルチエージェントオーケストレーションを確実構築できます。
ドキュメントと実行可能なサンプルを確認しましょう:
Docs: Declarative workflows overview
Python samples: python/samples/03-workflows/declarative
.NET samples: dotnet/samples/03-workflows/Declarative
コードで実装する代わりに、宣言型ワークフローを試してみてください。そして、あなたが構築した成果をぜひ見せてください。今後の機能や改善点についてアイデアがあれば、GitHub で Issue を作成してください。一緒に開発を進めていただき、ありがとうございます。
原文を表示
Most multi-agent apps wire every flow in application code: the sequence of steps, branching, and handoffs between agents all live inside the program, making the orchestration harder to review, version, and change.
Declarative workflows make that orchestration explicit. In YAML, you define how agents coordinate, how state changes, where execution branches, and when people step in. Agent Framework loads the definition into a standard workflow you can run, stream, and compose with code.
Today, declarative workflows reach 1.0 across both Agent Framework SDKs. Python’s agent-framework-declarative package is now 1.0.0, joining the already-stable .NET Microsoft.Agents.AI.Workflows.Declarative package.
Why teams choose declarative workflows
Declarative workflows separate orchestration from application logic, and that separation pays off well beyond cleaner code. Because the workflow is a document rather than a call graph, product owners, solution architects, and developers can review how a workflow behaves without reading framework code. Updating an approval step, adding a new agent handoff, or changing branching logic often becomes a YAML change rather than a code change; something you can diff, review, and ship on its own.
You give up nothing at runtime. A declarative workflow loads into the same Workflow type as a code-first one, so it runs, streams, and composes just the same.
Author in YAML, run as an ordinary workflow
Consider a support desk that routes each incoming request to the right specialist. The entire orchestration is a short, readable list of steps: a triage agent classifies the request, and a condition routes it to the billing, sales, or support agent.
kind: Workflow
trigger:
kind: OnConversationStart
id: support_router
actions:
# A triage agent classifies the incoming request.
- kind: InvokeAzureAgent
id: triage
conversationId: =System.ConversationId
agent:
name: TriageAgent
output:
responseObject: Local.Triage
# Route to the specialist that matches the category.
- kind: If
id: route
condition: =Local.Triage.Category = "Billing"
then:
- kind: InvokeAzureAgent
id: billing
agent:
name: BillingAgent
else:
- kind: If
condition: =Local.Triage.Category = "Sales"
then:
- kind: InvokeAzureAgent
id: sales
agent:
name: SalesAgent
else:
- kind: InvokeAzureAgent
id: support
agent:
name: SupportAgent
The routing lives in the definition, not in application control flow. To add a category or reorder the checks, you edit the list; no executors to rewire.
In Python, use WorkflowFactory to load the YAML definition and create a Workflow instance:
from agent_framework.declarative import WorkflowFactory
factory = WorkflowFactory()
workflow = factory.create_workflow_from_yaml_path("support_router.yaml")
workflow is a standard Workflow - run, stream or compose it like any other.
The agents it names (TriageAgent, BillingAgent, ...) live in your Foundry project.
In .NET, use DeclarativeWorkflowBuilder to load the workflow definition and create a Workflow instance:
using Microsoft.Agents.AI.Workflows;
using Microsoft.Agents.AI.Workflows.Declarative;
// options carries your agent provider and configuration; see the sample for setup.
Workflow workflow = DeclarativeWorkflowBuilder.Build<string>("CustomerSupport.yaml", options);
// From here, run or stream workflow like any other workflow.
These snippets focus on loading the workflow definition. For the full, runnable version of this pattern (with ticketing, escalation, and a human handoff); see the customer support sample (Python, .Net).
What you can build
The router workflow above is intentionally small, but the same building blocks carry real multi-agent work. Each capability has a runnable sample in the repository:
State and expressions: Store values in workflow state and compute new values with Power Fx expressions, such as =If(IsBlank(inputs.name), "World", inputs.name) (sample).
Control flow: Branch on workflow state or agent results using conditions, loops, and jumps (sample).
Agent invocation: Invoke agents and route their responses, from sequential pipelines (marketing) to conditional routing (customer support).
Function, MCP, and HTTP tools: Call application code (function tools, MCP, HTTP) from a step.
Human-in-the-loop: Pause for input or approval and continue when the person responds (sample).
Checkpoint and resume: Persist workflow state and resume execution later (sample).
Declarative definitions load as standard Workflow instances, so you can run and compose them with code-first workflows. Use YAML where it fits and the lower-level APIs when you need custom behavior.
Get started
Install the package for your SDK:
pip install agent-framework-declarative
dotnet add package Microsoft.Agents.AI.Workflows.Declarative
Key takeaways
Declarative workflows give you a way to define orchestration as data rather than code. Author workflows in YAML, review them like configuration, version them with your application, and execute them using the same runtime that powers code-first workflows. With 1.0 now available across Python and .NET, you can confidently build production multi-agent orchestrations while choosing the authoring style that best fits your team.
Explore the documentation and runnable samples:
Docs: Declarative workflows overview
Python samples: python/samples/03-workflows/declarative
.NET samples: dotnet/samples/03-workflows/Declarative
Try a declarative workflow for an orchestration you would otherwise implement in code, then show us what you build. If you have ideas for what should come next, open an issue on GitHub. Thanks for building with us.
The post Move Agent Orchestration/Workflows out of Code with Agent Framework Declarative Workflows 1.0 appeared first on Microsoft Agent Framework.
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み