マイクロソフトのエージェント・フレームワークを用いた自律型 AI システムの構築
Microsoft は 2025 年 10 月に Semantic Kernel と AutoGen を統合した「Agent Framework」をリリースし、AI エージェント開発における安全性の実証的評価と生産環境向け統制機能を強化した。
キーポイント
フレームワークの統合と新機能
2025 年 10 月にリリースされた Microsoft Agent Framework は、Semantic Kernel と AutoGen を統合し、Microsoft Foundry プラットフォーム上で観測可能性や安全性設定などのエンタープライズ級制御を提供する。
安全性の定量的評価アプローチ
開発プロセスにおいて安全性を後付けではなく最優先とし、ガードレールあり・なしの 2 つのモデルインスタンスで同一プロンプトを実行し、応答とレイテンシを並列比較する手法を推奨している。
実証的なリスク可視化
爆発物の作り方などの挑発的プロンプトを用いて、安全設定が有効な場合の拒否応答と無効な場合の危険応答を即座に確認できるツールを実装し、理論ではなく実際の挙動に基づいた判断を可能にする。
コミュニティ主導の開発支援
Boston Azure AI Group が主催する「Agent Framework Dev Day」などを通じ、開発者向けの実践的なトレーニング教材を提供し、現場適用可能なパターンを共有している。
安全性を定量的な比較問題として扱う
安全対策を後付けではなく、開発の初期段階で「ガードレールあり」と「なし」のモデルを同時に実行し、応答内容とレイテンシを並列表示することで実証するアプローチが推奨されます。
コンプライアンス要件に基づく多角的なテスト
暴言フィルタ、政府発行ID(SSN)、個人情報(PII)といった具体的な入力カテゴリに対して両モデルの挙動を比較し、ガードレールの有効範囲と隙間を可視化します。
安全性は構成可能なスペクトルである
安全対策は単なるオンオフスイッチではなく、アプリケーションの文脈に応じてレイテンシやリスク許容度とのトレードオフを考慮して調整される設定可能なパラメータとして捉えるべきです。
影響分析・編集コメントを表示
影響分析
この記事は、AI エージェント開発のライフサイクルにおいて、従来の「機能重視」から「安全性と運用性重視」へのパラダイムシフトを示唆しています。特に、セキュリティリスクを理論ではなく実データで可視化するアプローチは、企業による AI 導入の障壁を下げる重要な指針となります。Microsoft の戦略が業界標準となることで、開発者のワークフローやガバナンス体制に大きな影響を与える可能性があります。
編集コメント
「安全性を後付けではなく最優先事項とする」という提言は、生成 AI の実社会展開において極めて重要な視点です。特に、安全設定の有無による挙動の違いを実機で即座に比較できる手法は、開発現場の品質保証プロセスを革新する可能性があります。
image**
画像提供:編集者
# イントロダクション
Agent Framework Dev Project は、現代的なフレームワークとツールを活用して AI エージェントを構築するための、実践的で開発者向けのトレーニング教材を提供するコミュニティ主導のイニシアチブです。このプロジェクトはボストン Azure AI グループが主催し、Microsoft がスポンサーを務める「Agent Framework Dev Day」を開催しています。2025 年 10 月にリリースされた Microsoft Agent Framework は、Semantic Kernel と AutoGen を統合し、本番環境向けのエージェントシステム構築のための統一されたアプローチを実現します。これに Microsoft Foundry** プラットフォームを組み合わせることで、コアフレームワークの上に観測性(observability)、安全設定、およびエンタープライズグレードの運用制御を提供します。このフレームワークの Python コンテンツを通じて取り組むと、4 つの相互に関連する技術領域が明らかになります。これらはそれぞれ直前の領域に直接依存して構築され、実稼働システムに適用可能なパターンに基づいています。
# 安全性を経験的測定問題として扱う
**
ほとんどのアジェンティック(自律型)チュートリアルでは、安全性は脚注扱いされています。より良い出発点は、アジェンティックロジックを一行も書かずに、まず開発者が目にするものとして、そして測定するものとして安全性を設定することです。これにより、防護されていないモデルが実際に何を行うのかという現実的な理解に基づいて、残りの作業の基盤を築くことができます。
そのためのツールは、二つのモデルを比較するランナーです。同じプロンプトを同時に gpt-4.1-mini のデプロイされた 2 つのインスタンスに送信します。一方には Microsoft Foundry の安全性ガードレールが有効化されており、他方はこれらのガードレールが制限されています。結果はターミナル上で並列表示され、各モデルの応答テキストとレイテンシ(応答遅延時間)が含まれるため、2 つのデプロイ間の行動の違いを理論的なものとして片付けることは不可能になります。
デフォルトのプロンプトは意図的に挑発的です:家庭用爆弾の作り方に関する指示を求めるものです。ガードレールが有効なモデルは拒否します。一方、ガードレールが制限されたモデルは拒否しないかもしれません。両方の応答は、同じインターフェース上で、同じハードウェアで、同時に表示されます。対比は即座に、かつ具体的であり、仮説的なものではありません。
そこから比較は、調査する価値のある 3 つの入力カテゴリに広がります:
- Microsoft Foundry のキュレーション済みブロックリストによってフィルタリング可能な卑猥語
- 社会保障番号(SSN)などの政府発行の識別子
- その他個人を特定できる情報(PII)
それぞれは、企業コンプライアンスにおける現実的な懸念クラスに対応しており、それぞれのケースで 2 つのデプロイ間に観察可能な違いが生じます。これにより、開発者はガードレールがどこで機能し、どこにギャップが残っているのかを直接的に把握することができます。
**
ここでは遅延(レイテンシ)にも注意を払う必要があります。単にレスポンスの内容だけでなく、安全性のガードレールが導入されることで生じる測定可能なオーバーヘッドがあり、このトレードオフは仮定で片付けるのではなく定量化する価値があります。2 つの極端な設定の間でデフォルト設定で動作するモデルという第 3 のレジームは、安全性がバイナリな切り替えではなく、アプリケーションの文脈に基づいてエンジニアが積極的に調整可能な構成可能なスペクトラムであることを再確認させます。
使用されている基礎的なコードでは、各モデルに対してフレームワークの AzureAIClient を用いて短寿命のエージェントを起動し、asyncio.gather を通じて両方を実行し、タイミングデータとともにトークン数を表面化しています。アーキテクチャは意図的に最小限に抑えられています。目的はインフラストラクチャそのものではなく、比較にあります。
より広い教訓として、タスクを完了するエージェントと、現実世界の入力下で責任を持ってタスクを完了するエージェントは同じではありません。この違いを早期に理解することが、その後に続くすべてのアーキテクチャ上の意思決定を形作ります。
# モデルコンテキストプロトコル(Model Context Protocol)によるエージェントの世界への接続
モデルコンテキストプロトコル (MCP) は、AI エージェントが標準化されたプロトコルを通じてデータソースやツールに接続することを可能にするユニバーサルアダプターです。基盤となるサービスが変更されてもエージェントクライアント側に変更を必要としないため、進化するエンタープライズシステムと相互作用するエージェントを構築するための実用的な基盤となります。
このアーキテクチャには3つのコンポーネントがあります。ホストアプリケーション(AI エージェント)は MCP クライアントを介して 1 つ以上の MCP サーバーに接続し、各サーバーはツール、リソース、プロンプトを公開します。サーバーはローカルまたはリモートであり、どちらの場合でもクライアントコードを変更する必要がないため、エージェント層がインフラストラクチャの決定からきれいに分離された状態を保ちます。
主要なデプロイメントシナリオをカバーする 2 つの転送メカニズムがあります:
// STDIO 転送
STDIO 転送では、MCP サーバーがサブプロセスとして実行され、標準入力と出力を通じて通信します。これは、低レイテンシと緊密なプロセス結合が望ましいローカルツールや CLI 統合に適しています。
// HTTP/SSE 転送
HTTP/SSE 転送では、サーバーが Web サービスとして実行され、Server-Sent Events (SSE) を介して HTTP で通信します。これは、分散環境全体で複数のエージェントが同時に到達する必要があるクラウドサービスや共有ツールに適しています。
サポートチケットドメインにおける具体的な 4 コンポーネントの実装により、これらのパターンを具体的に理解することができます。mcp_local_server は STDIO を介して 4 つのツール(GetConfig, UpdateConfig, GetTicket, UpdateTicket)を公開します。mcp_remote_server はポート 5060 で動作する FastAPI REST API であり、適切なサービス層として同じチケットデータを管理しています。mcp_bridge はポート 5070 で動作し、HTTP/SSE と通常の HTTP 呼び出しを REST バックエンド間で変換します。mcp_agent_client はこれらすべてを同時に消費し、各サーバーからツールを動的に発見して、Azure OpenAI が期待する関数呼び出し形式に変換します。これらはすべて単一のエージェントセッション内で実現されます。
最も重要なエンタープライズへの影響を持つアーキテクチャ上の洞察は、既存の REST API を MCP ブリッジでラップする場合、バックエンドに何ら変更を加える必要がないという点です。HTTP エンドポイントを既に公開しているサービスであれば、そのサービスのコードに触れることなく AI エージェントからアクセス可能になります。これにより、大規模な既存 API 表面を持つ組織における統合コストが劇的に低下します。
ここで構築された完全なエージェントループは、ランタイムでのツール発見、動的関数変換、モデル呼び出し、ツールディスパッチ、そして結果をコンテキスト内に再取り込むという一連のプロセスを網羅しています。これらはすべて MCP SDK と Azure OpenAI を用いて第一原理から構築されており、各レイヤーがどのように接続されているかについて開発者に完全な理解をもたらします。
# ワークフローパターンのオーケストレーション:シーケンシャル、コンカレント、およびヒューマン・イン・ザ・ループ
**
ワークフローオーケストレーションとは、個々のエージェントが協調システムとして機能し始め、単一のモデル呼び出しではきれいに解決できないほど複雑な問題に対処できる段階を指します。
3 つのパターンすべてが同じ SupportTicket データモデルに基づいて動作しており、チケット ID、顧客名、件名、説明、優先度などのフィールドを保持しています。すべてのパターンで同一のドメインを使用するのは意図的な選択です:その目的は、本質的に異なる処理アーキテクチャを通じて同じデータが移動する様子を観察し、出力、レイテンシ、オペレーターが利用可能な制御面において何が変化するかを確認することにあります。
// シーケンシャルワークフロー
パスワードリセット後にログインできなくなった顧客からの高優先度チケットは、インテークから AI による分類ステップへ移行します。このステップでは問題が構造化された JSON で分類および要約され、その後応答生成ステップへと進みます。出力は、緊急性を認識し、具体的な次の手順を提供し、かつチケット番号を含んだ、顧客がそのまま使用できる完全な返信です。パイプライン全体は人間の介入なしで実行され、各ステップの出力は次のステップへ渡される前に可視化されるため、各段階でのデータ変換が明確かつ検証可能になります。
// 並列ワークフロー
1 つのメッセージ内で重複請求とアプリケーションのクラッシュの両方を報告する顧客は、逐次的な単一エージェント・パイプラインの限界を露呈します。請求に関する懸念と技術的な懸念には異なる専門知識が必要であり、これらを単一のエージェントにルーティングすると、より狭いドメイン内で深く推論できる専門家それぞれにルーティングした場合よりも結果が劣ります。
並行パターンは、この質問を請求担当のエージェントと技術担当のエージェントの両方に同時に展開します。請求担当エージェントは重複請求に対応し、返金経路を提案します。一方、技術担当エージェントはクラッシュするアプリケーションに対するキャッシュクリアと再インストールの手順に焦点を当てます。どちらのエージェントも両方のドメインを処理しようとはしません。集約された結果により、顧客には単一の専門家では決して生み出せなかった完全な回答が提供され、応答時間は 2 つのエージェントの合計ではなく、より遅い方のエージェントによって制限されます。
// Human-in-the-Loop Workflow
最もリスクの高いケースは、1 週間前に購入した年間プレミアム・サブスクリプションに対して全額返金を求める顧客の場合です。AI は、14 日間の返金保証ポリシーを正しく引用し、即時キャンセル処理を行うことを提案するドラフト応答を生成します。その後、実行が停止し、何かが送信される前に制御が明示的に人間レビューヤーに引き渡されます。
スーパーバイザーは完全なドラフトと、3 つの明示的な選択肢を受け取ります:そのまま承認して送信する、送信前に編集する、あるいは管理層にエスカレートするです。承認されると、システムはそのアクションを記録し、チケットのステータスを「解決済み」に更新し、変更なしでレスポンスが承認されたことをログに記録します。これにより、意思決定の完全な監査証跡が作成されます。
このパターンを実行することで具体化されるのは、ワークフロー図がしばしば隠蔽してしまうものです:人間をループに組み込むための一時停止は、失敗モードや例外パスではありません。それは設計された、第一級のワークフロー上の停止点です。システムはポーリングやタイムアウトなしでこれを待ちます。これが、規制の厳しい環境や高リスクな環境において AI 支援プロセスを監査可能かつ防御可能にするパターンであり、最終的な代替手段としてではなく、完全自動化された代替案と同等の地位を持つものとして扱われるべきです。
各パターンを深掘りすることで理解はさらに深まります。逐次パイプライン内で分類の前に感情分析エージェントを追加する、並列ファンアウトにセキュリティまたはアカウント専門家を追加する、人間をループに組み込むステップに「情報の要求」のような新しいスーパーバイザーアクションを追加する、そして逐次パターンと並列パターンを組み合わせて単一のハイブリッドワークフローに構成する—all これらは、エグゼキュータークラス、共有クライアントファクトリ、データモデルがシステム全体でどのように接続されているかを理解することを必要とします。
# RAG から Agentic RAG へ
標準的な検索拡張生成(RAG)アプリケーションは始めやすい一方で、単純な検索では扱いにくい質問タイプに直面し、これらの制限は実ユーザーがシステムと対話し始めるや否やすぐに表面化します。はい/いいえの質問、数え上げクエリ、多段推論はすべて、単一の埋め込みルックアップパイプラインの仮定を圧迫し、それがプロダクション環境ですぐに顕在化するようになります。
この問題への取り組みは4つの段階を経て進みます:取り込み(ingestion)、単純な RAG、高度な RAG、そしてエージェント型 RAG です。この順序付けには意図があります。素朴な検索の制限を先に経験しておくことで、より単純なアプローチにおけるギャップが解決策を導入する前にすでに可視化されているため、エージェント型検索へのアーキテクチャ上の転換は抽象的なものではなく、意味のあるものとなります。
本ソリューションは、Microsoft Agent Framework を使用し、Handoff ワークフローオーケストレーションパターンを採用しています。これにより、特定の検索機能を担う専門エージェントが構築され、その基盤には Azure AI Search が提供されています。Handoff パターンは、すべての質問を単一の検索パイプラインに流すのではなく、クエリを最も適切な専門エージェントへルーティングします。これにより、各エージェントは自身が担当するクエリタイプに対して最適化することが可能になります。
実装は 4 つのステップで構成されています:初期セットアップ、Yes/No 検索用エージェント、Count 検索用エージェント、そして残りの専門エージェントです。それぞれのエージェントがシステム全体に新たな検索機能を追加していきます。
標準的な RAG(Retrieval-Augmented Generation)からのアーキテクチャ上の転換は大きく、明確に述べる価値があります。単一の検索パイプラインがすべてのクエリタイプを同じ戦略で処理するのではなく、オーケストレーターが異なる検索アプローチに特化したエージェントへ指示を出します。ここで Azure AI Search は、すべての専門エージェントが参照する共有知識のバックボーンとして機能します。
その結果、標準的な RAG アプリケーションでは対応が難しい幅広い種類の質問に応答できるシステムが構築されます。これには、単に取得した結果を返すだけでなく、取得された結果に対して推論を行う必要がある質問も含まれます。
# なぜこれら 4 つのトピックが一緒に扱われるべきかの理解
**
この進歩は、本番環境対応型のエージェント開発に実際に何が必要かという一貫した見方を反映しており、トピックが現れる順序も偶然ではありません。安全性が最優先されるのは、それがエージェントの文脈における「動作するコード」の意味を再定義し、能力と責任ある行動が別々の性質であり、それぞれ独立して測定されなければならないことを最初から確立するためです。MCP は、エージェントが外部ツールやサービスと標準化された相互運用可能な方法でどのように通信するかを確立します — 既存の API をバックエンドの変更なしにブリッジできるという洞察を含み、これによりエージェントを実用的な本番環境システムに接続することが可能になり、目的別に作られた玩具のようなバックエンドに限定されなくなります。ワークフローパターンは、複数のエージェントがどのように協調し、特にいつ人間のために一時停止するかを確立し、重大な設定で展開するに十分な信頼性を持つエージェントシステムを実現するための制御構造を導入します。アジェンティック RAG は、知識の検索が単純な参照を超えてスケーリングし、実際のユーザーが尋ねるあらゆる種類の質問に対応する方法を示し、このフレームワークに基づいて構築された本番環境向け知識システムの全体像を完成させます。
これら 4 つのドメインを合わせると、行動観察からアーキテクチャ構築、そしてシステム運用へと移行します。この進歩こそが、単なる動作するプロトタイプと展開可能なシステムを分けるものであり、各層を理解することで次の層を推論することが格段に容易になります。
Rachel Kuznetsov はビジネスアナリティクスの修士号を取得しており、複雑なデータパズルの解決や新たな挑戦への取り組みを生きがいとしています。彼女は難解なデータサイエンスの概念をより理解しやすくすることに取り組んでおり、AI が私たちの生活にどのような影響を与えるかについて多角的に探求しています。学びと成長のための継続的な旅路において、彼女は他の人々も一緒に学べるようその過程を記録しています。詳細は LinkedIn でご覧いただけます。
原文を表示

