Skip to main content
Set followups=True on a Team to automatically generate followup prompt suggestions after each response. Works the same way as agent followups, with support for all team modes.
1

Create a Python file

team_followup_suggestions.py
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.team.team import Team
from agno.team.mode import TeamMode

researcher = Agent(
    name="Researcher",
    role="Research topics thoroughly",
    model=OpenAIResponses(id="gpt-4o"),
)

team = Team(
    name="Research Team",
    model=OpenAIResponses(id="gpt-4o"),
    mode=TeamMode.coordinate,
    members=[researcher],
    followups=True,
    num_followups=3,
)

response = team.run("What are the latest advances in fusion energy?")

print(response.content)
print("\nFollowup suggestions:")
for i, suggestion in enumerate(response.followups, 1):
    print(f"  {i}. {suggestion}")
2

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate
3

Install dependencies

uv pip install -U agno openai
4

Export your OpenAI API key

export OPENAI_API_KEY="your_openai_api_key_here"
5

Run Team

python team_followup_suggestions.py

Options

ParameterTypeDefaultDescription
followupsboolFalseEnable followup suggestion generation
num_followupsint3Number of suggestions to generate (minimum 1)
followup_modelModelTeam’s modelSeparate model for generating followups. Use a smaller model to reduce cost.

Streaming

Followup suggestions are available via events when streaming.
team_followup_streaming.py
import asyncio

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.team.team import Team
from agno.team.mode import TeamMode
from agno.team import TeamRunEvent

researcher = Agent(
    name="Researcher",
    role="Research topics thoroughly",
    model=OpenAIResponses(id="gpt-4o"),
)

team = Team(
    name="Research Team",
    model=OpenAIResponses(id="gpt-4o"),
    mode=TeamMode.coordinate,
    members=[researcher],
    followups=True,
    num_followups=3,
)


async def main():
    async for event in team.arun(
        "What are the latest advances in fusion energy?",
        stream=True,
        stream_events=True,
    ):
        if event.event == TeamRunEvent.run_content and event.content:
            print(event.content, end="", flush=True)

        if event.event == TeamRunEvent.followups_completed:
            print("\n\nFollowup suggestions:")
            for i, suggestion in enumerate(event.followups, 1):
                print(f"  {i}. {suggestion}")


asyncio.run(main())

Developer Resources