멀티 에이전트 시스템
전문 에이전트를 팀으로 구성하여 정교한 애플리케이션을 구축하세요.
구축할 내용
이 가이드에서는 코디네이터가 쿼리를 전문가에게 라우팅하는 고객 서비스 시스템을 만듭니다.
┌─────────────────────┐
사용자 문의 │ │
────────────────▶ │ COORDINATOR │
│ "전문가에게 라우팅" │
└──────────┬──────────┘
│
┌───────────────┴───────────────┐
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ BILLING AGENT │ │ SUPPORT AGENT │
│ │ │ │
│ 💰 결제 │ │ 🔧 기술 문제 │
│ 📄 송장 │ │ 🐛 버그 보고서 │
│ 💳 구독 │ │ ❓ 방법 │
└──────────────────┘ └──────────────────┘
주요 개념:
- Coordinator - 모든 요청을 수신하고 누가 처리할지 결정합니다.
- 전문가(Specialists) - 특정 도메인에 뛰어난 집중 agents입니다.
- 인계(Transfer) - coordinator에서 specialist로의 원활한 인계.
빠른 시작
1. 프로젝트 생성
cargo new multi_agent_demo
cd multi_agent_demo
Cargo.toml에 종속성 추가:
[dependencies]
adk-rust = { version = "0.2", features = ["agents", "models", "cli"] }
tokio = { version = "1", features = ["full"] }
dotenvy = "0.15"
API 키를 사용하여 .env 생성:
echo 'GOOGLE_API_KEY=your-api-key' > .env
2. 고객 서비스 예시
완전한 작동 예시는 다음과 같습니다:
use adk_rust::prelude::*;
use adk_rust::Launcher;
use std::sync::Arc;
#[tokio::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
dotenvy::dotenv().ok();
let api_key = std::env::var("GOOGLE_API_KEY")?;
let model = Arc::new(GeminiModel::new(&api_key, "gemini-2.5-flash")?);
// 전문가: 결제 Agent
let billing_agent = LlmAgentBuilder::new("billing_agent")
.description("Handles billing questions: payments, invoices, subscriptions, refunds")
.instruction("You are a billing specialist. Help customers with:\n\
- Invoice questions and payment history\n\
- Subscription plans and upgrades\n\
- Refund requests\n\
- Payment method updates\n\
Be professional and provide clear information about billing matters.")
.model(model.clone())
.build()?;
// 전문가: 기술 지원 Agent
let support_agent = LlmAgentBuilder::new("support_agent")
.description("Handles technical support: bugs, errors, troubleshooting, how-to questions")
.instruction("You are a technical support specialist. Help customers with:\n\
- Troubleshooting errors and bugs\n\
- How-to questions about using the product\n\
- Configuration and setup issues\n\
- Performance problems\n\
Be patient and provide step-by-step guidance.")
.model(model.clone())
.build()?;
// 조정자: 적절한 전문가에게 라우팅
let coordinator = LlmAgentBuilder::new("coordinator")
.description("Main customer service coordinator")
.instruction("You are a customer service coordinator. Analyze each customer request:\n\n\
- For BILLING questions (payments, invoices, subscriptions, refunds):\n\
Transfer to billing_agent\n\n\
- For TECHNICAL questions (errors, bugs, how-to, troubleshooting):\n\
Transfer to support_agent\n\n\
- For GENERAL greetings or unclear requests:\n\
Respond yourself and ask clarifying questions\n\n\
When transferring, briefly acknowledge the customer and explain the handoff.")
.model(model.clone())
.sub_agent(Arc::new(billing_agent))
.sub_agent(Arc::new(support_agent))
.build()?;
println!("🏢 Customer Service Center");
println!(" Coordinator → Billing Agent | Support Agent");
println!();
Launcher::new(Arc::new(coordinator)).run().await?;
Ok(())
}
상호작용 예시:
You: I have a question about my last invoice
[Agent: coordinator]
Assistant: I'll connect you with our billing specialist to help with your invoice question.
[Agent: billing_agent]
Assistant: Hello! I can help you with your invoice. What specific question do you have about your last invoice?
You: Why was I charged twice?
[Agent: billing_agent]
Assistant: I understand your concern about the duplicate charge. Let me help you investigate this...
다중 Agent 전송 작동 방식
전체 그림
하위 Agent를 상위 Agent에 추가하면, LLM은 작업을 위임하는 능력을 얻게 됩니다:
┌─────────────────────┐
User Message │ │
─────────────────▶ COORDINATOR │
│ │
└──────────┬──────────┘
│
"This is a billing question..."
│
┌────────────────┴────────────────┐
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ billing_agent │ │ support_agent │
│ 💰 Payments │ │ 🔧 Tech Issues │
│ 📄 Invoices │ │ 🐛 Bug Reports │
└──────────────────┘ └──────────────────┘
단계별 전송 흐름
사용자가 청구 관련 질문을 할 때 정확히 어떤 일이 발생하는지 다음과 같습니다:
┌──────────────────────────────────────────────────────────────────────┐
│ STEP 1: 사용자가 메시지를 보냅니다 │
├──────────────────────────────────────────────────────────────────────┤
│ │
│ 사용자: "내 송장에 왜 두 번 청구되었나요?" │
│ │
│ ↓ │
│ │
│ ┌──────────────────────────────────────┐ │
│ │ COORDINATOR AGENT │ │
│ │ 메시지를 먼저 받습니다 │ │
│ └──────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────┘
↓
┌──────────────────────────────────────────────────────────────────────┐
│ STEP 2: LLM이 분석하고 전송을 결정합니다 │
├──────────────────────────────────────────────────────────────────────┤
│ │
│ 🧠 LLM 생각: "이것은 송장 청구에 관한 것입니다..." │
│ "송장 = 청구 주제..." │
│ "billing_agent로 전송해야 합니다" │
│ │
│ 📞 LLM 호출: transfer_to_agent(agent_name="billing_agent") │
│ │
└──────────────────────────────────────────────────────────────────────┘
↓
┌──────────────────────────────────────────────────────────────────────┐
│ STEP 3: Runner가 전송을 감지하고 대상을 호출합니다 │
├──────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ 전송 이벤트 ┌─────────────────┐ │
│ │ Runner │ ─────────────────────▶ │ billing_agent │ │
│ └─────────┘ (동일한 사용자 메시지) └─────────────────┘ │
│ │
│ • Runner는 agent 트리에서 "billing_agent"를 찾습니다 │
│ • 동일한 사용자 메시지로 새로운 컨텍스트를 생성합니다 │
│ • billing_agent를 즉시 호출합니다 │
│ │
└──────────────────────────────────────────────────────────────────────┘
↓
┌──────────────────────────────────────────────────────────────────────┐
│ STEP 4: 대상 Agent가 응답합니다 │
├──────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────┐ │
│ │ billing_agent가 응답합니다 │ │
│ │ │ │
│ │ "중복 청구 문제에 대해 도와드릴 수 │ │
│ │ 있습니다. 제가 조사해보겠습니다..." │ │
│ └─────────────────────────────────────────┘ │
│ │
│ ✅ 사용자는 끊김 없는 응답을 봅니다 - 방해 없이! │
│ │
└──────────────────────────────────────────────────────────────────────┘
작동 원리
| 구성 요소 | 역할 |
|---|---|
.sub_agent() | 상위 Agent 아래에 전문가를 등록합니다 |
transfer_to_agent tool | 하위 Agent가 있을 때 자동 주입됩니다 |
| Agent 설명 | LLM이 어떤 Agent가 무엇을 처리할지 결정하도록 돕습니다 |
| Runner | 전송 이벤트를 감지하고 대상 Agent를 호출합니다 |
| 공유 Session | 전송 전반에 걸쳐 상태 및 기록이 보존됩니다 |
하위 Agent 추가 전후
하위 Agent 없이 - 하나의 Agent가 모든 것을 처리합니다:
사용자 ──▶ coordinator ──▶ 응답 (청구 및 지원 모두 처리)
하위 Agent 사용 - 전문가가 각자의 영역을 처리합니다:
사용자 ──▶ coordinator ──▶ billing_agent ──▶ 응답 (청구 전문가)
──▶ support_agent ──▶ 응답 (기술 전문가)
계층적 멀티 에이전트 시스템
복잡한 시나리오를 위해 다단계 계층 구조를 만들 수 있습니다. 각 Agent는 자체 하위 Agent를 가질 수 있으며, 이는 트리 형태를 이룹니다:
시각 자료: 3단계 콘텐츠 팀
┌─────────────────────┐
│ PROJECT MANAGER │ ← 레벨 1: 최상위 코디네이터
│ "Manage projects" │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ CONTENT CREATOR │ ← 레벨 2: 중간 레벨 코디네이터
│ "Coordinate R&W" │
└──────────┬──────────┘
│
┌────────────────┴────────────────┐
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ RESEARCHER │ │ WRITER │ ← 레벨 3: 전문가
│ │ │ │
│ 📚 Gather facts │ │ ✍️ Write content │
│ 🔍 Analyze data │ │ 📝 Polish text │
│ 📊 Find sources │ │ 🎨 Style & tone │
└──────────────────┘ └──────────────────┘
요청 흐름 방식
User: "Create a blog post about electric vehicles"
│
▼
┌─────────────────────────────────────────────────────────────┐
│ PROJECT MANAGER: "This is a content task" │
│ → transfers to content_creator │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ CONTENT CREATOR: "Need research first, then writing" │
│ → transfers to researcher │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ RESEARCHER: "Here's what I found about EVs..." │
│ → provides research summary │
└─────────────────────────────────────────────────────────────┘
전체 예시 코드
use adk_rust::prelude::*;
use adk_rust::Launcher;
use std::sync::Arc;
#[tokio::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
dotenvy::dotenv().ok();
let api_key = std::env::var("GOOGLE_API_KEY")?;
let model = Arc::new(GeminiModel::new(&api_key, "gemini-2.5-flash")?);
// Level 3: Leaf specialists
let researcher = LlmAgentBuilder::new("researcher")
.description("Researches topics and gathers comprehensive information")
.instruction("You are a research specialist. When asked to research a topic:\n\
- Gather key facts and data\n\
- Identify main themes and subtopics\n\
- Note important sources or references\n\
Provide thorough, well-organized research summaries.")
.model(model.clone())
.build()?;
let writer = LlmAgentBuilder::new("writer")
.description("Writes polished content based on research")
.instruction("You are a content writer. When asked to write:\n\
- Create engaging, clear content\n\
- Use appropriate tone for the audience\n\
- Structure content logically\n\
- Polish for grammar and style\n\
Produce professional, publication-ready content.")
.model(model.clone())
.build()?;
// Level 2: Content coordinator
let content_creator = LlmAgentBuilder::new("content_creator")
.description("Coordinates content creation by delegating research and writing")
.instruction("You are a content creation lead. For content requests:\n\n\
- If RESEARCH is needed: Transfer to researcher\n\
- If WRITING is needed: Transfer to writer\n\
- For PLANNING or overview: Handle yourself\n\n\
Coordinate between research and writing phases.")
.model(model.clone())
.sub_agent(Arc::new(researcher))
.sub_agent(Arc::new(writer))
.build()?;
// Level 1: Top-level manager
let project_manager = LlmAgentBuilder::new("project_manager")
.description("Manages projects and coordinates with content team")
.instruction("You are a project manager. For incoming requests:\n\n\
- For CONTENT creation tasks: Transfer to content_creator\n\
- For PROJECT STATUS or general questions: Handle yourself\n\n\
Keep track of overall project goals and deadlines.")
.model(model.clone())
.sub_agent(Arc::new(content_creator))
.build()?;
println!("📊 Hierarchical Multi-Agent System");
println!();
println!(" project_manager");
println!(" └── content_creator");
println!(" ├── researcher");
println!(" └── writer");
println!();
Launcher::new(Arc::new(project_manager)).run().await?;
Ok(())
}
Agent 계층 구조:
project_manager
└── content_creator
├── researcher
└── writer
예시 프롬프트:
- "의료 분야의 AI에 대한 블로그 게시물 작성" → PM → Content Creator → Writer
- "전기차 연구" → PM → Content Creator → Researcher
서브 에이전트 구성
sub_agent() 빌더 메서드를 사용하여 모든 LlmAgent에 서브 에이전트를 추가하세요:
let parent = LlmAgentBuilder::new("parent")
.description("Coordinates specialized tasks")
.instruction("Route requests to appropriate specialists.")
.model(model.clone())
.sub_agent(Arc::new(specialist_a))
.sub_agent(Arc::new(specialist_b))
.build()?;
핵심 사항:
- 각 Agent는 여러 서브 에이전트를 가질 수 있습니다.
- 서브 에이전트는 자체 서브 에이전트를 가질 수 있습니다 (다단계 계층 구조).
- Agent 이름은 계층 구조 내에서 고유해야 합니다.
- 설명은 LLM이 어느 Agent로 전송할지 결정하는 데 도움이 됩니다.
효과적인 전송 지침 작성
성공적인 Agent 전송을 위해 명확한 지침과 설명을 제공하세요:
부모 Agent 지침
let coordinator = LlmAgentBuilder::new("coordinator")
.description("Main customer service coordinator")
.instruction("You are a customer service coordinator. Analyze each request:\n\n\
- BILLING 관련 질문 (결제, 송장, 구독)의 경우:\n\
billing_agent로 전송\n\n\
- TECHNICAL 관련 질문 (오류, 버그, 문제 해결)의 경우:\n\
support_agent로 전송\n\n\
- 일반적인 인사 또는 불명확한 요청의 경우:\n\
직접 응답하고 명확히 하는 질문을 하세요")
.model(model.clone())
.sub_agent(Arc::new(billing_agent))
.sub_agent(Arc::new(support_agent))
.build()?;
서브 Agent 설명
let billing_agent = LlmAgentBuilder::new("billing_agent")
.description("Handles billing questions: payments, invoices, subscriptions, refunds")
.instruction("You are a billing specialist. Help with payment and subscription issues.")
.model(model.clone())
.build()?;
let support_agent = LlmAgentBuilder::new("support_agent")
.description("Handles technical support: bugs, errors, troubleshooting, how-to questions")
.instruction("You are a technical support specialist. Provide step-by-step guidance.")
.model(model.clone())
.build()?;
모범 사례:
- 용도를 명확하게 나타내는 설명적인 Agent 이름을 사용하세요.
- 상세한 설명을 작성하세요 - LLM은 이를 사용하여 전송을 결정합니다.
- 예상되는 사용자 요청과 일치하는 특정 키워드를 설명에 포함하세요.
- 부모 Agent 지침에 명확한 위임 규칙을 명시하세요.
- Agent 설명 전반에 걸쳐 일관된 용어를 사용하세요.
멀티 Agent 시스템 테스트
예제 실행
# 고객 서비스 예제 실행
cargo run --bin customer_service
# 계층적 예제 실행
cargo run --bin hierarchical
예제 테스트 프롬프트
고객 서비스:
- "지난 송장에 대해 질문이 있습니다." →
billing_agent로 라우팅되어야 합니다. - "앱이 계속 충돌합니다." →
support_agent로 라우팅되어야 합니다. - "내 요금제를 어떻게 업그레이드하나요?" →
billing_agent로 라우팅되어야 합니다. - "안녕하세요, 도움이 필요합니다." → 명확화를 위해
coordinator에 머물러야 합니다.
계층적:
- "의료 분야 AI에 대한 블로그 게시물 작성" → PM → Content Creator → Writer
- "전기 자동차의 역사 연구" → PM → Content Creator → Researcher
- "현재 프로젝트의 상태는 어떤가요?" →
project_manager에 머물러야 합니다.
전송 문제 디버깅
전송이 예상대로 작동하지 않는 경우:
- Agent 이름 확인 - 전송 호출에서 정확히 일치해야 합니다.
- 설명 검토 - 더 구체적이고 키워드가 풍부하게 만드세요.
- 지침 명확화 - 언제 전송해야 하는지 명시적으로 작성하세요.
- 경계 케이스 테스트 - 모호한 요청을 시도하여 라우팅 동작을 확인하세요.
- 전송 지표 확인 -
[Agent: name]은 어떤 Agent가 응답하는지 보여줍니다.
전역 지침
기본 사용법
let agent = LlmAgentBuilder::new("assistant")
.description("A helpful assistant")
.global_instruction(
"You are a professional assistant for Acme Corp. \
Always maintain a friendly but professional tone. \
Our company values are: customer-first, innovation, and integrity."
)
.instruction("Help users with their questions and tasks.")
.model(model.clone())
.build()?;
전역 지침 vs Agent 지침
- Global Instruction: 계층 구조의 모든 Agent에 적용되며, 전반적인 성격/컨텍스트를 설정합니다.
- Agent Instruction: 각 Agent에 특화되며, 특정 역할과 동작을 정의합니다.
두 지침 모두 대화 기록에 포함되며, Global Instruction이 먼저 나타납니다.
동적 전역 지침
더 고급 시나리오의 경우, 지침을 동적으로 계산하는 Global Instruction provider를 사용할 수 있습니다.
use adk_core::GlobalInstructionProvider;
let provider: GlobalInstructionProvider = Arc::new(|ctx| {
Box::pin(async move {
// 컨텍스트 정보 접근
let user_id = ctx.user_id();
// 동적 지침 계산
let instruction = format!(
"You are assisting user {}. Tailor your responses to their preferences.",
user_id
);
Ok(instruction)
})
});
let agent = LlmAgentBuilder::new("assistant")
.description("A personalized assistant")
.global_instruction_provider(provider)
.model(model.clone())
.build()?;
상태 변수 주입
Global 및 Agent 지침 모두 {variable} 구문을 사용한 상태 변수 주입을 지원합니다.
// 이전 Agent 또는 Tool에서 상태 설정
// state["company_name"] = "Acme Corp"
// state["user_role"] = "manager"
let agent = LlmAgentBuilder::new("assistant")
.global_instruction(
"You are an assistant for {company_name}. \
The user is a {user_role}."
)
.instruction("Help with {user_role}-level tasks.")
.model(model.clone())
.build()?;
프레임워크는 세션 상태의 값을 지침 템플릿에 자동으로 주입합니다.
일반적인 다중 에이전트 패턴
코디네이터/디스패처 패턴
중앙 에이전트가 전문 서브 에이전트에게 요청을 라우팅합니다:
let billing = LlmAgentBuilder::new("billing")
.description("Handles billing and payment questions")
.model(model.clone())
.build()?;
let support = LlmAgentBuilder::new("support")
.description("Provides technical support")
.model(model.clone())
.build()?;
let coordinator = LlmAgentBuilder::new("coordinator")
.instruction("Route requests to billing or support agents as appropriate.")
.sub_agent(Arc::new(billing))
.sub_agent(Arc::new(support))
.model(model.clone())
.build()?;
대화 예시:
User: I have a question about my last invoice
[Agent: coordinator]
Assistant: I'll connect you with our billing specialist.
🔄 [Transfer requested to: billing]
[Agent: billing]
Assistant: Hello! I can help you with your invoice.
What specific question do you have?
User: Why was I charged twice?
[Agent: billing]
Assistant: Let me investigate that duplicate charge for you...
핵심 사항:
- 코디네이터는 요청을 분석하고 결제 에이전트로 전달합니다.
- 결제 에이전트는 동일한 턴에서 즉시 응답합니다.
- 이후 메시지는 결제 에이전트와 계속됩니다.
- 전달 지표(
🔄)는 인수인계가 발생하는 시점을 보여줍니다.
계층적 작업 분해
복잡한 작업을 분해하기 위한 다단계 계층 구조:
// 하위 레벨 전문가
let researcher = LlmAgentBuilder::new("researcher")
.description("Researches topics and gathers information")
.model(model.clone())
.build()?;
let writer = LlmAgentBuilder::new("writer")
.description("Writes content based on research")
.model(model.clone())
.build()?;
// 중간 레벨 코디네이터
let content_creator = LlmAgentBuilder::new("content_creator")
.description("Creates content by coordinating research and writing")
.sub_agent(Arc::new(researcher))
.sub_agent(Arc::new(writer))
.model(model.clone())
.build()?;
// 최상위 레벨 관리자
let project_manager = LlmAgentBuilder::new("project_manager")
.description("Manages content creation projects")
.sub_agent(Arc::new(content_creator))
.model(model.clone())
.build()?;
워크플로우 에이전트와 결합
다중 에이전트 시스템은 워크플로우 에이전트(Sequential, Parallel, Loop)와 잘 작동합니다:
use adk_agent::workflow::{SequentialAgent, ParallelAgent};
// 전문 에이전트 생성
let validator = LlmAgentBuilder::new("validator")
.instruction("Validate the input data.")
.output_key("validation_result")
.model(model.clone())
.build()?;
let processor = LlmAgentBuilder::new("processor")
.instruction("Process data if {validation_result} is valid.")
.output_key("processed_data")
.model(model.clone())
.build()?;
// 순차적 워크플로우로 결합
let pipeline = SequentialAgent::new(
"validation_pipeline",
vec![Arc::new(validator), Arc::new(processor)]
);
// 파이프라인을 서브 에이전트로 사용
let coordinator = LlmAgentBuilder::new("coordinator")
.description("Coordinates data processing")
.sub_agent(Arc::new(pipeline))
.model(model.clone())
.build()?;
에이전트 간 통신
계층 구조의 에이전트는 공유 세션 상태를 통해 통신합니다:
// 에이전트 A가 상태에 데이터를 저장합니다.
let agent_a = LlmAgentBuilder::new("agent_a")
.instruction("Analyze the topic and save key points.")
.output_key("key_points") // Automatically saves output to state
.model(model.clone())
.build()?;
// 에이전트 B가 상태에서 데이터를 읽습니다.
let agent_b = LlmAgentBuilder::new("agent_b")
.instruction("Expand on the key points: {key_points}")
.model(model.clone())
.build()?;
output_key 구성은 에이전트의 최종 응답을 세션 상태에 자동으로 저장하여 후속 에이전트가 사용할 수 있도록 합니다.
다중 에이전트 시스템 실행하기
Launcher 사용하기
Launcher는 다중 에이전트 시스템을 실행하고 테스트하는 쉬운 방법을 제공합니다:
use adk_rust::Launcher;
let coordinator = /* your multi-agent setup */;
Launcher::new(Arc::new(coordinator))
.run()
.await?;
실행 모드:
# Interactive console mode
cargo run --example multi_agent -- chat
# Web server mode with UI
cargo run --example multi_agent -- serve
cargo run --example multi_agent -- serve --port 3000
기능:
- Agent 표시기: 어떤 agent가 응답하는지 보여줍니다
[Agent: coordinator] - 전송 시각화: 전송 이벤트를 표시합니다
🔄 [Transfer requested to: billing_agent] - 원활한 핸드오프: transfer 후 대상 agent가 즉시 응답합니다
- 대화 기록: agent transfer 전반에 걸쳐 context를 유지합니다
전송 테스트하기
다중 agent 시스템이 올바르게 작동하는지 확인하려면:
- 응답할 때 대괄호 안에 agent 이름이 나타나는지 확인합니다
- agent가 핸드오프할 때 전송 표시기(
🔄)를 찾습니다 - 다시 프롬프트를 입력하지 않고 대상 agent로부터 즉각적인 응답이 오는지 확인합니다
- 적절한 라우팅을 보장하기 위해 다양한 요청 유형을 테스트합니다
- 존재하지 않는 agent로 transfer하는 것과 같은 에지 케이스를 확인합니다
전송 문제 디버깅하기
transfer가 작동하지 않는 경우:
.sub_agent()를 통해 하위 agent가 추가되었는지 확인합니다- agent description을 확인합니다 - LLM은 이를 사용하여 transfer를 결정합니다
- instructions를 검토합니다 - 상위 agent는 언제 transfer해야 하는지 언급해야 합니다
- agent 이름을 확인합니다 - transfer 호출에서 정확히 일치해야 합니다
- event stream에서 transfer action을 확인하려면 logging을 활성화합니다
모범 사례
- 명확한 Description: LLM이 올바른 transfer 결정을 내릴 수 있도록 설명적인 agent 이름과 description을 작성합니다
- 구체적인 Instructions: 각 agent에 역할에 대한 명확하고 집중된 instructions를 제공합니다
- 전역 Instruction 사용: 모든 agent에 걸쳐 일관된 personality와 context를 설정합니다
- 상태 관리: agent 통신을 위해
output_key와 state 변수를 사용합니다 - 계층 깊이 제한: 더 나은 유지보수성을 위해 계층을 얕게 유지합니다 (2-3단계)
- Transfer Logic 테스트: agent가 다양한 요청에 대해 올바른 하위 agent로 transfer하는지 확인합니다
관련 항목
- LLM Agent - Core agent 구성
- Workflow Agents - SequentialAgent, ParallelAgent, LoopAgent
- Sessions - Session 상태 관리
이전: ← Workflow Agents | 다음: Graph Agents →