AgentTeam
Defined in the agents module.AI Agent Multi-agent coordinator that manages and delegates work to multiple agents. AgentTeam orchestrates the execution of tasks across multiple Agent instances, supporting sequential, parallel, and hierarchical execution patterns.
Constructor
Any
required
No description available.
Any
No description available.
Any
default:"'sequential'"
No description available.
Any
No description available.
Optional[str]
No description available.
Optional
No description available.
Optional[str]
No description available.
Optional
default:"False"
No description available.
Optional
default:"False"
No description available.
Optional
default:"False"
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Optional
No description available.
Methods
stream_emitter()
Aggregate
StreamEventEmitter fanning in member agents’ events.add_task()
Instance method.
clean_json_output()
Clean JSON output while preserving the legacy team method.
context_manager()
ContextManager instance for unified context management across all agents.
default_completion_checker()
Instance method.
aexecute_task()
Async version of execute_task method - now using DRY helpers
arun_task()
Async version of run_task method
arun_all_tasks()
Async version of run_all_tasks method
astart()
Async version of start method.
save_output_to_file()
Instance method.
execute_task()
Synchronous version of execute_task method - now using DRY helpers
run_task()
Synchronous version of run_task method
run_all_tasks()
Synchronous version of run_all_tasks method
get_task_status()
Instance method.
get_all_tasks_status()
Instance method.
get_task_result()
Instance method.
get_task_details()
Instance method.
get_agent_details()
Instance method.
where_does_it_run()
Plain-English answer to ‘where does my code actually run?’.
start()
Start agent execution with verbose output (beginner-friendly).
run()
Run agents silently (production use).
start_for_each()
Run this team once per input dict, interpolating
key placeholders.astart_for_each()
Async twin of :meth:
start_for_each (sequential per-item execution).set_state()
Set a state value
get_state()
Get a state value
update_state()
Update multiple state values
clear_state()
Clear all state values
has_state()
Check if a state key exists
get_all_state()
Get a copy of the entire state dictionary
delete_state()
Delete a state key if it exists. Returns True if deleted, False if key didn’t exist.
increment_state()
Increment a numeric state value. Creates the key with default if it doesn’t exist.
append_to_state()
Append a value to a list state. Creates the list if it doesn’t exist.
save_session_state()
Persist team session state for deterministic resume (Issue #3635).
restore_session_state()
Restore team session state for deterministic resume. Returns True if restored.
get_token_usage_summary()
Get a summary of token usage across all agents and tasks.
get_detailed_token_report()
Get a detailed token usage report.
display_token_usage()
Display token usage in a formatted table.
launch()
Launch all agents as a single API endpoint (HTTP) or an MCP server.
current_plan()
Get the current plan.
todo_list()
Get the current todo list.
get_plan_markdown()
Get the current plan as markdown.
get_todo_markdown()
Get the current todo list as markdown.
update_plan_step_status()
Update the status of a plan step.
close()
Close all agent resources and cleanup connections.
spawn_sub_agent()
Spawn a sub-agent for non-blocking execution (sync version).
announce_completion()
Announce sub-agent completion via event bus (sync version).
get_spawned_agents()
Get list of currently spawned sub-agents.
wait_for_completions()
Wait for sub-agent completions (optional blocking method).
aspawn_sub_agent()
Async version of spawn_sub_agent using asyncio primitives.
aannounce_completion()
Async version of announce_completion.
await_for_completions()
Async, event-driven version of wait_for_completions.
Usage
Notes
The class was renamed fromAgentManager to AgentTeam in v1.0.
AgentManager and Agents remain as silent aliases for backward compatibility.
Source
View on GitHub
praisonaiagents/agents/agents.py at line 620
