Skip to main content
AutoGen Extensions (autogen-ext) provide modular components that extend the core framework with support for different LLM providers, code execution environments, and tool integrations.

Architecture

The extensions package follows a plugin architecture where each component type implements a specific interface:

Extension Categories

AutoGen extensions are organized into four main categories:

Model Clients

Connect to OpenAI, Anthropic, Azure, Ollama, Gemini, Mistral, and more

Code Executors

Execute code safely in Docker containers, Jupyter notebooks, or locally

Tools

Integrate MCP servers, HTTP APIs, LangChain tools, and GraphRAG

Custom Extensions

Build your own extensions following AutoGen’s component model

Installation

Extensions are installed with optional dependencies based on what you need:

Component Model

All extensions implement the AutoGen component model, which provides:

Configuration Serialization

Components can be serialized to/from configuration:

Lifecycle Management

Components support async lifecycle methods:

Context Manager Support

Many components can be used as async context managers:

Available Extensions

Model Clients

Code Executors

Tool Integrations

Best Practices

Use Type Hints

Leverage Python’s type system for better IDE support:

Handle Cancellation

Always pass and respect CancellationToken:

Dispose Resources Properly

Use context managers or explicit cleanup:

Configure Logging

Extensions use AutoGen’s event and trace logging:

Next Steps

Model Clients

Learn how to configure different LLM providers

Code Executors

Set up safe code execution environments

Tools

Integrate external tools and APIs

Custom Extensions

Create your own custom extensions