Build a coding assistant where one AI agent writes Python code and another reviews it in a back-and-forth loop until it passes
Create a customer support pipeline where agents triage, research, and draft responses in sequence
Set up a research workflow where multiple agents search different sources then one agent synthesizes the results
Add a human approval checkpoint to an AI workflow so a person must approve before any sensitive action runs
Requires Python 3.10 or newer and API keys for your chosen LLM provider stored in a local JSON config file.
AG2 (formerly AutoGen) is an open-source Python framework for building AI agents that can work together to complete tasks. It grew out of the AutoGen project and is now maintained by a group of volunteers across multiple organizations. The library is designed to make it easier to create systems where multiple AI assistants coordinate with each other, share information, and pass work along through structured conversation. The core building block is something called a ConversableAgent: a software object that can send and receive messages, generate replies using a large language model, call external tools, or accept input from a real person. You can create as many of these agents as you need and set them up to talk to each other. A common example has one agent write code while another reviews it, with the two exchanging messages until the task is finished. AG2 includes several built-in patterns for organizing groups of agents. You can run them in a sequence (each agent hands off to the next), in a group chat (agents take turns in a shared thread), in nested conversations (an agent internally spawns a separate sub-conversation), or in a swarm (agents hand off control to one another based on conditions you define). Custom coordination logic is also supported if none of those patterns fit your needs. Human oversight is built into the framework. You can configure an agent to pause and ask a person for input or approval at any point in the workflow, which keeps a human in the decision loop for steps where that matters. To get started, you install the package via pip (Python 3.10 or newer is required) and store your API keys for whichever language model you plan to use in a local JSON config file. The README includes a minimal working example showing two agents exchanging messages about a coding task, which is enough to understand the basic pattern before exploring more advanced setups.
← ag2ai on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.