Registry / llm-agents / agent-framework

agent-framework

JSON →
library1.8.1pypypiunverified

Microsoft Agent Framework is a comprehensive Python library for building, orchestrating, and deploying AI agents and multi-agent workflows. It provides core abstractions, implementations, and integrations with various LLM providers. Version 1.0.1 is the current stable release, offering production-ready APIs with a commitment to long-term support. The project maintains an active development and release cadence.

pip install agent-framework
INSTALL
IMPORT
SIG · AGENT-FRAMEWORK
A
agent-framework
llm-agentspythonv1.8.1
Install
35.1s avg
Import
846ms
Disk
832MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.8.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 38.75s
py 3.11
✕ build_error
✓ 39.03s
py 3.12
✕ build_error
✓ 31.68s
py 3.13
✕ build_error
✓ 30.95s
py 3.9
✕ build_error
✕ build_error
832MB installed
● package 832MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Agent
from agent_framework import Agent
FoundryChatClient
from agent_framework.foundry import FoundryChatClient
AzureOpenAIResponsesClient
from agent_framework.azure import AzureOpenAIResponsesClient
AzureCliCredential
from azure.identity import AzureCliCredential
from agent_framework.azure import AzureCliCredential
AzureCliCredential is part of the 'azure-identity' package, not 'agent-framework.azure'.
asyncio
import asyncio
os
import os

This quickstart demonstrates how to create a simple AI agent using the Microsoft Agent Framework with Azure OpenAI. It requires `azure-identity` for authentication (e.g., via `az login`) and environment variables for Azure project endpoint and deployment name. All agent operations are asynchronous and must be run using `asyncio.run()`.

import asyncio import os from agent_framework.azure import AzureOpenAIResponsesClient from azure.identity import AzureCliCredential # from dotenv import load_dotenv # Uncomment and install if using .env file locally async def main(): # Load environment variables from .env file if uncommented above # load_dotenv() # Ensure AZURE_AI_PROJECT_ENDPOINT and AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME are set # and you are authenticated via Azure CLI (e.g., `az login`) project_endpoint = os.environ.get("AZURE_AI_PROJECT_ENDPOINT", "https://your-project.services.ai.azure.com") deployment_name = os.environ.get("AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME", "gpt-4o") if not all([project_endpoint, deployment_name]): print("Please set AZURE_AI_PROJECT_ENDPOINT and AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME environment variables.") print("Ensure you have authenticated via Azure CLI (`az login`).") return # Create an Azure CLI credential for authentication credential = AzureCliCredential() # Initialize the Azure OpenAI Responses client client = AzureOpenAIResponsesClient( project_endpoint=project_endpoint, deployment_name=deployment_name, credential=credential, ) # Create an agent with instructions agent = client.as_agent( name="HelloAgent", instructions="You are a friendly assistant. Keep your answers brief.", ) # Run the agent print("Agent: Thinking...") result = await agent.run("What is the capital of France?") print(f"Agent: {result}") # Example of streaming response (optional) # print("\nAgent (streaming): Thinking...") # async for token in agent.run("Tell me a short story about a brave knight.", stream=True): # print(token, end="", flush=True) # print() if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
gotchaAll agent operations in the Microsoft Agent Framework are asynchronous. You must use `async/await` syntax and execute your agent logic within an `async` function, typically run via `asyncio.run()`.
fix
Wrap agent invocation code in an `async def main():` function and execute it with `asyncio.run(main())`.
affects: >=1.0.0
gotchaProper authentication and configuration via environment variables are crucial. For Azure services, you'll need to authenticate (e.g., using `az login` for `AzureCliCredential`) and set variables like `AZURE_AI_PROJECT_ENDPOINT` and `AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME`.
fix
Ensure `azure-identity` is installed, run `az login` for Azure CLI authentication, and set required environment variables or API keys before running your agent code. Consider using `python-dotenv` for local development with a `.env` file.
affects: >=1.0.0
gotchaThe command `pip install agent-framework` installs the main package along with all its sub-packages and integrations (e.g., Azure, Foundry, Purview, AG-UI). This can lead to a large dependency footprint. If you only need core functionality or specific integrations, consider installing individual sub-packages (e.g., `agent-framework-core`, `agent-framework-azure`) to keep dependencies lighter.
fix
For smaller deployments or specific use cases, analyze your needs and install only the relevant sub-packages (e.g., `pip install agent-framework-core agent-framework-azure`).
affects: >=1.0.0
gotchaThe Microsoft Agent Framework requires Python 3.10 or a newer version to run correctly.
fix
Ensure your development and deployment environments are using Python 3.10 or a later version.
affects: >=1.0.0
Upgrade
Version history
1.8.1latest on PyPI · released Jun 9, 2026
Audit
Dependencies
azure-identityrequiredRequired for Azure authentication methods like AzureCliCredential, used by Azure-specific chat clients.
python-dotenvoptionalCommonly used for loading environment variables from .env files in local development. Not strictly required by the framework itself, but often seen in quickstarts.
Agent activity
58 hits · last 30 days
node
50
OpenAI (training)
1
Resources
agent-framework — pip install agent-framework · libregistry