{"id":1504,"date":"2023-11-09T16:33:29","date_gmt":"2023-11-10T00:33:29","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/semantic-kernel\/?p=1504"},"modified":"2023-11-10T05:32:26","modified_gmt":"2023-11-10T13:32:26","slug":"assistants-a-first-look-into-using-openai-assistants-with-semantic-kernel","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/agent-framework\/assistants-a-first-look-into-using-openai-assistants-with-semantic-kernel\/","title":{"rendered":"OpenAI Assistants: a first look into using OpenAI Assistants with Semantic Kernel"},"content":{"rendered":"<h1 style=\"padding-bottom: 2rem;\"><a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/03\/skpatternlarge.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-89\" src=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/03\/skpatternlarge.png\" alt=\"Image skpatternlarge\" width=\"1638\" height=\"136\" srcset=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/03\/skpatternlarge.png 1638w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/03\/skpatternlarge-300x25.png 300w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/03\/skpatternlarge-1024x85.png 1024w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/03\/skpatternlarge-768x64.png 768w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/03\/skpatternlarge-1536x128.png 1536w\" sizes=\"(max-width: 1638px) 100vw, 1638px\" \/><\/a><\/h2>\n<p>On Monday, we shared that <a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/assistants-the-future-of-semantic-kernel\/\">the future of Semantic Kernel will leverage OpenAI Assistants<\/a> so you can take advantage of the ease-of-use they provide in creating agents and copilots.<\/p>\n<p>In <em>this<\/em> blog post, we wanted to pick up where we left off and share an incremental update on our current progress while <em>also<\/em> diving into some of the scenarios we want to enable once we\u2019ve launched the integration.<\/p>\n<p style=\"text-align: left;\">So without further ado\u2026 check out this recorded demo of us using assistants with Semantic Kernel! In the demo, you\u2019ll see just how easy it\u2019ll be to update an existing Semantic Kernel v1.0 project from a standard kernel to an assistant kernel.<\/p>\n<p style=\"text-align: center;\"><video style=\"max-width: 100%; width: 600px; aspect-ratio: auto 600\/300; height: auto;\" src=\"https:\/\/learn.microsoft.com\/video\/media\/aa0aaef2-6c63-4253-a725-19cbaf464254\/SK%20and%20Assistants_1699574142931_1920x1080_AACAudio_2809.mp4\" crossorigin=\"anonymous\" poster=\"https:\/\/videoencodingpublicwus.blob.core.windows.net\/docs-video-encoding\/992c487b-2a40-4f94-88fa-a6737626e761\/draft\/Thumbnail\/Screenshot%202023-11-10%20at%2012.06.08%E2%80%AFAM.png?skoid=1603f197-ec42-4fdf-bfea-0574bc283e7a&amp;sktid=975f013f-7f24-47e8-a7d3-abc4752bf346&amp;skt=2023-11-09T23%3A24%3A09Z&amp;ske=2023-11-15T23%3A29%3A09Z&amp;sks=b&amp;skv=2021-08-06&amp;sv=2021-08-06&amp;st=2023-11-10T00%3A07%3A22Z&amp;se=2023-11-10T04%3A07%3A22Z&amp;sr=b&amp;sp=r&amp;sig=jW0bxUgD0zJozwNI9w7HR%2BhMDmEKI6BaOB3QWstURFE%3D\" controls=\"controls\" width=\"300\" height=\"150\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><track kind=\"captions\" src=\"https:\/\/videoencodingpublicwus.blob.core.windows.net\/docs-video-encoding\/992c487b-2a40-4f94-88fa-a6737626e761\/draft\/Caption\/SK%20and%20Assistants_en-us.vtt?skoid=1603f197-ec42-4fdf-bfea-0574bc283e7a&amp;sktid=975f013f-7f24-47e8-a7d3-abc4752bf346&amp;skt=2023-11-09T23%3A24%3A09Z&amp;ske=2023-11-15T23%3A29%3A09Z&amp;sks=b&amp;skv=2021-08-06&amp;sv=2021-08-06&amp;st=2023-11-10T00%3A07%3A22Z&amp;se=2023-11-10T04%3A07%3A22Z&amp;sr=b&amp;sp=r&amp;sig=zI%2FGT6TE2Nbb%2BKuTenM6y4BZ31d%2BRxCYrWgvpJlrH00%3D\" label=\"English (United States)\" srclang=\"en-us\" \/><!--fast-78jdfw:2-->\nYour browser does not support the video tag.<\/video><\/p>\n<p>As you likely saw from the video, we\u2019re able to use the Semantic Kernel SDK to let users chat with an entire team of agents. This functionality has been <em>highly<\/em> influenced by the work pioneered by the Autogen team. With their framework, they\u2019ve shown that multiple agents can be better than one.<\/p>\n<p>For example, when you use a single assistant, you must give it <em>all<\/em> your plugins and memory so it can answer <em>any<\/em> request by a user. This, however, can be too much for a single assistant to handle. Plus, it becomes difficult to evaluate that a monolithic agent can <em>actually<\/em> work across such a large domain.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant@2x.png\"><img decoding=\"async\" class=\"aligncenter wp-image-1512 size-large\" src=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant@2x-1024x409.png\" alt=\"Image user to assistant 2x\" width=\"480\" height=\"192\" srcset=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant@2x-1024x409.png 1024w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant@2x-300x120.png 300w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant@2x-768x307.png 768w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant@2x-1536x613.png 1536w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant@2x.png 1824w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>Instead, you can create individual assistants for each of your domains by giving them specialized plugins and memories. In the picture below, we show how you could have a single Project Manager agent that coordinates requests between the user and the rest of the team\u2013in this case, a scientist, artist, and investigator.<\/p>\n<p><strong>We call this a hierarchical chat.<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant-to-assistant.png\"><img decoding=\"async\" class=\"aligncenter wp-image-1511 size-large\" src=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant-to-assistant-1024x623.png\" alt=\"Image user to assistant to assistant\" width=\"640\" height=\"389\" srcset=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant-to-assistant-1024x623.png 1024w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant-to-assistant-300x182.png 300w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant-to-assistant-768x467.png 768w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant-to-assistant-1536x934.png 1536w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/user-to-assistant-to-assistant-2048x1245.png 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>With plugins, we\u2019ll make it extremely easy to model a hierarchical structure like this. The benefit of this approach is that the project manager agent can make parallel requests to multiple agents. For example, the product manager agent may want to simultaneously get scientific, artistic, and investigative insight to answer a user\u2019s request.<\/p>\n<p>The challenge with this approach, however, is that the user must wait for the product manager to relay any information it receives from its team.<\/p>\n<p>Because of this, we\u2019re also in the process of implementing a solution that allows all agents to speak on the same thread. This is very similar to what <a href=\"https:\/\/github.com\/microsoft\/autogen\">Autogen<\/a> does today. By sharing a thread, all assistants instantly have awareness of what was said elsewhere, <em>and<\/em> the sub-assistants can directly communicate with the user.<\/p>\n<p><strong>We call this a joint chat.<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/11\/joint-chat.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-1513\" src=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2023\/11\/joint-chat-1024x622.png\" alt=\"Image joint chat\" width=\"640\" height=\"389\" srcset=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/joint-chat-1024x622.png 1024w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/joint-chat-300x182.png 300w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/joint-chat-768x466.png 768w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/joint-chat-1536x933.png 1536w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2023\/11\/joint-chat-2048x1244.png 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>This is just like a live Teams meeting. You can have faster collaboration, but each person can only speak one at a time\u2013therefore its more difficult to parallelize than hierarchical chat.<\/p>\n<p>The pros and cons of the two approaches mirror how people collaborate in businesses as well. For highly distributed tasks, having an org hierarchy is helpful (you wouldn\u2019t want an entire company on the same Teams call!) while other tasks are best hammered out over a meeting.<\/p>\n<p>As research in this space grows, the choice of which method to choose (and when) will become more clear, but in the meantime, the Semantic Kernel team believes that both will have an important part to play in orchestrating agents, so we want to make sure both routes are extremely easy to create with our SDK.<\/p>\n<h2 style=\"clear: both; padding-top: 2rem;\">Take a look at our prototype<\/h2>\n<p>If you\u2019re excited to see the sample code, you can look at our <em>very<\/em> early prototype in our <a href=\"https:\/\/github.com\/matthewbolanos\/sk-v1-proposal\/blob\/main\/dotnet\/samples\/06-Assistants\/Program.cs\">v1 proposal repo<\/a>. It still has some polishing to go through, so don\u2019t be surprised if it\u2019s a bit buggy at first. The team is now refining the implementation so we can bring it into the main branch of Semantic Kernel.<\/p>\n<p>Once it\u2019s in, I\u2019ll share another blog post that walks through how to use the SDK in more detail!<\/p>\n<h2 style=\"clear: both; padding-top: 2rem;\">Have feedback?<\/h2>\n<p>We\u2019ve already gotten great feedback on our proposal to integrate assistants into our SDK. If you have additional thoughts, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/discussions\/3393\">consider sharing them with us there<\/a>!<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Monday, we shared that the future of Semantic Kernel will leverage OpenAI Assistants so you can take advantage of the ease-of-use they provide in creating agents and copilots. In this blog post, we wanted to pick up where we left off and share an incremental update on our current progress while also diving into [&hellip;]<\/p>\n","protected":false},"author":121401,"featured_media":1505,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1504","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-semantic-kernel"],"acf":[],"blog_post_summary":"<p>On Monday, we shared that the future of Semantic Kernel will leverage OpenAI Assistants so you can take advantage of the ease-of-use they provide in creating agents and copilots. In this blog post, we wanted to pick up where we left off and share an incremental update on our current progress while also diving into [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/1504","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\/121401"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/comments?post=1504"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/1504\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media\/1505"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media?parent=1504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/categories?post=1504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/tags?post=1504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}