Agno 팀(Teams)으로 멀티 에이전트 협업하기
Agno 팀(Teams)으로 멀티 에이전트 협업하기
한 에이전트가 모든 걸 처리하기 어려운 작업은 여러 에이전트로 나눠 팀을 구성하면 더 잘 풀려요. Agno에서 Team은 에이전트나 중첩 팀을 조정(coordinate)해요. 기본 조정 모드에서는 리더가 멤버 역할에 따라 작업을 위임하고 결과를 종합해요.
출처: Agno 팀 공식 문서
기본 구조
from agno.team import Team
from agno.agent import Agent
team = Team(members=[
Agent(name="English Agent", role="You answer questions in English"),
Agent(name="Chinese Agent", role="You answer questions in Chinese"),
Team(
name="Germanic Team",
role="You coordinate the team members to answer questions in German and Dutch",
members=[
Agent(name="German Agent", role="You answer questions in German"),
Agent(name="Dutch Agent", role="You answer questions in Dutch"),
],
),
])
members에 에이전트와 하위 팀을 함께 넣을 수 있어요. 각 멤버는 role로 정체를 드러내고, 하위 팀은 자기만의 리더와 멤버를 갖는 중첩(nested) 구조가 가능해요.
왜 팀을 쓰나
역할·도구·실행 경로가 분리된 작업이면 팀이 제어하기 더 쉬워요.
| Benefit | Description |
|---|---|
| Specialization | Give each member a focused role and toolset |
| Coordination | Select coordinate, route, broadcast, or tasks mode |
| Composition | Nest teams when a sub-team needs its own leader and members |
| Inspection | Keep member responses and metrics separate from the leader response |
리더와 멤버는 별도 모델 호출을 하기 때문에, 지연 시간·토큰 사용량·조정 상태가 늘어난다는 점은 알아 둬야 해요.
언제 팀을 쓰고 언제 단일 에이전트를 쓰나
팀을 쓰는 경우:
- 서로 다른 도구나 전문성을 가진 여러 전문화 에이전트가 필요한 작업
- 명시적인 라우팅·브로드캐스트·태스크 리스트 패턴이 필요할 때
- 멤버 실행 결과나 지표를 별도로 가져와야 할 때
단일 에이전트를 쓰는 경우:
- 작업이 한 도메인에 맞을 때
- 토큰 비용 절감이 중요할 때
- 추가 조정이 결과를 개선하지 못할 때
팀 모드(TeamMode)
TeamMode는 협업 방식을 명시적으로 만들어 줘요. respond_directly나 delegate_to_all_members 같은 옛 플래그 대신 mode=를 쓰는 걸 권장해요.
from agno.team import Team, TeamMode
team = Team(
name="Research Team",
members=[...],
mode=TeamMode.broadcast,
)
| Mode | Configuration | Use case |
|---|---|---|
| Coordinate | mode=TeamMode.coordinate (default) |
Decompose work, delegate to members, synthesize results |
| Route | mode=TeamMode.route |
Route to a single specialist and return their response directly |
| Broadcast | mode=TeamMode.broadcast |
Delegate the same task to all members and synthesize |
| Tasks | mode=TeamMode.tasks |
Run a task list loop until the goal is complete |
mode를 지정하지 않으면 respond_directly=True는 TeamMode.route로, delegate_to_all_members=True는 TeamMode.broadcast로 매핑되고, 그 외에는 TeamMode.coordinate를 써요. 모드는 멤버 구성을 바꾸지 않고 위임 경로만 정해요.
콜러블 팩토리
tools, knowledge, members에 정적 리스트 대신 함수를 넘길 수 있어요. Agno는 실행 설정 시점에 팩토리를 해석하고, 가능하면 캐시된 결과를 재사용해요. 파라미터 이름에 따라 컨텍스트를 주입하고, 캐시 키는 사용자 정의 키 > user_id > session_id 순이에요.
더 알아보기
- 팀 만들기: Building Teams
- 팀 실행: Running Teams
- 위임 제어: Delegation
- 에이전트 기초: What are Agents?