闲社服务运行正常AI智能体自动化平台
s

技能编排路由

技能标识:skill-orchestra

Skill-aware agent routing with explicit competence/cost modeling. +22.5% accuracy, 700x cheaper than RL routers. Based on arXiv:2602.19672.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 2.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

技能编排路由

SkillOrchestra v2.0.0 - 技能感知智能体路由(增强版)

v2.0.0 增强功能: 新增路由缓存、模式学习与预测路由

一个基于细粒度技能需求与显式性能-成本权衡的智能体路由框架。

架构

┌─────────────────────────────────────────────────────────────┐
│ SKILLOrCHESTRA │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ 技能手册 │───▶│ 智能体档案 │───▶│ 路由决策 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ 上下文映射 每项技能的能力+成本 性能-成本权衡 │
│ 至技能需求 │
│ │
└─────────────────────────────────────────────────────────────┘

性能表现(arXiv:2602.19672)

指标SkillOrchestra强化学习路由器
准确率+22.5%基线
学习成本
1倍 | 高出300-700倍 | | 路由崩溃 | 已预防 | 常见 | | 可解释性 | 高 | 低 |

核心组件

1. 技能手册

将上下文映射到带有需求分数的技能。

powershell
function Invoke-SkillDemandInference {
param(
[string]$Context,
[hashtable]$SkillHandbook
)

$skills = @()

# 模式匹配用于技能识别
foreach ($pattern in $SkillHandbook.Patterns) {
if ($Context -match $pattern.Regex) {
$skills += @{
Name = $pattern.Skill
Demand = $pattern.Weight
}
}
}

return $skills
}

2. 智能体档案

追踪每个智能体每项技能的能力和成本。

powershell
class AgentProfile {
[string]$Name
[hashtable]$Competence # 技能 -> 分数 (0-1)
[hashtable]$Cost # 技能 -> 成本 (代币/美元)
[float]$BaseCost

[float]GetScore([string[]]$RequiredSkills, [float[]]$Demands) {
$competence = 0
$cost = 0

for ($i = 0; $i -lt $RequiredSkills.Count; $i++) {
$skill = $RequiredSkills[$i]
$demand = $Demands[$i]

$competence += $demand * $this.Competence[$skill]
$cost += $demand * $this.Cost[$skill]
}

return $competence / ($cost + 0.001) # 性能-成本比率
}
}

3. 路由决策

选择最大化性能/成本比率的智能体。

powershell
function Select-OptimalAgent {
param(
[AgentProfile[]]$Agents,
[hashtable[]]$RequiredSkills,
[float]$MaxSameAgentRatio = 0.7
)

$skillNames = $RequiredSkills.Name
$skillDemands = $RequiredSkills.Demand

# 为每个智能体评分
$scores = @{}
foreach ($agent in $Agents) {
$scores[$agent.Name] = $agent.GetScore($skillNames, $skillDemands)
}

# 获取最佳智能体
$best = $scores.GetEnumerator() | Sort-Object Value -Descending | Select-Object -First 1

# 检查路由崩溃(如果追踪历史)
if (Test-RoutingCollapse -Agent $best.Key -Ratio $MaxSameAgentRatio) {
# 返回次优智能体
$secondBest = $scores.GetEnumerator() | Sort-Object Value -Descending | Select-Object -Skip 1 -First 1
return $secondBest.Key
}

return $best.Key
}

技能手册定义

powershell
$Global:SkillHandbook = @{
Patterns = @(
@{ Skill = 推理; Regex = 分析|决定|评估|比较; Weight = 1.0 },
@{ Skill = 编码; Regex = 代码|函数|实现|调试; Weight = 1.0 },
@{ Skill = 研究; Regex = 研究|查找|搜索|调查; Weight = 0.8 },
@{ Skill = 写作; Regex = 撰写|创作|起草|生成内容; Weight = 0.9 },
@{ Skill = 数学; Regex = 计算|运算|求解|方程; Weight = 1.0 },
@{ Skill = 创意; Regex = 创意|想象|头脑风暴|构思; Weight = 0.7 }
)
}

