Skip to main content

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

1

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.
2

Create a virtual environment (recommended)

Using a virtual environment keeps AutoGen dependencies isolated:
python3 -m venv .venv
source .venv/bin/activate
To deactivate later:
deactivate

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

Extension Options

The autogen-ext package supports many optional dependencies. Install only what you need:
# 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]"
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

1

Install .NET SDK

Download and install .NET 8.0 SDK or later.Verify installation:
dotnet --version
2

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.

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:
dotnet run
For more examples, see the .NET samples.

Development Installation

If you want to contribute to AutoGen or use the latest unreleased features:
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]"

Platform-Specific Notes

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:
brew install python@3.12
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

This usually means your Python version is too old. AutoGen requires Python 3.10+:
python --version
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
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
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

Having installation issues? Ask for help on GitHub Discussions or Discord.