**
Image by Editor
# Introduction
The Agent Framework Dev Project is a community initiative providing hands-on, developer-focused training materials for building AI agents using modern frameworks and tooling, with its Agent Framework Dev Day hosted by the Boston Azure AI Group and sponsored by Microsoft. The Microsoft Agent Framework, released in October 2025, extends both Semantic Kernel and AutoGen into a unified approach for building production agentic systems. Paired with the Microsoft Foundry** platform, it provides observability, safety configuration, and enterprise-grade operational controls on top of the core framework. Working through the framework's Python content reveals four interconnected technical domains, each one building directly on the last, and each grounded in patterns that apply to real deployed systems.
# Treating Safety as an Empirical Measurement Problem
**
Most agentic tutorials treat safety as a footnote. The better starting point is to make safety the first thing a developer sees and measures before writing a single line of agentic logic, grounding the rest of the work in a realistic picture of what unguarded models actually do.
The tool for this is a dual-model comparison runner. The same prompt is sent concurrently to two deployed instances of gpt-4.1-mini: one with Microsoft Foundry safety guardrails enabled, one with those guardrails reduced. Results appear side-by-side in the terminal, including response text and latency for each model, making the behavioral difference between the two deployments impossible to dismiss as theoretical.
The default prompt is deliberately provocative: a request for instructions on making a homemade explosive. The guarded model refuses. The unguarded model may not. Both responses surface in the same interface, on the same hardware, at the same time. The contrast is immediate and concrete rather than hypothetical.
From there, the comparison opens to three input categories worth probing:
- Profanity filterable via curated blocklists in Microsoft Foundry
- Government identifiers such as Social Security Numbers (SSNs)
- Other personally identifiable information (PII)
Each maps to a real class of enterprise compliance concern, and each produces observable differences between the two deployments, giving developers a direct sense of where guardrails engage and where gaps remain.
Latency deserves attention here, not just response content. Safety guardrails introduce measurable overhead, and that tradeoff is worth quantifying rather than assuming away. A third regime — models running with default settings between the two extremes — reinforces that safety is a configurable spectrum rather than a binary toggle, one that engineers actively tune based on application context.
The underlying code uses the framework's AzureAIClient to spin up short-lived agents for each model, runs both via asyncio.gather, and surfaces token counts alongside timing data. The architecture is intentionally minimal. The point is the comparison, not the infrastructure surrounding it.
The broader lesson: an agent that completes a task is not the same as an agent that completes a task responsibly under real-world inputs, and understanding that difference early shapes every architectural decision that follows.
# Connecting Agents to the World with the Model Context Protocol
The Model Context Protocol** (MCP) is a universal adapter that allows AI agents to connect to data sources and tools through a standardized protocol, without requiring changes to the agent client when the underlying service changes, which makes it a practical foundation for building agents that interact with evolving enterprise systems.
The architecture has three components. A host application (the AI agent) connects through an MCP client to one or more MCP servers, each of which exposes tools, resources, and prompts. Servers can be local or remote, and the client code does not change to accommodate either, which keeps the agent layer cleanly decoupled from infrastructure decisions.
Two transport mechanisms cover the main deployment scenarios:
// STDIO Transport
STDIO transport runs the MCP server as a subprocess communicating through standard input and output. This suits local tools and CLI integrations where low latency and tight process coupling are desirable.
// HTTP/SSE Transport
HTTP/SSE transport runs the server as a web service communicating over HTTP with Server-Sent Events (SSE). This suits cloud services and shared tooling that multiple agents need to reach simultaneously across distributed environments.
A concrete four-component implementation on a support ticket domain makes these patterns tangible. The mcp_local_server exposes four tools via STDIO: GetConfig, UpdateConfig, GetTicket, and UpdateTicket. The mcp_remote_server is a FastAPI REST API running on port 5060 managing the same ticket data as a proper service layer. The mcp_bridge runs on port 5070 and translates between HTTP/SSE and ordinary HTTP calls to the REST backend. The mcp_agent_client consumes all of these simultaneously, discovering tools from each server dynamically and converting them into the function-calling format that Azure OpenAI expects, all within a single agent session.
The architectural insight with the most significant enterprise implications: wrapping an existing REST API with an MCP bridge requires no modification to the backend whatsoever. Any service already exposing HTTP endpoints becomes accessible to an AI agent without touching that service's own code, which dramatically lowers the integration cost for organizations with large existing API surfaces.
The full agentic loop built here covers tool discovery at runtime, dynamic function conversion, model invocation, tool dispatch, and result ingestion back into context, all constructed from first principles using the MCP SDK and Azure OpenAI, giving developers a complete picture of how each layer connects.
# Orchestrating Workflow Patterns: Sequential, Concurrent, and Human-in-the-Loop
**
Workflow orchestration is where individual agents start functioning as coordinated systems capable of handling problems too complex for any single model call to resolve cleanly on its own.
All three patterns operate on the same SupportTicket data model, carrying fields like ticket ID, customer name, subject, description, and priority. Using the same domain across all three patterns is deliberate: the goal is to watch identical data move through fundamentally different processing architectures and observe what changes about the output, the latency, and the control surface available to the operator.
// Sequential Workflow
A high-priority ticket from a customer unable to log in after a password reset moves from intake through an AI categorization step, which classifies and summarizes the issue in structured JSON, and then into a response generation step. The output is a complete, customer-ready reply that acknowledges urgency, offers concrete next steps, and includes the ticket number. The entire pipeline runs without human intervention, and each step's output is visible before it passes to the next, making the data transformation at each stage explicit and inspectable.
// Concurrent Workflow
A customer reporting both a duplicate charge and a crashing application in the same message exposes the limits of a sequential single-agent pipeline. Billing and technical concerns require different expertise, and routing both through a single agent produces a weaker result than routing each to a specialist who can reason deeply within a narrower domain.
The concurrent pattern fans the question out to a billing expert agent and a technical expert agent simultaneously. The billing agent addresses the duplicate charge and recommends a refund path. The technical agent focuses on cache clearing and reinstallation steps for the crashing application. Neither agent attempts to handle both domains. The aggregated result gives the customer a complete answer that no single specialist could have produced alone, and the response time is bounded by the slower of the two agents rather than their sum.
// Human-in-the-Loop Workflow
The highest-stakes case involves a customer requesting a full refund on an annual premium subscription purchased one week prior. The AI generates a draft response correctly invoking the 14-day money-back guarantee policy and offering to process cancellation immediately. Then execution stops, and control passes explicitly to a human reviewer before anything is sent.
The supervisor receives the full draft and three explicit choices: approve and send as written, edit before sending, or escalate to management. On approval, the system records the action, updates the ticket status to resolved, and logs that the response was approved without modification, creating a complete audit trail of the decision.
What running this pattern makes concrete is something workflow diagrams tend to obscure: the human-in-the-loop pause is not a failure mode or an exception path. It is a designed, first-class stop in the workflow. The system waits for it without polling or timeout. This is the pattern that makes AI-assisted processes auditable and defensible in regulated or high-stakes environments, and it deserves to be treated as a peer to the fully automated alternatives rather than a fallback of last resort.
Extending each pattern deepens the understanding considerably. Adding a sentiment analysis agent before categorization in the sequential pipeline, adding a security or account specialist to the concurrent fan-out, adding new supervisor actions like "Request More Info" to the human-in-the-loop step, and composing sequential and concurrent patterns into a single hybrid workflow all require understanding how the executor classes, shared client factory, and data models connect across the full system.
# Moving from RAG to Agentic RAG
Standard retrieval-augmented generation (RAG) applications are straightforward to get started with but encounter question types that basic retrieval handles poorly, and those limitations tend to surface quickly once real users start interacting with the system. Yes/no questions, counting queries, and multi-hop reasoning all stress the assumptions of a single embedding-lookup pipeline in ways that become immediately visible in production.
The progression through this problem moves across four stages: ingestion, simple RAG, advanced RAG, and agentic RAG. The sequencing is intentional. Encountering the limitations of naive retrieval first makes the architectural shift to agentic retrieval meaningful rather than abstract, because the gaps in the simpler approach are already visible before the solution is introduced.
The solution uses the Microsoft Agent Framework with a Handoff workflow orchestration pattern, writing specialized agents that perform specific search capabilities backed by Azure AI Search**. The Handoff pattern routes a query to the most appropriate specialist agent rather than sending every question through a single retrieval pipeline, which means each agent can be optimized for the query type it is designed to handle. Implementation covers four steps: initial setup, a yes/no search agent, a count search agent, and the remaining specialist agents, each one adding a new retrieval capability to the overall system.
The architectural shift from standard RAG is significant and worth making explicit. Rather than a single retrieval pipeline attempting to handle all query types with the same strategy, an orchestrator dispatches to agents specialized for different retrieval approaches, with Azure AI Search serving as the shared knowledge backbone that all specialist agents draw from. The result is a system capable of answering the full range of question types that standard RAG applications struggle with, including questions that require reasoning over retrieved results rather than simply returning them.
# Understanding Why These Four Topics Belong Together
**
The progression reflects a coherent view of what production-ready agentic development actually requires, and the order in which the topics appear is not arbitrary. Safety comes first because it reframes what working code means in an agentic context, establishing from the outset that capability and responsible behavior are separate properties that must be measured independently. MCP establishes how agents communicate with external tools and services in a standardized, interoperable way — including the insight that existing APIs can be bridged without any backend modification, which makes it practical to connect agents to real enterprise systems rather than purpose-built toy backends. Workflow patterns establish how multiple agents coordinate and, critically, when to pause for a human, introducing the control structures that make agentic systems trustworthy enough to deploy in consequential settings. Agentic RAG demonstrates how knowledge retrieval scales beyond simple lookup to handle the full range of question types real users ask, completing the picture of what a production knowledge system built on this framework looks like.
Taken together, the four domains move from behavior observation to architecture construction to system operation. That progression is what separates a working prototype from a deployable system, and understanding each layer makes the next one considerably easier to reason about.
Rachel Kuznetsov** has a Master's in Business Analytics and thrives on tackling complex data puzzles and searching for fresh challenges to take on. She's committed to making intricate data science concepts easier to understand and is exploring the various ways AI makes an impact on our lives. On her continuous quest to learn and grow, she documents her journey so others can learn alongside her. You can find her on LinkedIn.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み