# AutoGen: A Programming Framework for Agentic AI

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/microsoft-autogen
Generated for open source discovery and AI-assisted research.

AutoGen is a versatile programming framework from Microsoft designed for building multi-agent AI applications. It empowers AI agents to operate autonomously or collaborate seamlessly with human users, streamlining the execution of complex tasks. The framework offers a layered, extensible design, providing both high-level APIs for rapid prototyping and low-level components for fine-grained control.

GitHub: https://github.com/microsoft/autogen
OSRepos URL: https://osrepos.com/repo/microsoft-autogen

## Summary

AutoGen is a versatile programming framework from Microsoft designed for building multi-agent AI applications. It empowers AI agents to operate autonomously or collaborate seamlessly with human users, streamlining the execution of complex tasks. The framework offers a layered, extensible design, providing both high-level APIs for rapid prototyping and low-level components for fine-grained control.

## Topics

- agentic-ai
- multi-agent
- llm-framework
- python
- artificial-intelligence
- software-development
- autogen
- microsoft

## Repository Information

Last analyzed by OSRepos: Mon Mar 30 2026 16:21:38 GMT+0100 (Western European Summer Time)
Detail views: 4
GitHub clicks: 6

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
AutoGen is a powerful programming framework developed by Microsoft for creating multi-agent AI applications. It enables AI agents to act autonomously or collaborate with humans, facilitating complex task execution. While AutoGen continues to be maintained, users new to the framework are encouraged to explore the [Microsoft Agent Framework](https://github.com/microsoft/agent-framework), as announced in recent updates.

## Installation
AutoGen requires **Python 3.10 or later**.

To install the core components and OpenAI client, use pip:
bash
pip install -U "autogen-agentchat" "autogen-ext[openai]"

For a no-code GUI experience, you can install AutoGen Studio:
bash
pip install -U "autogenstudio"

Refer to the official [AutoGen documentation](https://microsoft.github.io/autogen/) for detailed installation instructions and migration guides for previous versions.

## Examples
Here are a few quickstart examples demonstrating AutoGen's capabilities. Remember to set your `OPENAI_API_KEY` environment variable before running these examples.

### Hello World
Create a simple assistant agent using OpenAI's GPT-4o model.
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())


### Web Browsing with MCP Server
Create a web browsing assistant agent that utilizes the Playwright MCP server.
python
# First run `npm install -g @playwright/mcp@latest` to install the MCP server.
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import McpWorkbench, StdioServerParams


async def main() -> None:
    model_client = OpenAIChatCompletionClient(model="gpt-4.1")
    server_params = StdioServerParams(
        command="npx",
        args=[
            "@playwright/mcp@latest",
            "--headless",
        ],
    )
    async with McpWorkbench(server_params) as mcp:
        agent = AssistantAgent(
            "web_browsing_assistant",
            model_client=model_client,
            workbench=mcp, # For multiple MCP servers, put them in a list.
            model_client_stream=True,
            max_tool_iterations=10,
        )
        await Console(agent.run_stream(task="Find out how many contributors for the microsoft/autogen repository"))


asyncio.run(main())

*Warning*: Only connect to trusted MCP servers as they may execute commands in your local environment or expose sensitive information.

### Multi-Agent Orchestration
Set up a basic multi-agent orchestration using `AgentTool` to delegate tasks to specialized agents.
python
import asyncio

from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.tools import AgentTool
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient


async def main() -> None:
    model_client = OpenAIChatCompletionClient(model="gpt-4.1")

    math_agent = AssistantAgent(
        "math_expert",
        model_client=model_client,
        system_message="You are a math expert.",
        description="A math expert assistant.",
        model_client_stream=True,
    )
    math_agent_tool = AgentTool(math_agent, return_value_as_last_message=True)

    chemistry_agent = AssistantAgent(
        "chemistry_expert",
        model_client=model_client,
        system_message="You are a chemistry expert.",
        description="A chemistry expert assistant.",
        model_client_stream=True,
    )
    chemistry_agent_tool = AgentTool(chemistry_agent, return_value_as_last_message=True)

    agent = AssistantAgent(
        "assistant",
        system_message="You are a general assistant. Use expert tools when needed.",
        model_client=model_client,
        model_client_stream=True,
        tools=[math_agent_tool, chemistry_agent_tool],
        max_tool_iterations=10,
    )
    await Console(agent.run_stream(task="What is the integral of x^2?"))
    await Console(agent.run_stream(task="What is the molecular weight of water?"))


asyncio.run(main())

For more advanced multi-agent orchestrations and workflows, refer to the [AgentChat documentation](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/index.html).

### AutoGen Studio
Prototype and run multi-agent workflows without writing code using AutoGen Studio.
bash
autogenstudio ui --port 8080 --appdir ./my-app

*Caution*: AutoGen Studio is intended for rapid prototyping and demonstration, not as a production-ready application. Developers should build their own applications with necessary security and authentication features.

## Why Use AutoGen?
AutoGen provides a comprehensive ecosystem for creating AI agents, particularly for multi-agent workflows, encompassing a robust framework, essential developer tools, and example applications. Its layered and extensible design allows for flexible use, from high-level APIs to low-level components.

The framework is structured with:
*   **Core API**: Implements message passing, event-driven agents, and a flexible runtime, supporting both .NET and Python.
*   **AgentChat API**: Offers a simpler API for rapid prototyping, building on the Core API and supporting common multi-agent patterns.
*   **Extensions API**: Enables continuous expansion of framework capabilities through first and third-party extensions, including LLM clients and code execution.

Key developer tools include:
*   [AutoGen Studio](https://microsoft.github.io/autogen/stable/user-guide/autogenstudio-user-guide/installation.html): A no-code GUI for building multi-agent applications.
*   [AutoGen Bench](https://github.com/microsoft/autogen/tree/main/python/packages/agbench): A benchmarking suite for evaluating agent performance.

AutoGen also fosters a thriving community with weekly office hours, talks, a [Discord server](https://aka.ms/autogen-discord), and GitHub Discussions for support and collaboration.

## Links & Resources
*   **GitHub Repository**: [microsoft/autogen](https://github.com/microsoft/autogen)
*   **Official Documentation**: [AutoGen Documentation](https://microsoft.github.io/autogen/)
*   **AutoGen Blog**: [Microsoft AutoGen Blog](https://devblogs.microsoft.com/autogen/)
*   **Discord Server**: [Join AutoGen Discord](https://aka.ms/autogen-discord)
*   **GitHub Discussions**: [AutoGen Q&A](https://github.com/microsoft/autogen/discussions)
*   **Installation Guide**: [AutoGen Installation](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/installation.html)
*   **Quickstart Guide**: [AutoGen Quickstart](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/quickstart.html#)
*   **AgentChat Documentation**: [AgentChat User Guide](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/index.html)
*   **AutoGen Studio Documentation**: [AutoGen Studio User Guide](https://microsoft.github.io/autogen/stable/user-guide/autogenstudio-user-guide/index.html)