Microsoft is pushing the boundaries of artificial intelligence with the release of the Agent Framework, a recent toolkit designed to simplify the creation of sophisticated AI agents. This framework aims to bridge the gap between large language models (LLMs) and practical, enterprise-ready applications, offering developers a more robust and flexible platform than previous iterations. The Agent Framework, currently in public preview, builds upon the foundations laid by Semantic Kernel and AutoGen, combining their strengths into a unified system.
At its core, the Microsoft Agent Framework provides developers with the tools to build AI-powered applications capable of handling complex tasks. It introduces two primary components: Agents and Workflows. Agents are individual entities powered by LLMs – supporting models like Azure OpenAI, OpenAI, Anthropic, and Ollama – that process inputs, call tools, and generate responses. Workflows, are graph-based systems that connect agents and functions for multi-step tasks, incorporating secure routing, checkpoints, and human-in-the-loop integration.
The framework isn’t just about agents and workflows; it as well provides fundamental building blocks for developers. These include model clients for conversation completion and responses, an agent session manager for state handling, context providers for agent memory, middleware for intercepting agent actions, and MCP clients for tool integration. These components collectively offer the flexibility and power needed to create interactive, robust, and secure AI applications.
Getting Started with the Agent Framework
Microsoft provides straightforward installation instructions for developers using both .NET and Python. For .NET developers, the following packages can be added to a project:
dotnet add package Azure.AI.OpenAI --prerelease dotnet add package Azure.Identity dotnet add package Microsoft.Agents.AI.OpenAI --prerelease
A simple example demonstrates how to create an agent using the Azure OpenAI service:
using System; using Azure.AI.OpenAI; using Azure.Identity; using Microsoft.Agents.AI; AIAgent agent = new AzureOpenAIClient( new Uri(Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!), new AzureCliCredential()) .GetChatClient("gpt-4o-mini") .AsAIAgent(instructions: "You are a friendly assistant. Keep your answers brief."); Console.WriteLine(await agent.RunAsync("What is the largest city in France?"));
Python developers can install the framework using pip:
pip install agent-framework --pre
And a corresponding Python example:
credential = AzureCliCredential() client = AzureOpenAIResponsesClient( project_endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"], deployment_name=os.environ["AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME"], credential=credential, ) agent = client.as_agent( name="HelloAgent", instructions="You are a friendly assistant. Keep your answers brief.", ) # Non-streaming: get the complete response at once result = await agent.run("What is the largest city in France?") print(f"Agent: {result}")
When to Employ Agents vs. Workflows
The Agent Framework offers guidance on choosing between agents and workflows based on the nature of the task. Agents are best suited for open-ended or conversational tasks requiring autonomous tool use and planning. Workflows excel in scenarios with well-defined steps, requiring explicit control over execution order and coordination between multiple agents or functions. Microsoft emphasizes that if a task can be handled with a traditional function, that approach is preferable to using an AI agent.
The framework’s developers highlight that Agent Framework isn’t a complete departure from its predecessors. It combines the simplicity of AutoGen’s agent abstractions with the enterprise-level features of Semantic Kernel, such as session-based state management, type safety, middleware, and telemetry. The introduction of workflows provides developers with explicit control over multi-agent execution paths and a robust state management system for long-term and human-in-the-loop scenarios. Microsoft positions Agent Framework as the next evolution of both Semantic Kernel and AutoGen.
The project welcomes contributions from the open-source community, mirroring the success of Semantic Kernel and AutoGen. Developers are encouraged to provide feedback and report issues through the GitHub repository. It’s vital to note that the Microsoft Agent Framework is currently in public preview, indicating ongoing development and potential changes.
Microsoft includes a critical disclaimer regarding the use of the framework with third-party servers or agents. Users are responsible for reviewing data shared with external entities and understanding their data retention and location practices. Organizations must carefully manage data flows to ensure compliance with Azure’s geographic and compliance boundaries.
The Agent Framework represents a significant step forward in simplifying the development of AI-powered applications. By combining the strengths of existing frameworks and introducing new features like workflows, Microsoft is empowering developers to build more sophisticated and reliable AI solutions. As the framework matures and the community contributes, we can expect to see even more innovative applications emerge.
Share your thoughts and experiences with the Microsoft Agent Framework in the comments below. What use cases are you most excited about exploring?