Skip to main content

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

from upsonic import Agent, Task, Team

# Create specialized agents
data_analyst = Agent(
    model="openai/gpt-4o",
    name="Data Analyst",
    role="Data Analysis Expert",
    goal="Analyze data and extract insights"
)

report_writer = Agent(
    model="openai/gpt-4o",
    name="Report Writer",
    role="Business Report Specialist",
    goal="Create professional business reports"
)

# Create team with coordination
team = Team(
    agents=[data_analyst, report_writer],
    mode="coordinate",
    model="openai/gpt-4o"  # Required for leader agent
)

# Define tasks
tasks = [
    Task(description="Analyze Q4 sales data and identify trends"),
    Task(description="Create executive summary of findings")
]

# Leader agent coordinates the team
result = team.do(tasks)
print(result)

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