Skip to content

AutoGen / AG2 (Python)

Research-grade multi-agent framework. AutoGen pioneered GroupChat-style multi-agent conversations; AG2 is the community continuation with event-driven architecture and A2A protocol.

Install

Terminal window
pip install "ag2[openai]"

Version

AG2 · 2026 · Python 3.10+

Best for

Research, experimentation, GroupChat, human-proxy workflows.

  • AG2 rebrand (Nov 2024) — community continuation; legacy autogen imports preserved via aliases.
  • Event-driven architecture (autogen.beta) — typed events for complex conversations.
  • A2A protocol — cross-framework interop.
  • AG2 CLI — scaffolding and deploy helpers.
from autogen import ConversableAgent, LLMConfig
# Option A — inline
llm_config = LLMConfig({"api_type": "openai", "model": "gpt-4o"})
# Option B — load a classic OAI_CONFIG_LIST file or env var
# llm_config = LLMConfig.from_json(env="OAI_CONFIG_LIST")
# llm_config = LLMConfig.from_json(path="OAI_CONFIG_LIST.json")
agent = ConversableAgent(
name="assistant",
llm_config=llm_config,
system_message="You are a helpful assistant.",
)
reply = agent.generate_reply(
messages=[{"role": "user", "content": "What is 2 + 2?"}]
)
print(reply)

Ready? Start Zero → Hero Step 1 →


DateVersionChanges
2026-04-21AG2Index redesigned with Zero → Hero + Jump-to-topic grid.
November 2024AG2Rebranded from AutoGen to AG2.

Note: For the newer AG2 guide, focusing on 2025 features (event-driven, A2A, CLI), visit that framework’s page.