OpenClaw 多 Agent 协作:串联计算与翻译任务
让不同的独立 Agent 处理复杂任务是后续处理任务的必要条件。
本次实验使用 OpenClaw 和两个 Agent 串联完成一个完整的工作流。
前提条件
- OpenClaw 版本:2026.2.3
- 自然语言输入:Web 端交互
- 命令行输入:终端操作
提示:用户只需用自然语言描述需求,无需手动执行底层命令。底层命令仅供技术参考。
实验目标
使用 math-agent 计算数学表达式,然后把结果给 translator-agent 翻译成英文。
实验过程
步骤 0:创建相应的 Agent
openclaw agents add math-agent --workspace /home/admin/.openclaw/workspace --non-interactive --json
openclaw agents add translator-agent --workspace /home/admin/.openclaw/workspace --non-interactive --json
openclaw agents list
输出示例:
Identity: MY_NAME (IDENTITY.md)
Workspace: ~/.openclaw/workspace
Agent dir: ~/.openclaw/agents/math-agent/agent
Model: minimax/MiniMax-M2.5-highspeed
Routing rules: 0
步骤 1:单独调用 math-agent 计算
用户输入: 利用 math-agent 计算表达式:(88 + 12) * 5 - 100 / 4,一步步计算出来
命令示例:
openclaw agent --agent math-agent --message"计算表达式:(88 + 12) * 5 - 100 / 4,一步步计算出来"
输出结果:
**计算表达式:`(88 + 12) * 5 - 100 / 4`**
**步骤 1:** 括号内 - 88 + 12 = **100**
**步骤 2:** 乘除法 - 100 × 5 = **500** - 100 ÷ 4 = **25**
**步骤 3:** 减法 - 500 - 25 = **475**
---
**最终答案:475**


