Teams¶
Teams are organizational units that group agents together, enabling collaboration, load balancing, and hierarchical communication.
What is a Team?¶
A Team in AG2Trust:
- Groups related agents together
- Enables agent-to-agent communication
- Manages deployments (auto-scaled agent pools)
- Defines collaboration boundaries
Team Architecture¶
┌─────────────────────────────────────────────────────────┐
│ Team │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Deployments │ │
│ │ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ Support │ │ Research │ │ │
│ │ │ (3 replicas)│ │ (2 replicas)│ │ │
│ │ └─────────────┘ └─────────────┘ │ │
│ └─────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Agent Communication │ │
│ │ Support-1 ←→ Support-2 ←→ Research-1 │ │
│ └─────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ MCP Integrations │ │
│ │ GitHub, Jira, Slack │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
Creating a Team¶
Via Dashboard¶
- Navigate to Teams in the sidebar
- Click Create Team
- Fill in the team details:
- Name: Descriptive team name
- Slug: URL-friendly identifier (auto-generated)
- Description: Team purpose
Team Configuration¶
| Field | Required | Description |
|---|---|---|
| Name | Yes | Display name for the team |
| Slug | Yes | URL-friendly identifier |
| Description | No | Team purpose and notes |
Deployments¶
Deployments define how many agents of each type run within a team.
Creating a Deployment¶
- Open your team's detail page
- Click Add Deployment
- Select an Agent Type
- Set the desired replica count
- Click Deploy
Deployment Properties¶
| Property | Description |
|---|---|
| Agent Type | The template for agents in this deployment |
| Desired Replicas | Target number of running agents |
| Actual Replicas | Current running agent count |
| Status | Deployment health status |
Auto-Reconciliation¶
AG2Trust automatically maintains your desired replica count:
graph LR
A[Desired: 3] --> B{Actual?}
B -->|2| C[Start 1 agent]
B -->|4| D[Stop 1 agent]
B -->|3| E[No action] The reconciliation loop runs every 60 seconds.
Agent Communication¶
Agents within a team can discover and communicate with each other.
Discovering Agents¶
# Agent tool: discover_agent
# Returns list of agents in the same team
agents = discover_agent(role="researcher")
# Returns: [{"id": "agent-1", "name": "Research Assistant", ...}]
Sending Messages¶
# Agent tool: send_agent_message
# Send message to another agent in the team
response = send_agent_message(
target_agent_id="agent-2",
message="Please analyze this data: ..."
)
Communication Flow¶
Agent A Backend Agent B
│ │ │
│ send_agent_message() │ │
├─────────────────────────►│ │
│ │ Validate team membership │
│ │ Publish to Redis │
│ ├─────────────────────────►│
│ │ │ Process
│ │◄─────────────────────────┤
│ │ Forward response │
│◄─────────────────────────┤ │
│ │ │
Rate Limits¶
| Operation | Limit |
|---|---|
| Agent-to-agent messages | 20/minute per agent |
MCP Integrations¶
Teams can be granted access to MCP (Model Context Protocol) servers for external tool access.
Assigning MCP Servers¶
- Register MCP server in Integrations
- Open your team's settings
- Attach the MCP server
- Grant specific agent types access
Access Model¶
MCP Server (registered in Integrations)
└── Assigned to Team(s)
└── Agent Types granted access within team
Agents can then use call_mcp() to invoke tools from assigned servers.
Team Limits¶
| Resource | Limit |
|---|---|
| Teams per organization | 3 |
| Agents per team | 20 |
| MCP servers per team | 10 |
Best Practices¶
1. Organize by Function¶
# Good: Clear functional boundaries
Team: Customer Support
└── Deployments: tier1-support (3), escalation (1)
Team: Engineering
└── Deployments: code-review (2), devops (1)
# Avoid: Mixed purposes
Team: Everything
└── All agent types mixed together
2. Right-Size Deployments¶
| Traffic Level | Recommended Replicas |
|---|---|
| Development | 1 |
| Low traffic | 1-2 |
| Medium traffic | 2-3 |
| High traffic | 3-5 |
3. Monitor Deployment Health¶
Check the Teams dashboard for: - Replica status (desired vs actual) - Agent health indicators - Communication patterns
4. Use Meaningful Slugs¶
Team slugs appear in agent names:
Team API Endpoints¶
List Teams¶
Get Team Details¶
Create Deployment¶
POST /api/teams/{team_id}/deployments
Content-Type: application/json
{
"agent_type_id": "uuid",
"desired_replicas": 3
}
Scale Deployment¶
PATCH /api/teams/{team_id}/deployments/{deployment_id}
Content-Type: application/json
{
"desired_replicas": 5
}
Use Cases¶
Customer Support Tiers¶
Team: Support
├── Deployment: general-support (5 replicas)
│ └── Handles initial customer inquiries
├── Deployment: technical-support (3 replicas)
│ └── Handles technical issues
└── Deployment: escalation (1 replica)
└── Handles complex cases, can message other agents
Research Pipeline¶
Team: Research
├── Deployment: data-collector (2 replicas)
│ └── Gathers information from web
├── Deployment: analyzer (2 replicas)
│ └── Analyzes collected data
└── Deployment: report-writer (1 replica)
└── Compiles findings into reports