--- id: ag2 version: "1.0.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # ag2 — A programming framework for agentic AI License: permissive · Maintenance: active · Downloads: 505.5K/mo ## What it is and what it does AG2 is a protocol-driven framework for building AI agents and coordinating multiple agents to solve tasks. It replaces the earlier AutoGen Classic framework (now maintained separately as ag2-classic) with a new agent model centered on async-first design, a Network-based orchestration pattern for multi-agent coordination, and integration with multiple LLM providers through a unified config interface. The core building block is the Agent class, which talks to a model provider, can invoke tools, and returns structured replies; conversations are stateful, so calling ask() on a reply continues the same conversation thread. The framework is designed for developers building autonomous or human-in-the-loop workflows where agents need to collaborate, persist knowledge, and call external functions. It uses pydantic for configuration, supports Python 3.10 through 3.14, and is actively maintained. The package is permissively licensed (Apache-2.0) and has no known security vulnerabilities. Use it for: - Build a code-review agent that analyzes code snippets and suggests improvements across multiple turns. - Coordinate multiple specialized agents (e.g., researcher, writer, editor) over a typed channel network to collaboratively produce documents. - Create an autonomous assistant that calls external APIs or Python functions to fetch data, process it, and report results. - Implement a human-in-the-loop workflow where an agent pauses to request confirmation or missing information from a person. - Develop a multi-turn conversational system where agent state and history persist across multiple user interactions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. AG2 is a Python framework for building AI agents that interact with language models, call tools, and coordinate with other agents to solve tasks. Yes. AG2 is a mature, actively maintained framework (Production/Stable status) with low install friction, permissive licensing, no known vulnerabilities, and strong community adoption. Install it if you need to build AI agents that coordinate with LLMs and other agents. Note: this is a breaking change from AG2 Classic (autogen namespace) — if you have existing Classic code, stay on ag2-classic or consult the migration guide. ## Install pip install ag2 uv add ag2 poetry add ag2 ## Installing ag2 Before you install: Installation is straightforward with low friction; the package is actively maintained with a recent release and strong repository activity. Requires Python 3.10 or later and pulls in 9 runtime dependencies including pydantic, httpx, and tiktoken. License in practice: Licensed under Apache-2.0 (permissive), so you can use, modify, and distribute AG2 freely in commercial and private projects without restriction. Quickstart: pip install ag2[openai] import asyncio from ag2 import Agent from ag2.config import OpenAIConfig agent = Agent( "assistant", prompt="You are a helpful assistant.", config=OpenAIConfig(model="gpt-4o-mini"), ) async def main(): reply = await agent.ask("Your question here") print(reply.body) asyncio.run(main()) Requires Python 3.10 or later. You must set OPENAI_API_KEY or provide an API key explicitly to OpenAIConfig; other model providers require their respective environment variables or explicit configuration. Verify before relying: - Whether the framework supports streaming responses or only turn-based ask/reply patterns. - What tool-calling capabilities are available and how they compare to direct function registration. - Performance characteristics and latency for multi-agent coordination at scale. - How the Network orchestration model differs functionally from the classic GroupChat pattern beyond naming. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 505.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags multi-agent ai framework, llm agent orchestration, autonomous agent programming, ai agent framework python, agent communication framework, agentic ai development, agent network coordination, agent-framework, llm-orchestration, async-first [View on SkillFed](https://skillfed.io/packages/ag2) · [View on PyPI](https://pypi.org/project/ag2/)