멀티 에이전트 라우팅
단일 Gateway에서 여러 격리된 에이전트를 실행하여 업무/개인 분리, 가족 공유 또는 다양한 AI 성격을 구현하세요.
1.멀티 에이전트 라우팅이란?
멀티 에이전트 라우팅을 사용하면 단일 OpenClaw Gateway에서 여러 격리된 AI 에이전트를 실행할 수 있습니다. 각 에이전트는 고유한 정체성, 메모리 및 설정을 가지지만 동일한 인프라를 공유합니다.
각 에이전트가 가진 것:
고유한 정체성
별도의 이름, 성격 및 시스템 프롬프트
격리된 메모리
독립적인 대화 기록 및 컨텍스트
맞춤 도구
에이전트별 다른 도구 권한
채널 바인딩
특정 채널을 특정 에이전트로 라우팅
일반적인 사용 사례
업무/개인 분리
업무용 Slack을 개인용 Telegram과 분리하세요. 다른 성격, 다른 메모리.
가족 공유
각 가족 구성원이 개인화된 응답과 비공개 메모리를 가진 자신만의 에이전트를 받습니다.
다양한 성격
이메일용 전문 비서, Discord용 캐주얼 친구, 브레인스토밍용 창작 작가.
멀티 계정
격리된 에이전트로 여러 WhatsApp 번호 또는 Telegram 계정을 처리합니다.
2.핵심 개념
각 에이전트는 '워크스페이스'에 존재합니다 - 설정, 메모리, 파일이 포함된 디렉토리입니다.
~/openclaw/agents/work/ ├── AGENTS.md # Define sub-agents and their specialties ├── SOUL.md # Agent personality and communication style ├── USER.md # Information about the user └── skills/ # Agent-specific skills
- soul.md— 에이전트 성격 및 시스템 프롬프트
- user.md— 사용자 선호도 및 컨텍스트
- memory/— 대화 기록 및 사실
- skills/— 이 에이전트용 맞춤 스킬
중요
에이전트는 동일한 Gateway 프로세스와 API 키를 공유합니다. 완전한 격리(별도 API 키, 별도 프로세스)를 위해서는 여러 Gateway 인스턴스를 실행하세요.
- - 요청 제한이 모든 에이전트에서 공유됨
- - API 비용이 합산됨
- - 충돌 시 모든 에이전트에 영향
바인딩은 채널, 사용자 또는 그룹을 기반으로 수신 메시지를 올바른 에이전트로 라우팅합니다.
// Example: Route WhatsApp business account to work agent
{
"bindings": [{
"agent": "work",
"channel": "whatsapp",
"accountId": "business-account-id"
}]
}3.단계별 설정
새 에이전트 생성
새 에이전트를 위한 워크스페이스 디렉토리를 생성하세요:
openclaw agents add work
이렇게 하면 자체 워크스페이스 디렉토리가 있는 새 에이전트가 생성됩니다.
워크스페이스 설정
에이전트의 성격 및 사용자 파일을 생성하세요:
soul.md - 에이전트 성격:
# Work Assistant Soul You are a professional work assistant. Be formal, concise, and focused on productivity. Avoid casual language. ## Communication Style - Use professional language - Be direct and efficient - Focus on actionable items - Respect work-life boundaries
user.md - 사용자 컨텍스트:
# User Profile - Work Context - Role: Software Engineer at Acme Corp - Working hours: 9 AM - 6 PM PST - Key projects: Project Alpha, Customer Portal - Slack workspace: acme-corp.slack.com
채널 바인딩 설정
openclaw.json에서 채널을 새 에이전트로 라우팅하세요:
{
"agents": {
"default": {
"workspace": "~/openclaw/agents/default",
"agentDir": "~/openclaw/state/default"
},
"work": {
"workspace": "~/openclaw/agents/work",
"agentDir": "~/openclaw/state/work"
}
},
"bindings": [
{
"agent": "work",
"channel": "whatsapp",
"accountId": "work-phone-id"
},
{
"agent": "work",
"channel": "slack",
"teamId": "T123ACMECORP"
}
],
"defaultAgent": "default"
}바인딩은 각 채널의 메시지를 어떤 에이전트가 처리해야 하는지 OpenClaw에 알려줍니다.
보안 설정 (선택사항)
에이전트의 샌드박스 모드 및 도구 제한을 설정하세요:
{
"agents": {
"work": {
"workspace": "~/openclaw/agents/work",
"agentDir": "~/openclaw/state/work",
"sandbox": "all",
"tools": {
"allow": ["calendar", "email", "notes"],
"deny": ["shell", "browser"]
}
},
"home": {
"workspace": "~/openclaw/agents/home",
"agentDir": "~/openclaw/state/home",
"sandbox": "non-main",
"tools": {
"allow": ["*"],
"deny": []
}
}
}
}설정 확인
OpenClaw를 재시작하고 멀티 에이전트 설정을 테스트하세요:
openclaw agents list
openclaw agents test --channel whatsapp --from +1234567890
4.설정 예제
다른 WhatsApp 번호를 다른 에이전트로 라우팅:
{
"agents": {
"personal": { "workspace": "~/.openclaw/personal" },
"business": { "workspace": "~/.openclaw/business" }
},
"bindings": [
{ "channel": "whatsapp:+1234567890", "agent": "personal" },
{ "channel": "whatsapp:+0987654321", "agent": "business" }
]
}업무에는 GPT-4, 개인용에는 Claude 사용:
{
"agents": {
"work": {
"workspace": "~/.openclaw/work",
"model": "gpt-4o"
},
"personal": {
"workspace": "~/.openclaw/personal",
"model": "claude-3-5-sonnet-20241022"
}
}
}다른 Discord 서버 또는 Slack 워크스페이스에 다른 에이전트:
{
"bindings": [
{ "channel": "discord", "guild": "gaming-server-id", "agent": "gaming-buddy" },
{ "channel": "discord", "guild": "work-server-id", "agent": "work-assistant" },
{ "channel": "slack", "workspace": "company-workspace", "agent": "work-assistant" }
]
}각 가족 구성원이 Telegram 사용자 ID를 통해 자신만의 에이전트를 받습니다:
{
"agents": {
"dad": { "workspace": "~/.openclaw/dad" },
"mom": { "workspace": "~/.openclaw/mom" },
"kids": { "workspace": "~/.openclaw/kids", "sandbox": "all" }
},
"bindings": [
{ "channel": "telegram", "userId": "123456", "agent": "dad" },
{ "channel": "telegram", "userId": "789012", "agent": "mom" },
{ "channel": "telegram", "userId": "345678", "agent": "kids" }
]
}5.바인딩 우선순위
여러 바인딩이 일치할 수 있는 경우 OpenClaw는 가장 구체적인 것을 사용합니다:
- 1
사용자별
userId가 있는 바인딩이 먼저 일치
{ "channel": "telegram", "userId": "123", "agent": "personal" } - 2
그룹별
group/guild/workspace가 있는 바인딩이 두 번째로 일치
{ "channel": "discord", "guild": "abc", "agent": "gaming" } - 3
채널별
채널만 있는 바인딩이 마지막으로 일치
{ "channel": "telegram", "agent": "default" }
예제
'telegram' (기본) 및 'telegram + userId:123' (개인)에 대한 바인딩이 있는 경우, 사용자 123의 메시지는 'personal'로, 나머지는 'default'로 이동합니다.
6.보안 및 샌드박싱
샌드박스 모드와 도구 정책으로 각 에이전트가 할 수 있는 작업을 제어합니다.
신뢰 수준에 따라 에이전트 기능을 제한합니다:
"sandbox": "off"전체 접근에이전트가 모든 도구를 사용할 수 있습니다. 신뢰할 수 있는 개인 에이전트에 사용하세요.
"sandbox": "non-main"제한됨파일/셸 접근을 워크스페이스 디렉토리로만 제한합니다.
"sandbox": "all"엄격파일 시스템 또는 셸 접근 없음. 채팅 및 웹만 가능.
에이전트가 사용할 수 있는 도구에 대한 세밀한 제어:
{
"agents": {
"restricted": {
"workspace": "~/openclaw/agents/restricted",
"agentDir": "~/openclaw/state/restricted",
"tools": {
// Only allow these specific tools
"allow": ["calendar", "notes", "reminders"],
// Explicitly block dangerous tools
"deny": ["shell", "filesystem", "browser", "email"]
}
},
"trusted": {
"workspace": "~/openclaw/agents/trusted",
"agentDir": "~/openclaw/state/trusted",
"tools": {
// Allow everything except...
"allow": ["*"],
"deny": ["shell"] // Still block shell for safety
}
}
}
}기본적으로 에이전트는 자신의 워크스페이스 디렉토리 내의 파일에만 접근할 수 있습니다. 이렇게 하면 한 에이전트가 다른 에이전트의 메모리나 파일을 읽는 것을 방지합니다.
{
"agents": {
"work": {
"workspace": "~/openclaw/agents/work",
"agentDir": "~/openclaw/state/work",
"filesystem": {
// Only allow access to these directories
"allowedPaths": [
"~/Documents/Work",
"~/Projects",
"/tmp"
],
// Block access to sensitive areas
"blockedPaths": [
"~/.ssh",
"~/.aws",
"~/Documents/Personal"
]
}
}
}
}멀티 에이전트 준비 완료!
이제 다양한 사용 사례를 위한 격리된 에이전트가 있습니다.
질문이 있으신가요? Discord 참여 또는 GitHub 이슈 열기