Groq Agent Team

Coordinate web-search and finance agents with a GPT-OSS 120B team on Groq.

agent_team.py
"""
Groq Agent Team
===============

Cookbook example for `groq/agent_team.py`.
"""

from agno.agent import Agent
from agno.models.groq import Groq
from agno.team import Team
from agno.tools.websearch import WebSearchTools
from agno.tools.yfinance import YFinanceTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

web_agent = Agent(
    name="Web Agent",
    role="Search the web for information",
    model=Groq(id="openai/gpt-oss-120b"),
    tools=[WebSearchTools()],
    instructions="Always include sources",
    markdown=True,
)

finance_agent = Agent(
    name="Finance Agent",
    role="Get financial data",
    model=Groq(id="openai/gpt-oss-120b"),
    tools=[YFinanceTools()],
    instructions="Use tables to display data",
    markdown=True,
)

agent_team = Team(
    members=[web_agent, finance_agent],
    model=Groq(
        id="openai/gpt-oss-120b"
    ),  # You can use a different model for the team leader agent
    instructions=["Always include sources", "Use tables to display data"],
    markdown=True,
    show_members_responses=False,  # Comment to hide responses from team members
)

# Give the team a task
agent_team.print_response(
    input="Summarize the latest news about Nvidia and share its stock price?",
    stream=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass

Run the Example

Set up your virtual environment

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

Install dependencies

uv pip install -U agno ddgs groq yfinance

Export your Groq API key

export GROQ_API_KEY="your_groq_api_key_here"

Run the example

Save the code above as agent_team.py, then run:

python agent_team.py

Full source: cookbook/90_models/groq/agent_team.py