ag2

AG2 (formerly AutoGen): The Open-Source AgentOS.Join us at: https://discord.gg/sNGSwQME3x

What is ag2?

AG2 (formerly AutoGen): The Open-Source AgentOS.Join us at: https://discord.gg/sNGSwQME3x

Overview of ag2

What it is

AG2 (formerly AutoGen) is an open-source programming framework for building AI agents and facilitating cooperation among multiple agents to solve tasks. It is described as an open-source AgentOS for AI agents. The project is maintained by a group of volunteers from several organizations.

Key features

  • Agents capable of interacting with each other - Facilitates the use of various large language models (LLMs) and tool use support - Autonomous and human-in-the-loop workflows - Multi-agent conversation patterns - The core building block is the Agent class, which talks to a model provider, calls tools, and returns a reply - Tools are plain Python functions decorated with @tool that the agent can invoke - Orchestration of multiple agents over a hub and typed channels using the Network

Use cases

  • Building AI agents that can cooperate to solve tasks - Developing multi-agent conversation systems - Creating workflows that involve human oversight (human-in-the-loop)
  • Using tools to extend agent capabilities with external data, APIs, or functions - Coordinating several agents for complex task execution

Getting started

AG2 requires Python version >= 3.11. Windows/Linux: bash pip install ag2[openai] Mac: bash pip install 'ag2[openai]' Setup your API keys: bash export OPENAI_API_KEY='' # or ANTHROPIC_API_KEY, GEMINI_API_KEY, ... Run your first agent: python import asyncio from ag2 import Agent from ag2.config import OpenAICompletionsConfig agent = Agent( 'assistant', prompt='You are a helpful assistant.', config=OpenAICompletionsConfig(model='gpt-4o-mini'), ) async def main() -> None: reply = await agent.ask('Summarize the main differences between Python lists and tuples.') print(reply.body) asyncio.run(main())

License and pricing

The license is Apache-2.0. The pricing type is open_source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/ag2aiag2.svg)](https://yunodb.com/tools/ag2aiag2?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/ag2aiag2?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/ag2aiag2.svg" alt="Featured on YunoDB" height="20"></a>