Agent skill

Semantic Router

by LeoYeAI in LeoYeAI/openclaw-master-skills

让 AI 代理根据对话内容自动选择最合适的模型。层2(多词非连续命中)+ 层1(单词兜底)并行决定模型池;层3(embedding)永远独立运行决定会话切换。B+ 连续漂移计数器(第3次警告,第4次强制 C-auto)。softkeywords 泛用词降权机制。四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。

MITAuto-check: notesAI & LLM Engineering

Install Semantic Router

skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill semantic-router -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LeoYeAI/openclaw-master-skills semantic-router --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/semantic-router .claude/skills/semantic-router && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
semantic-router
GitHub stars
2.2k
Token cost
~3.6k tokens
SKILL.md length
741 words
Files
19 (incl. scripts, references)
Skills in repo
1,235
Repo updated
First seen
Licence
MIT

At a glance

让 AI 代理根据对话内容自动选择最合适的模型。层2(多词非连续命中)+ 层1(单词兜底)并行决定模型池;层3(embedding)永远独立运行决定会话切换。B+ 连续漂移计数器(第3次警告,第4次强制 C-auto)。softkeywords 泛用词降权机制。四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。

  • Works in 4 steps: 环境检测 → 冲突预检 → 智能合并(推荐) → …
  • Tasks that involve Embeddings
  • SKILL.md covers ⚠️ Security & Permissions…, 🎯 这个技能解决什么问题?, 🔒 安全与权限说明 and 🚀 快速安装, plus 4 more sections
  • Runs Python scripts from its folder; calls python3, jq and curl; reaches clawhub.ai; needs LOVBROWSER_API_KEY

What it does

Semantic Router is an agent skill from LeoYeAI/openclaw-master-skills. 让 AI 代理根据对话内容自动选择最合适的模型。层2(多词非连续命中)+ 层1(单词兜底)并行决定模型池;层3(embedding)永远独立运行决定会话切换。B+ 连续漂移计数器(第3次警告,第4次强制 C-auto)。softkeywords 泛用词降权机制。四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。

Its SKILL.md is about 3.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 21 other files, including scripts and reference files (for example `README.md`, `README_CN.md` and `README_Humanities_CN.md`).

It sits in AI & LLM Engineering, covering Embeddings. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.

When your agent uses it

  • Tasks that involve Embeddings

Example prompts

  • “/semantic-router”

Requirements

  • Python 3
  • A credential in LOVBROWSER_API_KEY

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. 环境检测
  2. 冲突预检
  3. 智能合并(推荐)
  4. 验证 & 激活

What it can do on your machine

Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • jq
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • clawhub.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • LOVBROWSER_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Semantic Router loads about 3.6k tokens when it runs, and up to ~8.7k if it reads all its reference files. Until then it costs about 47 tokens; SKILL.md has 741 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~3.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:285
    # 3. 检查 .env,仅追加缺失的环境变量(如 LOVBROWSER_API_KEY)

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 741 words, ~3,585 tokens.

