autogen_agentchat package provides high-level abstractions for building conversational agents and teams.
Agent Classes
AssistantAgent
AssistantAgent
AI-powered assistant agent with tool use and handoff capabilities.
Unique name for the agent
LLM client for generating responses
Tools the agent can use
Other agents this agent can transfer control to
System prompt for the agent
Description of the agent’s capabilities
Context manager for conversation history
Memory modules for the agent
Whether to reflect on tool execution results (default: False)
Maximum tool call iterations per turn (default: 1)
Methods
Stream messages and events as they’re generated
UserProxyAgent
UserProxyAgent
CodeExecutorAgent
CodeExecutorAgent
SocietyOfMindAgent
SocietyOfMindAgent
MessageFilterAgent
MessageFilterAgent
Team Classes
RoundRobinGroupChat
RoundRobinGroupChat
SelectorGroupChat
SelectorGroupChat
Team with dynamic agent selection using an LLM.
Agents available for selection
LLM for selecting the next speaker
Custom prompt for agent selection
Whether the same agent can speak twice in a row (default: False)
Swarm
Swarm
MagenticOneGroupChat
MagenticOneGroupChat
GraphFlow
GraphFlow
BaseGroupChat
BaseGroupChat
Base class for all team implementations.
Message Types
TextMessage
TextMessage
HandoffMessage
HandoffMessage
ToolCallSummaryMessage
ToolCallSummaryMessage
Summary of tool execution results.
StructuredMessage
StructuredMessage
Message with structured data.
Events
ToolCallRequestEvent
ToolCallRequestEvent
Event emitted when a tool is called.
ToolCallExecutionEvent
ToolCallExecutionEvent
Event emitted after tool execution.
ModelClientStreamingChunkEvent
ModelClientStreamingChunkEvent
Streaming chunk from the model.
ThoughtEvent
ThoughtEvent
Agent’s internal reasoning.
Response Types
Response
Response
Termination Conditions
MaxMessageTermination
MaxMessageTermination
Stop after a maximum number of messages.
TextMentionTermination
TextMentionTermination
Stop when specific text is mentioned.
StopMessageTermination
StopMessageTermination
Stop on a specific message type.
TimeoutTermination
TimeoutTermination
Stop after a time limit.
TokenUsageTermination
TokenUsageTermination
Stop after token budget is exhausted.
State Management
AssistantAgentState
AssistantAgentState
Serializable state for assistant agents.
Logging
Logger name:
"autogen_agentchat"Logger name:
"autogen_agentchat.events"See Also
- autogen_core - Core agent runtime and messaging
- autogen_ext - Model clients and extensions