[00:00:06] Hi everyone. Get excited cuz we're about [00:00:09] to build the future of agentic UI with [00:00:12] Blazor. I'm Daniel Roth. I'm the [00:00:15] principal product manager for ASP.NET [00:00:17] Core and Blazor on the .NET team. And in [00:00:19] this session, we're going to learn how [00:00:20] to add agentic capabilities to our .NET [00:00:23] apps. We're going to look at some things [00:00:25] that are still in preview, some things [00:00:27] that are a little experimental. We're [00:00:28] going to be using AI. I'm super excited [00:00:31] for you to try out these new features [00:00:33] and let us know what you think. [00:00:35] Now, many apps are loaded with features [00:00:39] and capabilities, and that's powerful. [00:00:42] But it can also make these apps, you [00:00:43] know, kind of complicated and difficult [00:00:45] to use. Sometimes finding the the right [00:00:48] feature that you need uh can feel harder [00:00:50] than actually completing the task [00:00:52] itself. You know, which menu should you [00:00:54] use? Which button do you press? Which [00:00:56] screen do you need? With apps like photo [00:00:58] editors, 3D design tools, office apps, [00:01:01] even IDEs, uh learning the application [00:01:05] is often a skill in its own right. Now, [00:01:08] AI provides a new way for users to [00:01:11] access all of that functionality. You [00:01:13] know, what if the users could start with [00:01:15] the outcome that they needed? What if [00:01:17] the app came with a a skilled and [00:01:20] helpful assistant for achieving that [00:01:22] outcome? [00:01:25] Well, that's the opportunity with [00:01:27] agentic apps. [00:01:28] Build that skilled assistant into the [00:01:31] application to help users unlock that [00:01:33] functionality and be more productive. [00:01:36] Users describe what they want to [00:01:37] accomplish. The agent then uses the [00:01:39] current context and the app's [00:01:41] capabilities to help do the work, not [00:01:44] just explain how to do it, you know, how [00:01:46] to tell you where the button is, but [00:01:47] actually do it for you. The existing UI [00:01:50] all uh stays available to the user so [00:01:52] they can inspect the results and make [00:01:54] precise edits. The person and the agent [00:01:57] uh can work together in the same [00:01:58] application, contributing to the task. [00:02:01] Now, collaborating with an agent [00:02:03] introduces all sorts of new uh UI and UX [00:02:06] challenges. You know, people need to be [00:02:08] able to express their goals naturally [00:02:10] through language, voice, or images. Uh [00:02:12] the agent needs tools to use the app's [00:02:15] capabilities and shared context uh to [00:02:18] work with the information the person [00:02:19] sees. [00:02:20] Users need to be able to follow the [00:02:22] agent's work, [00:02:24] uh inspect results, uh review proposed [00:02:26] changes, [00:02:28] and approve consequential actions. Uh [00:02:30] they also need a way to to stop or [00:02:32] interrupt interrupt the agent when [00:02:33] necessary. You know, basic chat provides [00:02:36] a flexible foundation for these types of [00:02:37] experiences, but rich agentic UI adds [00:02:40] visibility, it adds precision, and [00:02:42] control. All right, so let's let's take [00:02:44] a look and do a little teaser on what uh [00:02:46] an agentic user experience like this [00:02:48] could look like in our customer service [00:02:50] app. [00:02:51] So, over here, [00:02:54] and we [laughter] have our e-shop [00:02:55] customer service application, and uh we [00:02:58] have a customer that looks like they're [00:03:00] having some problems where they ordered [00:03:02] a new uh docking station and it seems to [00:03:05] be delayed, tracking has not changed for [00:03:07] 5 days and they're upset, so they opened [00:03:09] a a support ticket and our support [00:03:11] engineer is going to support service rep [00:03:12] is going to try to help them. Now, we [00:03:14] have all the you know the normal UI here [00:03:16] where we can see all the information [00:03:17] about the support ticket, we have UI [00:03:19] where we can you know offer to give them [00:03:21] a refund or a replacement and so forth. [00:03:24] But what we also have now is an an agent [00:03:28] that's sitting alongside us to help us [00:03:30] uh accomplish the task that we want to [00:03:32] be able to do. Okay, so we have this new [00:03:33] support ticket, you know normally the [00:03:35] support uh service rep would probably go [00:03:37] you know look at the the case activity [00:03:39] log, look at inventory, you know [00:03:41] understand the issue, collect all that [00:03:42] information, but instead of doing that, [00:03:44] let's just ask the agent to go [00:03:45] investigate this delayed delivery and [00:03:48] recommend uh solution. So, the agent has [00:03:50] tools that it can use to pull that uh [00:03:53] support case context all together and [00:03:55] let us know what it thinks about what [00:03:57] needs to be done next. So, it's pulled [00:03:58] the correct order, so that great. Says [00:04:01] there are yeah there's zero uh um uh uh [00:04:04] docking stations available for the model [00:04:06] that the user ordered, but there are 12 [00:04:08] compatible ones that we might be able to [00:04:10] um offer a replacement for. And in the [00:04:13] the the status here you can see it looks [00:04:14] like that something got delayed in the [00:04:16] Seattle uh hub. Below the agents [00:04:18] provided a nice little summary of what [00:04:20] it's learned. It says yeah, there was a [00:04:21] delay at the Seattle hub and there's no [00:04:24] um uh there's no uh [00:04:26] uh uh no stock available there it is for [00:04:29] that uh existing Doc Pro docking station [00:04:31] that they ordered, but there is a [00:04:32] compatible docking station that we could [00:04:34] offer them that has 12 units available [00:04:36] and it's recommending that we, you know, [00:04:37] offer a replacement with the upgraded [00:04:39] version. Okay? So this you know, this is [00:04:41] just a beginning like now we've we've [00:04:43] had the agent like learn something about [00:04:45] our uh our support case. Now we also [00:04:47] wanted to be able to do things on our [00:04:48] behalf. Let's take a look at how we can [00:04:51] build agentic experiences like this. [00:04:55] Okay. Now agentic user interfaces need a [00:04:58] way to communicate with the agent. Uh [00:05:00] AGUI stands for the agent user [00:05:04] interaction protocol. It's an open [00:05:06] event-driven protocol for agent human [00:05:09] interactions through an application. So [00:05:11] the app sends messages, the app's [00:05:13] current state, uh available front-end [00:05:16] tools that the agent can use, and user [00:05:18] decisions. The agent then streams text, [00:05:21] tool activity, state updates, and [00:05:23] requests for input. Uh AGUI composes [00:05:26] with other uh agent protocols that you [00:05:28] may have heard of. Uh for example, uh [00:05:30] MCP. Uh MCP is often used to connect uh [00:05:33] AI applications and agents to tools and [00:05:36] to context. I think of it as like the uh [00:05:38] the agent to tools protocol. [00:05:40] Uh ATA is used to allow agents to talk [00:05:43] to each other, the agent to agent uh [00:05:45] protocol so they can, you know, have [00:05:47] little chats and talk about you behind [00:05:49] your back [laughter] or or hopefully get [00:05:51] more stuff done working to working [00:05:52] together. Uh the AGUI protocol allows us [00:05:55] to connect the agent to the application [00:05:57] uh where the person is working. Okay, so [00:05:59] how do we get started using AGUI with [00:06:02] .NET? [00:06:04] Well, there's a new official AGUI.net [00:06:07] SDK contributed by the .NET team in [00:06:10] collaboration and built in collaboration [00:06:12] with Copilot Kit. It's an open source [00:06:15] MIT MIT licensed library that's [00:06:17] available on NuGet. [00:06:18] The AGUI.client package provides the an [00:06:22] AGUI chat client implementation which is [00:06:24] an implementation of IChat client from [00:06:26] microsoft.extensions.ai [00:06:29] based on the AGUI protocol. [00:06:31] AGUI.server [00:06:32] allows you to then implement the [00:06:33] protocol from the server. [00:06:36] Microsoft Agent Framework builds on this [00:06:39] AGUI SDK to expose agents over AGUI. [00:06:43] It's ASP.NET Core hosting adapter [00:06:45] provides a map AGUI server API so that [00:06:48] you can take your AI agent and expose an [00:06:50] AGUI endpoint for it. [00:06:53] Agent Framework handles the the agent [00:06:55] behavior, the tools, approvals, and the [00:06:57] integration and carries those [00:06:58] interactions over the protocol. [00:07:01] Now, the AGUI .NET SDK is shipped and [00:07:04] it's stable. [00:07:06] The Agent Framework AGUI integration [00:07:08] that's still in preview. [00:07:10] The protocol also supports [00:07:12] interoperability with agents written in [00:07:14] another languages like Python or [00:07:15] TypeScript or whatever. So it's not just [00:07:17] a .NET specific experience. [00:07:20] Okay, but how do we need then take [00:07:22] the that AGUI content and actually build [00:07:25] a UI out of it? [00:07:27] Well, the experimental Blazer AI [00:07:29] components give us building blocks for [00:07:32] building agentic UI using familiar Razor [00:07:35] components. We can start with a chat [00:07:37] page component which basically is like a [00:07:39] whole agentic user interface in [00:07:42] pre-canned together. It shows you the [00:07:45] the messages, the streaming status, [00:07:47] errors, retry UI, and the and the input [00:07:49] that the user can use to talk to the [00:07:51] agent. You can then customize individual [00:07:53] interactions in that chat page with [00:07:56] block renderers. You can like handle [00:07:59] rich text formatting, tool calls, tool [00:08:02] approvals, or just render your own [00:08:04] content. [00:08:06] The case context card that we just saw [00:08:07] earlier in the previous demo, that was [00:08:09] done using a custom block renderer to [00:08:11] render a tool result. [00:08:13] Or you can compose your your own layout [00:08:14] completely. You can take apart the [00:08:15] little pieces that make up the chat page [00:08:18] and lay lay them out however you'd like [00:08:20] with the agent boundary component which [00:08:21] gives you access to the agent context, [00:08:23] the message list component which gives [00:08:25] you the message list that you saw in [00:08:27] that chat and the the actual message [00:08:29] input itself. Now underneath all of that [00:08:32] the Blazer AI components use a UI agent [00:08:35] abstraction that takes an I chat client [00:08:38] and turns that into observable content [00:08:41] blocks. There's also a UI agent of T at [00:08:44] T state that adds typed shared and [00:08:47] predictive state about your app that you [00:08:50] can then share with the the agent so it [00:08:51] can kind of see the app like it sees the [00:08:54] state of the app and it can [00:08:56] make modifications to it in [00:08:57] collaboration with the application. [00:09:00] Now basic chat with the Blazer AI [00:09:02] components can actually work with any I [00:09:03] chat client from Microsoft Extensions [00:09:05] AI. [00:09:06] In this app today we're going to be [00:09:08] using the AGUI chat client to connect [00:09:11] these components to our agent over AGUI [00:09:14] because that will enable more elevated [00:09:16] experiences like being able to do remote [00:09:18] tool calls from the from the the agent [00:09:20] on the server to the front end, [00:09:23] approvals and also handle shared state. [00:09:27] Okay, now [00:09:29] let's talk about how you then implement [00:09:31] some of these experiences on top of all [00:09:32] that. So first off is tools. So tools [00:09:36] let the agent use your applications [00:09:38] capabilities. [00:09:39] Back end tools are usually directly [00:09:41] accessible by the agent. But you can [00:09:43] also have front end tools that are part [00:09:45] of your application and are exposed to [00:09:47] the agent, for example using the AGUI [00:09:50] protocol. [00:09:51] You can typically just configure these [00:09:52] tools as AI functions using Microsoft [00:09:54] Extensions AI and you just configure [00:09:56] them on the corresponding side of the [00:09:58] wire either in in the client app or on [00:10:01] the server with your with your agent. [00:10:03] Now the Blazer AI components can render [00:10:04] details of tool calls from both the [00:10:06] front end and the back end using a block [00:10:08] renderer uh for the function invocation [00:10:11] content blocks. Now, what you typically [00:10:13] do is you create your own custom [00:10:15] function invocation content block that's [00:10:17] specific to the function invocation for [00:10:19] your tool. As you can see here, like [00:10:20] there's the one that's being defined for [00:10:22] the set accent color [00:10:25] tool call, and you can have properties [00:10:26] defined for each of the arguments that [00:10:28] that tool takes. [00:10:32] Now, tools do the work, uh but your [00:10:34] agent also needs uh context, needs [00:10:37] information about what's actually going [00:10:38] on in your app. [00:10:40] AGUI enables you to share application [00:10:43] state with the agent. So, what way this [00:10:45] works, the app first sends its initial [00:10:47] request, a run agent input request to [00:10:51] the agent, which includes the initial [00:10:53] state of of the application. [00:10:56] And then the agent can send state [00:10:58] updates back to the app. The updates can [00:11:01] either be like full state snapshots that [00:11:04] it wants to like basically replace the [00:11:05] state wholesale, or they can even be [00:11:07] like partial updates. This is what [00:11:09] allows the agent to both see the state [00:11:11] of the app and make changes to it in [00:11:13] collaboration with the user. Now, [00:11:15] currently serialization and [00:11:16] deserialization of the state is handled [00:11:18] by the app at the AGUI layer. [00:11:21] In agent framework, the state updates [00:11:23] from the agent are typically triggered [00:11:26] using configured tool calls. You like [00:11:27] mark a tool and say like, hey, when this [00:11:29] tool returns, its result is basically a [00:11:32] state update. So, send it as a [00:11:34] state update snapshot using the AGUI [00:11:36] protocol. [00:11:38] So, that's how you can share a state. [00:11:41] Now, shared state keeps us working with [00:11:44] the same information. [00:11:46] Predictive state is a feature that lets [00:11:48] us review proposed changes before [00:11:51] before keeping that that change. So, for [00:11:53] example, you might want to preview like [00:11:54] a document edit before approving it and [00:11:57] making it the actual state of the app. [00:12:00] Predictive state's kind of a bad name. I [00:12:01] think of it more as like, you know, [00:12:02] proposed state or provisional state. In [00:12:05] the Blazer AI components, you can [00:12:07] capture a proposed state update from the [00:12:10] agent uh calling the set predictive [00:12:13] API and then that state can either be [00:12:15] accepted or or rejected uh as the new [00:12:18] app state. And you could then render UI [00:12:20] uh [00:12:20] based off of that. Now the components [00:12:22] provide rollback uh keeping uh [00:12:28] keeping edits um [00:12:30] so that means that like if you have like [00:12:31] edits that you had started uh based on [00:12:33] the edit and then you decide like you [00:12:34] know what let's not let's not actually [00:12:36] go with that then the old state can then [00:12:38] be uh restored. [00:12:39] All right. [00:12:40] So that was a lot. Let's take a look at [00:12:42] how shared state, tool calls, predictive [00:12:46] edits uh [00:12:47] can all work together in an agentic user [00:12:49] interface. [00:12:52] Awesome. Okay, so let's go back to the [00:12:54] app. [00:12:54] So remember before uh we were able to [00:12:57] get the agent to uh collect a bunch of [00:12:58] information about this support case. We [00:13:00] have a user who's uh [00:13:02] eagerly waiting for their docking [00:13:03] station to arrive but unfortunately it's [00:13:05] that they're out of inventory. So now [00:13:07] below we have some UI where we can [00:13:09] select whether to do a refund or a [00:13:10] replacement. Uh we can select which [00:13:12] replacement model to to choose and we [00:13:15] can specify the delivery address. [00:13:16] There's also a place below to draft a [00:13:18] response uh to the to the user. Okay, [00:13:21] but instead of me doing all that hard [00:13:23] work let's just I mean the agent's [00:13:24] already recommended what to do. It said [00:13:25] to offer a Doc Pro Plus replacement. So [00:13:29] let's go ahead and do that. So um [00:13:31] uh [00:13:32] go ahead [00:13:34] and specify [00:13:36] the replacement model. [00:13:41] Okay. [00:13:42] Now hopefully the agent has access to [00:13:44] all the functionality of my app. So it [00:13:46] should be able to use in this case it's [00:13:48] going to use a a front end tool so it [00:13:50] can kind of reach down into my app and [00:13:52] sort of set you see you see it just did [00:13:53] it. So there's the the replacement model [00:13:55] is now set to be a USB C Doc Pro Plus uh [00:13:59] uh model. So it was able to make a call [00:14:00] into the front end using a front end [00:14:02] tool. Now the user can also still make [00:14:04] changes. Like let's say the I come in [00:14:05] here and I'm going to change the [00:14:07] delivery address. Let's change this to [00:14:09] uh 1.net [00:14:11] way or something like that. I want to [00:14:13] doesn't really matter. Uh but then we [00:14:14] should the agent should be able to see [00:14:16] that the user made that change. And [00:14:18] that's that state sharing capability [00:14:20] that we talked about earlier. So let's [00:14:21] ask the agent now like, what's the [00:14:23] delivery [00:14:26] address? [00:14:29] The state should be able to see what's [00:14:30] going on in the app. That's how that's [00:14:32] how it can help you out and be effective [00:14:34] as a as an assistant. And it says, yeah, [00:14:36] the delivery address is 1.netway just [00:14:39] like we updated. So it saw that update. [00:14:41] So it's able to make updates and able to [00:14:43] see the updates that I make. Okay. So [00:14:45] now below we have this like draft [00:14:47] response to the customer. Let's ask the [00:14:48] agent to do that. So draft [00:14:50] a response to the customer. [00:14:54] And let's let just see what it comes up [00:14:56] with. [00:14:57] Oops, something wrong. [00:14:59] I don't know what's going on. So I guess [00:15:00] we have a [00:15:02] little [00:15:03] agent hiccup there. So let's let's try [00:15:04] this again. So we're back here. Let's [00:15:06] select a docking station. Let's change [00:15:09] the state of this again to [00:15:10] 1.netway. You know, we are dealing with [00:15:13] some preview features here. So apologize [00:15:14] for that. [00:15:16] Okay. And let's see if we can get it to [00:15:20] you know, investigate first to pull in [00:15:21] the context about the this the support [00:15:24] case. [00:15:26] Okay. [00:15:27] Good. [00:15:33] Should bring in the same recommendation. [00:15:34] Okay, now draft [00:15:35] response to the customer. [00:15:38] Let's go ahead and do that. Hopefully [00:15:40] this time it'll work. [00:15:42] And that was just a network hiccup. I [00:15:43] don't know. [00:15:45] Awesome. Okay. So what just happened? [00:15:47] Now remember we talked about state [00:15:48] sharing where the agent can see the [00:15:50] state of the the app. There's also [00:15:53] predictive state or [00:15:55] more like proposed state where here the [00:15:57] agent is saying, hey, I would like to [00:15:58] make this state update. Is that okay? [00:16:00] And then you can choose like do you want [00:16:02] to keep the the proposed reply or [00:16:04] discard it or accept it? And here I [00:16:07] think let's make sure that it actually [00:16:08] mentioned the user said they needed this [00:16:10] docking station for a workshop. I'd like [00:16:11] to acknowledge that. And I don't think [00:16:13] it did. So let's discard that one. [00:16:21] >> Okay. And then let's say a draft another [00:16:24] reply, [00:16:26] but be sure to mention [00:16:31] the customers workshop [00:16:35] like that and see if it can does a [00:16:37] catches that now. So I you know I [00:16:39] rejected that predictive state. So the [00:16:41] old state rolled back like I don't have [00:16:43] any reply anymore. [00:16:45] And then now if I ask it again and this [00:16:47] time if I accept now it actually becomes [00:16:49] the the state for the application and [00:16:51] we're we're good to go. Okay? Lastly, [00:16:53] you know like we this this [00:16:56] card up above that was a back end tool [00:16:58] call that we recognized and rendered [00:16:59] some custom UI to show you know [00:17:01] information about the the case up above. [00:17:04] We can also call front end tool calls [00:17:05] like for example if we asked the agent [00:17:08] to show us the a review of the proposed [00:17:10] resolution for this case. That's a piece [00:17:12] of client side functionality. It was [00:17:14] able to pop up this you know client side [00:17:16] dialogue reached down into my app and [00:17:18] and do something for me. That's an [00:17:19] example of front end tool calls with [00:17:22] ADUI and the Blazer AI components. Okay, [00:17:24] how do we how does this all implemented? [00:17:26] Let's look at the code real quick. So [00:17:27] there's quite a bit going on here but [00:17:28] I'll walk you through it. So this web [00:17:30] application that's our Blazer front end [00:17:33] and then we also have this agent server [00:17:36] project. That's an API back end that's [00:17:37] actually using Microsoft agent framework [00:17:39] to implement our APIs. We also have an [00:17:42] API for just like accessing the the the [00:17:44] database. And then we're using a Spire [00:17:45] of course. So we have our app host and [00:17:47] the service defaults for that and some [00:17:49] test projects and so forth. Just some [00:17:50] some machinery projects around all of [00:17:52] that. So in the agent server project [00:17:55] that's where we're actually setting up [00:17:56] our agent. [00:17:58] So if we scroll up here like here's [00:18:00] where we're actually creating the agent. [00:18:01] You can see all of its instructions that [00:18:03] you're a helpful customer service [00:18:04] representative etc etc etc. [00:18:07] And then down below where you can see [00:18:08] that we are giving it a couple tools [00:18:11] and we saw this like get case context [00:18:14] tool earlier. Let me scroll over so you [00:18:15] can actually see that. Yeah, there it [00:18:16] is. So there's that get case context [00:18:18] tool that we saw that resulted in that [00:18:20] card being rendered. [00:18:22] Uh and then we also see this call to map [00:18:25] AGI server. And that's what's actually [00:18:26] exposing our agent uh over the uh AGI [00:18:29] protocol. [00:18:31] Now I mentioned before that like state [00:18:32] updates from the server, those often are [00:18:34] handled using um uh uh [00:18:38] uh [00:18:39] uh those are often handled using uh tool [00:18:41] calls where you like basically tell uh [00:18:43] the system like, hey, when you get this [00:18:45] tool call, please just treat it as a [00:18:46] state update. So that's what we're [00:18:47] seeing here. We're saying like, hey, map [00:18:49] the result of this this tool call uh as [00:18:52] a a state snapshot. So that's how you [00:18:54] can send state updates from the server [00:18:56] to to the client. [00:18:57] Okay, that's the server piece, the agent [00:18:59] piece where we're exposing it using AGI. [00:19:02] On the client, uh here's where we're [00:19:04] actually setting up our AGI chat client [00:19:06] and some just a normal iChat client that [00:19:08] happens to be implemented using the AGI [00:19:09] protocol. And we're doing some some [00:19:11] extra machinery here to like wrap that [00:19:13] AGI chat client to like we so we can do [00:19:15] things like handle markdown and do rich [00:19:17] text formatting which the Blazer AI [00:19:19] components help us a bit with. Although [00:19:21] they don't they don't have directly a [00:19:23] markdown parser, so you still need to [00:19:24] bring your own. In this case, I think [00:19:25] we're using Markdig for the actual [00:19:27] markdown parsing. [00:19:28] Okay, so there's our our chat client. [00:19:30] And then to actually render the Blazer [00:19:33] agentic user interface, there's our chat [00:19:35] page that we mentioned earlier. We're [00:19:37] passing in uh a UI chat client here [00:19:40] based off of that AGI chat client that [00:19:42] we saw saw earlier. And you can see [00:19:43] there's we can see the message list and [00:19:45] there's a bunch of stuff you can put in [00:19:46] here to control what actually gets [00:19:49] rendered. So if we go uh check out [00:19:52] which we look for, let's look at the [00:19:53] this resolution tool renderers. That's [00:19:55] where we see all of our list of block [00:19:56] renderers where we're picking out, you [00:19:59] know, the different blocks that make up [00:20:00] the message list and telling the Blazer [00:20:03] AI components how we want those to be [00:20:04] rendered. Like this one here at the top, [00:20:06] this case context block, if we look at [00:20:09] that, that is the function invocation [00:20:11] content block that we talked about [00:20:13] earlier. And it's a custom one that's [00:20:15] set up specifically to map to that get [00:20:18] case context tool. So on the server, it [00:20:21] calls that get case context tool. It [00:20:23] sends AGI events down to the client to [00:20:25] let it know like, hey, I just called [00:20:26] this tool, and then on the client, we're [00:20:28] using this block renderer to render this [00:20:31] custom UI content for that tool results. [00:20:33] That's how you're customizing the [00:20:36] the [00:20:36] the blocks in the the message list, [00:20:39] okay? And then we can also look at how [00:20:41] the on the client, how the UI agent is [00:20:44] being set up. So here's our UI agent [00:20:45] that we actually pass to the chat page, [00:20:48] and you can see this is a UI agent of T. [00:20:50] So it has the the the state of the [00:20:52] application that available to it that it [00:20:54] can then manage, you know, and keep [00:20:55] track of like predictive or provisional [00:20:58] state [00:20:59] and you know, revert back to the [00:21:00] original state if if needed. And you can [00:21:02] also configure tools from the client. [00:21:05] Like we're configuring a bunch of tools [00:21:06] here. Again, they're just AI functions [00:21:08] like you would use with Microsoft [00:21:10] Extensions AI. Well, there's a bunch [00:21:11] bunch more down here. And this is [00:21:13] exposing functionality from the front [00:21:15] end to our back end agent. [00:21:17] One last thing to call out is that when [00:21:19] you're dealing with shared state, you [00:21:20] know, that state that we're sharing [00:21:21] between the the agent and the [00:21:22] application, [00:21:24] the serialization and [00:21:26] deserialization of that is handled by [00:21:27] the application. So here you can see [00:21:29] we're kind of poking down into the raw [00:21:30] representation and getting the that [00:21:32] original request, that run agent input, [00:21:35] and then deserializing the state, sorry, [00:21:38] serializing the state in this case, and [00:21:40] setting it on that request so that when [00:21:41] we send the initial request to the [00:21:43] agent, it knows what the state of the [00:21:44] application is. And then we have this [00:21:47] mapper down below [00:21:49] that handles the state updates that come [00:21:50] from the server to deserialize those [00:21:52] back into the state. So that's that's [00:21:54] how that how that all is working. [00:21:56] Okay. [00:21:57] Now, sometimes you also need to [00:22:03] give give users control over whether an [00:22:07] an agentic tool invocation should [00:22:09] actually succeed or not. And the way you [00:22:10] typically model this with Microsoft [00:22:12] Extensions AI is you instead of it just [00:22:14] being an AI function, you make it an [00:22:16] approval required AI function. And so if [00:22:19] you have one of those, then the [00:22:21] AGUI protocol implementation will detect [00:22:23] that and let the uh client know, and [00:22:25] then you can have uh uh block renderers [00:22:27] that recognize, oh, we're having a uh [00:22:29] a tool call here that's going to require [00:22:31] some user interaction. And then you can [00:22:32] display some custom custom UI elements [00:22:35] to allow the user to accept or reject [00:22:37] that tool. And that will actually like [00:22:38] prevent the tool from even being evoked [00:22:40] invoked. Like if the user says, no, you [00:22:42] can't call that tool, then it's not like [00:22:43] the tool got invoked and it's like, oh [00:22:44] no, how do we like backtrack? They [00:22:46] literally stop it from from happening. [00:22:48] And you can render it using a function [00:22:50] approval block with your your block [00:22:51] renderers. So let's let me show you [00:22:53] quickly how that looks. [00:22:55] Okay. So if we go back to the app, [00:22:57] and so I think we're good to go. We've [00:22:59] got a reply. We've got the right [00:23:01] replacement model. Everything looks [00:23:02] good. So let's go ahead and um ask the [00:23:06] uh agent to go ahead and request an [00:23:08] approval. [00:23:10] Um now this is going to involve calling [00:23:11] a tool. Uh involves, you know, checking [00:23:13] some authorization things and some [00:23:15] things in inventory and so forth. But [00:23:17] hopefully yeah, okay. So invoked a tool. [00:23:21] Now because this is an approval required [00:23:23] uh tool, it's asking me like, hey, is [00:23:25] this okay if we like like do this? And [00:23:27] in this case, I'm going to say yes. [00:23:28] That's the uh resolution that we want [00:23:30] for this support case. So we're able to [00:23:32] keep a the human in the loop and have [00:23:33] them maintain control. And done. Okay, [00:23:36] we just resolved this support case. If [00:23:38] we look down below, we can see that we [00:23:40] have the replacement confirmed with one [00:23:43] unit allocated to ship off to the [00:23:44] customer their their their new docking [00:23:46] station so they can do their workshop. [00:23:48] If we look in the code to see how this [00:23:50] one is is implemented, this is uh was a [00:23:52] server tool. So we go back to the [00:23:53] server. You may have saw this earlier [00:23:56] that one of the tools that we were [00:23:57] configuring, this guy, the confirm [00:24:00] resolution tool, this is uh an approval [00:24:03] required uh AI function. And that flows [00:24:06] down all the way through AGUI to the [00:24:07] Blazer AI components. Uh and then in our [00:24:10] block renderers, like where is it? [00:24:12] There's somewhere down here there's a uh [00:24:14] function approval block, this guy right [00:24:16] here, that detects that, hey, this is a [00:24:17] function that requires approval. And we [00:24:19] can write, you know, a bunch of custom [00:24:20] UI elements to give the buttons so the [00:24:22] user can approve or reject that. All [00:24:25] right, so that's how you can do human in [00:24:26] the loop. [00:24:28] All right, cool. So that's how .NET can [00:24:30] help you build agentic user interfaces. [00:24:33] The AGUI .NET SDK uh helps you connect [00:24:37] apps and agents using the AGUI protocol. [00:24:39] Microsoft Agent Framework enables agents [00:24:42] uh to do useful work and expose that [00:24:44] over the AGUI protocol through the AGUI [00:24:46] integration. [00:24:47] Um the Blazer AI components uh make that [00:24:49] work visible to the user and also [00:24:52] coordinate with the agent. And by adding [00:24:54] these agentic capabilities to your .NET [00:24:56] apps, you can help your users become [00:24:58] just absolute power users by having that [00:25:00] that intelligent AI assistant by their [00:25:02] side uh all the time to to access all of [00:25:04] your apps' great capabilities. Where I'm [00:25:07] super excited to see what you what you [00:25:09] build with these capabilities. You can [00:25:10] get started today by going to [00:25:12] aka.ms/blazor/ [00:25:14] / ai-components. [00:25:16] Again, these components are currently [00:25:18] experimental and some of these features [00:25:19] are preview. So we'd love to hear about [00:25:21] what you want to build with these [00:25:23] things, how well they work for you. [00:25:24] Share your feedback. Uh you can share [00:25:26] your feedback on the Blazer AI [00:25:27] components in the ASP.NET Core repo and [00:25:30] any of the Microsoft Agent Framework uh [00:25:32] AGUI integration you can share in the [00:25:35] Agent Framework repo in the in the [00:25:36] Microsoft org. And yeah, I [00:25:39] can't wait to see what you guys do.