Skip to main content
A Team is a collection of Agents (or other sub-teams) that work together to accomplish tasks. Teams can either “coordinate”, “collaborate” or “route” to solve a task. A Team has a list of members that can be instances of Agent or Team.
The team will transfer tasks to the members depending on the mode of the team.
It is recommended to specify the name and the role fields of the team member, for better identification by the team leader.

Modes

Route Mode

In Route Mode, the team leader routes the user’s request to the most appropriate team member based on the content of the request. The member’s response is returned directly to the user and the team leader doesn’t interpret/transform the response.
In async execution, if more than once member is transferred to at once by the team leader, these members are executed concurrently.

Coordinate Mode

In Coordinate Mode, the team leader delegates tasks to team members and synthesizes their outputs into a cohesive response. The team leader can send to multiple members at once, or one after the other depending on the request and what the model decides is most appropriate.
In async execution, if more than once member is transferred to at once by the team leader, these members are executed concurrently.

Collaborate Mode

In Collaborate Mode, all team members are given the same task and the team leader synthesizes their outputs into a cohesive response.
In async execution, all the members are executed concurrently.

Team Memory and History

Teams can maintain memory of previous interactions, enabling contextual awareness:
The team can also manage user memories:

Team Knowledge

Teams can use a knowledge base to store and retrieve information:
The team can also manage user memories:

Session Summaries

To enable session summaries, set enable_session_summaries=True on the Team.

Examples

Multi-Language Team

Let’s walk through a simple example where we use different models to answer questions in different languages. The team consists of three specialized agents and the team leader routes the user’s question to the appropriate language agent.
multilanguage_team.py

Content Team

Let’s walk through another example where we use two specialized agents to write a blog post. The team leader coordinates the agents to write a blog post.
content_team.py

Research Team

Here’s an example of a research team that combines multiple specialized agents:
1

Create HackerNews Team

Create a file hackernews_team.py
hackernews_team.py
2

Run the team

Install libraries
Run the team

Developer Resources