Download SKILL.mdSave it as .claude/skills/semantic-router/SKILL.md (or your agent's skills folder). This skill also uses 18 other files; get the full folder from GitHub.
name
semantic-router
description
让 AI 代理根据对话内容自动选择最合适的模型。层2(多词非连续命中)+ 层1(单词兜底)并行决定模型池;层3(embedding)永远独立运行决定会话切换。B+ 连续漂移计数器(第3次警告,第4次强制 C-auto)。soft_keywords 泛用词降权机制。四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。
version
8.0.0
author
halfmoon82
tags
semantic, routing, model-pools, task-classification, fallback, system-passthrough, production, layer-parallel
requires_approval
true

🔒 安全声明:本技能需要修改 OpenClaw 配置以实现模型路由功能。所有配置变更前会自动备份,支持一键回滚。建议在测试环境验证后再部署到生产环境。

⚠️ Security & Permissions Declaration

This skill performs the following privileged operations — all are intentional and explicitly user-initiated:

OperationPurposeScope
Read/patch ~/.openclaw/openclaw.jsonConfigure model routing poolsLocal config only
Read/write ~/.openclaw/workspace/.lib/pools.jsonStore model pool configurationWorkspace only
Read/write ~/.openclaw/workspace/.lib/tasks.jsonStore task type definitionsWorkspace only
Run semantic_check.py locallyClassify user messages for routingNo network required
Patch session model via sessions.patchSwitch active model poolCurrent session only
Restart OpenClaw Gateway (openclaw gateway restart)Apply routing config changesLocal service only
Inject prependContext into agent turnsOutput routing declaration in first lineRead-only context injection
Update Cron Job sessionTarget to "isolated"Prevent background tasks from polluting user sessionsAffects only background Cron jobs

What this skill does NOT do:

  • Does NOT exfiltrate conversation content or model credentials to external servers
  • Does NOT access API keys or secrets directly
  • Does NOT modify files outside ~/.openclaw/ and the skill's own workspace
  • Does NOT run with elevated (sudo/root) privileges
  • Does NOT auto-install additional packages

Requires: Python 3.8+, OpenClaw Gateway running, configured model providers

🔷 Semantic Router v7.9.3 — 生产级会话路由系统 🔷

ClawHub: https://clawhub.ai/halfmoon82/semantic-router
版本: 7.6.3 (生产环境)
作者: halfmoon82 状态: ✅ ROM 级固化,完全测试通过

🎯 这个技能解决什么问题?

核心问题(v7.2 新解决)

你是否遇到过:

  • Cron Job 导致会话频繁重置 — 后台定时任务打断用户交互
  • Discord/Telegram 渠道会话突然清空 — 长任务无法延续
  • AGENTS.md 被截断注入 — 大文件超过 20KB 限制
  • 模型自动切换被全局配置覆盖 — 切换不生效
解决方案

会话隔离架构:

用户直连渠道(稳定)
    ├─ 主代理会话 → semantic-router(精准路由)
    └─ Cron Job 隔离会话(独立环境)
        ├─ cloudflared-watchdog
        ├─ Fallback 回切检查
        └─ 自定义后台任务

完整配置引导:

  • 零冲突的智能合并配置
  • 预检脚本防止覆盖现有设置
  • 自动回滚失败的配置修改

🔒 安全与权限说明

为什么需要这些权限?
权限用途安全措施
读取 openclaw.json检测现有模型配置只读,不修改
修改 openclaw.json添加模型池配置自动备份 + 一键回滚
执行本地脚本运行配置向导和验证开源脚本,可审计
重启 Gateway应用新配置失败自动回滚
配置保护机制
  1. 前置备份:任何修改前自动创建带时间戳的备份
  2. 语法验证:JSON 修改后自动验证语法
  3. 健康检查:Gateway 重启后验证服务可用性
  4. 自动回滚:任何步骤失败立即恢复原配置
bash
# 手动回滚命令
python3 ~/.openclaw/workspace/.lib/config-rollback-guard.py rollback
代码审计
  • 所有脚本开源,位于 scripts/ 目录
  • 核心逻辑 semantic_check.py 62KB,完全可审计
  • 无网络请求,无数据上报,纯本地运行

🚀 快速安装

第一步:安装技能
bash
# 从 ClawHub 安装
clawhub install https://clawhub.ai/halfmoon82/semantic-router

# 或手动复制到本地
cp -r ~/.openclaw/workspace/skills/semantic-router ~/my-projects/
第二步:运行配置引导
bash
# 启动交互式配置向导
python3 ~/.openclaw/workspace/skills/semantic-router/scripts/setup_wizard.py

# 向导将:
# 1. 检测你的已有配置
# 2. 扫描可用模型
# 3. 推荐三池配置
# 4. 生成 pools.json 和 tasks.json
第三步:启动 Webhook 服务(重要!)
bash
# 复制核心文件到 .lib 目录
cp ~/.openclaw/workspace/skills/semantic-router/scripts/semantic_check.py \
   ~/.openclaw/workspace/.lib/
cp ~/.openclaw/workspace/skills/semantic-router/scripts/semantic-webhook-server.py \
   ~/.openclaw/workspace/.lib/

# 启动 Webhook 服务(端口 9811)
python3 ~/.openclaw/workspace/.lib/semantic-webhook-server.py --port 9811 &

# 验证服务是否运行
curl http://127.0.0.1:9811/health
# 预期输出: {"status": "ok", "version": "7.9.x"}
第四步:隔离现有 Cron Job(重要!)
bash
# 列出你的所有 Cron Job
cron list | jq '.jobs[] | {id, name, sessionKey}'

# 对每个使用了渠道会话(telegram/discord/whatsapp)的 Job,执行隔离
cron update {job_id} \
  --patch '{"sessionKey": null, "sessionTarget": "isolated"}'

# 示例(cloudflared-watchdog)
cron update ba28e228-473a-4963-8413-c228762bf2d1 \
  --patch '{"sessionKey": null, "sessionTarget": "isolated"}'
第五步:验证安装
bash
# 测试 Webhook 路由接口
curl -X POST http://127.0.0.1:9811/route \
  -H "Content-Type: application/json" \
  -d '{"message": "帮我写个Python爬虫", "current_pool": "Highspeed"}'

# 预期输出
# {
#   "branch": "C",
#   "task": "development",
#   "target_pool": "Intelligence",
#   "primary_model": "claude-opus-4.6",
#   "declaration": "【语义检查 by DeepEye@halfmoon82】P1-任务切换..."
# }

🎓 核心概念

四池模型架构
池名用途模型示例特点
Highspeed查询、检索、信息搜索gemini-2.5-flash快速、成本低
Intelligence开发、编程、复杂任务claude-sonnet-4.6精准、能力强
Humanities内容生成、翻译、写作gemini-2.5-pro平衡、流畅
Agentic长上下文代理、Computer Use、专业知识工作gpt-5.41M上下文、工具调用、多步骤
两步判断法

Step 1: 关键词 + 指示词检测

"帮我写个爬虫" → 关键词 "写" + "爬虫" → 开发任务 → Intelligence
"继续刚才的" → 指示词 "继续" → 延续当前池 → B 分支
"查一下天气" → 关键词 "查" + "天气" → 查询任务 → Highspeed
"帮我整理这些材料做成PPT" → trigger_groups_all 规则命中 → 代理任务 → Agentic

trigger_groups_all 非连续词组命中(v7.7 新增)

支持在 tasks.json 中定义分组规则,每条规则内所有分组取 AND,分组内词取 OR,多条规则取 OR:

json
"trigger_groups_all": [
  [["帮我","自动","用AI"], ["操作","填写","截图"]],
  [["处理","生成","制作"], ["报告","表格","文档","PPT"]]
]

说"帮我自动操作浏览器"→ 规则①命中 → Agentic 池。无需精确关键词,口语自然表达即可触发。

Step 2: 上下文关联度评分(当 Step 1 无结果时)

相似度 ≥ 0.15 → 延续当前会话(B 分支)
相似度 0.08~0.15 → 延续但警告(B+ 分支)
相似度 < 0.08 → 新话题,重置会话(C-auto 分支)
五分支路由决策
分支触发条件动作会话行为
A关键词完全匹配直接切到目标池切换模型,不重置
B指示词(延续)保持当前无动作
B+中等关联度(0.08~0.15)保持 + 警告输出漂移警告
C新任务关键词切到目标池切换模型,不重置
C-auto低关联度(<0.08)重置 + 切池/new + 切换模型

⚙️ 完整配置指南(无冲突)

问题:为什么配置容易冲突?

你的 OpenClaw 配置可能已经存在:

  • 已配置的模型提供商(OpenAI、Claude、本地 LLM 等)
  • 已配置的模型池(可能与语义路由的池名冲突)
  • 已定义的任务类型(可能与 tasks.json 冲突)

直接覆盖会导致:❌ 原有配置丢失
❌ 某些模型无法使用
❌ Cron Job 执行失败

解决方案:智能合并流程
Step 1: 环境检测
bash
# 检查现有配置
cat ~/.openclaw/openclaw.json | jq '.models | keys'
# 输出: ["anthropic", "openai", "google-ai", "minimax-cn"]

cat ~/.openclaw/openclaw.json | jq '.agents[0].model'
# 输出: "custom-llmapi-lovbrowser-com/anthropic/claude-haiku-4.5"
Step 2: 冲突预检
bash
# 备份当前配置
cp ~/.openclaw/openclaw.json \
   ~/.openclaw/backup/openclaw.json.backup-$(date +%s)

# 运行预检脚本
python3 ~/.openclaw/workspace/.lib/config-rollback-guard.py check

# 查看冲突报告
cat ~/.openclaw/logs/config-modification.log
Step 3: 智能合并(推荐)
bash
# 选项 A: 使用自动合并脚本
python3 ~/.openclaw/workspace/.lib/merge-config.py \
  --existing ~/.openclaw/openclaw.json \
  --new ~/.openclaw/workspace/skills/semantic-router/config/pools.json \
  --output ~/.openclaw/openclaw.json.merged \
  --mode append  # 仅追加,不覆盖

# 选项 B: 手动合并(更安全)
# 编辑 ~/.openclaw/openclaw.json,按以下步骤:
# 1. 检查 .models 字段,仅追加缺失的提供商
# 2. 检查 .agents[].model,如果已有则不修改
# 3. 检查 .env,仅追加缺失的环境变量(如 LOVBROWSER_API_KEY)
Step 4: 验证 & 激活
bash
# 验证 JSON 语法
python3 -c "import json; json.load(open('~/.openclaw/openclaw.json'))" && echo "✅ JSON 有效"

# 备份原配置
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak

# 应用新配置
cp ~/.openclaw/openclaw.json.merged ~/.openclaw/openclaw.json

# 重启 Gateway(失败时自动回滚)
openclaw gateway restart

# 如果启动失败,自动回滚
python3 ~/.openclaw/workspace/.lib/config-rollback-guard.py rollback

🔧 Cron Job 隔离最佳实践

❌ 错误做法(会导致会话重置)
bash
cron add \
  --name "my-background-task" \
  --sessionKey "agent:main:telegram:direct:123456" \
  --sessionTarget "main" \
  --payload '{"kind": "agentTurn", "message": "执行任务..."}'

为什么错?

  • sessionKey 使用了 Telegram 渠道的直连会话
  • 任务消息可能无法匹配 tasks.json 中的关键词
  • semantic-router 触发 C-auto 分支 → 会话被强制重置
  • 用户的长任务被打断 ❌
✅ 正确做法 A:隔离会话(推荐)
bash
cron add \
  --name "my-background-task" \
  --sessionTarget "isolated" \
  --payload '{
    "kind": "agentTurn",
    "message": "运维任务:执行后台清理。检查磁盘空间...",
    "timeoutSeconds": 60
  }'

