[00:00:05] All right. Hey everybody and welcome to [00:00:07] this session where we're going to talk [00:00:09] about less chat more action AI powered [00:00:13] Net Maui apps. My name is Gerald and I'm [00:00:16] a software engineer on the net Maui SDK [00:00:18] team at Microsoft and here presenting [00:00:21] for you today at .NET Comp. So this [00:00:24] session might as well just also been [00:00:26] called um basically using AI inside of [00:00:29] your net Maui app. I have another [00:00:31] session on building Maui apps through [00:00:33] AI. So that's kind of like a little bit [00:00:35] of a different nuance there. There's a [00:00:37] bunch of sessions about net maui in all [00:00:39] kinds of varieties what's new in neti. [00:00:41] So go check out all the other recordings [00:00:43] from net comp 2026 as well. But for now [00:00:47] we're going to focus on how to add AI [00:00:49] inside of your net maui app. So, I don't [00:00:53] know about you, AI is everywhere. That's [00:00:55] a fact. We can't get around it. That's [00:00:57] fine. Um, but the implementation up till [00:00:59] now has been kind of like simple, right? [00:01:01] Even if you go to the clots, the chat [00:01:03] GPTs, all those things, it's basically a [00:01:05] chat interface. I know they're super [00:01:08] powerful by now, but with a little bit [00:01:09] of a imagination, you can do so much [00:01:13] more, right? Your users don't just want [00:01:15] to know the chatbot, they want the app [00:01:17] to act, right? And you can do that [00:01:19] especially in mobile apps because in [00:01:21] mobile apps you have all these things [00:01:24] that are great to use to feed the [00:01:26] context for all of these AIs, right? If [00:01:29] you want, you have the camera, you can [00:01:31] add pictures, you can show it things, [00:01:33] you can use the microphone. You don't [00:01:35] even have to type. I I will say I'm from [00:01:37] the generation that's a little bit [00:01:38] awkward to actually talk to my phone. [00:01:41] Um, but I'm getting there because now [00:01:43] just it things are going so fast. Just [00:01:45] typing is not fast enough anymore, [00:01:47] right? So, I'll I I find myself talking [00:01:50] to my phone, talking to uh all the AI [00:01:52] things now, a little bit, and it's [00:01:54] perfect for that, right? You have the [00:01:56] microphone, you have all the sensors to [00:01:57] just do that. If you want to take it [00:02:00] even further, it can take in the [00:02:02] location. It has all the sensors to know [00:02:04] where you are, take into account the [00:02:06] location. A earlier session, um some [00:02:09] silly example, I have an allergy for [00:02:11] sesame. So that's always whenever I go [00:02:13] traveling uh for the non-verirtual [00:02:15] event. So not like this, but if I go to [00:02:17] an actual place, it's like, hey, do I [00:02:19] need to look out for a session here um [00:02:22] and I built a little se uh demo app for [00:02:24] that session where I could scan the [00:02:26] menu? And it would also pull in the [00:02:28] context of the location like, hey, maybe [00:02:31] am I if I'm in kind of like an Asian [00:02:33] part of the world, it would be much more [00:02:36] risky than, you know, anywhere else, [00:02:38] right? So, um you could do all kinds of [00:02:40] like fun stuff with that. And that's [00:02:41] just one example. Um maybe your [00:02:44] calendar, right? Maybe you want to find [00:02:45] things in your calendar. You could pull [00:02:47] all that in. And if you want to really [00:02:48] go far, gets a little bit sensitive [00:02:50] there. You could pull in health data, [00:02:52] right? But there is so much information [00:02:54] on your mobile device that you could use [00:02:57] for all of this great AI stuff. Now, [00:03:00] I've built a little app, we'll see that [00:03:02] in a minute, for Netcon. You can [00:03:04] actually download it in the store. you [00:03:05] can look at it yourself, but it's also [00:03:07] open source uh built with C-pilot, [00:03:10] GitHub Copilot, um and also AI in there. [00:03:14] Now, we'll get into that in a little [00:03:16] bit, but there what you can then do is [00:03:19] not just, hey, have a chat window like [00:03:21] you're not going to go to your [00:03:22] conference app and be like, oh, I'm [00:03:24] going to have a chat with this thing um [00:03:26] and I'm going to tell it about my day, [00:03:27] right? I mean it kind of makes sense in [00:03:29] this u scenario but what you do want to [00:03:32] do is find and find historically [00:03:35] traditionally would be like oh you need [00:03:37] to hit these certain key po keywords so [00:03:39] that you can actually find the thing [00:03:41] that you want right for all the search [00:03:42] engines all those things um you need to [00:03:44] know how to search we don't need that [00:03:46] anymore we can now just say oh I have [00:03:48] this vague idea you don't even have to [00:03:50] spell it correctly anymore it will [00:03:52] understand what you're looking for right [00:03:54] so all the blazer talks on Thursday boom [00:03:56] it knows exactly what you [00:03:58] save all the Aspire sessions. It will [00:04:00] automatically save that in your personal [00:04:03] schedule so that you will have them [00:04:06] there and you can build your own [00:04:08] personal schedule there with all the [00:04:09] things that you would like to see. [00:04:10] You'll get a little notification and you [00:04:12] don't have to go out and looking through [00:04:14] all the sessions anymore. You'll just be [00:04:16] like, "Hey, any session that has to do [00:04:17] with Aspire, I want to see it." Boom. [00:04:19] They're all there. The AI model will do [00:04:22] that for you. And of course, like, hey, [00:04:24] take me there, right? Like, hey, who is [00:04:26] giving these bladed sessions? who is [00:04:27] giving these Maui sessions, right? You [00:04:29] will just go there. It will look it up [00:04:31] for you. So, you can do all these kinds [00:04:34] of like cool things. Well, I'm a visual [00:04:36] guy. I'll show you a little bit first [00:04:38] what that looks like, right? So, like I [00:04:40] told you, I built this little app. I've [00:04:42] got it here on iOS. And this is the [00:04:44] onboarding screen, right? So, you [00:04:46] downloaded it. You got it, opened it for [00:04:48] the first time, and this is what you [00:04:50] see, right? So um here it has a little [00:04:52] bit of a um promotional text what you if [00:04:55] you will introduction text and it's a [00:04:57] little onboarding screen with three [00:04:59] things here. So I can go next I can [00:05:00] slide there if I want and you can [00:05:02] automatically see like hey describe your [00:05:04] interest with ondevice AI because that's [00:05:06] the thing that I'm going to talk about [00:05:08] mostly but you can swap it out for other [00:05:10] things as well. And the thing that is [00:05:14] good to know here is that your device [00:05:16] needs to be able to support this right. [00:05:18] So for iOS devices, I think as of the [00:05:21] iPhone 16 and up, um you should be good, [00:05:24] right? It has the hardware to kind of [00:05:25] like do things. U with Android, it's [00:05:27] always a little bit more complicated. [00:05:29] And then on Windows, there is this other [00:05:30] thing as well, right? So if you're going [00:05:32] to look into these things now, it's [00:05:34] probably a little bit early days because [00:05:36] all the device vendors are figuring this [00:05:39] out uh at this point, right? Up till [00:05:42] now, it's mostly all in the cloud and we [00:05:44] using those models. uh but this [00:05:46] definitely has benefits but you want to [00:05:48] take into account that there might also [00:05:49] be devices there might also be users who [00:05:52] do not have an AI enabled device so if [00:05:56] you are actually going to download this [00:05:58] um on your phone you might not see this [00:06:00] exact same experience right so that's [00:06:02] good to keep in mind here what it will [00:06:04] do is like hey it will give you a couple [00:06:06] of suggestions like hey security all the [00:06:08] boring bits I made it a little playful [00:06:11] right um team David Whitney um I'm [00:06:14] pulling in the actual data here and AI [00:06:16] is already mixing that in here. Feed my [00:06:18] ASP.NET curiosity. Um, and then whenever [00:06:21] we um kind of like click it, more [00:06:23] copilot, less FOMO, that sounds like a [00:06:24] good one. Is going to say like, hey, [00:06:26] what interests you? I'm interested in [00:06:28] co-pilot. But of course, we can also do [00:06:30] our own thing, right? So, let me just do [00:06:33] um, hey, I want to see all sessions [00:06:39] by Daniel Roth [00:06:41] and my great friend Daniel Roth. And of [00:06:44] course some Net Maui sessions, right? [00:06:46] I'm all about the Net Maui sessions. [00:06:48] Find the sessions for me. You can also [00:06:50] pull in here. So all the session times [00:06:52] are in my time zone. And then you can [00:06:54] also specify the watch hours because you [00:06:56] can go all the ways with this, right? [00:06:58] You can say, "Hey, Don confronts from [00:07:01] base in Seattle." Um, but it can go all [00:07:04] night if you are where I am in Europe, [00:07:06] right? So you probably don't want to [00:07:08] stay up all night. Maybe you do. I don't [00:07:09] know. Maybe you're crazy enough. And you [00:07:11] can say, "Oh, I only want the sessions [00:07:13] between 7:00 a.m. and 11 p.m." Right? [00:07:15] So, that's what I kind of like did in [00:07:17] here. But if you're crazy enough, you [00:07:18] can change it. And the AI model will [00:07:20] take all of that into account. Now, it [00:07:23] found me some sessions. Nine selected. [00:07:25] Uh they should have all to do with [00:07:27] Blazer, do Maui, do Maui. Uh well, [00:07:30] actually, not Blazer with Daniel Roth. [00:07:33] Um and then Maui, right? So, these all [00:07:35] look good. Um yes, I've reviewed them, [00:07:38] add them to my schedule, and boom, [00:07:40] they're there. And you can see actually [00:07:41] that I made a little typo, but it still [00:07:43] understood what I was going for. Right. [00:07:45] Continue. You can enable the session [00:07:47] reminders if you want. Done. And you can [00:07:49] see they're already here in my schedule. [00:07:51] It just did it for me. Right? They're [00:07:53] all here in a beautiful looking control [00:07:56] that Avalonia has put in here. Right? So [00:07:58] it just did that for me. Now what was [00:08:02] going on here? What happened? The [00:08:03] building blocks. Let's see what this is [00:08:05] all about. [00:08:06] If you have been doing anything with AI [00:08:08] in your net applications at this point, [00:08:11] then you have probably heard about the [00:08:12] Microsoft extensions AI, right? That is [00:08:15] the library that is the abstraction that [00:08:17] you can plug everything into and it's [00:08:19] basically I know it's a little bit more [00:08:21] than that, but the core of this is the I [00:08:23] chat client and you can swap that out [00:08:25] for anything because it's an interface, [00:08:27] right? You provide the implementation [00:08:29] and we have a lots of implementations. [00:08:32] You can do on device like actual [00:08:34] ondevice that we've seen right here. But [00:08:36] you also have another ondevice. I'll [00:08:38] show you that in a minute. Um and of [00:08:40] course like everything that we have in [00:08:41] kind of like Microsoft Foundry, right? [00:08:43] And you can just plug that in, configure [00:08:46] it once, and then all your view models [00:08:47] or all your other things inside of your [00:08:49] application that are going to use this [00:08:51] Jet client, they don't care where the [00:08:53] data is coming from. They just know what [00:08:55] they can expect because it's implemented [00:08:57] through an interface and you could do [00:08:59] everything with it. Right? So here on [00:09:01] the right you can see a very simple [00:09:02] implementation of all of that right we [00:09:04] have this class session assistant you um [00:09:07] dependency inject the I chat client [00:09:10] there and then you're going to ask async [00:09:12] a thing and you set that up with like [00:09:14] inner client as builder you can use [00:09:17] function invocation you can configure [00:09:18] that whole thing however you want to use [00:09:20] it open telemetry so that you have some [00:09:23] um instrumentation on hey what is going [00:09:25] on there whenever something goes wrong [00:09:27] you can um look into all the telemetry [00:09:30] there and you have all of that as well. [00:09:33] Now, if we do that a little bit further, [00:09:35] if we look at like what I did for my [00:09:37] application right here, then this is [00:09:40] kind of like your architectural picture, [00:09:41] right? Your diagram. Um, on the top is [00:09:44] my app, your pages, your view models, [00:09:46] everything that you already have, right? [00:09:48] And we want to augment that. We have the [00:09:50] AI attributes. What that is, I'll get to [00:09:52] that in a second. Then under that you [00:09:54] have the Microsoft extensions AI the I [00:09:57] chat client that we've just seen tool [00:09:58] calling telemetry everything is there [00:10:00] and then under that you can go a couple [00:10:03] of ways and one of the ways is [00:10:06] essentials.ai AI which is something that [00:10:08] we've been building on the net Maui uh [00:10:10] team and that uses the ondevice AI [00:10:14] models on iOS on Android on Windows [00:10:17] right who knows what else might come but [00:10:19] those are the platforms that we're [00:10:20] focusing on right now or you can swap [00:10:23] that out for any cloud provider [00:10:24] Microsoft Foundry just go straight to [00:10:26] OpenAI anything that you want to do [00:10:28] there so this is kind of like your stack [00:10:30] that you can use here and I'll I'll go [00:10:32] through the important bits here for our [00:10:34] application and for what's important for [00:10:37] you as a net bow developer. Right? So [00:10:39] let's start with the essentials AI one. [00:10:42] Now a little bit of history here. Um [00:10:44] it's all about app modernization and all [00:10:46] this talk about our craft changing as [00:10:50] software developers makes it makes us I [00:10:52] was going to say but at least me a [00:10:54] little bit nostalgic of like oh what [00:10:56] what cool things did we do and now [00:10:58] that's all changed. Um it all started [00:11:01] kind of like with examining essentials, [00:11:02] right? So if you know a little bit about [00:11:03] your history, Don Maui was examining [00:11:05] before not super important. Um but it's [00:11:08] mostly a UI framework right and but also [00:11:12] on every device on every platform you [00:11:14] have the same things geoloccation we [00:11:16] already mentioned that interacting with [00:11:18] the calendar uh battery information um [00:11:21] turning on your flashlight all these [00:11:23] kind of like crazy things that you can [00:11:24] do on every device but it wasn't [00:11:26] necessarily UI. So what we came up with [00:11:29] was something that was called essentials [00:11:31] which would still provide a unified API [00:11:33] for all of these things across all these [00:11:35] platforms and now you could still use [00:11:37] that from C and net without having to do [00:11:40] silly things on the platform itself to [00:11:42] do all of these trivial um APIs and [00:11:44] operations right that became part of net [00:11:47] bow because that is just how essential [00:11:51] it was it was already in the name uh [00:11:53] that we were like hey this this [00:11:54] shouldn't be an extra package because [00:11:56] everyone everyone installed called this [00:11:59] the first thing right under examine [00:12:00] application we were like that's that's [00:12:02] not necessary that shouldn't be [00:12:03] necessary let's just pull that in to net [00:12:06] maui directly um and so that you can [00:12:09] immediately use that and it's just APIs [00:12:11] that are just there the same kind of [00:12:14] thing is kind of like happening with [00:12:15] essentials.ai AI right now because [00:12:17] basically this is just an abstraction a [00:12:20] unified API on top of the ondevice [00:12:23] models that are there because now what [00:12:25] we're seeing AI is everywhere it's in [00:12:27] the cloud and it's also very expensive [00:12:29] to run there right um we're we are [00:12:31] getting uh we're uh very lucky uh with [00:12:34] the the things the credits that we get [00:12:36] right now but it's always better it's [00:12:38] always cheaper to just run it on your [00:12:40] own device of course it's a little bit [00:12:42] more limited it's not the super data [00:12:44] centers that are everywhere ware that [00:12:46] can um do all kinds of like crazy [00:12:48] computations in a fraction of a second. [00:12:50] Um but you can still get very powerful [00:12:53] results just from your device. And [00:12:56] that's what we're doing with Essentials [00:12:57] AI. Um where you just have that unified [00:13:00] API that you can talk to so that you [00:13:02] don't have to figure out all the APIs [00:13:04] for iOS, for Android yourself. And you [00:13:07] can just do that very easily by plugging [00:13:09] in this library and you have this one [00:13:11] API to work with. Now getting started, [00:13:13] super easy. Um it lives on the Maui labs [00:13:18] um repository. You'll see that at the [00:13:20] end of the slide. There will be a link [00:13:22] there. Um one of the things that we did [00:13:24] because shipping in the AI era is going [00:13:26] so so fast, we created a um [00:13:29] github.com/d.net/maui-labs [00:13:32] repository so that we can ship things a [00:13:34] little bit faster. We can experiment [00:13:35] with things. We can just iterate on them [00:13:37] very fast. And this library is also part [00:13:39] of that. So, it is released as a [00:13:42] pre-release as a Maui Labs thing. Is it [00:13:45] actually supported? Yes, very much so. [00:13:47] Um, does it fall under the official [00:13:50] guarantees and licenses and support from [00:13:52] Microsoft? No. Right. Um, but we're [00:13:55] looking for your feedback there. If [00:13:57] you're like, "This is essential. Uh, [00:13:59] this should be in there. Let us know and [00:14:01] we can hopefully graduate it." Right? [00:14:03] Um, this is definitely a good candidate [00:14:05] for there. But for now, it is what it [00:14:06] is. Um, so step one is like, hey, add [00:14:09] the package. you need to add d-p [00:14:10] pre-release and you need to add a little [00:14:12] bit of a no warn thingy in your CS [00:14:14] podge. Do not get build warnings or [00:14:16] you're like I ignore the build warnings [00:14:18] anyway so I'll just I'll just leave them [00:14:20] there. That's fine. Um then what you [00:14:23] want to do is register this, right? So [00:14:25] go into your Maui program and say, "Hey, [00:14:27] I want to add the singleton for the IET [00:14:29] client and we need the um platform [00:14:33] specific one there, right? We can [00:14:34] probably maybe improve a little bit [00:14:36] there um the API to not have these if [00:14:39] iOS if Mac catalyst kind of things. Um [00:14:42] but for now this works and then for [00:14:44] Android we're going to do the Gemini [00:14:46] Nano right we're going to register the [00:14:48] actual implementation of this I chat [00:14:50] client and then from there you'll just [00:14:52] talk to the I chat client um uh [00:14:55] interface from all your view models from [00:14:57] all your things and it doesn't matter [00:14:59] what the implementation is anymore right [00:15:00] so that's just unified you don't have to [00:15:03] do all these if statements everywhere [00:15:05] the one thing that you do want to check [00:15:06] I already said that a little bit earlier [00:15:08] is check if the model is ready right it [00:15:11] needs a a little bit of initialization. [00:15:13] Uh maybe it's not even there, right? If [00:15:15] you have like an older iPhone, older um [00:15:18] if you have like an Android device, um [00:15:21] not every Android device has all the [00:15:23] models, right? For Android, you can also [00:15:25] have multiple models. For iOS, it's just [00:15:27] the one basically for Android you can [00:15:29] have multiple models that can do [00:15:30] different things. Um and it's not even [00:15:32] super common that they're on there right [00:15:35] now or installed with the OS, right? to [00:15:38] what I've seen happening and where we [00:15:39] have APIs for as well is that you have [00:15:41] to check if the model is there. If not, [00:15:43] you can offer to download it, but it's [00:15:44] like five gigabytes, right? So, it takes [00:15:46] a little while to get there. All a whole [00:15:49] new world um from crossplatform [00:15:51] development that you need to look into [00:15:52] and take into account now as well, but [00:15:55] it's fun. It's fun. I promise. So, what [00:15:57] you can then do is bring your own model, [00:16:00] right? So, where does that kind of like [00:16:01] leave you with the options on the left? [00:16:04] More private and it's free. It's on your [00:16:06] device. It's built into DOS, Apple [00:16:09] Intelligence, Gemini Nano, um, Windows [00:16:12] AI, right? All those things are there on [00:16:14] the device depending a little bit on the [00:16:16] hardware, but it should be there. Um, [00:16:18] nothing leaves a device. So, also good [00:16:20] for privacy, those kinds of things, but [00:16:22] a little bit more limited, right? As [00:16:24] we'll see in a little bit in my next [00:16:26] demo, like, hey, what are the things [00:16:27] that you can think of to do here? you do [00:16:30] need to spell it out a little bit more [00:16:32] than whenever you talk to kind of like [00:16:34] the uh premium models in the cloud where [00:16:36] you can get away with any vague prompt [00:16:38] and it will come up with an answer, [00:16:39] right? It doesn't work that way if [00:16:41] you're like on the models of the actual [00:16:43] device. Now, if you still want to stay [00:16:45] on the device, but you are like, "Oh, I [00:16:47] I want to create this custom model that [00:16:49] I've trained to do this very specific [00:16:51] thing," or you just have a model that [00:16:53] you think is better than the built-in [00:16:55] one for the OS, you can use Onyx, right? [00:16:58] And Onyx has also um C# implementation [00:17:02] that works a net implementation that [00:17:04] works with Maui apps as well. And with [00:17:06] that you can just bring your own model [00:17:08] there too and it still runs on the [00:17:10] device but you're bringing in also [00:17:12] probably gigabytes or at least hundreds [00:17:14] of megabytes of a file into your app, [00:17:16] right? So that's kind of like the [00:17:18] trade-off that you need to make here. Um [00:17:20] it can be more powerful, it can be [00:17:21] better depending on what you want to do. [00:17:23] You can definitely incorporate that [00:17:25] inside of your application. Um, but [00:17:27] yeah, there's that little bit of more [00:17:29] manual work. And then of course on the [00:17:31] other end of the scale on the far right, [00:17:33] more capable. All the premier models, [00:17:35] they're costly. Um, but you can do a lot [00:17:38] of cool things. Um, and your app stays [00:17:41] small because it's just API calls, [00:17:43] right? you can just go back and forth to [00:17:45] the cloud. Microsoft Foundry go directly [00:17:47] to the um AI vendors, uh talk to them [00:17:51] and um you'll just have that key uh that [00:17:54] you're of course not going to put in [00:17:55] your app because we are very secure. We [00:17:57] store that in the back end. Um but then [00:17:59] you can do whatever you want, right? You [00:18:01] get all the power, but it needs a little [00:18:03] bit back and forth. It's not offline. [00:18:04] Your data goes to places and you have [00:18:07] all of that, right? But the cool thing [00:18:09] is all three of these are abstracted by [00:18:13] the Microsoft extensions AI, right? It's [00:18:16] all the IF client. So it doesn't matter [00:18:18] what you're doing. And that kind of [00:18:19] brings me to the next thing like, hey, [00:18:21] how are we going to implement this? [00:18:22] Well, you don't need to do it per app. [00:18:26] Think of it per feature. You can split [00:18:27] it up per feature. You can have two [00:18:30] clients and say, "Hey, my I remote chat [00:18:33] client or my I local chat client can be [00:18:36] two different things." And for the kind [00:18:37] of like simpler things, you go to the [00:18:39] device thing uh to the device model. And [00:18:41] then for your more advanced thing, [00:18:43] you're going to go to your other chat [00:18:45] client that gets the things from remote, [00:18:47] right? So you can split it up between [00:18:50] features, between however you want, [00:18:52] right? You're in control of your app. [00:18:54] You probably know best what makes sense. [00:18:56] Try out a little bit what brings you the [00:18:57] best results. Um but you can split it up [00:19:00] within your app. You don't have to [00:19:02] choose one or the other and be stuck [00:19:04] with that. You have all kinds of options [00:19:07] here. [00:19:09] Then here I already said it a little [00:19:10] bit. Um then also to make it even more [00:19:12] interesting. Um [00:19:15] not all the platforms support the same [00:19:18] things, right? So um first you have to [00:19:21] check if they have ondevice models [00:19:23] available for you. Then yes. And then um [00:19:26] because this is just a the tip of the [00:19:28] iceberg basically. Does it do tool [00:19:31] calling? Yes or no. There is all kinds [00:19:33] of other things that you can um expect [00:19:35] from AI models. Um I should have an [00:19:38] overview. It's probably on the Maui labs [00:19:41] uh with an whole matrix of like what it [00:19:42] can or can do. So even if they have like [00:19:45] an ondevice model, um then it's not said [00:19:47] that whatever you implement will work [00:19:50] across all of these different platforms [00:19:51] as well, right? So this is probably a [00:19:52] point in time problem, right? This is a [00:19:54] problem right now. I expect that this [00:19:56] will go very fast and this will become [00:19:58] more important um and the ondevice [00:20:00] models will catch up and you can do tool [00:20:02] calling on all of these um within no [00:20:04] time and all the other things that you [00:20:06] want to do with that as well. Um but for [00:20:08] now you do want to test and kind of like [00:20:10] look out for what the capabilities are [00:20:13] for each device. So right now iOS [00:20:17] Apple intelligence can do tool calling. [00:20:19] Yes, that's the thing that we're going [00:20:20] to see here. for Android only the Nano [00:20:23] V4 models which are only a preview. I [00:20:26] set it up just for this demo and you had [00:20:28] to go through a couple of hoops to [00:20:30] actually be in some developer preview [00:20:31] program. So it's not like super public [00:20:33] out there. Um and for Windows I don't [00:20:35] think it's there yet. Uh but it's coming [00:20:37] soon, right? So all kinds of things that [00:20:39] you for this point in time at least want [00:20:41] to take into account. Um but whenever it [00:20:44] gets there you can do cool things. The [00:20:46] other thing AI attributes I already [00:20:48] mentioned it uh but I didn't really show [00:20:50] you that yet. And this is really really [00:20:52] cool because what you could do with this [00:20:54] is basically turn your code [00:20:58] in tools, right? And tools in AI model [00:21:01] world are basically their REST APIs, [00:21:04] right? That will allow them to do [00:21:06] things. Um so here in our ask tools.cs, [00:21:09] CS which is our ask tools class. Um we [00:21:13] are creating tools for the model to use [00:21:15] and by just adding an attribute with a [00:21:17] export AI function we give it that name [00:21:20] open speaker. Um that will be the name [00:21:23] of the function that it knows to call [00:21:24] that the model knows to call to do a [00:21:26] thing. Um and then the description right [00:21:28] which is arguably more important because [00:21:30] that it's all based on large language [00:21:33] models LLMs uh which is about language. [00:21:36] So whenever you put some intent in your [00:21:38] prompt box like open a speaker profile [00:21:41] um the description needs to be [00:21:43] descriptive enough that the model knows [00:21:45] like oh this is the tool that this user [00:21:47] can use right now so I'm going to invoke [00:21:50] this one and then it's not the the [00:21:53] prompts are not going to be structured [00:21:55] and be like oh this parameter this [00:21:57] parameter this parameter right so each [00:21:58] of the parameters here are also getting [00:22:00] a description so that the model can [00:22:02] infer of like oh um this [00:22:06] um this parameter is what they are [00:22:10] meaning here in this sentence right so [00:22:11] about the talk of a topic or some [00:22:14] weekday or the person name right and [00:22:16] then it can request an action um open [00:22:19] speaker right it's going to do another [00:22:21] tool call to actually open the speaker [00:22:24] right there with these parameters and it [00:22:26] actually knows how to do a thing by [00:22:28] adding these attributes there will be a [00:22:30] little source generator that writes all [00:22:31] of the calling code um compile all of [00:22:34] that there's no reflection whenever the [00:22:36] tool runs, right? Because especially in [00:22:37] mobile devices, they don't really like [00:22:39] that typically. So that's what you could [00:22:41] do. No duplication of code, no kind of [00:22:44] like letting a model um infer and decide [00:22:47] one thing and then you still have to [00:22:49] write kind of like very deterministic [00:22:51] code to actually do a thing, right? Like [00:22:53] no, we just turn this into tools that [00:22:55] the model can use directly. So and then [00:22:59] here um AI tool source, right? You're [00:23:01] going to create a context. You're going [00:23:03] to create a little index of like, hey, [00:23:05] these are all the things right here. Um, [00:23:07] also as builder allow concurrent [00:23:09] invocations, maximum iterations. You can [00:23:12] set this whole thing up um according to [00:23:14] what you need and um actually um put [00:23:18] through like, hey, the find sessions [00:23:19] thing ties to the ask actions um find [00:23:23] sessions, right? So you can wire that [00:23:24] all up so that the model understands and [00:23:27] knows where to go. [snorts] [00:23:30] And then the app acts, right? So every [00:23:32] tool stages an action. It doesn't touch [00:23:34] the UI itself. It just invokes the [00:23:36] thing. Um and then it runs through the [00:23:38] same view and the same models and the [00:23:40] services that the screens use. Right? So [00:23:42] no more um user that needs to do this [00:23:45] very specific thing. No, the model will [00:23:47] figure out what the intent is and then [00:23:49] go from there. [00:23:53] Little live demo. So let's go back to [00:23:55] the app right here. And you can see [00:23:57] already there is a big button with some [00:23:59] sparkles. Ask about the conference. And [00:24:01] sparkles as you should know by now is [00:24:03] the universal sign of AI. Right? So [00:24:06] there it is. Ask about the conference [00:24:08] pops up a little thing. What would you [00:24:10] like to do? Well, if we are going to say [00:24:13] um Blazer talks on Thursday, right? Let [00:24:16] me show that Blazer talks on Thursday [00:24:18] and I'm going to make sure I spell this [00:24:20] right. Like I said, the local models are [00:24:22] a little bit more picky with like the [00:24:24] typos and those kinds of things. Uh I'm [00:24:26] pretty sure that if I do blazer with an [00:24:28] E, it will know what to do. Um but let's [00:24:30] just be sure because this is a demo, [00:24:33] right? Um and you can see right now it [00:24:36] doesn't just come up with a list, right? [00:24:39] Typically in a more traditional UI, you [00:24:41] would now get a list of what you were [00:24:43] searching for, right? And the model [00:24:44] would be smart enough to get the [00:24:46] results, but you would still show it in [00:24:47] a list. No. Why would we do that? Why we [00:24:51] have wired in this app the tools up so [00:24:53] that it knows how to navigate through [00:24:54] the app to bring you to the UI to the [00:24:57] place where you want to be. Right? So [00:24:59] here it's selected for as you can see it [00:25:01] in the top here. It selected Thursday [00:25:03] because I asked about Thursday and it [00:25:05] filtered on Blazer. So it knows okay I [00:25:07] need to filter I need to put in a little [00:25:09] filter here for Blazer. I need to filter [00:25:11] it on Thursday and boom here we go. [00:25:13] We've got all of the sessions about [00:25:16] Blazer on Thursday. Right. So there it [00:25:18] is. If we go back, we can do a couple of [00:25:20] other things, right? So, let's do [00:25:21] another thing. Um, save all the Aspire [00:25:25] sessions, right? I'm u very interested [00:25:27] in Aspire. [00:25:29] Um, they're not part of net anymore. So, [00:25:31] what are they doing? I I don't know [00:25:33] anymore. And I just want to see all of [00:25:35] that. So, let's save all of those in my [00:25:37] schedule. And you can see down here my [00:25:38] schedule now it had nine. And now, boom, [00:25:41] we suddenly get 15. And it brings me [00:25:43] there to show what it did, right? So, it [00:25:46] did add the little hearts on all of [00:25:48] these to now also include all the Aspire [00:25:51] sessions. It just did that for me. And [00:25:52] apparently, it was nine now, it was six, [00:25:55] 15 now. So, apparently there are six [00:25:56] sessions about Aspire. And it just did [00:25:58] that for me, right? It's not like, oh, [00:26:00] here's the list. Please do all these [00:26:02] things for please manually press all the [00:26:04] hearts. It's like, no, I'm going to do [00:26:06] that for you because I have the tools. I [00:26:08] know how to invoke the code to do that [00:26:10] for you and actually make your user [00:26:13] experience for this ad better. Same [00:26:15] thing with like there he is again. My um [00:26:18] great friend Daniel Roth. Daniel Roth. [00:26:21] Open Daniel Roth. A little bit of a [00:26:22] weird syntax here. Open Daniel Roth. Um [00:26:25] but this makes it clear to the model [00:26:27] that it needs to open the Daniel Roth [00:26:29] speaker page and it goes to that speaker [00:26:32] page, right? I don't need to go I don't [00:26:34] need to know how to navigate to that [00:26:35] page. My only intent is like I want to [00:26:38] see the details and it brings me there. [00:26:40] Same thing for kind of like the [00:26:42] sessions, right? If I do um open [00:26:45] introducing [00:26:47] uh introducing blazer kit, I know that [00:26:51] that is a session. Um it will bring me [00:26:54] to the session details for this very [00:26:56] specific um session or it should right [00:26:58] I'm now overplaying my hand introducing. [00:27:00] See it's a little bit more on the typos [00:27:03] here. I hope that we'll do it like this [00:27:05] else I'm just going to continue. Um, but [00:27:08] you can see this is immediately also a [00:27:10] little bit of the limitations that we're [00:27:11] hitting for the local models, right? You [00:27:13] need to be a little bit more clear than [00:27:14] with something that runs on the cloud [00:27:16] and that can infer like, oh, you made a [00:27:18] typo, but I know what you understand, [00:27:19] right? So, introducing Blerkit. Let's [00:27:22] put that on my schedule as well. Boom. [00:27:24] There we go. So that I don't miss it. [00:27:26] And when I'm done, this is also a nice [00:27:28] one. Remove actually aspire. It's not in [00:27:31] anymore. I don't care, right? Remove all [00:27:33] the Aspire sessions again. um I mean I I [00:27:37] just don't want to see them, right? U so [00:27:38] I've got 16 in my schedule right now and [00:27:40] it's going to remove them for me. But [00:27:42] this is a destructive um action, right? [00:27:46] So you want to get some confirmation. [00:27:48] There is an attribute for that as we [00:27:50] will see in a second as well. So that [00:27:52] the model will actually ask you for an [00:27:54] extra time of like hey this is this is [00:27:56] potentially dangerous. Are you sure that [00:27:58] this is what you want to do? Um, so then [00:28:00] it can come back and have this extra [00:28:02] confirmation of like, oh, hey, you want [00:28:04] to remove these nine sessions that all [00:28:06] have to do with this fire in some way. [00:28:07] Um, and you can say, well, remove or [00:28:09] keep in my schedule, right? The choice [00:28:10] is yours. Um, and I'm going to remove [00:28:12] them. And you can immediately see that [00:28:14] the seven um is updated. And now I only [00:28:16] have the seven left that have nothing to [00:28:18] do with Aspire, right? Another little [00:28:21] thing that I'm not going to show you in [00:28:22] much detail is like, hey, here in this [00:28:25] great control, I have this five hour and [00:28:28] 30 minute break, right? And then I have [00:28:30] all these gaps here. So I add a little [00:28:32] uh button here with like, hey, find um [00:28:34] gaps, find sessions for the gaps. Uh I [00:28:37] see gaps in my schedule, watch sessions [00:28:39] fit in here. So, it will again take into [00:28:41] account the um hours that I want to [00:28:43] watch, find the sessions for my gaps, [00:28:45] and it's going to actually propose to me [00:28:47] like, oh, these are the things that fit [00:28:49] um between the schedule that you might [00:28:50] already have in place um so that you [00:28:52] have a full schedule and you're never [00:28:54] bored and you don't have any gaps in [00:28:56] here, right? So, just a couple things [00:28:58] that you can kind of like do here. See, [00:29:00] 12 selected uh check sessions are not [00:29:02] saved until you choose add. sheet. So, [00:29:04] this plucks it in and these are probably [00:29:06] sessions that are already um kind of [00:29:08] like in the um in my schedule as well. [00:29:11] So, they will overlap and that's why [00:29:12] they're not um selected automatically, [00:29:15] right? So, all kinds of cool things that [00:29:17] you can do here. [00:29:19] Keep your users in control. I think this [00:29:21] is very important if you want to augment [00:29:23] your app with AI. Uh improve that user [00:29:26] experience, keep your users in control, [00:29:28] right? So, this goes back to um the [00:29:30] approval required, but also for other [00:29:33] things where the user might feel like, [00:29:35] oh, I'm losing control. People don't [00:29:36] like that, right? They want to be [00:29:38] helped. Um but they do not want to feel [00:29:40] like they're losing control and they [00:29:41] don't know what's going on anymore. So, [00:29:43] um here you have the little uh you can [00:29:45] see it in the top line there, approval [00:29:47] required because we have request [00:29:49] removal, right? And then it can come [00:29:51] back um and it will um the call comes [00:29:54] back for approval and then it can [00:29:56] execute some code on like hey if they [00:29:58] approve if they do not approve what is [00:30:00] going to happen on these things right [00:30:02] but it's still plain C you are you can [00:30:05] write that you can understand it and the [00:30:07] model will decide like hey if something [00:30:09] is going to happen yes or no um if [00:30:11] approval is going to be needed [00:30:14] where to draw the line validate every [00:30:16] request right um it's still it doesn't [00:30:20] change here, prompt injection, all those [00:30:22] kinds of things. Whenever you get things [00:30:23] from other places, you need to validate [00:30:26] um all the arguments, all the input, [00:30:28] make sure that it's safe, make sure that [00:30:29] nothing uh weird will happen. Again, the [00:30:32] local models might be a little bit [00:30:34] limited. Um the remote models I think [00:30:36] should be pretty good by now by picking [00:30:38] up any ill intent, but for the local [00:30:40] models, they might not, right? Any [00:30:43] destructive actions, make sure they [00:30:45] confirm. Um say what you can do, right? [00:30:47] Make clear messages because you can [00:30:49] ground all of this. Um you'll see that [00:30:51] in the .NET comp if you go there for the [00:30:53] source. Say what you can't do. Set clear [00:30:56] boundaries. This shouldn't be new if [00:30:58] you've been working with AI for the past [00:30:59] year, right? And expose only what you [00:31:01] know. U it's only what you need, right? [00:31:04] Don't go now all methods inside of your [00:31:06] app. Make them tools because then [00:31:08] suddenly your model can do all kinds of [00:31:10] things that you didn't expect. Um and [00:31:12] maybe you've built an app that becomes [00:31:13] self-aware and you have all the troubles [00:31:15] there, right? So um expose only what's [00:31:17] needed, what you're comfortable with [00:31:19] that people should be doing within your [00:31:21] app. [00:31:22] This is not really implemented. One [00:31:24] thing I quickly want to mention, [00:31:25] semantic search, right? So it doesn't [00:31:27] really build a database. It doesn't [00:31:29] train your model. Um but it turns your [00:31:31] text into vectors so that you don't [00:31:33] really need to match like the actual [00:31:35] keywords of like, hey, um okay, I want [00:31:37] to do talks about AI on phones. And then [00:31:39] whenever you do something with a phone, [00:31:41] it doesn't need to or whenever it kind [00:31:42] of like hits the same topic. It doesn't [00:31:44] necessarily have to be the same [00:31:46] keywords, right? So with semantic [00:31:47] search, it will pick up on similar [00:31:49] meaning. It will score that [00:31:50] automatically for you. You can just [00:31:52] index it once and it will automatically [00:31:54] pick that up out of the context and make [00:31:56] that for easier for you as well. Here [00:31:59] are some other ideas that we, you know, [00:32:01] could think of. Um, hey, where do I find [00:32:03] the dark mode switch? Um, new to Aspire, [00:32:06] where do I start? uh what should I know [00:32:08] before watching this talk right so you [00:32:11] can make this crazy it's not just an app [00:32:13] anymore with like oh this is an overview [00:32:15] of the speakers and the sessions but you [00:32:17] can just make this a whole educational [00:32:19] experience of like hey what are all the [00:32:20] things that I do here and make it very [00:32:22] inclusive right without having to [00:32:24] localize my whole application read it in [00:32:26] my language why not translate all these [00:32:28] abstract to the language that you want [00:32:31] right the sky's is the limit with all of [00:32:32] this stuff um and then if you want to go [00:32:35] completely crazy why are we stuck stuck [00:32:37] with UIs to begin with, right? Um there [00:32:40] is another experiment in the Maui labs [00:32:42] repository which is called AI wayfinding [00:32:45] because actually isn't it always been [00:32:48] about intent? Why do I need to know [00:32:51] where to exactly click to get the [00:32:52] speaker details or where to exactly [00:32:54] click to do the push notifications or [00:32:56] where to find the settings for this [00:32:58] thing? Right? It's about the intent. I [00:33:00] know what I want to do and the UI should [00:33:03] be intuitive enough to be able to find [00:33:05] it. But now we have all the tools, we [00:33:08] have the models to just say like, "Oh, I [00:33:10] want to do this thing." And the model [00:33:11] could figure out how to do it, how to [00:33:13] get you there. Maybe we're going to a [00:33:15] place where um the UI is just very [00:33:17] custom to you. I want to see the [00:33:19] speakers. I want to see the session in a [00:33:21] grid with, I don't know, all the uh [00:33:24] speaker images um in a mosaic. I don't [00:33:27] know, something like that. And the model [00:33:28] just knows how to lay that out for you [00:33:30] because that's your preference. And it [00:33:32] has the data. It knows how to create a [00:33:33] UI. So why not create something custom [00:33:35] for you and not have a um deterministic [00:33:38] UI that I have decided for you that you [00:33:41] should like. Right? So all kinds of cool [00:33:43] experiments in the Maui labs that are [00:33:46] going on Microsoft X engines AI one a IT [00:33:49] client for all the things that you can [00:33:51] plug in here. Essentials AI your unified [00:33:54] API for your private offline AI on the [00:33:57] device AI attributes to turn your code [00:34:00] into tools that the model can call. Um, [00:34:02] and of course keep your users in control [00:34:04] with everything that you do. Try it [00:34:06] today. All the packages are here. The [00:34:08] labs repository is on GitHub. The demo [00:34:10] app is on GitHub and in the app source. [00:34:13] The garden sample is also a sample that [00:34:15] lives in the Maui labs repository. [00:34:17] Barista Notes is another cool app by [00:34:19] David Ortnau that also incorporates some [00:34:21] of these concepts and even more. So go [00:34:24] definitely go check that out as well. [00:34:26] And of course, we have everything in the [00:34:28] docs on learn.microsoft.com. Thank you [00:34:31] so much for your time. Enjoy all the [00:34:32] other sessions at .NET Con.