# AutoGen

> Build multi-agent AI apps where agents converse with each other, tools, and humans

- Category: Agents & Automation / Multi-Agent Systems
- Language: Python
- Repository: https://github.com/microsoft/autogen
- Website: https://microsoft.github.io/autogen/
- Canonical page: https://ai-tldr.dev/tools/autogen/

## In short

AutoGen is a Python framework from Microsoft Research for building applications where one or more AI agents act on tasks. An agent wraps a language model and can call tools, talk to other agents, and work alongside a human. It sits in the Multi-Agent Systems category of the Agents & Automation tools and is open-source, written in Python.

## Overview

AutoGen is a Python framework from Microsoft Research for building applications where one or more AI agents act on tasks. An agent wraps a language model and can call tools, talk to other agents, and work alongside a human. The core building block is the AssistantAgent, which you give a model client and then ask to run a task.

It fits the multi-agent systems category: instead of a single prompt-and-response, you compose several specialized agents (for example a math expert and a chemistry expert) and let a coordinating agent route work to them. AutoGen also connects to external tools through the Model Context Protocol (MCP), and ships AutoGen Studio, a no-code GUI for prototyping workflows.

Note: AutoGen is now in maintenance mode and is community-managed. It still works, but Microsoft points new users to its successor, the Microsoft Agent Framework, and provides a migration guide for existing AutoGen projects.

## What it does

- AssistantAgent: a model-backed agent you call with run() or stream output with run_stream()
- Pluggable model clients via autogen-ext, such as OpenAIChatCompletionClient
- MCP support through McpWorkbench and StdioServerParams to connect external tool servers
- Multi-agent orchestration using AgentTool to expose one agent as a tool for another
- AutoGen Studio: a no-code GUI to prototype and run multi-agent workflows
- Async-first API built on asyncio for streaming responses and tool iterations

## Getting started

AutoGen requires Python 3.10 or later. Install the AgentChat package with the OpenAI extension, set your API key, then run a minimal assistant agent.

1. Install AutoGen

   Install AgentChat and the OpenAI client from Extensions with pip.

```bash
pip install -U "autogen-agentchat" "autogen-ext[openai]"
```

2. Set your OpenAI API key

   The quickstart calls the OpenAI API, so export your key first.

```bash
export OPENAI_API_KEY="sk-..."
```

3. Run a Hello World agent

   Create an assistant agent, run a task, and close the model client.

```python
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient

async def main() -> None:
    model_client = OpenAIChatCompletionClient(model="gpt-4.1")
    agent = AssistantAgent("assistant", model_client=model_client)
    print(await agent.run(task="Say 'Hello World!'"))
    await model_client.close()

asyncio.run(main())
```

4. Try AutoGen Studio (optional)

   Install the no-code GUI and run it locally to prototype workflows in the browser.

```bash
pip install -U "autogenstudio"
autogenstudio ui --port 8080 --appdir ./my-app
```

## When to use it

- Orchestrating several specialized agents (for example domain experts) behind one coordinating assistant
- Building a tool-using agent that browses the web or calls external services via an MCP server
- Prototyping multi-agent workflows visually in AutoGen Studio before writing code
- Maintaining or migrating an existing AutoGen project toward the Microsoft Agent Framework
