Assistants
Teams
We can combine multiple Assistants to form a team and tackle tasks as a cohesive unit.
Here’s an example:
cookbook/teams/hackernews.py
from phi.assistant import Assistant
from phi.tools.hackernews import HackerNews
story_researcher = Assistant(
name="HackerNews Story Researcher",
role="Researches hackernews stories and users.",
tools=[HackerNews()],
)
user_researcher = Assistant(
name="HackerNews User Researcher",
role="Reads articles from URLs.",
tools=[HackerNews()],
)
hn_assistant = Assistant(
name="Hackernews Team",
team=[story_researcher, user_researcher],
# debug_mode=True,
)
hn_assistant.print_response(
"Write a report about the users with the top 2 stories on hackernews",
markdown=True
)
How to build Assistant Teams
- Add a
role
parameter to the team-member Assistants. - Create a Team Leader that can delegate tasks to team-members.
- Use your Assistant team just like you would use a regular Assistant.
Checkout the teams cookbook for more examples of Assistant Teams.
Open-ended Assistant teams are great to play with, but are not reliable for real-world problems. They need constant oversight and can run in loops if not monitored. This drawback should improve as models get better (eagerly waiting for GPT5).
Was this page helpful?