# 关键字段:
# - sessionKey: null (让 Gateway 自动分配隔离会话)
# - sessionTarget: "isolated" (完全隔离,语义路由只在这个会话内生效)

优点:

  • ✅ 后台任务不影响用户会话
  • ✅ 完全隔离,无须担心关键词匹配
  • ✅ 自动过期清理(24h)
✅ 正确做法 B:包含显式关键词(如果需要直连会话)
bash
cron add \
  --name "my-background-task" \
  --sessionKey "agent:main:cron:manual" \
  --payload '{
    "kind": "agentTurn",
    "message": "【运维检查】执行磁盘空间检查。关键词: 检查、运维、系统。"
  }'

# 消息中必须包含 tasks.json 中的关键词
# (检查、运维、系统)→ 可以匹配到 "query" 或 "operations" 任务类型

📊 监控与故障排除

检查隔离状态
bash
# 验证 Cron Job 已隔离
cron list | jq '.jobs[] | select(.name == "cloudflared-watchdog") | {id, name, sessionKey, sessionTarget}'

# 期望输出
# {
#   "id": "ba28e228-473a-4963-8413-c228762bf2d1",
#   "name": "cloudflared-watchdog",
#   "sessionKey": null,              ✅ 已隔离
#   "sessionTarget": "isolated"      ✅ 隔离会话
# }
查看语义路由日志
bash
# 实时监控路由决策
tail -f ~/.openclaw/logs/gateway.log | grep "semantic-router"

