多智能体蓝图:构建您的 AI 团队 - Openclaw Skills
作者:互联网
2026-04-17
什么是 多智能体蓝图?
多智能体蓝图是一个专业级模板,专为希望使用 Openclaw Skills 扩展自动化的开发者设计。它提供了一种结构化的方法来构建专业智能体团队(如协调员、财务顾问和技术主管),这些智能体可以自主通信并移交任务。该框架通过提供标准化的角色模板和通信协议,解决了多智能体编排的复杂性。
通过利用 Openclaw Skills 的强大功能,该蓝图允许进行复杂的模型分层,确保高推理任务由 Claude Opus 等高端模型处理,而常规操作则路由到更经济的层级。该架构经过可靠性实战测试,具有回退链和用于文件及数据库操作的集中式主模式,以防止数据冲突并优化资源利用率。
下载入口:https://github.com/openclaw/skills/tree/main/skills/neal-collab/multi-agent-blueprint
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install multi-agent-blueprint
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 multi-agent-blueprint。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
多智能体蓝图 应用场景
- 创建一个 24/7 全天候自主运行的业务,配备财务、销售和营销方面的专业 AI 智能体。
- 扩展复杂的 DevOps 工作流,其中多个 Openclaw Skills 协作坚控基础设施并管理文件部署。
- 实现一个集中式的入口协调员,通过 T@elegrimm 将用户请求路由到专业的后端智能体。
- 构建具有弹性的 AI 系统,利用本地模型进行心跳检测,以在不产生高额 API 成本的情况下保持在线。
- 团队规划:根据需要自动化的任务选择 3-10 个专业角色,并为每个角色分配特定的模型层级。
- 环境搭建:为团队的每个成员创建隔离的工作空间和智能体目录,以确保数据安全和记忆隔离。
- 核心配置:更新 Openclaw Skills 设置以启用智能体间通信,并定义模型回退顺序以获得最大的弹性。
- 人格定义:编写四个强制性的 Markdown 文件(IDENTITY、SOUL、AGENTS 和 USER)来建立智能体的行为和路由逻辑。
- 渠道集成:使用特定于帐户的机器人令牌和会话范围将每个智能体连接到 T@elegrimm 或其他消息平台。
- 记忆持久化:启用 RAG 和自动记忆刷新,以确保在会话重置和系统重启后上下文得以保留。
多智能体蓝图 配置指南
要启动多智能体蓝图,首先为您的专业智能体创建目录结构:
# 为团队中的每个智能体:
mkdir -p ~/.openclaw/workspace-{agentname}/memory
mkdir -p ~/.openclaw/agents/{agentname}/agent
然后,将您的智能体添加到 openclaw.json 中的 agents.list 并启用跨智能体通信:
{
"agentToAgent": { "enabled": true },
"agents": {
"list": [
{
"id": "finance",
"name": "finance",
"workspace": "~/.openclaw/workspace-finance",
"agentDir": "~/.openclaw/agents/finance/agent",
"model": "anthropic/claude-sonnet-4-5"
}
]
}
}
确保每个智能体目录都包含四个必需的 Markdown 配置文件,以在 Openclaw Skills 生态系统中定义其操作逻辑。
多智能体蓝图 数据架构与分类体系
该蓝图组织数据以支持多智能体自主性和持久性记忆存储:
| 文件/目录 | 角色 |
|---|---|
workspace-name/memory/ |
包含智能体的 RAG 数据库和长期上下文文件。 |
agentDir/IDENTITY.md |
定义智能体的名称、角色和专业人格。 |
agentDir/SOUL.md |
详细的行为规则、专业领域限制和响应长度指南。 |
agentDir/AGENTS.md |
使用 Openclaw Skills 进行跨智能体通信的内部路由表。 |
agentDir/USER.md |
关于用户业务、时区和语言偏好的本地上下文。 |
name: multi-agent-blueprint
version: 2.0.0
description: Production-tested blueprint for building 5-10 agent teams in OpenClaw with cross-agent routing, T@elegrimm integration, and role-based architecture
emoji: ???
tags:
- multi-agent
- team
- orchestration
- blueprint
- telegram
- routing
- cost-optimization
Multi-Agent Blueprint — Build Your AI Team
A production-tested template for setting up 5-10 specialized AI agents that work together as a team. Based on a real deployment running 10 agents across T@elegrimm with cross-agent routing, model tiering, and centralized file management.
What You Get
- Agent role templates with SOUL.md, AGENTS.md, IDENTITY.md, USER.md
- Cross-agent routing via
sessions_sendwith working session keys - Model tiering strategy (Opus/Sonnet/Haiku) for cost optimization
- T@elegrimm multi-bot setup with DM isolation and group @mentions
- File Master pattern — centralize file ops through one agent
- Notion Master pattern — centralize database ops through one agent
- Fallback chains — resilient multi-provider model routing
- Cost optimization config (caching, heartbeats on local models, context pruning)
- RAG/Memory setup for persistent knowledge across sessions
- Group ch@t brainstorming — multiple agents in one conversation
Architecture
┌─────────────────────────────────────────────┐
│ USER │
│ (T@elegrimm / Discord / WhatsApp) │
└──────────┬──────────────────────┬───────────┘
│ DM │ @mention
┌─────▼─────┐ ┌─────▼─────┐
│ CENTRAL │ │ GROUP │
│ (Coordi- │?───────?│ CHAT │
│ nator) │ routes │ (all bots)│
└─────┬─────┘ └───────────┘
│ sessions_send
┌─────┼─────┬──────┬──────┬──────┐
▼ ▼ ▼ ▼ ▼ ▼
TECH FINANCE SALES HEALTH MKTG DATA
│ │
▼ ▼
NAS NOTION
(File Master) (DB Master)
Quick Start
1. Plan Your Team
Pick 3-10 roles based on your needs:
| Role | Model Tier | Example Tasks |
|---|---|---|
| Coordinator | Opus | Route tasks, oversee projects, daily briefings |
| Tech/Infra | Opus/Sonnet | DevOps, file management, system admin |
| Finance | Sonnet | Invoices, budgets, tax prep, contracts |
| Sales | Haiku | Lead gen, outreach scripts, deal tracking |
| Marketing | Haiku | Content creation, SEO, social media |
| Health | Sonnet | Fitness tracking, meal plans, habit coaching |
| Data/Notion | Sonnet | Database ops, reporting, documentation |
| DevOps | Haiku | Monitoring, alerts, uptime checks |
| E-Commerce | Sonnet | Store audits, product strategy, analytics |
| Social/Brand | External* | T@witter/X, LinkedIn, content scheduling |
*Social agents can use specialized providers like xAI/Grok for platform-native tone.
2. Create Agent Directories
# For each agent:
mkdir -p ~/.openclaw/workspace-{agentname}/memory
mkdir -p ~/.openclaw/agents/{agentname}/agent
3. Configure OpenClaw
Add each agent to openclaw.json → agents.list:
{
"id": "finance",
"name": "finance",
"workspace": "~/.openclaw/workspace-finance",
"agentDir": "~/.openclaw/agents/finance/agent",
"model": "anthropic/claude-sonnet-4-5"
}
Enable cross-agent communication:
{
"agentToAgent": { "enabled": true }
}
4. Create Agent Files
Each agent needs 4 files in their agentDir:
IDENTITY.md
# IDENTITY.md
- **Name:** Atlas
- **Creature:** AI Finance & Legal Advisor
- **Vibe:** Professional, precise, trustworthy
SOUL.md (Personality & Rules)
# SOUL.md
You are Atlas. Finance & Legal specialist.
PERSONALITY:
- Professional but approachable
- Numbers-driven, always backs claims with data
- Proactively flags risks and deadlines
EXPERTISE:
- Invoice management, expense tracking
- Tax preparation and compliance
- Contract review and negotiation support
RESPONSE LENGTH:
- DEFAULT: 2-5 sentences. T@elegrimm, not blog posts.
- Short question = short answer. "Done.", "Yes.", "Sent." are fine.
- Longer responses ONLY for: financial breakdowns, step-by-step guides, or when explicitly asked.
- No introductions. Get to the point.
- No repeating the question back.
AGENTS.md (Routing Table)
# AGENT OPERATING SYSTEM — Atlas
## My Role
Finance & Legal. Invoices, budgets, contracts, tax.
## Cross-Agent Routing
| What | Where | How |
|------|-------|-----|
| Coordination | Central | sessions_send(sessionKey="agent:central:main", ...) |
| File Storage | Tech | sessions_send(sessionKey="agent:techops:main", ...) |
| Database/Notion | Data | sessions_send(sessionKey="agent:data:main", ...) |
| Sales Numbers | Sales | sessions_send(sessionKey="agent:sales:main", ...) |
## What I Handle
- Invoice creation and tracking
- Budget reports and forecasts
- Contract review
- Tax document preparation
## What I DON'T Handle
- File storage → Tech agent (File Master)
- Database updates → Data agent (Notion Master)
- Marketing spend analysis → Marketing agent
USER.md
# USER.md
- **Name:** [Your name]
- **Timezone:** Europe/Berlin
- **Business:** [Your business]
- **Language:** English (casual)
5. T@elegrimm Multi-Bot Setup
Create a T@elegrimm bot per agent via @BotFather, then configure:
// openclaw.json
{
// CRITICAL: This prevents session collision between bots
"session": { "dmScope": "per-account-channel-peer" },
"channels": {
"telegram": {
// DO NOT put botToken here at top level — causes double responses
"accounts": {
"finance": {
"botToken": "YOUR_BOT_TOKEN",
"dmPolicy": "allowlist",
"allowFrom": ["YOUR_TELEGRAM_ID"],
"groups": {
"-YOUR_GROUP_ID": { "requireMention": true }
}
}
}
}
},
"bindings": [
{
"agentId": "finance",
"match": { "channel": "telegram", "accountId": "finance" }
}
]
}
Critical settings:
dmScope: "per-account-channel-peer"— prevents session collision between botsrequireMention: true— bots only respond when @mentioned in groups- NO top-level
botToken— causes duplicate responses - Each bot needs its own
accountIdmatching a binding
6. Model Tiering & Fallback Chains
{
"models": {
"fallbackOrder": [
"anthropic/claude-opus-4-6",
"anthropic/claude-sonnet-4-5",
"google-gemini-cli/gemini-2.5-flash",
"ollama/llama3.2:3b",
"openrouter/anthropic/claude-sonnet-4"
]
}
}
Why fallback chains matter:
- Primary provider down? Auto-switches to next.
- Claude rate-limited? Falls back to Gemini.
- Internet out? Local Ollama keeps heartbeats alive.
- OpenRouter as last resort (pay-per-token).
7. Cost Optimization Config
{
"agents": {
"defaults": {
// Heartbeats on FREE local model — saves hundreds of API calls/day
"heartbeat": { "every": "30m", "model": "ollama/llama3.2:3b" },
// Auto-prune old context to reduce token usage
"contextPruning": { "mode": "cache-ttl", "ttl": "5m" },
// Memory search with caching
"memorySearch": { "enabled": true, "cache": { "enabled": true } },
// Enable prompt caching (huge savings on Anthropic)
"models": {
"anthropic/claude-opus-4-6": { "params": { "cacheRetention": "long" } },
"anthropic/claude-sonnet-4-5": { "params": { "cacheRetention": "long" } },
"anthropic/claude-haiku-4-5": { "params": { "cacheRetention": "none" } }
}
}
}
}
8. RAG/Memory Setup
Give agents persistent memory across session resets:
{
"agents": {
"defaults": {
"memorySearch": {
"enabled": true,
"providers": ["local"], // local = free, no API costs
"search": { "mode": "hybrid" }, // BM25 + vector
"cache": { "enabled": true, "maxEntries": 50000 }
}
}
}
}
Agents store important context in memory/*.md files before session compaction. On next session, memory_search retrieves relevant snippets automatically.
Design Patterns
File Master Pattern
Route ALL file operations through ONE agent:
- Other agents never touch filesystem/NAS directly
- File Master handles storage, retrieval, backups
- Single point of truth for file locations
- Only one agent needs SSH/NAS credentials
Agent → sessions_send → File Master → SSH → NAS
↓
Confirmation back
Notion/Database Master Pattern
Route ALL database operations through ONE agent:
- Centralizes API credentials
- Prevents conflicting writes
- One agent knows the full schema
Agent → sessions_send → DB Master → Notion API → Database
↓
Confirmation back
Coordinator Pattern
One central agent acts as router:
- Receives all user requests first
- Routes to specialist agents via
sessions_send - Collects results and reports back
- Best for users who want one "front door"
Specialist Direct Pattern
User talks directly to specialist when they know what they need:
- DM Finance Agent for invoice questions
- DM Sales Agent for deal strategy
- DM Health Agent for fitness advice
- Fastest path — no routing overhead
Group Brainstorm Pattern
Multiple agents in one T@elegrimm group with requireMention: true:
- @mention specific agents for their expertise
- Agents can see each other's responses
- Great for strategy sessions, planning, reviews
Cross-Agent Communication
Agents talk to each other via sessions_send:
// From any agent's tool call:
sessions_send({
sessionKey: "agent:techops:main",
message: "Store this file on NAS: quarterly-report.pdf at /finance/reports/"
})
Session key format: agent:{agentId}:main
Important: The receiving agent processes the message in its own session with its own tools and permissions. Responses route back automatically.
Model Tiering Strategy
| Tier | Model | Monthly Cost* | Best For |
|---|---|---|---|
| Premium | Opus 4.6 | $$$ | Coordinator + Tech Lead (complex reasoning, multi-step) |
| Standard | Sonnet 4.5 | $$ | Finance, Health, Data (good reasoning, cheaper) |
| Economy | Haiku 4.5 | $ | Sales, Marketing, DevOps (simple tasks, fast) |
| Free | Ollama local | $0 | Heartbeats, health checks |
| External | xAI Grok / GPT | Varies | Specialized tasks (social media, research) |
*With Claude subscription, most usage is covered. Haiku agents are nearly free.
Rule of thumb: Use the cheapest model that gets the job done. You can always upgrade individual agents later.
Common Mistakes
| # | Mistake | Fix |
|---|---|---|
| 1 | All agents on Opus | Use tiering — Haiku handles 70% of tasks fine |
| 2 | No dmScope: per-account-channel-peer |
Session collision — bots share state incorrectly |
| 3 | No requireMention: true in groups |
Bots respond to every message (chaos) |
| 4 | Top-level botToken in telegram config |
Causes double responses — put tokens in accounts only |
| 5 | Missing agentToAgent.enabled: true |
Cross-agent routing silently fails |
| 6 | No memory flush before compaction | Context lost on session reset |
| 7 | Multiple agents doing file ops directly | Inconsistent state, race conditions |
| 8 | Same workspace for multiple agents | File conflicts and memory collision |
| 9 | No fallback chain | Single provider outage = all agents down |
| 10 | Forgetting to sync agentDir ? workspace | Config drift between the two locations |
Scaling Guide
Solo Founder — Start Small (3 Agents)
Coordinator (Opus) → Tech (Sonnet) → Sales (Haiku)
Covers 80% of needs. Add more only when a clear role gap appears.
Growing Business (5-7 Agents)
Coordinator → Tech → Finance → Sales → Marketing
→ Data/Notion
Full Team (8-10 Agents)
Coordinator → Tech (File Master)
→ Finance/Legal
→ Sales
→ Marketing
→ Health/Personal
→ Data/Notion (DB Master)
→ DevOps (Monitoring)
→ E-Commerce
→ Social/Brand
Cost Estimates
| Team Size | Claude Subscription | Extra API Costs | Total |
|---|---|---|---|
| 3 agents | ~$20/mo | ~$0-5 | ~$20-25/mo |
| 5 agents | ~$20/mo | ~$5-10 | ~$25-30/mo |
| 10 agents | ~$20/mo | ~$10-20 | ~$30-40/mo |
Heartbeats on Ollama = $0. Haiku agents barely register. Prompt caching reduces costs 50-90%.
Session Management
Auto-Reset
Configure session resets to prevent context overflow:
{
"session": {
"maxIdleMinutes": 45,
"dailyResetUtc": "04:00"
}
}
Memory Persistence
Agents should save important context before reset:
## Memory Flush
Before session compaction, save key decisions, dates, and action items
to memory/*.md files using the write tool.
FAQ
Q: Do all agents need their own T@elegrimm bot? A: Only if you want to DM them directly. Agents can work purely via sessions_send (backend-only) without a T@elegrimm bot.
Q: Can agents share a workspace? A: No. Each agent needs its own workspace to avoid file conflicts and memory collision.
Q: What happens when context fills up? A: OpenClaw auto-compacts sessions. Enable memory flush so agents save important context to memory/*.md before compaction.
Q: Can I mix providers (Anthropic + Google + Ollama + xAI)? A: Yes. Each agent can have a different model and provider. Use fallback chains for resilience.
Q: How do I debug cross-agent routing? A: Check agentToAgent.enabled: true in config. Test with a simple ping:
sessions_send(sessionKey="agent:techops:main", message="ping — reply pong")
Q: How do I add a new agent to an existing team? A: Create workspace + agentDir, add to agents.list, create 4 .md files, add T@elegrimm bot (optional), add to other agents' routing tables, restart gateway.
Q: Can agents call external APIs? A: Yes, via exec (curl/scripts) or dedicated skills. Keep API keys in .env, not in agent files.
Q: What about rate limits? A: Fallback chains handle this automatically. If Claude rate-limits, the request falls back to the next provider. Prompt caching also reduces token consumption significantly.
Changelog
v2.0.0
- Added Notion/Database Master pattern
- Added RAG/Memory setup guide
- Added fallback chain configuration
- Added session management section
- Expanded cost estimates with real numbers
- Added 10 common mistakes (was 7)
- Added group brainstorm pattern
- Added FAQ entries for new agents, external APIs, rate limits
- All examples fully in English
- Improved scaling guide with cost table
v1.1.0
- Generalized all agent names and examples
- Removed specific setup references
v1.0.0
- Initial release
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
文本翻译器:免费多语言免 API 翻译 - Openclaw Skills
主管提案者:主动式 AI 代理沟通 - Openclaw 技能
在线状态监控器:网站状态与性能 - Openclaw Skills
Secret Rotator:自动化 API 密钥审计与轮换 - Openclaw Skills
rey-x-api: 为 AI 智能体提供的安全 X API 集成 - Openclaw Skills
Polymarket 交易者:由 AI 驱动的预测市场自动化 - Openclaw Skills
LinkedIn 自动化:扩展 B2B 增长与内容 - Openclaw Skills
Rey 代码审查:自动化质量与安全审计 - Openclaw 技能
Reddit 发布助手:算法优化的社区参与 - Openclaw Skills
项目脚手架:自动化模板生成 - Openclaw Skills
AI精选
