LaunchKit · 2026
Back to Skills

semantic-router

Auto-routing skill with configurable model pools and task type matching.

0
816 downloads
by @halfmoon82

Setup & Installation

openclaw skills install @halfmoon82/semantic-router

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install semantic-router

Version History

v7.9.6Mar 16, 2026 - Version note by skill developer:

**semantic-router v7.9.6** - 新增 `scripts/semantic-webhook-server.py`,支持本地 webhook 路由接口及远程语义检查。 - 安装与验证步骤增加 webhook 服务的部署和健康检查说明。 - SKILL.md 相关说明同步:使用 curl POST 本地接口(端口 9811)进行语义路由演示。 - references/declaration-format.md 与主文档更新以兼容 webhook 部署场景。 - clawhub.yaml 等配置文件对应调整,支持 webhook server 启动。

What This Skill Does

Routes each AI agent message to one of four model pools based on keyword detection, semantic similarity scoring, and contextual continuity. Uses a five-branch decision tree to switch models, maintain sessions, or reset conversations when topics change. Also isolates background cron jobs from user-facing sessions to prevent interruptions.

Reduces token costs and latency by matching each message to an appropriately scoped model rather than routing everything through a single expensive model.

When to use it

  • Switching to a fast model for quick lookups while keeping a capable model for coding tasks
  • Automatically resetting the session when the conversation topic shifts completely
  • Preventing scheduled background jobs from disrupting an ongoing chat session
  • Routing long-context or multi-step agent tasks to a high-context model pool
  • Matching translation or writing requests to a content-optimized model

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: 'Help me write a Python web scraper'

AGENT
  1. 1semantic_check.py receives the message and checks it against system filters
  2. 2Keyword match found: 'write' and 'scraper' classify the message as a development task
  3. 3Router selects branch C and targets the Intelligence pool
  4. 4Session model is patched via sessions.patch to the configured Intelligence pool model
  5. 5A routing tag is prepended to the agent response instructing the LLM to output the active pool and model on the first line
OUTPUT

Response generated by the Intelligence pool model, with a routing declaration in the first line indicating the active pool and model ID

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

API keys for at least one configured model provider (e.g., Anthropic, Google AI, OpenAI)