AG2 is a multi-agent large language model orchestration framework, agentic workflow automation tool, and RAG-enabled agent platform. It functions as a communication protocol and framework for coordinating multiple AI agents to solve complex tasks through shared state and standardized messaging.
The project distinguishes itself through flexible coordination strategies, including hierarchical agent organization, hub-and-spoke models, and dynamic routing that analyzes conversation context to distribute work. It implements multi-stage feedback loops for iterative refinement and uses schema-constrained output generation to ensure responses adhere to specific data models.
The system covers a broad capability surface, including retrieval augmented generation for external data integration, human-in-the-loop oversight for output validation, and secure external tool execution within isolated environments. It also provides shared state management for memory persistence across agent lifecycles and an error handling system that routes failures to recovery agents.
Model provider integration is managed through optional dependency groups for targeted installation.