Installation
AutoGen is available for both Python and .NET. This guide covers installation for both platforms, prerequisites, and verification steps.
Python Installation
AutoGen requires Python 3.10 or later.
Prerequisites
Check Python version
Verify you have Python 3.10 or later:python --version
# or
python3 --version
If you need to upgrade, download from python.org. Create a virtual environment (recommended)
Using a virtual environment keeps AutoGen dependencies isolated:python3 -m venv .venv
source .venv/bin/activate
To deactivate later:If you prefer conda, first install Conda.conda create -n autogen python=3.12
conda activate autogen
To deactivate later:
Core Packages
AutoGen has three main packages that can be installed separately or together:
autogen-core
Event-driven foundation with agent runtime, message passing, and distributed execution.
autogen-agentchat
High-level API with preset agents and team patterns. Built on autogen-core.
autogen-ext
Extensions for model clients, tools, and integrations.
Installation Options
For most users, install AgentChat with model client extensions:pip install -U "autogen-agentchat" "autogen-ext[openai]"
This installs:
autogen-core (dependency)
autogen-agentchat for high-level agents and teams
autogen-ext[openai] for OpenAI/Azure OpenAI support
For advanced users who want event-driven control:pip install -U "autogen-core"
You’ll likely also want extensions:pip install -U "autogen-ext[openai]"
Install AutoGen Studio for visual workflow building:pip install -U "autogenstudio"
Launch the UI:autogenstudio ui --port 8080
Then open http://localhost:8080 in your browser.
Extension Options
The autogen-ext package supports many optional dependencies. Install only what you need:
Model Clients
Tools & Capabilities
Memory & Storage
Advanced
# OpenAI and Azure OpenAI
pip install "autogen-ext[openai]"
# Azure with AAD authentication
pip install "autogen-ext[azure]"
# Anthropic Claude
pip install "autogen-ext[anthropic]"
# Google Gemini
pip install "autogen-ext[gemini]"
# Local models via Ollama
pip install "autogen-ext[ollama]"
# llama.cpp support
pip install "autogen-ext[llama-cpp]"
# Code execution in Docker
pip install "autogen-ext[docker]"
# Jupyter kernel code execution
pip install "autogen-ext[jupyter-executor]"
# MCP server integration
pip install "autogen-ext[mcp]"
# Web browsing capabilities
pip install "autogen-ext[web-surfer]"
# File handling tools
pip install "autogen-ext[file-surfer]"
# ChromaDB vector store
pip install "autogen-ext[chromadb]"
# Redis caching
pip install "autogen-ext[redis]"
# DiskCache
pip install "autogen-ext[diskcache]"
# Mem0 memory system
pip install "autogen-ext[mem0]"
# gRPC for distributed runtime
pip install "autogen-ext[grpc]"
# GraphRAG integration
pip install "autogen-ext[graphrag]"
# LangChain integration
pip install "autogen-ext[langchain]"
# Semantic Kernel
pip install "autogen-ext[semantic-kernel-core]"
# Rich terminal output
pip install "autogen-ext[rich]"
You can combine multiple extensions: pip install "autogen-ext[openai,docker,chromadb]"
Verify Python Installation
Test that packages are installed correctly:
import autogen_core
import autogen_agentchat
import autogen_ext.models.openai
print(f"autogen-core: {autogen_core.__version__}")
print(f"autogen-agentchat: {autogen_agentchat.__version__}")
print(f"autogen-ext: {autogen_ext.__version__}")
print("\nAutoGen installed successfully!")
Latest stable version: 0.7.5 (check releases for updates)
.NET Installation
AutoGen for .NET supports both the legacy AutoGen.* packages and the new Microsoft.AutoGen.* packages.
Prerequisites
Create a new project
dotnet new console -n MyAutoGenApp
cd MyAutoGenApp
Package Options
AutoGen for .NET has two package families:
- Microsoft.AutoGen.* (new, event-driven model) - Recommended
- AutoGen.* (legacy, v0.2 style) - Being gradually deprecated
This guide focuses on the new packages.
The new event-driven packages:# Core contracts and types
dotnet add package Microsoft.AutoGen.Contracts
# Agent runtime
dotnet add package Microsoft.AutoGen.Core
# gRPC support for distributed runtime
dotnet add package Microsoft.AutoGen.Core.Grpc
# Runtime gateway
dotnet add package Microsoft.AutoGen.RuntimeGateway.Grpc
See .NET Core documentation for usage. The older packages for AutoGen v0.2 style:# Core abstractions
dotnet add package AutoGen.Core
# OpenAI integration
dotnet add package AutoGen.OpenAI
# Source generators for type-safe functions
dotnet add package AutoGen.SourceGenerator
These packages will continue to receive bug fixes and security patches but new features go to Microsoft.AutoGen.*
Sample .NET Code
Here’s a simple agent using the legacy packages:
using AutoGen;
using AutoGen.OpenAI;
var openAIKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY")
?? throw new Exception("Please set OPENAI_API_KEY");
var gpt35Config = new OpenAIConfig(openAIKey, "gpt-3.5-turbo");
var assistantAgent = new AssistantAgent(
name: "assistant",
systemMessage: "You are a helpful AI assistant.",
llmConfig: new ConversableAgentConfig
{
Temperature = 0,
ConfigList = new[] { gpt35Config },
})
.RegisterPrintMessage();
var userProxyAgent = new UserProxyAgent(
name: "user",
humanInputMode: HumanInputMode.ALWAYS)
.RegisterPrintMessage();
await userProxyAgent.InitiateChatAsync(
receiver: assistantAgent,
message: "Hello, assistant!",
maxRound: 10);
Verify .NET Installation
Run your project:
For more examples, see the .NET samples.
Development Installation
If you want to contribute to AutoGen or use the latest unreleased features:
From Source (Python)
Nightly Builds (.NET)
git clone https://github.com/microsoft/autogen.git
cd autogen/python
# Install in development mode
pip install -e packages/autogen-core
pip install -e packages/autogen-agentchat
pip install -e "packages/autogen-ext[openai]"
Add the nightly feed to your NuGet sources:dotnet nuget add source https://pkgs.dev.azure.com/AGPublish/AGPublic/_packaging/AutoGen-Nightly/nuget/v3/index.json \
--name AutoGen-Nightly
Then install packages from this feed:dotnet add package Microsoft.AutoGen.Core --prerelease
PowerShell Execution PolicyIf you can’t activate virtual environments, run:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Long Path SupportEnable long paths to avoid installation issues:# Run as Administrator
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Python InstallationUse Homebrew for the latest Python:M1/M2/M3 MacsSome extensions may require Rosetta for x86 dependencies:softwareupdate --install-rosetta
System DependenciesSome extensions need system packages:Ubuntu/Debian:sudo apt-get update
sudo apt-get install -y python3-dev build-essential
CentOS/RHEL:sudo yum install python3-devel gcc
Troubleshooting
pip install fails with 'No matching distribution'
This usually means your Python version is too old. AutoGen requires Python 3.10+:Upgrade Python if needed, or use python3.10, python3.11, or python3.12 explicitly:python3.11 -m pip install autogen-agentchat
On Linux/Mac, you might need --user flag:pip install --user autogen-agentchat
Or use a virtual environment (recommended).
Update certificates:pip install --upgrade certifi
Or temporarily bypass (not recommended for production):pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org autogen-agentchat
Import errors after installation
Make sure you’re using the correct Python environment:which python # Linux/Mac
where python # Windows
If using a virtual environment, ensure it’s activated.
AutoGen has specific version requirements. If you get conflicts:# Create a fresh environment
python -m venv fresh_venv
source fresh_venv/bin/activate # or activate.bat on Windows
pip install autogen-agentchat
Upgrading AutoGen
Update to the latest version:pip install --upgrade autogen-agentchat autogen-ext
Check installed version:pip show autogen-agentchat
Update packages:dotnet add package Microsoft.AutoGen.Core
Or update all packages:
Migrating from AutoGen v0.2? The new version has breaking changes. See the Migration Guide for detailed upgrade instructions.
Next Steps
Now that AutoGen is installed:
Quickstart
Build your first agent in 5 minutes
Core Concepts
Learn about agents, teams, and tools
Model Configuration
Set up OpenAI, Azure, or other providers
Examples
Explore sample applications
Additional Resources