# 查看特定消息的路由结果
cat ~/.openclaw/workspace/.lib/semantic_check.log | jq '.[] | select(.input | contains("爬虫"))'
故障排除表
症状根因解决方案
"Cron Job 执行失败,超时 30s"消息文本不在 tasks.json 中,semantic-router 无法识别方案 A: 改用隔离会话 / 方案 B: 添加关键词
"Discord 会话仍在被重置"sessionKey 未清空,仍使用渠道会话cron update {id} --patch '{"sessionKey": null}'
"模型没有切换到目标池"全局 default_model 覆盖了切换结果改用隔离会话避免全局影响
"配置修改后 Gateway 启动失败"JSON 语法错误 或 模型不可用运行 config-rollback-guard.py rollback 回滚

📋 语义检查声明格式

semantic-router 自动生成的声明格式规范:

声明示例
【语义检查 by DeepEye@halfmoon82】P2-延续|模型池:【智能池】|实际模型:claude-opus-4.6
【语义检查 by DeepEye@halfmoon82】P1-执行开发任务|新会话→智能池|实际模型:claude-opus-4.6
Show full SKILL.md (297 more words)Show less
字段说明
字段说明
PXP1=开发/自动化, P2=信息检索, P3=内容生成
模型池:【XXX池】当前所属模型池中文名
实际模型:当前调用的模型 ID
新会话→C分支专用,表示触发 session reset

