360 Secure SkillHub
360 安全技能中心

DualAgentSolver

通过 Python 脚本驱动两个代理多轮协作:主代理由 OpenClaw agent 充当求解者,第二代理负责质询假设、暴露风险并改进方案,轮数可指定;若配置 OpenAI 密钥则第二代理使用指定模型,否则同样走 OpenClaw。最终输出逐轮记录与合并后的可执行方案,并写入 Open Brain 记忆库(public.memories)。

tvaloki
tvaloki
热度 66.66
最近更新 2026-05-11 17:28:58
分类:自动化依赖:代码执行 / MCP 服务 / 第三方 API / 内部调用大模型应用场景:工作流 / 任务管理 / 笔记整理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add dual-agent-solver
Metadata
name
dual-agent-solver
description
Run a two-agent collaborative problem-solving workflow where one agent is your OpenClaw agent (primary solver) and a second agent challenges assumptions, surfaces risks, and improves the plan over multiple rounds, then outputs one merged actionable solution and stores it in Open Brain memory.

DualAgentSolver

Use this when the user wants two agents to work a problem and converge on a practical solution.

Setup

export OPENBRAIN_MCP_URL="http://127.0.0.1:54321/mcp"
# optional
export OPENBRAIN_MCP_TOKEN="..."

Optional second-agent model via OpenAI API (if key exists):

export OPENAI_API_KEY="..."
export SOLVER_SECOND_MODEL="gpt-4o-mini"

If OPENAI_API_KEY is missing, the second agent also runs through openclaw agent.

Run

python3 skills/dual-agent-solver/scripts/dual_agent_solver.py \
  --query "How should we migrate our cron jobs safely?" \
  --rounds 3

Output

Returns JSON including:

  • round-by-round solver + critic outputs
  • final merged solution
  • memory write result and key (dual-agent-solver:<timestamp>)

Storage

Persists outcome into public.memories (creates table if missing).