Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teams 2.0 #2246

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
438d3c2
Add skeleton for teams
dirkbrnd Feb 25, 2025
33c48b6
WIP
dirkbrnd Feb 26, 2025
502c1be
Update logs and metrics
dirkbrnd Feb 26, 2025
11278c6
Add proxy agent example
dirkbrnd Feb 27, 2025
52e684a
Update
dirkbrnd Feb 27, 2025
fb84677
Add collaborative mode
dirkbrnd Feb 28, 2025
6fd7358
Update
dirkbrnd Feb 28, 2025
af09a28
Update collaborative
dirkbrnd Mar 2, 2025
adc9e20
Clean up agent
dirkbrnd Mar 2, 2025
ecf7340
Improve tic-tac-toe
dirkbrnd Mar 2, 2025
7daafa0
Merge
dirkbrnd Mar 3, 2025
68fccb1
Merge branch 'main' of https://github.com/agno-agi/agno into feat/tea…
dirkbrnd Mar 4, 2025
f2c63d1
Update
dirkbrnd Mar 4, 2025
3d7d22e
Merge
dirkbrnd Mar 4, 2025
4d00121
Merge branch 'main' into feat/teams-2-0
anuragts Mar 6, 2025
e054190
Feat/migrate teamv2 (#2308)
anuragts Mar 7, 2025
8cf86d7
fix: don't show error in streamlit ui
anuragts Mar 7, 2025
9091399
Fix logging
dirkbrnd Mar 7, 2025
5aa55fc
Merge branch 'feat/teams-2-0' of https://github.com/agno-agi/agno int…
dirkbrnd Mar 7, 2025
1add212
feat:Add ai customer support use case (#2309)
mishramonalisha76 Mar 7, 2025
7c6107f
Update
dirkbrnd Mar 9, 2025
1ee2890
Merge branch 'feat/teams-2-0' of https://github.com/agno-agi/agno int…
dirkbrnd Mar 9, 2025
e24503f
Remove breaking changes
dirkbrnd Mar 10, 2025
023b355
Merge
dirkbrnd Mar 11, 2025
24a5e8f
Update
dirkbrnd Mar 11, 2025
7cf248a
Startup Team (#2366)
anuragts Mar 12, 2025
1a4c8c9
Merge
dirkbrnd Mar 12, 2025
34c1edc
feat:Add a multi language team (#2376)
mishramonalisha76 Mar 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.yfinance import YFinanceTools
from agno.team.team import Team

web_agent = Agent(
name="Web Agent",
Expand All @@ -212,8 +213,10 @@ finance_agent = Agent(
)

agent_team = Agent(
team=[web_agent, finance_agent],
mode="coordinator",
members=[web_agent, finance_agent],
model=OpenAIChat(id="gpt-4o"),
success_criteria="A comprehensive financial news report with clear sections and data-driven insights.",
instructions=["Always include sources", "Use tables to display data"],
show_tool_calls=True,
markdown=True,
Expand Down
2 changes: 1 addition & 1 deletion cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The concepts cookbook walks through the core concepts of Agno.
- [Reasoning](./agent_concepts/reasoning)
- [Vector DBs](./agent_concepts/vector_dbs)
- [Multi-modal Agents](./agent_concepts/multimodal)
- [Agent Teams](./agent_concepts/teams)
- [Agent Teams](teams)
- [Hybrid Search](./agent_concepts/hybrid_search)
- [Agent Session](./agent_concepts/agent_session)
- [Other](./agent_concepts/other)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
*.mp3
*.wav
*.mp4
*.mp3
*.mp3
52 changes: 0 additions & 52 deletions cookbook/agent_concepts/teams/respond_directly.py

This file was deleted.

72 changes: 40 additions & 32 deletions cookbook/examples/apps/chess_team/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
Usage Examples:
---------------
1. Quick game with default settings:
agents = get_chess_teams()
team = get_chess_team()

2. Game with debug mode off:
agents = get_chess_teams(debug_mode=False)
team = get_chess_team(debug_mode=False)

The game integrates:
- Multiple AI models (Claude, GPT-4, etc.)
Expand All @@ -22,13 +22,13 @@

import sys
from pathlib import Path
from typing import Dict

from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.google import Gemini
from agno.models.groq import Groq
from agno.models.openai import OpenAIChat
from agno.team.team import Team
from agno.utils.log import logger

project_root = str(Path(__file__).parent.parent.parent.parent)
Expand Down Expand Up @@ -66,6 +66,7 @@ def get_model_for_provider(provider: str, model_name: str):
return Claude(
id="claude-3-7-sonnet-20250219",
max_tokens=8192,
thinking={"type": "enabled", "budget_tokens": 4096},
)
else:
return Claude(id=model_name)
Expand All @@ -75,14 +76,14 @@ def get_model_for_provider(provider: str, model_name: str):
raise ValueError(f"Unsupported model provider: {provider}")


def get_chess_teams(
def get_chess_team(
white_model: str = "openai:gpt-4o",
black_model: str = "anthropic:claude-3-7-sonnet",
master_model: str = "openai:gpt-4o",
debug_mode: bool = True,
) -> Dict[str, Agent]:
) -> Team:
"""
Returns a dictionary of chess agents with specific roles.
Returns a chess team with specialized agents for white pieces, black pieces, and game master.

Args:
white_model: Model for white piece strategy
Expand All @@ -91,22 +92,20 @@ def get_chess_teams(
debug_mode: Enable logging and debug features

Returns:
Dictionary of configured agents
Team instance configured for chess gameplay
"""
try:
# Parse model providers and names
white_provider, white_name = white_model.split(":")
black_provider, black_name = black_model.split(":")
master_provider, master_name = master_model.split(":")

# Create model instances
white_piece_model = get_model_for_provider(white_provider, white_name)
black_piece_model = get_model_for_provider(black_provider, black_name)
master_model = get_model_for_provider(master_provider, master_name)

# Create agents
white_piece_agent = Agent(
name="white_piece_agent",
role="White Piece Strategist",
description="""You are a chess strategist for white pieces. Given a list of legal moves,
analyze them and choose the best one based on standard chess strategy.
Consider piece development, center control, and king safety.
Expand All @@ -117,6 +116,7 @@ def get_chess_teams(

black_piece_agent = Agent(
name="black_piece_agent",
role="Black Piece Strategist",
description="""You are a chess strategist for black pieces. Given a list of legal moves,
analyze them and choose the best one based on standard chess strategy.
Consider piece development, center control, and king safety.
Expand All @@ -125,31 +125,39 @@ def get_chess_teams(
debug_mode=debug_mode,
)

master_agent = Agent(
name="master_agent",
description="""You are a chess master overseeing the game. Your responsibilities:
1. Analyze the current board state to determine if the game has ended
2. Check for checkmate, stalemate, draw by repetition, or insufficient material
3. Provide commentary on the current state of the game
4. Evaluate the position and suggest who has an advantage

Respond with a JSON object containing:
{
"game_over": true/false,
"result": "white_win"/"black_win"/"draw"/null,
"reason": "explanation if game is over",
"commentary": "brief analysis of the position",
"advantage": "white"/"black"/"equal"
}""",
return Team(
name="Chess Team",
mode="router",
model=master_model,
success_criteria="The game is completed with a win, loss, or draw",
members=[white_piece_agent, black_piece_agent],
instructions=[
"You are the chess game coordinator and master analyst.",
"Your role is to coordinate between two player agents and provide game analysis:",
"1. white_piece_agent - Makes moves for white pieces",
"2. black_piece_agent - Makes moves for black pieces",
"",
"When receiving a task:",
"1. Check the 'current_player' in the context",
"2. If current_player is white_piece_agent or black_piece_agent:",
" - Forward the move request to that agent",
" - Return their move response directly without modification",
"3. If no current_player is specified:",
" - This indicates a request for position analysis",
" - Analyze the position yourself and respond with a JSON object:",
" {",
" 'game_over': true/false,",
" 'result': 'white_win'/'black_win'/'draw'/null,",
" }",
"",
"Do not modify player agent responses.",
"For analysis requests, provide detailed evaluation of the position.",
],
debug_mode=debug_mode,
markdown=True,
show_members_responses=True,
)

return {
"white_piece_agent": white_piece_agent,
"black_piece_agent": black_piece_agent,
"master_agent": master_agent,
}
except Exception as e:
logger.error(f"Error initializing agents: {str(e)}")
logger.error(f"Error initializing chess team: {str(e)}")
raise
Loading
Loading