Overview
What is Team?
The Team class is a callable class for multi-agent operations using the Upsonic client. It enables you to create teams of specialized AI agents that can work together to accomplish complex tasks that would be difficult for a single agent to handle.How Team Works?
Teams handle all the complexity automatically through several key mechanisms:- Smart Assignment - Automatically picks the right agent for each task based on their roles and capabilities
- Context Sharing - Agents receive context from previous tasks and can see what other agents have accomplished
- Result Combining - Combines all outputs from multiple agents into one coherent final answer
- Coordination (in coordinate mode) - A leader agent plans and delegates work strategically
- Routing (in route mode) - Intelligent expert selection for specialized queries
Attributes
The Team class accepts the following parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
agents | list[Any] | Required | List of Agent instances to use as team members |
tasks | list[Task] | None | None | List of tasks to execute (optional) |
model | Optional[Any] | None | Model provider for internal agents (leader, router) |
response_format | Any | str | Response format for the final output |
ask_other_team_members | bool | False | Flag to add other agents as tools |
mode | Literal["sequential", "coordinate", "route"] | "sequential" | Operational mode for the team |
memory | Optional[Memory] | None | Shared memory for team coordination |
Choosing Right Team Mode
What is The Selection Criteria?
Choose your team mode based on your workflow requirements:- Sequential: For linear workflows where tasks flow from one agent to the next
- Coordinate: For complex projects requiring strategic planning and delegation
- Route: For routing queries to the best specialist agent
Use Case for Sequential Mode
Use sequential mode when:- You have a clear sequence of steps
- Each step needs a different skill
- Tasks build on previous results
- You want simple, automatic collaboration
Use Case for Coordinate Mode
Use coordinate mode when:- Tasks are complex and interconnected
- You need strategic planning
- The workflow isn’t linear
- You want a leader making decisions
Use Case for Route Mode
Use route mode when:- You have specialized experts
- Each request goes to ONE expert
- You need fast routing decisions
- No multi-step collaboration needed
Modes
Sequential
What is Sequential Team mode
Sequential mode is the default and most straightforward team operation mode. Tasks flow from one agent to the next automatically, with the team intelligently selecting the best agent for each task based on their roles and capabilities.Usage
Params
agents: List of Agent instancesmode: Set to"sequential"response_format: Optional, defaults tostrask_other_team_members: Optional, enables inter-agent communication
Coordinate
What is Coordinate Team mode
Coordinate mode introduces a leader agent that takes charge of the entire workflow. The leader analyzes all tasks, creates a strategic plan, and delegates work to team members using a sophisticated delegation system.Usage
Params
agents: List of Agent instancesmode: Set to"coordinate"model: Required - Model provider for the leader agentmemory: Optional - Shared memory for team coordinationresponse_format: Optional, defaults tostr
Route
What is Route Team mode
Route mode uses an intelligent router agent to analyze incoming requests and select the single best specialist agent to handle the entire task. This is ideal for scenarios where you have domain experts and need to route queries efficiently.Usage
Params
agents: List of Agent instancesmode: Set to"route"model: Required - Model provider for the router agentresponse_format: Optional, defaults tostr
Assigning Tasks Manually
Assigning Tasks to Agents Manually
You can explicitly assign specific agents to tasks by setting theagent property on the Task object. This overrides the automatic agent selection process.
Full Example Code
Examples
Basic Team Example
About Example Scenario
This example demonstrates a content creation workflow where a research agent gathers information about AI trends, and a writer agent creates a blog post based on that research.Team Configuration
- Mode: Sequential (default)
- Agents: Research Specialist + Content Writer
- Workflow: Research → Write
- Context Sharing: Automatic between tasks

