Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
ag2ai avatar

Ag2 Imports

  • 1 installs
  • 4 repo stars
  • Updated April 1, 2026
  • ag2ai/resource-hub

ag2-imports is a Claude Code skill that documents the correct import paths and module structure for the AG2 framework.

About

This skill documents the correct import paths and module structure for the AG2 framework. It clarifies that the package is ag2 (not autogen) and shows how to import core agents (AssistantAgent, UserProxyAgent, ConversableAgent), LLMConfig, group-chat helpers (run_group_chat, DefaultPattern, AutoPattern, RoundRobinPattern), and the @tool decorator. A developer uses it to avoid common import mistakes such as import autogen or using GroupChat/config_list dicts.

  • Correct import paths and module structure for the AG2 framework
  • The package is ag2, not autogen; all imports use the ag2 namespace
  • Documents core agents, LLMConfig, group-chat patterns, tools, and common import mistakes

Ag2 Imports by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #14,102 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

ag2-imports capabilities & compatibility

Free; a reference skill with no runtime API key requirement.

Capabilities
import reference · framework migration
Use cases
documentation
Pricing
Free
From the docs

What ag2-imports says it does

The package name is `ag2`, not `autogen`. All imports use the `ag2` namespace.
SKILL.md
Do NOT use `import autogen` -- the package was renamed to `ag2`.
SKILL.md
npx skills add https://github.com/ag2ai/resource-hub --skill ag2-imports

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars4
Last updatedApril 1, 2026
Repositoryag2ai/resource-hub

What it does

Look up the correct ag2 import paths for agents, LLMConfig, group-chat patterns, and tools.

Who is it for?

Developers writing AG2 code who need the correct ag2 import paths and want to avoid autogen-era mistakes.

Skip if: Runtime agent design or non-import questions.

When should I use this skill?

The user is writing AG2 code and needs correct import statements or hits import errors.

What you get

Code uses the correct ag2 namespace imports and patterns like LLMConfig and run_group_chat.

  • correct ag2 import statements

By the numbers

  • 3 common import mistakes listed

Files

SKILL.mdMarkdownGitHub ↗

AG2 Imports

The package name is ag2, not autogen. All imports use the ag2 namespace.

Core Agents

from ag2.agentchat import AssistantAgent, UserProxyAgent, ConversableAgent
  • AssistantAgent -- LLM-powered agent that generates replies.
  • UserProxyAgent -- Proxy for human input; can also execute code.
  • ConversableAgent -- Base class for all conversable agents.

LLM Configuration

from ag2 import LLMConfig

Use LLMConfig as a context manager to bind a model configuration to agents created within its scope:

with LLMConfig(api_type="openai", model="gpt-4o"):
    agent = AssistantAgent(name="assistant")

Group Chat

from ag2.agentchat.group import run_group_chat
from ag2.agentchat.group import DefaultPattern, AutoPattern, RoundRobinPattern
  • run_group_chat -- Orchestrates a multi-agent conversation.
  • DefaultPattern -- LLM-based speaker selection with optional handoffs.
  • AutoPattern -- Automatic orchestration; the LLM decides flow.
  • RoundRobinPattern -- Agents speak in fixed round-robin order.

Tools

from ag2.tools import tool

The @tool decorator converts a plain function into a tool that agents can call.

Nested Chats and Advanced Patterns

from ag2.agentchat import initiate_chats          # Sequential multi-conversation
from ag2.agentchat import register_hand_off        # Handoff registration
from ag2.agentchat.group import Handoff            # Explicit handoff target

Common Mistakes

  • Do NOT use import autogen -- the package was renamed to ag2.
  • Do NOT import GroupChat or GroupChatManager -- use run_group_chat with a pattern instead.
  • Do NOT use config_list dicts -- use LLMConfig objects.

Related skills

FAQ

Is the package called autogen or ag2?

The package name is ag2, not autogen; all imports use the ag2 namespace, so do not use import autogen.

How do I set up group chat in AG2?

Import run_group_chat and a pattern (DefaultPattern, AutoPattern, or RoundRobinPattern) from ag2.agentchat.group; do not import GroupChat or GroupChatManager.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.