完整规范见:references/declaration-format.md

⚡ 架构变更说明(2026-03-06)

M1 机制更新(FIX-0 第一轮)

原实现:prependContext 包含声明字符串(declarationPrepend),用于让 LLM 在回复首行输出声明。

问题根因:声明字符串含 ctx_score(每消息均不同的浮点相似度)等易变字段,导致:

  • 每条用户消息前缀不同 → LLM provider 前缀缓存(prefix cache)每轮全部 miss
  • 20 轮对话的历史 input tokens 每轮都重新计费

新实现:

  • declarationPrepend 从 prependContext 数组中移除(声明改由 semantic_check.log 记录)
  • extractDeclKey → extractSkillKey:缓存键只关心 skill/retry/degrade 激活状态
  • 普通消息(无技能激活)prependContext = undefined → 用户消息完全干净 → 对话历史 100% cache 命中
  • 技能激活时:prependContext = skillPrepend(技能指令相对稳定)→ 高缓存命中率

节省估算:单活跃会话每日约节省 6-10M tokens(对话历史从 input 变为 cache_read,约 1/10 价格)

Option C 路由标签(FIX-0 第二轮,2026-03-06 续)

背景:用户需要在 Discord/Telegram 回复中看到语义路由声明(当前使用的模型池+模型)。 由于 OpenClaw 主网关的 message_sending hook 从未被触发(架构限制:deliver-DCtqEVTU.js 的 globalHookRunner 在主网关上下文中从不初始化),无法在发送前修改消息内容。 选择 Option C:通过 prependContext 注入路由标签指令,由 LLM 自行在首行输出。

新增函数:extractStableRoutingParts(declarationText, fallbackModel)

  • 从 declarationText 提取:pool、model、sessionType
  • sessionType: "延续" | "新对话" — 通过解析 P\d+-XXX 分支标签判断:延续 → 延续,其他 → 新对话

路由标签格式:

【语义检查·路由】高速池|gemini-2.5-flash|延续
【语义检查·路由】智能池|claude-sonnet-4.6|新对话

注入逻辑(before_agent_start):

typescript
const isChannelSession = isMainAgentSession
  && !sessionKey.includes(":cron:")
  && !sessionKey.includes(":subagent:");   // subagent 不注入

const routingInstruction = routingTag
  ? `请在你回复的第一行,原样输出以下路由标签(不要修改):${routingTag}`
  : undefined;

// M1 stability: combinedKey = skillKey + routingTagKey
// routingTagKey = "rt:{pool}:{model}:{sessionType}"
// 相同池+模型+会话类型 → 相同 prependContext → LLM prefix cache 命中

缓存稳定性分析:

场景routingTagKey结果
连续对话(同池同模型)rt:高速池:gemini-2.5-flash:延续 不变M1 命中,cache hit ✅
首条新话题消息rt:xxx:yyy:新对话cache miss(pool 切换本来就 miss)✅
Gateway 重启后首条任意 keycache miss(M1 state 清空),第二条起命中 ✅

subagent 排除:isChannelSession 新增 !sessionKey.includes(":subagent:") 条件。 原因:subagent session 如 agent:main:subagent:xxx 满足 startsWith("agent:main:"),若不排除会注入两份 routingInstruction,导致 Discord 回复中路由标签重复出现。

FIX-4(lockModel 毒化修复)

modelOverride/providerOverride 已从 before_agent_start 返回值中移除。路由仅通过 sessions.patch 实现。原 lockModel 时返回 override 会毒化所有 fallback(kimi-coding/zai/minimax 等非 lovbrowser 渠道),导致 All models failed。

📚 完整文档

文档内容位置
SKILL.md技能说明(本文件)/skills/semantic-router/
README_v3_PRODUCTION.md完整部署指南(英文)/skills/semantic-router/
README_v7.2_生产部署指南_中文.docx完整部署指南(中文 DOCX)/skills/semantic-router/
declaration-format.md声明格式规范(已内置)/skills/semantic-router/references/
完整架构指南五分支、评分算法、Fallback 回路docs/INTELLIGENT_ROUTING_SYSTEM.md
部署清单7 步完整部署流程docs/ROUTING_DEPLOYMENT_CHECKLIST.md

