Install
pip install "ag2[openai]"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
pip install "ag2[openai]"Version
AG2 · 2026 · Python 3.10+
Best for
Research, experimentation, GroupChat, human-proxy workflows.
autogen imports preserved via aliases.autogen.beta) — typed events for complex conversations.from autogen import ConversableAgent, LLMConfig
# Option A — inlinellm_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 →
| Date | Version | Changes |
|---|---|---|
| 2026-04-21 | AG2 | Index redesigned with Zero → Hero + Jump-to-topic grid. |
| November 2024 | AG2 | Rebranded from AutoGen to AG2. |
Note: For the newer AG2 guide, focusing on 2025 features (event-driven, A2A, CLI), visit that framework’s page.