SuperAPI AI 工具集

swarm-orchestration

智能体与模型

查看项目

更新于 10-15 21:47

技能介绍

用途:该技能使用 agentic-flow 的协调系统编排多智能体集群,适合需要并行执行与智能协调、规模超出单个智能体的任务场景。

主要能力:支持 mesh(点对点)、hierarchical(女王—工作者)与 adaptive(动态)三种拓扑;提供自动任务分发、负载均衡与容错;支持并行、流水线(带依赖)与自适应执行模式;通过共享内存在各 agent 间同步状态;提供吞吐量、延迟、成功率与 agent 利用率等指标;可与 hooks 集成完成前置协调、任务后同步与会话恢复。

使用方式:需 agentic-flow v1.5.11+ 与 Node.js 18+。初始化集群:npx agentic-flow hooks swarm-init --topology mesh --max-agents 5;生成 agent:npx agentic-flow hooks agent-spawn --type coder(tester、reviewer 同理);编排任务:npx agentic-flow hooks task-orchestrate --task "Build REST API with tests" --mode parallel。代码接口示例:swarm.init({ topology: 'mesh', agents: ['coder','tester','reviewer'], communication: 'broadcast' });swarm.execute({ tasks, mode: 'parallel', timeout: 300000 });swarm.pipeline([...]);swarm.autoOrchestrate({ goal, constraints });swarm.memory.store / retrieve;swarm.enableLoadBalancing、swarm.setResiliency、swarm.getMetrics。

适用场景:多 agent 并行开发(如后端、前端、测试、审查分工)、带依赖的多阶段流水线、需要动态调整协作方式或自动分配负载的复杂任务。

限制与建议:要求指定版本与 Node 环境,需具备一定分布式系统理解(非强制);建议从 2-3 个 agent 起步再扩展,善用共享内存传递上下文,设置超时防止任务挂起;协调异常时检查内存访问并启用 hooks,性能不佳时可改用自适应拓扑并开启负载均衡。其他未在资料中说明的细节暂未提供。