💡 常见问题

Q: 我应该选择哪种隔离方案? A: 99% 的情况下,选择方案 A(隔离会话)。只有在特殊需求下(需要在用户可见的会话中执行)才选方案 B。

Q: 隔离会话会占用额外资源吗? A: 不会。隔离会话是临时的,自动过期(24h),不会额外占用内存。

Q: 如何自定义三池模型? A: 编辑 ~/.openclaw/workspace/.lib/pools.json,或运行 setup_wizard.py 交互式配置。

Q: 我的原有配置会被覆盖吗? A: 不会。使用智能合并流程(Step 3),仅追加缺失配置,保留原有设置。


🎓 学习路径

  1. 快速体验(5 分钟)

    • 运行 setup_wizard.py
    • 隔离现有 Cron Job
    • 测试语义检查
  2. 深入理解(30 分钟)

    • 阅读本文档
    • 自定义 tasks.json 关键词
    • 配置三池模型
  3. 生产部署(1 小时)

    • 完整配置指南
    • 智能合并配置
    • 故障排除与监控

📊 版本对比

特性v7.0v7.1v7.2
关键词匹配✅✅✅
上下文评分✅✅✅
三池架构✅✅✅
会话隔离规则❌❌✅ 新增
无冲突配置❌❌✅ 新增
完整故障排除❌❌✅ 新增

📝 许可与支持


最后更新: 2026-03-06 GMT+8 维护者: halfmoon82
稳定性: ⭐⭐⭐⭐⭐ (生产级)


⚖️ 知识产权与归属声明 (Intellectual Property & Attribution)

Powered by halfmoon82 🔷

本技能(Semantic Router)由 halfmoon82 开发并维护。

  • 版权所有: © 2026 halfmoon82. All rights reserved.
  • 官方发布: ClawHub
  • 许可证: 本技能采用 MIT 许可证。您可以自由使用、修改和分发,但必须保留原始作者信息及此版权声明。
  • 贡献与支持: 欢迎通过 ClawHub 提交 Issue 或参与讨论。

© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 18 other files (scripts, references) in skills/semantic-router of LeoYeAI/openclaw-master-skills.

  • SKILL.md
  • README.md
  • README_CN.md
  • README_Humanities_CN.md
  • README_v7.6.3_完整版.md
  • README_v7.9.2_设计哲学与演进史.md
  • _meta.json
  • clawhub.yaml
  • config/pools.json
  • config/tasks.json
  • package.json
  • references/README_v3_PRODUCTION.md
  • references/declaration-format.md
  • references/flow.md
  • scripts/generate_docx.py
  • scripts/semantic-webhook-server.py
  • scripts/semantic_check.py
  • scripts/setup_wizard.py
  • … and 1 more

Open the folder on GitHubat commit e5199b5

Compare with similar skills

Semantic Router next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Semantic Router compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Semantic Router this skillLeoYeAI/openclaw-master-skills2.2k—~3.6kAutomated safety check: NotesMIT
Chroma Vector DatabaseOrchestra-Research/AI-Research-SKILLs13k7 repos~2.3kAutomated safety check: PassMIT
SageMaker Serving Image Selectionhuggingface/skills11k1 repos~4.6kAutomated safety check: PassApache-2.0
Codebase Managementgiancarloerra/SocratiCode3.3k1 repos~1.8kAutomated safety check: PassAGPL-3.0
CLIP Image-Text MatchingOrchestra-Research/AI-Research-SKILLs13k7 repos~1.7kAutomated safety check: PassMIT
Sentence-Transformers Training Routerhuggingface/skills11k1 repos~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • Chroma Vector Database

    Orchestra-Research/AI-Research-SKILLs

    Shows how to store documents and embeddings in Chroma, query them by similarity with metadata filters, and persist them to disk for RAG and semantic search projects.

    13k GitHub starsUsed in 7 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Chooses the right serving container and current image URI for deploying a Hugging Face model to a SageMaker endpoint, preferring Hugging Face images over generic ones.

    11k GitHub starsUsed in 1 repo~4.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Codebase Management

    giancarloerra/SocratiCode

    Set up, index, and manage SocratiCode codebase indexing. An agent skill from giancarloerra/SocratiCode.

    3.3k GitHub starsUsed in 1 repo~1.8k tokens
    AI & LLM EngineeringAuto-check passed
  • CLIP Image-Text Matching

    Orchestra-Research/AI-Research-SKILLs

    Explains OpenAI's CLIP model for zero-shot image classification, image-text similarity, semantic image search and content moderation, with install steps and code patterns.

    13k GitHub starsUsed in 7 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Routes a sentence-transformers training task to the right model type and required reference docs and example scripts, covering bi-encoders, rerankers, sparse and multi-vector models.

    11k GitHub starsUsed in 1 repo~2.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Mashup Mods

    rehan-remade/universal-modder

    Build cross-game mashups and total conversions, the "Minecraft inside Elden Ring" or "skateboarding in MW2" kind.

    6.1k GitHub stars~3.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from LeoYeAI/openclaw-master-skills

