skillfed

ag2

A programming framework for agentic AI

ag2 v1.0.1 505.5K downloads/30d#6,291 on PyPI4,859
Permissive license Apache-2.0 Active released

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 on this page — 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

ag2 on PyPI

pip

pip install ag2

uv

uv add ag2

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 9 — termcolor, python-dotenv, tiktoken, pydantic, pyyaml, packaging, httpx, anyio, fast-depends
Maintenance actively maintained — 16 days since the last release
Last repo commit
First released
Downloads 505,464/month — #6,291 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ag2-1.0.1-py3-none-any.whl

Keywords: ai, agent, autogen, ag2, ag2.ai, ag2ai, agentic

Development Status :: 5 - Production/StableFramework :: PydanticFramework :: Pydantic :: 2Intended Audience :: DevelopersIntended Audience :: Information TechnologyOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python Modules

Tags

multi-agent ai frameworkllm agent orchestrationautonomous agent programmingai agent framework pythonagent communication frameworkagentic ai developmentagent network coordination
agent-frameworkllm-orchestrationasync-first

More Software Development packages

Further reading