ag2ai/ag2

每日信息看板 · 2026-02-25
开源项目
Category
github_search
Source
2
Score
2026-02-25T01:57:26Z
Published

AI 总结

AG2(原AutoGen)在新组织AG2AI下演进为开源AgentOS框架,用于构建与编排多智能体协作(含工具调用与人类在环),并改采Apache 2.0以强化开放治理与可持续协作。
#GitHub #repo #开源项目 #AG2 #AutoGen #AgentOS #LLM #Apache-2.0 #Agent #RAG

内容摘录

<a name="readme-top"></a>

<p align="center">
 <!-- The image URL points to the GitHub-hosted content, ensuring it displays correctly on the PyPI website.-->
 <img src="https://raw.githubusercontent.com/ag2ai/ag2/27b37494a6f72b1f8050f6bd7be9a7ff232cf749/website/static/img/ag2.svg" width="150" title="hover text">

 <br>
 <br>

 <a href="https://www.pepy.tech/projects/ag2">
 <img src="https://static.pepy.tech/personalized-badge/ag2?period=month&units=international_system&left_color=grey&right_color=green&left_text=downloads/month" alt="Downloads"/>
 </a>

 <a href="https://pypi.org/project/autogen/">
 <img src="https://img.shields.io/pypi/v/ag2?label=PyPI&color=green">
 </a>

 <img src="https://img.shields.io/pypi/pyversions/ag2.svg?label=">

 <a href="https://github.com/ag2ai/ag2/actions/workflows/python-package.yml">
 <img src="https://github.com/ag2ai/ag2/actions/workflows/python-package.yml/badge.svg">
 </a>
 <a href="https://discord.gg/pAbnFJrkgZ">
 <img src="https://img.shields.io/discord/1153072414184452236?logo=discord&style=flat">
 </a>

 <br>

 <a href="https://x.com/ag2oss">
 <img src="https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40ag2ai">
 </a>
</p>

<p align="center">
 <a href="https://docs.ag2.ai/">📚 Documentation</a> |
 <a href="https://github.com/ag2ai/build-with-ag2">💡 Examples</a> |
 <a href="https://docs.ag2.ai/latest/docs/contributor-guide/contributing">🤝 Contributing</a> |
 <a href="#related-papers">📝 Cite paper</a> |
 <a href="https://discord.gg/pAbnFJrkgZ">💬 Join Discord</a>
</p>

<p align="center">
AG2 was evolved from AutoGen. Fully open-sourced. We invite collaborators from all organizations to contribute.
</p>
AG2: Open-Source AgentOS for AI Agents

AG2 (formerly AutoGen) is an open-source programming framework for building AI agents and facilitating cooperation among multiple agents to solve tasks. AG2 aims to streamline the development and research of agentic AI. It offers features such as agents capable of interacting with each other, facilitates the use of various large language models (LLMs) and tool use support, autonomous and human-in-the-loop workflows, and multi-agent conversation patterns.

The project is currently maintained by a dynamic group of volunteers from several organizations. Contact project administrators Chi Wang and Qingyun Wu via support@ag2.ai if you are interested in becoming a maintainer.
Table of contents
AG2: Open-Source AgentOS for AI Agents
Table of contents
Getting started
Installation
Setup your API keys
Run your first agent
Example applications
Introduction of different agent concepts
Conversable agent
Human in the loop
Orchestrating multiple agents
Tools
Advanced agentic design patterns
Announcements
Code style and linting
Related papers
Contributors Wall
Cite the project
License
Getting started

For a step-by-step walk through of AG2 concepts and code, see Basic Concepts in our documentation.
Installation

AG2 requires **Python version >= 3.10, < 3.14**. AG2 is available via ag2 (or its alias autogen) on PyPI.

**Windows/Linux:**

**Mac:**

Minimal dependencies are installed by default. You can install extra options based on the features you need.
Setup your API keys

To keep your LLM dependencies neat and avoid accidentally checking in code with your API key, we recommend storing your keys in a configuration file.

In our examples, we use a file named **OAI_CONFIG_LIST** to store API keys. You can choose any filename, but make sure to add it to .gitignore so it will not be committed to source control.

You can use the following content as a template:
Run your first agent

Create a script or a Jupyter Notebook and run your first agent.
Example applications

We maintain a dedicated repository with a wide range of applications to help you get started with various use cases or check out our collection of jupyter notebooks as a starting point.
Build with AG2
Jupyter Notebooks
Introduction of different agent concepts

We have several agent concepts in AG2 to help you build your AI agents. We introduce the most common ones here.
**Conversable Agent**: Agents that are able to send messages, receive messages and generate replies using GenAI models, non-GenAI tools, or human inputs.
**Human in the loop**: Add human input to the conversation
**Orchestrating multiple agents**: Users can orchestrate multiple agents with built-in conversation patterns such as swarms, group chats, nested chats, sequential chats or customize the orchestration by registering custom reply methods.
**Tools**: Programs that can be registered, invoked and executed by agents
**Advanced Concepts**: AG2 supports more concepts such as structured outputs, rag, code execution, etc.
Conversable agent

The ConversableAgent is the fundamental building block of AG2, designed to enable seamless communication between AI entities. This core agent type handles message exchange and response generation, serving as the base class for all agents in the framework.

Let's begin with a simple example where two agents collaborate:
A **coder agent** that writes Python code.
A **reviewer agent** that critiques the code without rewriting it.

---
Orchestrating Multiple Agents

AG2 enables sophisticated multi-agent collaboration through flexible orchestration patterns, allowing you to create dynamic systems where specialized agents work together to solve complex problems.

Here’s how to build a team of **teacher**, **lesson planner**, and **reviewer** agents working together to design a lesson plan:

---
Human in the Loop

Human oversight is often essential for validating or guiding AI outputs.
AG2 provides the UserProxyAgent for seamless integration of human feedback.

Here we extend the **teacher–planner–reviewer** example by introducing a **human agent** who validates the final lesson:

---
Tools

Agents gain significant utility through **tools**, which extend their capabilities with external data, APIs, or functions.
Advanced agentic…