AG2
A Python AI agent framework for local models through Ollama or cloud APIs, with agent coordination, tool calls and human approval. Apache 2.0 licensed.

AG2 is an open-source Python framework for developers building cooperating AI agents on their own machines or servers. Its Ollama integration lets agents use a local LLM; it also supports OpenAI, Anthropic and Gemini APIs, which send model requests to those providers. It runs on macOS, Windows and Linux under the Apache 2.0 license.
Agents can consult each other, discuss a task in groups or pass work along according to conditions. AG2 records their exchanges in an audit trail and keeps shared context across a task. Python functions give agents access to tools and external APIs, while workflows can pause for a person's approval or missing information.
Optional persistent memory stores knowledge between runs, including on disk. Conversation compaction summarizes earlier turns to limit growing histories without simply dropping their context. Structured outputs, telemetry and evaluation support help developers inspect behavior and check results.
AG2 also supports collaboration with agents built in Google ADK, OpenAI and LangChain through A2A and MCP. This makes it relevant when an application needs to coordinate agents across frameworks rather than keep every agent in the same system.
The project builds on AutoGen. AG2 Classic is the separately maintained AutoGen-derived framework with the older agent classes and group-chat patterns; the current AG2 uses a different agent model and isn't a drop-in replacement for Classic.