All 1,235 skills in this repo
  • DevOps Pipeline Management

    LeoYeAI/openclaw-master-skills

    Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.

    2.2k GitHub stars~4.2k tokensUpdated 2 mo ago
    Auto-check: notes
  • Feishu Document Collaboration

    LeoYeAI/openclaw-master-skills

    Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.

    2.2k GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • Files Memory System

    LeoYeAI/openclaw-master-skills

    Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.

    2.2k GitHub stars~3.8k tokensUpdated 2 mo ago
    Auto-check passed
  • GEO-Claw AI Visibility Agent

    LeoYeAI/openclaw-master-skills

    Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.

    2.2k GitHub stars~4.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Google Workspace CLI

    LeoYeAI/openclaw-master-skills

    Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.

    2.2k GitHub stars~2.6k tokensUpdated 2 mo ago
    Auto-check: notes
  • HealthFit Health Advisors

    LeoYeAI/openclaw-master-skills

    Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.

    2.2k GitHub stars~4.4k tokensUpdated 2 mo ago
    Auto-check passed

Questions about Semantic Router

What does Semantic Router do?

让 AI 代理根据对话内容自动选择最合适的模型。层2(多词非连续命中)+ 层1(单词兜底)并行决定模型池;层3(embedding)永远独立运行决定会话切换。B+ 连续漂移计数器(第3次警告,第4次强制 C-auto)。softkeywords 泛用词降权机制。四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。. Semantic Router is an agent skill from LeoYeAI/openclaw-master-skills.

When should I use Semantic Router?

Semantic Router fits situations like: tasks that involve Embeddings.

How do I install Semantic Router in Claude Code?

Run `npx skills add LeoYeAI/openclaw-master-skills --skill semantic-router -a claude-code`. Or copy the skill folder (skills/semantic-router in LeoYeAI/openclaw-master-skills) into .claude/skills/semantic-router in your project. Claude Code loads it when a task matches its description.

How do I install Semantic Router in Codex?

Run `npx skills add LeoYeAI/openclaw-master-skills --skill semantic-router -a codex`. Or copy the skill folder (skills/semantic-router in LeoYeAI/openclaw-master-skills) into .agents/skills/semantic-router in your project. Codex loads it when a task matches its description.

Can I use Semantic Router in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill semantic-router -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/semantic-router, .gemini/skills/semantic-router, .github/skills/semantic-router and .opencode/skills/semantic-router in your project.

What does Semantic Router need to run?

Going by SKILL.md and its folder, Semantic Router needs Python for the scripts in its folder, the command-line tools its instructions call (python3, jq and curl) and credentials named LOVBROWSER_API_KEY. Our summary lists: Python 3; A credential in LOVBROWSER_API_KEY.

Does Semantic Router access the network?

SKILL.md names 1 domain. In commands or code: clawhub.ai; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Semantic Router safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Semantic Router use?

Semantic Router is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Semantic Router use?

About 3.6k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.1k tokens, read only when the agent opens those files.

What are the alternatives to Semantic Router?

Skills that share tags, products or a category with Semantic Router: Chroma Vector Database (Orchestra-Research/AI-Research-SKILLs, 13k stars), SageMaker Serving Image Selection (huggingface/skills, 11k stars), Codebase Management (giancarloerra/SocratiCode, 3.3k stars) and CLIP Image-Text Matching (Orchestra-Research/AI-Research-SKILLs, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Semantic Router?

LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,161 GitHub stars. The repository holds 1,235 skills in this directory. The repository was last updated on July 20, 2026.

Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.