Skip to main content
Concepts Team

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
You just define your agents and tasks - the team handles the rest.

Attributes

The Team class accepts the following parameters:
ParameterTypeDefaultDescription
agentslist[Any]RequiredList of Agent instances to use as team members
taskslist[Task] | NoneNoneList of tasks to execute (optional)
modelOptional[Any]NoneModel provider for internal agents (leader, router)
response_formatAnystrResponse format for the final output
ask_other_team_membersboolFalseFlag to add other agents as tools
modeLiteral["sequential", "coordinate", "route"]"sequential"Operational mode for the team
memoryOptional[Memory]NoneShared 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
Example: Research → Write → Edit → Publish

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
Example: Building a complete software project with architecture, development, testing, and deployment

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
Example: Customer support routing (billing → billing expert, technical → tech support)

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 instances
  • mode: Set to "sequential"
  • response_format: Optional, defaults to str
  • ask_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 instances
  • mode: Set to "coordinate"
  • model: Required - Model provider for the leader agent
  • memory: Optional - Shared memory for team coordination
  • response_format: Optional, defaults to str

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 instances
  • mode: Set to "route"
  • model: Required - Model provider for the router agent
  • response_format: Optional, defaults to str

Assigning Tasks Manually

Assigning Tasks to Agents Manually

You can explicitly assign specific agents to tasks by setting the agent 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

Full Code