第 5 章
子 Agent — 并行任务
⚙️ 配置
{
"agents": {
"defaults": {
"subAgents": {
"enabled": true,
"maxConcurrent": 3,
"timeout": 300000
}
}
}
}
maxConcurrent 推荐 3–5:过小无并行优势,过大触发 API 速率限制。
✅ 适用场景
✅ 适合并行
- • 收集 N 个网站信息
- • 批量处理独立文件
- • 多服务状态检查
❌ 不适合并行
- • 需要连贯性的写作任务
- • 有依赖关系的串行任务
- • 需要前序结果的分析
💡 使用方法
AI 会自动判断是否并行,也可显式指定:
"使用子 Agent 并行处理这个任务..."