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.
str
required
Unique name for the agent
ChatCompletionClient
required
LLM client for generating responses
List[Tool] | None
Tools the agent can use
List[Handoff | str] | None
Other agents this agent can transfer control to
str | None
System prompt for the agent
str
required
Description of the agent’s capabilities
ChatCompletionContext | None
Context manager for conversation history
List[Memory] | None
Memory modules for the agent
bool
Whether to reflect on tool execution results (default: False)
int
Maximum tool call iterations per turn (default: 1)
Methods
async method
async generator
Stream messages and events as they’re generated
UserProxyAgent
UserProxyAgent
CodeExecutorAgent
CodeExecutorAgent
SocietyOfMindAgent
SocietyOfMindAgent
MessageFilterAgent
MessageFilterAgent
Team Classes
RoundRobinGroupChat
RoundRobinGroupChat
SelectorGroupChat
SelectorGroupChat
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
str
Logger name:
"autogen_agentchat"str
Logger name:
"autogen_agentchat.events"See Also
- autogen_core - Core agent runtime and messaging
- autogen_ext - Model clients and extensions