{"id":3981,"date":"2025-01-17T09:20:52","date_gmt":"2025-01-17T17:20:52","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/semantic-kernel\/?p=3981"},"modified":"2025-02-10T10:16:32","modified_gmt":"2025-02-10T18:16:32","slug":"guest-blog-leap-forward-with-modern-ai-using-microsoft-365-agents-sdk-and-semantic-kernel","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/agent-framework\/guest-blog-leap-forward-with-modern-ai-using-microsoft-365-agents-sdk-and-semantic-kernel\/","title":{"rendered":"Guest Blog: Leap Forward with Modern AI using Microsoft 365 Agents SDK and Semantic Kernel"},"content":{"rendered":"<header class=\"entry-header\">\n<div class=\"entry-header-text entry-header-text-top text-center\">\n<h1 class=\"entry-title\">Leap Forward with Modern AI using Microsoft 365 Agents SDK and Semantic Kernel<\/h1>\n<p>Today we\u2019re featuring a guest author, Arafat Tehsin, who\u2019s a Microsoft Most Valuable Professional (MVP) for AI. He\u2019s written an article we\u2019re sharing below, focused on how to <a href=\"https:\/\/arafattehsin.com\/leap-forward-with-modern-ai-using-microsoft-365-agents-sdk-and-semantic-kernel\/\">Leap Forward with Modern AI using Microsoft 365 Agents SDK and Semantic Kernel<\/a>. We\u2019ll turn it over to Arafat to share more!<\/p>\n<\/div>\n<div class=\"entry-image relative\"><a href=\"https:\/\/arafattehsin.com\/leap-forward-with-modern-ai-using-microsoft-365-agents-sdk-and-semantic-kernel\/\"><img decoding=\"async\" class=\"attachment-large size-large wp-post-image\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/splash-agents-sdk-sk.gif\" alt=\"splash-agents-sdk-sk\" width=\"854\" height=\"480\" \/><\/a><\/div>\n<div>Happy new year. I know you\u2019re excited to see this. It is real, it is happening, but you know what? It is still in preview and things will break. So, get ready for it. If you\u2019re wondering what <a href=\"https:\/\/learn.microsoft.com\/microsoft-365\/agents-sdk\/?WT.mc_id=AI-MVP-5003464\">this SDK<\/a>\u00a0is all about then despite my little coverage about it in this post, you also may want to read the official documentation which Microsoft team has quickly put together for you. The objective of this post is to show you how to use\u00a0<a href=\"https:\/\/arafattehsin.com\/building-multi-agent-systems-with-multi-models-in-semantic-kernel-part-1\/\">Semantic Kernel\u2019s Agent Framework<\/a>\u00a0with Microsoft 365 Agents SDK and why is it a big deal.<\/div>\n<\/header>\n<div class=\"entry-content single-page\">\n<h2>\ud83e\udd14 Evolution or a new skin?<\/h2>\n<p>Not sure how many times (<em>probably 100-ish?<\/em>) I have mentioned on multiple instances that\u00a0<a href=\"https:\/\/learn.microsoft.com\/azure\/bot-service\/index-bf-sdk?view=azure-bot-service-4.0&amp;WT.mc_id=AI-MVP-5003464\">Bot Framework<\/a>\u00a0has been one of the best frameworks produced for Conversational AI by any team. I still remember\u00a0<a href=\"https:\/\/techcommunity.microsoft.com\/blog\/azure-ai-services-blog\/build-2020---conversational-ai-updates\/1397685?WT.mc_id=AI-MVP-5003464\">those days<\/a> when it evolved into such a great offering for not just code-first developers but also those who could utilize Composer client to create exceptional\u00a0<a href=\"https:\/\/arafattehsin.com\/build-a-flight-tracker-using-bot-framework-composer-part-1\/\">conversational experiences<\/a>. However, with time and strategy change, Copilot Studio took the charge and started to\u00a0<a href=\"https:\/\/learn.microsoft.com\/power-platform\/release-plan\/2024wave2\/microsoft-copilot-studio\/planned-features?WT.mc_id=AI-MVP-5003464\">release those cool features<\/a>\u00a0which are essential for today\u2019s conversational experiences.<\/p>\n<p>In the parallel world, considering multiple focus areas of Microsoft AI, enterprises who were already using Bot Framework SDK are a bit worried of its future. Why? Because they don\u2019t see any advancements with the similar speed as they witness in other products, for example\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/introducing-microsoft-extensions-ai-preview\/?WT.mc_id=AI-MVP-5003464\">.NET AI Extensions<\/a>,\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/\">Semantic Kernel<\/a>,\u00a0<a href=\"https:\/\/www.microsoft.com\/en-us\/microsoft-copilot\/microsoft-copilot-studio\">Microsoft Copilot Studio<\/a>\u00a0and so on. I think today they have an answer (<em>well, to be fair, an early answer<\/em>) in the form of Microsoft Agents 365 SDK.<\/p>\n<p>Microsoft 365 Agents SDK (Preview) represents a significant evolution in building enterprise-grade, scalable, multi-channel agents. It enables developers to create agents that integrate AI services of their choice, such as Azure AI Foundry and connect with orchestration layers like Semantic Kernel. These agents can be deployed across various channels including web via Direct Line, Microsoft Teams, Microsoft 365 Copilot and more.<\/p>\n<p>To put it differently, this SDK bridges the gap between the robust foundation laid by the Bot Framework and the cutting-edge capabilities demanded by modern AI-driven conversational experiences. Think of it as a natural evolution rather than a replacement of Bot Framework, because in reality, it isn\u2019t the one.<\/p>\n<h2>\ud83d\ude80 10x Up with Semantic Kernel<\/h2>\n<p>Semantic Kernel is an enterprise grade framework to\u00a0<a href=\"https:\/\/arafattehsin.com\/build-your-ai-first-apps-with-semantic-kernel\/\">build your AI-first apps<\/a>. Every time we see any advancement within the Generative AI space, be it Parallel Function Calling, Vector Stores, Small Language Models and so on, we see these features getting shipped with a speed. Similarly, they already had\u00a0<code>ChatCompletion<\/code>\u00a0capabilities from day 1 and now with the advancements of Agentic AI, we\u2019ve have got an Agent Framework as well.<\/p>\n<p>However, due to the light-weight nature of the framework, Semantic Kernel relies upon developers to build their own conversational experiences. Such as conversational event handling (<em>i.e. when someone joins the chat<\/em>), effective middleware routing and integration with the external channels such as Direct Line, Telephony, Microsoft Teams, Facebook, Slack and so on. This can now be unlocked by Microsoft 365 Agent SDK, Azure Bot and Semantic Kernel together.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32092\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/sequence-agent-m365-sdk.png\" sizes=\"(max-width: 1263px) 100vw, 1263px\" srcset=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/sequence-agent-m365-sdk.png 1263w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/sequence-agent-m365-sdk-300x219.png 300w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/sequence-agent-m365-sdk-1024x748.png 1024w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/sequence-agent-m365-sdk-768x561.png 768w\" alt=\"Sequence Diagram of a Microsoft 365 Agent SDK Agent with Semantic Kernel\" width=\"1263\" height=\"922\" \/><\/p>\n<p>Currently, the functionality doesn\u2019t have much except for a very basic use-case which talks about getting the flight status (mocked up) from Azure OpenAI Service with an Adaptive Card as a response back. I will improve the use-case as we move along in our upcoming posts.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32096\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/BotFramework-Emulator-Agent.png\" sizes=\"(max-width: 1187px) 100vw, 1187px\" srcset=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/BotFramework-Emulator-Agent.png 1187w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/BotFramework-Emulator-Agent-300x128.png 300w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/BotFramework-Emulator-Agent-1024x437.png 1024w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/BotFramework-Emulator-Agent-768x328.png 768w\" alt=\"BotFramework-Emulator-Agent\" width=\"1187\" height=\"507\" \/><\/p>\n<h2>\ud83d\udce6 Project and Packages<\/h2>\n<p>We will now explore as how you can integrate Semantic Kernel\u2019s Agent Framework with Microsoft 365 Agent SDK agent and surface it to multiple channels via Azure Bot. Unlike Bot Framework SDK, you don\u2019t have any Visual Studio starter templates therefore, you need an Empty ASP.NET Core project. Once you get that project, all you need is the set of\u00a0<code>nuget<\/code>\u00a0packages, just like below.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32089\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/packages.png\" sizes=\"auto, (max-width: 439px) 100vw, 439px\" srcset=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/packages.png 439w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/packages-300x154.png 300w\" alt=\"NuGet Packages for M365 Agent SDK and Semantic Kernel\" width=\"439\" height=\"226\" \/><\/p>\n<p>After that, you may create a similar folder structure as mine which I will explain you one by one. That\u2019s how it looks like.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32090\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/solution-structure.png\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" srcset=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/solution-structure.png 461w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/solution-structure-300x257.png 300w\" alt=\"Solution Structure for M365 Agent SDK and Semantic Kernel\" width=\"461\" height=\"395\" \/><\/p>\n<p>The complete working example is now a\u00a0<a href=\"https:\/\/github.com\/arafattehsin\/generative-ai\/tree\/main\/samples\/dotnet\/microsoft-agent-sk\">part of my repo<\/a>\u00a0which you can access. If you like it, give it a star as it will help others too.<\/p>\n<p><em>Disclaimer: Below code description is generated by o1-preview.<\/em><\/p>\n<h3>Program.cs<\/h3>\n<p>This is the entry point of the application. It sets up the web application, configures services, and starts the web server.<\/p>\n<ul>\n<li><strong>Configuration<\/strong>: Adds user secrets in development mode.<\/li>\n<li><strong>Services<\/strong>: Adds controllers, HTTP client, and registers the Semantic Kernel.<\/li>\n<li><strong>AI Service Registration<\/strong>: Configures Azure OpenAI or OpenAI based on the configuration.<\/li>\n<li><strong>Bot Registration<\/strong>: Registers the TravelAgent and the bot handler.<\/li>\n<li><strong>Application Build and Run<\/strong>: Builds the application and maps controllers<\/li>\n<\/ul>\n<h3>BotHandler.cs<\/h3>\n<p>This file contains the BotHandler class, which handles bot interactions.<\/p>\n<ul>\n<li><strong>OnMessageActivityAsync<\/strong>: Processes incoming messages, invokes the TravelAgent, and sends the response back to the user<\/li>\n<li><strong>OnMembersAddedAsync<\/strong>: Sends a welcome message when a new member is added to the conversation<\/li>\n<\/ul>\n<h3>ServiceCollectionExtensions.cs<\/h3>\n<p>This file contains extension methods for configuring services in the dependency injection container.<\/p>\n<ul>\n<li><strong>AddBot<\/strong>: Configures services for the bot, including authentication, connection clients, and the bot adapter<\/li>\n<\/ul>\n<h3>BotController.cs<\/h3>\n<p>This file contains the BotController class, which handles HTTP requests related to the bot.<\/p>\n<ul>\n<li><strong>PostAsync<\/strong>: Processes incoming HTTP POST requests and invokes the bot to handle the message<\/li>\n<\/ul>\n<h3>appsettings.json<\/h3>\n<p>This file contains configuration settings for the application.<\/p>\n<ul>\n<li><strong>TokenValidation<\/strong>: Contains audience settings for token validation.<\/li>\n<li><strong>Connections<\/strong>: Contains settings for the bot service connection, including client ID, client secret, and scopes.<\/li>\n<li><strong>ConnectionsMap<\/strong>: Maps service URLs to connections.<\/li>\n<li><strong>Logging<\/strong>: Configures logging levels for different components<\/li>\n<\/ul>\n<h3>TravelAgent.cs<\/h3>\n<p>This file defines the TravelAgent class, which acts as a virtual assistant for flight tracking.<\/p>\n<ul>\n<li><strong>Constructor<\/strong>: Initializes the Kernel,\u00a0<code>ChatHistory<\/code>, and\u00a0<code>ChatCompletionAgent<\/code>. Adds the\u00a0<code>TimePlugin<\/code>\u00a0to the agent\u2019s kernel.<\/li>\n<li><strong>InvokeAgentAsync<\/strong>: Takes user input, adds it to the chat history, invokes the agent, and ensures the response is in the correct format.<\/li>\n<\/ul>\n<h3>FlightResponse.cs<\/h3>\n<p>This file defines the\u00a0<code>FlightResponse<\/code>\u00a0class, which represents the response format expected from the\u00a0<code>TravelAgent<\/code><\/p>\n<ul>\n<li><strong>Properties<\/strong>: ContentType and Content with appropriate JSON serialization attributes.<\/li>\n<\/ul>\n<h3>TimePlugin.cs<\/h3>\n<p>This file defines the\u00a0<code>TimePlugin<\/code>\u00a0class, which provides time-related functionalities to the\u00a0<code>TravelAgent<\/code><\/p>\n<ul>\n<li><strong>Methods<\/strong>: Various methods to get the current date, time, year, month, day, etc., formatted in different ways.<\/li>\n<\/ul>\n<h2>\ud83c\udf10 Surface it to your favorite channels<\/h2>\n<p>If you have previously worked with Bot Framework SDK and Azure Bot then it wouldn\u2019t surprise you that the process is still the same. However, if you are new to this, then you may have to learn about it first. Below screenshot is what I have created for this demo and then I have configured the Azure Bot to use my Web App.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32095\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Azure-Subscription.png\" sizes=\"auto, (max-width: 1327px) 100vw, 1327px\" srcset=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Azure-Subscription.png 1327w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Azure-Subscription-300x101.png 300w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Azure-Subscription-1024x344.png 1024w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Azure-Subscription-768x258.png 768w\" alt=\"Azure Resource Management\" width=\"1327\" height=\"446\" \/><\/p>\n<p>Please note that I have got an Azure OpenAI Service subscription residing outside of this resource group so it\u2019s up to you if you want to keep it inside or use whatever is available. You can also learn about configuring the Azure Bot from\u00a0<a href=\"https:\/\/learn.microsoft.com\/azure\/bot-service\/bot-service-manage-settings?view=azure-bot-service-4.0&amp;tabs=userassigned&amp;WT.mc_id=AI-MVP-5003464\">Microsoft Learn<\/a>\u00a0docs. My current setup is just surfacing it to Microsoft Teams rather than anything else.\u00a0<em>Embedded WebChat<\/em>\u00a0and\u00a0<em>DirectLine are on by default.<\/em><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32098\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Agent-Channels.png\" sizes=\"auto, (max-width: 1193px) 100vw, 1193px\" srcset=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Agent-Channels.png 1193w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Agent-Channels-300x119.png 300w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Agent-Channels-1024x407.png 1024w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Agent-Channels-768x305.png 768w\" alt=\"Agent-Channels\" width=\"1193\" height=\"474\" \/><\/p>\n<p>I\u2019m a part of Microsoft\u2019s tenant as a Guest therefore, I do not have the privilege to install an app in Teams. However, I could successfully test on the same.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32097\" src=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Microsoft-Teams-Agent.png\" sizes=\"auto, (max-width: 1187px) 100vw, 1187px\" srcset=\"https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Microsoft-Teams-Agent.png 1187w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Microsoft-Teams-Agent-300x124.png 300w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Microsoft-Teams-Agent-1024x424.png 1024w, https:\/\/arafattehsin.com\/wp-content\/uploads\/2025\/01\/Microsoft-Teams-Agent-768x318.png 768w\" alt=\"Microsoft-Teams-Agent\" width=\"1187\" height=\"491\" \/><\/p>\n<p>Microsoft 365 Agents SDK and Semantic Kernel represent a significant leap forward in the realm of AI-driven solutions. By leveraging these powerful tools, developers can create more intelligent, context-aware applications that enhance user experiences and streamline workflows.<\/p>\n<p>The integration of Semantic Kernel allows for a deeper understanding of user intent, enabling more accurate and relevant responses. As we continue to explore the potential of these technologies, the possibilities for innovation are boundless. I will try to uncover some of the advanced capabilities in upcoming posts. Until next time.<\/p>\n<p>Thanks Arafat from the Semantic Kernel team, we appreciate you sharing your work. Please reach out if you have any questions or feedback through our <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/discussions\/categories\/general\" target=\"_blank\" rel=\"noopener\">Semantic Kernel GitHub Discussion Channel<\/a>. We look forward to hearing from you!<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Leap Forward with Modern AI using Microsoft 365 Agents SDK and Semantic Kernel Today we\u2019re featuring a guest author, Arafat Tehsin, who\u2019s a Microsoft Most Valuable Professional (MVP) for AI. He\u2019s written an article we\u2019re sharing below, focused on how to Leap Forward with Modern AI using Microsoft 365 Agents SDK and Semantic Kernel. We\u2019ll [&hellip;]<\/p>\n","protected":false},"author":149071,"featured_media":2302,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[117],"tags":[79,112,48,63,9],"class_list":["post-3981","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guest-blog","tag-net","tag-net-ai-extensions","tag-ai","tag-microsoft-semantic-kernel","tag-semantic-kernel"],"acf":[],"blog_post_summary":"<p>Leap Forward with Modern AI using Microsoft 365 Agents SDK and Semantic Kernel Today we\u2019re featuring a guest author, Arafat Tehsin, who\u2019s a Microsoft Most Valuable Professional (MVP) for AI. He\u2019s written an article we\u2019re sharing below, focused on how to Leap Forward with Modern AI using Microsoft 365 Agents SDK and Semantic Kernel. We\u2019ll [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/3981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/users\/149071"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/comments?post=3981"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/3981\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media\/2302"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media?parent=3981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/categories?post=3981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/tags?post=3981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}