{"id":5165,"date":"2026-09-25T17:13:30","date_gmt":"2026-09-25T17:13:30","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/09\/25\/ag-ui-protocol-now-has-a-first-class-net-sdk\/"},"modified":"2026-09-25T17:13:30","modified_gmt":"2026-09-25T17:13:30","slug":"ag-ui-protocol-now-has-a-first-class-net-sdk","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/09\/25\/ag-ui-protocol-now-has-a-first-class-net-sdk\/","title":{"rendered":"AG-UI Protocol now has a first-class .NET SDK"},"content":{"rendered":"<p>The .NET team is pleased to announce that we\u2019ve contributed a <a href=\"https:\/\/docs.ag-ui.com\/sdk\/dotnet\/abstractions\/overview\">.NET SDK for AG-UI<\/a> in collaboration with <a href=\"https:\/\/www.copilotkit.ai\/\">CopilotKit<\/a>. The AG-UI .NET SDK lives in the <a href=\"https:\/\/github.com\/ag-ui-protocol\/ag-ui\/tree\/main\/sdks\/dotnet\">AG-UI repository<\/a> alongside the TypeScript and Python SDKs, published on NuGet under the MIT license. Any .NET service can now speak AG-UI directly. The Microsoft Agent Framework (MAF) AG-UI support for .NET is now based on the AG-UI .NET SDK.<\/p>\n<h2>What is AG-UI?<\/h2>\n<p>Agents break the traditional request-and-response paradigm. They are long-running, stream tokens as they work, delegate to subagents, and invoke tools mid-response. Without a shared protocol, each agent framework or service can expose a different streaming format, leaving application developers to parse chunks, track state, and map framework-specific events to UI. This creates boilerplate that you must maintain, and it can break whenever the event format shifts.<\/p>\n<p><a href=\"https:\/\/github.com\/ag-ui-protocol\/ag-ui\">AG-UI (Agent-User Interaction Protocol)<\/a> standardizes how agents communicate with user-facing applications.<\/p>\n<p><img data-opt-id=874167964  fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2026\/09\/ag-ui-dotnet-sdk.png\" alt=\"A .NET backend streams AG-UI events to a client application that renders them\" \/><\/p>\n<p>It streams the agent lifecycle as typed events, grouped into <a href=\"https:\/\/docs.ag-ui.com\/concepts\/events\">several categories<\/a>. The frontend listens for <code>RUN_STARTED<\/code>, <code>TEXT_MESSAGE_CONTENT<\/code>, <code>STATE_DELTA<\/code>, and the other events without caring which framework produced them. State events keep the agent, the app, and the user in sync. How those events are displayed is the client\u2019s choice, so the surface can be a web app, terminal, mobile app, or even a chat platform like Slack or Teams.<\/p>\n<p>The .NET SDK brings that capability to C#. A backend emits those events natively, and a client consumes them from an agent written in any supported language.<\/p>\n<h2>Quickstart<\/h2>\n<p>The SDK works in both directions. <code>AGUI.Server<\/code> turns an agent into an AG-UI endpoint, and <code>AGUI.Client<\/code> lets a .NET application consume one. The server and client support is built on a common set of AG-UI primitives.<\/p>\n<pre><code class=\"language-console\">dotnet add package AGUI.Server<\/code><\/pre>\n<p>Your agent is an <code>IChatClient<\/code>, the standard chat abstraction from <code>Microsoft.Extensions.AI<\/code>. Assuming your app defines a <code>CreateChatClient()<\/code> method that returns a configured <code>IChatClient<\/code>, register the client and the AG-UI serializer:<\/p>\n<pre><code class=\"language-csharp\">using AGUI.Abstractions;\nusing AGUI.Server;\nusing Microsoft.AspNetCore.Http.Json;\nusing Microsoft.Extensions.AI;\nusing Microsoft.Extensions.Options;\n\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.Services.AddSingleton(CreateChatClient());\nbuilder.Services.Configure&lt;JsonOptions&gt;(options =&gt;\n    options.SerializerOptions.TypeInfoResolverChain.Insert(\n        0,\n        AGUIJsonUtilities.DefaultTypeInfoResolver));\n\nvar app = builder.Build();\n\napp.MapPost(\"\/\", (\n    RunAgentInput input,\n    IChatClient chatClient,\n    IOptions&lt;JsonOptions&gt; jsonOptions,\n    CancellationToken cancellationToken) =&gt;\n{\n    var context = input.ToChatRequestContext(\n        jsonOptions.Value.SerializerOptions);\n\n    var events = chatClient\n        .GetStreamingResponseAsync(\n            context.Messages,\n            context.ChatOptions,\n            cancellationToken)\n        .AsAGUIEventStreamAsync(context, cancellationToken);\n\n    return TypedResults.ServerSentEvents(events);\n});\n\nawait app.RunAsync();<\/code><\/pre>\n<p><code>ToChatRequestContext<\/code> unpacks the incoming <code>RunAgentInput<\/code>, the protocol\u2019s request payload, into the messages and options your <code>IChatClient<\/code> expects.<\/p>\n<p><code>AsAGUIEventStreamAsync<\/code> turns the response stream back into protocol events. It emits <code>RUN_STARTED<\/code> and <code>RUN_FINISHED<\/code> around the run, closes open text and reasoning blocks before switching to a different message or tool call, and collapses multiple interrupts into a single terminal <code>RUN_FINISHED<\/code>.<\/p>\n<p>The SDK handles the protocol. The web server is yours, which is why Agent Framework\u2019s ASP.NET Core package wraps these same primitives as <code>AddAGUIServer()<\/code> and <code>MapAGUIServer()<\/code>.<\/p>\n<p>In Agent Framework, the same endpoint takes only a few lines. Given an existing <code>IChatClient<\/code> named <code>chatClient<\/code>, the following code creates and hosts the agent. Read the <a href=\"https:\/\/learn.microsoft.com\/agent-framework\/integrations\/by-component\/ui\/ag-ui\/getting-started\">full walkthrough on Microsoft Learn<\/a> for a complete server and client.<\/p>\n<pre><code class=\"language-console\">dotnet add package Microsoft.Agents.AI.Hosting.AGUI.AspNetCore --prerelease<\/code><\/pre>\n<pre><code class=\"language-csharp\">using Microsoft.Agents.AI;\nusing Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;\nusing Microsoft.Extensions.AI;\n\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.Services.AddAGUIServer();\n\nvar app = builder.Build();\n\nAIAgent agent = chatClient.AsAIAgent(\n    name: \"AGUIAssistant\",\n    instructions: \"You are a helpful assistant.\");\n\napp.MapAGUIServer(\"\/\", agent);\nawait app.RunAsync();<\/code><\/pre>\n<p><code>AGUI.Client<\/code> handles the other direction, connecting a .NET application to any AG-UI agent.<\/p>\n<pre><code class=\"language-console\">dotnet add package AGUI.Client<\/code><\/pre>\n<pre><code class=\"language-csharp\">using AGUI.Client;\n\nusing var httpClient = new HttpClient();\n\nvar chatClient = new AGUIChatClient(\n    new(httpClient, \"http:\/\/localhost:5001\"));<\/code><\/pre>\n<p><code>AGUIChatClient<\/code> is an <code>IChatClient<\/code>, so it works anywhere your code already takes an <code>IChatClient<\/code>. The agent on the other end can be written in Python, TypeScript, or C#, and your code does not change.<\/p>\n<p>Once your endpoint speaks AG-UI, any AG-UI client can drive it: a .NET application through <code>AGUI.Client<\/code>, or a React frontend through <a href=\"https:\/\/docs.copilotkit.ai\/ms-agent-dotnet\/quickstart\">CopilotKit<\/a>. The CopilotKit Interactive Dojo has <a href=\"https:\/\/dojo.showcase.copilotkit.ai\/?integration=ms-agent-dotnet&amp;demo=beautiful-chat\">running examples<\/a> against a .NET backend.<\/p>\n<p>The repository has <a href=\"https:\/\/github.com\/ag-ui-protocol\/ag-ui\/tree\/main\/sdks\/dotnet\/samples\/GettingStarted\">worked examples<\/a> for each part of the protocol. There is one client and server pair per step, covering chat, backend and frontend tools, human in the loop, shared state, reasoning, multimodal input, interrupts, parallel tool calls, protobuf, and telemetry.<\/p>\n<h2>Architecture<\/h2>\n<p>Here is how everything works together. A request arrives from any AG-UI client, the endpoint hands it to your agent in Microsoft Agent Framework or your own agent code, and the response streams back as protocol events while the agent calls your tools and the model.<\/p>\n<p><img data-opt-id=142703244  fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2026\/09\/ag-ui-protocol-events.png\" alt=\"An AG-UI client posts to an agent endpoint, which calls tools and a model before streaming events back\" \/><\/p>\n<h2>The packages<\/h2>\n<p>The SDK ships as five packages on NuGet: protocol types, wire formatters, protobuf support, an HTTP client, and a framework-agnostic server adapter built on <code>Microsoft.Extensions.AI<\/code>.<\/p>\n<table>\n<thead>\n<tr>\n<th>Package<\/th>\n<th>What it is<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/www.nuget.org\/packages\/AGUI.Abstractions\"><code>AGUI.Abstractions<\/code><\/a><\/td>\n<td>Protocol model: events, messages, tools, capabilities, interrupts, state, and the source-generated serializer<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.nuget.org\/packages\/AGUI.Formatting\"><code>AGUI.Formatting<\/code><\/a><\/td>\n<td>Wire format abstraction and the default Server-Sent Events implementation<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.nuget.org\/packages\/AGUI.Protobuf\"><code>AGUI.Protobuf<\/code><\/a><\/td>\n<td>Opt-in protobuf codec generated from the TypeScript <code>.proto<\/code> definitions. It covers a subset of event types. SSE is the default and carries all of them<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.nuget.org\/packages\/AGUI.Client\"><code>AGUI.Client<\/code><\/a><\/td>\n<td>Consumes AG-UI<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.nuget.org\/packages\/AGUI.Server\"><code>AGUI.Server<\/code><\/a><\/td>\n<td>Produces AG-UI<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The client and server packages pull in the abstractions they need, so most applications reference one of them.<\/p>\n<h2>What this means for Microsoft Agent Framework<\/h2>\n<p>Agent Framework, our SDK for building AI agents in .NET and Python, used to include its own implementation of the AG-UI protocol. It now depends on the <code>AGUI.*<\/code> packages from NuGet and keeps the ASP.NET Core integration that turns an agent into an endpoint.<\/p>\n<p>The protocol is maintained in the AG-UI C# SDK and stays wire-compatible with the TypeScript and Python SDKs. See the <a href=\"https:\/\/github.com\/microsoft\/agent-framework\/blob\/main\/dotnet\/src\/Microsoft.Agents.AI.AGUI\/README.md\">migration notice<\/a> for full details.<\/p>\n<p>For existing Agent Framework users, the programming model is unchanged, though a few APIs were renamed:<\/p>\n<table>\n<thead>\n<tr>\n<th>Before<\/th>\n<th>Now<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>AddAGUI()<\/code>, <code>MapAGUI()<\/code><\/td>\n<td><code>AddAGUIServer()<\/code>, <code>MapAGUIServer()<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>Microsoft.Agents.AI.AGUI<\/code> namespace<\/td>\n<td><code>AGUI.Client<\/code>, <code>AGUI.Server<\/code>, <code>AGUI.Abstractions<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>AGUIChatClient<\/code> positional constructor<\/td>\n<td>Options-based constructor<\/td>\n<\/tr>\n<tr>\n<td>Reading the originating request<\/td>\n<td><code>chatOptions.TryGetRunAgentInput(out RunAgentInput? agentInput)<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The event format is unchanged, so existing frontends keep working against an upgraded backend without changes of their own.<\/p>\n<h2>Why this matters<\/h2>\n<p><strong>Any .NET backend can speak the protocol.<\/strong> A worker service, internal API, or existing line-of-business application can expose an agent over AG-UI on its own. No agent framework is required.<\/p>\n<p><strong>One backend can serve many surfaces.<\/strong> The client decides how to render the events, so the same endpoint serves a web app, terminal, mobile client, or chat platform like Slack and Teams.<\/p>\n<p><strong>Your existing code remains the same.<\/strong> <code>IChatClient<\/code> is the only integration point. You can consume AG-UI from .NET Framework 4.7.2 and later, and expose an endpoint from current .NET.<\/p>\n<p><strong>Interoperate across languages.<\/strong> The shared wire protocol keeps the C#, TypeScript, and Python SDKs compatible, so a .NET backend can work with clients built using any of them.<\/p>\n<h2>Get started<\/h2>\n<p>The AG-UI .NET SDK provides one C# implementation of AG-UI, published on NuGet and usable from any .NET service. Agent Framework consumes it, and so can you.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ag-ui-protocol\/ag-ui\/tree\/main\/sdks\/dotnet\">AG-UI .NET SDK source and samples<\/a><\/li>\n<li><a href=\"https:\/\/docs.ag-ui.com\/\">AG-UI documentation<\/a><\/li>\n<li><a href=\"https:\/\/www.copilotkit.ai\/blog\/agui-dotnet-sdk\">CopilotKit\u2019s AG-UI .NET SDK post<\/a><\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/agent-framework\/integrations\/by-component\/ui\/ag-ui\/\">Agent Framework AG-UI documentation on Microsoft Learn<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/agent-framework\/blob\/main\/dotnet\/src\/Microsoft.Agents.AI.AGUI\/README.md\">Microsoft Agent Framework migration notes<\/a><\/li>\n<\/ul>\n<p>Questions and feedback about the SDK are welcome in the <a href=\"https:\/\/github.com\/ag-ui-protocol\/ag-ui\">AG-UI repository<\/a>. For MAF integration questions, use the <a href=\"https:\/\/github.com\/microsoft\/agent-framework\/discussions\">Microsoft Agent Framework discussion boards<\/a>.<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/ag-ui-dotnet-sdk\/\">AG-UI Protocol now has a first-class .NET SDK<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>The .NET team is pleased to announce that we\u2019ve contributed a .NET SDK for AG-UI in collaboration with CopilotKit. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5166,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-5165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/5165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=5165"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/5165\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media\/5166"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=5165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=5165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=5165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}