{"id":4620,"date":"2025-04-04T09:33:25","date_gmt":"2025-04-04T16:33:25","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/semantic-kernel\/?p=4620"},"modified":"2025-04-04T10:13:12","modified_gmt":"2025-04-04T17:13:12","slug":"semantic-kernel-agents-are-now-generally-available","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/agent-framework\/semantic-kernel-agents-are-now-generally-available\/","title":{"rendered":"Semantic Kernel Agents are now Generally Available"},"content":{"rendered":"<p>The time is finally here, Semantic Kernel\u2019s Agent framework is now Generally Available! Available today as part of Semantic Kernel 1.45 (<a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.SemanticKernel\">.NET<\/a>) and 1.27 (<a href=\"https:\/\/pypi.org\/project\/semantic-kernel\/\">Python<\/a>), the Semantic Kernel Agent framework makes it easier for agents to coordinate and dramatically reduces the code developers need to write to build amazing AI applications.<\/p>\n<p>What does Generally Available mean? When we mark an API as Generally Available it means that we have high confidence in the quality of the surface for building AI applications and that we can support and maintain the API going forward. We know that a stable and supported API is important for everyone building AI and Agent enterprise applications on Semantic Kernel.<\/p>\n<p>Creating agents with Semantic Kernel is easy (this example is in Python, full sample here for <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/python\/samples\/getting_started_with_agents\/chat_completion\/step1_chat_completion_agent_simple.py\">Python<\/a> and <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/dotnet\/samples\/GettingStartedWithAgents\/Step01_Agent.cs\">C#<\/a>):<\/p>\n<pre class=\"prettyprint language-py\"><code class=\"language-py\">import asyncio\r\nfrom semantic_kernel.agents import ChatCompletionAgent\r\nfrom semantic_kernel.connectors.ai.open_ai import AzureChatCompletion\r\n\r\nasync def main():\r\n    # Initialize a chat agent with basic instructions\r\n    agent = ChatCompletionAgent(\r\n        service=AzureChatCompletion(),\r\n        name=\"SK-Assistant\",\r\n        instructions=\"You are a helpful assistant.\",\r\n    )\r\n\r\n    # Get a response to a user message\r\n    response = await agent.get_response(messages=\"Write a haiku about Semantic Kernel.\")\r\n    print(response.content)\r\n\r\nasyncio.run(main()) <\/code><\/pre>\n<p>Enhance your agent with custom tools (plugins) and structured output (this example is in C#, full sample here for <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/dotnet\/samples\/GettingStartedWithAgents\/Step02_Plugins.cs\">C#<\/a> and <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/python\/samples\/getting_started_with_agents\/chat_completion\/step4_chat_completion_agent_plugin_simple.py\">Python<\/a>):<\/p>\n<pre class=\"prettyprint language-cs language-csharp\"><code class=\"language-cs language-csharp\">using System.ComponentModel;\r\nusing Microsoft.SemanticKernel;\r\nusing Microsoft.SemanticKernel.Agents;\r\nusing Microsoft.SemanticKernel.ChatCompletion;\r\n\r\nvar builder = Kernel.CreateBuilder();\r\nbuilder.AddAzureOpenAIChatCompletion(\r\n                Environment.GetEnvironmentVariable(\"AZURE_OPENAI_DEPLOYMENT\"),\r\n                Environment.GetEnvironmentVariable(\"AZURE_OPENAI_ENDPOINT\"),\r\n                Environment.GetEnvironmentVariable(\"AZURE_OPENAI_API_KEY\")\r\n                );\r\nvar kernel = builder.Build();\r\n\r\nkernel.Plugins.Add(KernelPluginFactory.CreateFromType&lt;MenuPlugin&gt;());\r\n\r\nChatCompletionAgent agent =\r\n    new()\r\n    {\r\n        Name = \"SK-Assistant\",\r\n        Instructions = \"You are a helpful assistant.\",\r\n        Kernel = kernel,\r\n        Arguments = new KernelArguments(new PromptExecutionSettings() { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() })\r\n\r\n    };\r\n\r\nChatMessageContent message = new(AuthorRole.User, \"What is the price of the soup special?\");\r\n\r\nawait foreach (AgentResponseItem&lt;ChatMessageContent&gt; response in agent.InvokeAsync(message))\r\n{\r\n    Console.WriteLine(response.Message);\r\n    \/\/ The price of the Clam Chowder, which is the soup special, is $9.99.\r\n}\r\n\r\nsealed class MenuPlugin\r\n{\r\n    [KernelFunction, Description(\"Provides a list of specials from the menu.\")]\r\n    public string GetSpecials() =&gt;\r\n        \"\"\"\r\n        Special Soup: Clam Chowder\r\n        Special Salad: Cobb Salad\r\n        Special Drink: Chai Tea\r\n        \"\"\";\r\n\r\n    [KernelFunction, Description(\"Provides the price of the requested menu item.\")]\r\n    public string GetItemPrice(\r\n        [Description(\"The name of the menu item.\")]\r\n        string menuItem) =&gt;\r\n        \"$9.99\";\r\n}<\/code><\/pre>\n<p>Just because we\u2019ve declared GA for the core Agent framework, that doesn\u2019t mean we\u2019re going to stop adding features. For example, here are some other amazing new Semantic Kernel agent features you can try:<\/p>\n<div>\n<div>Build a system of specialized agents that can collaborate (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/python\/samples\/concepts\/agents\/chat_completion_agent\/chat_completion_agent_as_kernel_function.py\">full sample here<\/a>):<\/div>\n<div>\n<pre class=\"prettyprint language-py\"><code class=\"language-py\">billing_agent = ChatCompletionAgent(\r\n    service=AzureChatCompletion(), \r\n    name=\"BillingAgent\", \r\n    instructions=\"You handle billing issues like charges, payment methods, cycles, fees, discrepancies, and payment failures.\"\r\n)\r\n\r\nrefund_agent = ChatCompletionAgent(\r\n    service=AzureChatCompletion(),\r\n    name=\"RefundAgent\",\r\n    instructions=\"Assist users with refund inquiries, including eligibility, policies, processing, and status updates.\",\r\n)\r\n\r\ntriage_agent = ChatCompletionAgent(\r\n    service=OpenAIChatCompletion(),\r\n    name=\"TriageAgent\",\r\n    instructions=\"Evaluate user requests and forward them to BillingAgent or RefundAgent for targeted assistance.\"\r\n    \" Provide the full answer to the user containing any information from the agents\",\r\n    plugins=[billing_agent, refund_agent],\r\n)\r\n\r\nthread: ChatHistoryAgentThread = None\r\n\r\nasync def main() -&gt; None:\r\n    print(\"Welcome to the chat bot!\\n  Type 'exit' to exit.\\n  Try to get some billing or refund help.\")\r\n    while True:\r\n        user_input = input(\"User:&gt; \")\r\n\r\n        if user_input.lower().strip() == \"exit\":\r\n            print(\"\\n\\nExiting chat...\")\r\n            return False\r\n\r\n        response = await triage_agent.get_response(\r\n            messages=user_input,\r\n            thread=thread,\r\n        )\r\n\r\n        if response:\r\n            print(f\"Agent :&gt; {response}\")<\/code><\/pre>\n<p>Or, connect to other managed agent platforms:<\/p>\n<ul>\n<li>Azure AI Agent Service (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/dotnet\/src\/Agents\/AzureAI\">C#<\/a>, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/fd27470c86709cb86d6f61897dadedbf7a7b3421\/python\/semantic_kernel\/agents\/azure_ai\">Python)<\/a><\/li>\n<li>AutoGen (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/fd27470c86709cb86d6f61897dadedbf7a7b3421\/python\/semantic_kernel\/agents\/autogen\">Python<\/a>)<\/li>\n<li>AWS Bedrock (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/dotnet\/src\/Agents\/Bedrock\">C#<\/a>, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/fd27470c86709cb86d6f61897dadedbf7a7b3421\/python\/semantic_kernel\/agents\/bedrock\">Python<\/a>)<\/li>\n<li>Crew AI (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/dotnet\/samples\/Concepts\/Plugins\/CrewAI_Plugin.cs\">C#<\/a>, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/python\/semantic_kernel\/core_plugins\/crew_ai\">Python<\/a>)<\/li>\n<li>OpenAI Assistants (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/dotnet\/src\/Agents\/OpenAI\">C#<\/a>, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/fd27470c86709cb86d6f61897dadedbf7a7b3421\/python\/semantic_kernel\/agents\/open_ai\">Python<\/a>)<\/li>\n<\/ul>\n<p>Try out all of our &#8216;Getting Started with Agents&#8217; samples for <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/dotnet\/samples\/GettingStartedWithAgents\">C#<\/a> and <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/python\/samples\/getting_started_with_agents\/chat_completion\">Python<\/a>, and check out all of the Agent framework documentation and samples (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/dotnet\/samples\/Concepts\/Agents\">C#<\/a>, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/python\/samples\/concepts\/agents\">Python<\/a>)<\/p>\n<p>Today\u2019s Semantic Kernel announcement is part of a broader set of AI announcements we\u2019re making as part of Microsoft\u2019s 50<sup>th<\/sup> anniversary. You can find out more about<a href=\"https:\/\/aka.ms\/AIredteaming\"> AI Red Teaming<\/a> and the <a href=\"https:\/\/aka.ms\/azureaifoundry\/vscode\/blog\">AI Foundry Visual Studio Code extension<\/a> in <a href=\"https:\/\/aka.ms\/AzureAIFoundryApril2025\">Asha\u2019s blog post<\/a>. Happy birthday Microsoft!<\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The time is finally here, Semantic Kernel\u2019s Agent framework is now Generally Available! Available today as part of Semantic Kernel 1.45 (.NET) and 1.27 (Python), the Semantic Kernel Agent framework makes it easier for agents to coordinate and dramatically reduces the code developers need to write to build amazing AI applications. What does Generally Available [&hellip;]<\/p>\n","protected":false},"author":173663,"featured_media":2808,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[27,47,17],"tags":[49,82,63],"class_list":["post-4620","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-agents","category-announcement","category-announcements","tag-ai-agents","tag-announcement","tag-microsoft-semantic-kernel"],"acf":[],"blog_post_summary":"<p>The time is finally here, Semantic Kernel\u2019s Agent framework is now Generally Available! Available today as part of Semantic Kernel 1.45 (.NET) and 1.27 (Python), the Semantic Kernel Agent framework makes it easier for agents to coordinate and dramatically reduces the code developers need to write to build amazing AI applications. What does Generally Available [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/4620","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\/173663"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/comments?post=4620"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/4620\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media\/2808"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media?parent=4620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/categories?post=4620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/tags?post=4620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}