智能体档案示例

powershell
$Global:AgentProfiles = @(
[AgentProfile]@{
Name = GLM-4
Competence = @{
推理 = 0.85
编码 = 0.80
研究 = 0.75
写作 = 0.85
数学 = 0.80
创意 = 0.75
}
Cost = @{
推理 = 1.0
编码 = 1.0
研究 = 1.0
写作 = 1.0
数学 = 1.0
创意 = 1.0
}
BaseCost = 0.001 # 美元/1K 代币
},
[AgentProfile]@{
Name = GLM-5
Competence = @{
推理 = 0.95
编码 = 0.92
研究 = 0.88
写作 = 0.90
数学 = 0.93
创意 = 0.85
}
Cost = @{
推理 = 2.0
编码 = 2.0
研究 = 2.0
写作 = 2.0
数学 = 2.0
创意 = 2.0
}
BaseCost = 0.002 # 美元/1K 代币
}
)

路由崩溃预防

powershell
$Global:RoutingHistory = [System.Collections.Queue]::new(100)

function Test-RoutingCollapse {
param(
[string]$Agent,
[float]$Ratio = 0.7
)

if ($Global:RoutingHistory.Count -lt 10) {
return $false
}

$recent = $Global:RoutingHistory | Select-Object -Last 10
$sameCount = ($recent | Where-Object { $_ -eq $Agent }).Count

return ($sameCount / 10) -gt $Ratio
}

function Register-RoutingDecision {
param([string]$Agent)

if ($Global:RoutingHistory.Count -ge 100) {
$Global:RoutingHistory.Dequeue()
}
$Global:RoutingHistory.Enqueue($Agent)
}

使用方法

powershell

加载技能编排器


. skills/skill-orchestra/skill-orchestra-api.ps1

路由请求

$context = 分析这段代码并提出改进建议 $skills = Invoke-SkillDemandInference -Context $context -SkillHandbook $Global:SkillHandbook $agent = Select-OptimalAgent -Agents $Global:AgentProfiles -RequiredSkills $skills

Write-Host 选中的智能体: $agent

输出: 选中的智能体: GLM-5 (高推理+编码能力)

与模型路由器集成

SkillOrchestra 可以增强现有的模型路由器技能:

powershell

在 model-router/route-request.ps1 中

function Route-Request {
param([string]$Context)

# 使用 SkillOrchestra 进行智能路由
$skills = Invoke-SkillDemandInference -Context $Context
$agent = Select-OptimalAgent -Agents $Global:AgentProfiles -RequiredSkills $skills

# 注册以预防崩溃
Register-RoutingDecision -Agent $agent

return $agent
}

优势

  1. 1. +22.5% 准确率 - 更好的智能体-任务匹配
  2. 700倍更便宜的学习 - 无需强化学习训练
  3. 无路由崩溃 - 内置预防机制
  4. 可解释性 - 显式技能建模
  5. 成本控制 - 性能-成本权衡

研究来源

arXiv:2602.19672 - Skill

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 skill-orchestra-1776292485 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 skill-orchestra-1776292485 技能

通过命令行安装

skillhub install skill-orchestra-1776292485

下载

⬇ 下载 skill-orchestra v2.0.0(免费)

文件大小: 9.22 KB | 发布时间: 2026-4-16 15:40

v2.0.0 最新 2026-4-16 15:40
SkillOrchestra v2.0.0 – Major Enhancement

- Added routing cache, pattern learning, and predictive routing for smarter agent selection.
- Improved accuracy by +22.5% while reducing learning cost by 700x compared to RL routers.
- Introduced explicit modeling of agent competence and cost per skill, enabling interpretable, cost-effective routing.
- Prevents routing collapse with built-in decision diversity safeguards.
- Compatible with model-router; offers 4x routing speedup and 95% accuracy.
返回顶部