Install
openclaw skills install openclaw-intent-routerIntelligently routes natural language user intents to the best matching registered agent skill using keyword and semantic matching with confidence scores.
openclaw skills install openclaw-intent-routerIntelligent Intent-to-Skill Routing for AI Agents 为 AI Agent 提供智能意图到技能的路由
Version / 版本: 1.0.0 Package / 包名: openclaw-intent-router License / 许可: MIT
Intent Router is a capability routing framework that intelligently matches user intents to the most appropriate agent skills.
What it does:
Core Value: Solves the fundamental problem: "Given a user's intent, which agent skill should handle this request?"
Security Notice:
意图路由器是一个能力路由框架,能够智能地将用户意图匹配到最合适的 Agent 技能。
功能描述:
核心价值: 解决根本问题:"给定用户意图,哪个 Agent 技能应该处理这个请求?"
安全说明:
Runtime / 运行环境:
Operating System / 操作系统:
For Development / 开发环境:
External Dependencies / 外部依赖:
不需要外部依赖:
English:
中文:
English: Every match includes a 0-1 confidence score, allowing you to:
中文: 每个匹配都包含 0-1 的置信度分数,允许你:
English:
router.registerSkill({
name: 'skill-name',
description: 'What this skill does',
triggers: ['keyword1', 'keyword2'],
execute: async (params) => {
// Your skill logic
}
});
中文:
router.registerSkill({
name: '技能名称',
description: '技能功能描述',
triggers: ['关键词1', '关键词2'],
execute: async (params) => {
// 你的技能逻辑
}
});
English: Full TypeScript support with comprehensive type definitions for all APIs.
中文: 完整的 TypeScript 支持,所有 API 都有全面的类型定义。
English:
# Install from npm registry
npm install openclaw-intent-router
# Verify installation
node -e "console.log(require('openclaw-intent-router'))"
中文:
# 从 npm 注册表安装
npm install openclaw-intent-router
# 验证安装
node -e "console.log(require('openclaw-intent-router'))"
English:
# Install CLI globally
npm install -g openclaw-intent-router
# Use CLI commands
intent-router --version
intent-router skills
中文:
# 全局安装 CLI
npm install -g openclaw-intent-router
# 使用 CLI 命令
intent-router --version
intent-router skills
English:
# Clone repository
git clone https://github.com/ZhenRobotics/openclaw-intent-router.git
cd openclaw-intent-router
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
中文:
# 克隆仓库
git clone https://github.com/ZhenRobotics/openclaw-intent-router.git
cd openclaw-intent-router
# 安装依赖
npm install
# 构建
npm run build
# 运行测试
npm test
Security Note / 安全提示: Always verify the repository URL and inspect the code before running from source. 始终验证仓库 URL 并在从源码运行前检查代码。
English:
import { IntentRouter } from 'openclaw-intent-router';
const router = new IntentRouter();
// Register skills
router.registerSkill({
name: 'weather',
triggers: ['weather', 'temperature'],
execute: async () => ({ temp: 22, condition: 'sunny' })
});
// Route intent
const result = await router.route('What is the weather?');
console.log(result.primary.skill.name); // 'weather'
console.log(result.primary.confidence); // 0.95
中文:
import { IntentRouter } from 'openclaw-intent-router';
const router = new IntentRouter();
// 注册技能
router.registerSkill({
name: 'weather',
triggers: ['天气', '气温'],
execute: async () => ({ temp: 22, condition: '晴天' })
});
// 路由意图
const result = await router.route('今天天气怎么样?');
console.log(result.primary.skill.name); // 'weather'
console.log(result.primary.confidence); // 0.95
English:
import { BaseSkill } from 'openclaw-intent-router';
class EmailSenderSkill extends BaseSkill {
name = 'email-sender';
description = 'Send emails to recipients';
triggers = ['send email', 'email to'];
async execute(params) {
return await sendEmail(params.recipient, params.body);
}
}
router.registerSkill(new EmailSenderSkill());
中文:
import { BaseSkill } from 'openclaw-intent-router';
class EmailSenderSkill extends BaseSkill {
name = 'email-sender';
description = '发送邮件给收件人';
triggers = ['发送邮件', '发邮件给'];
async execute(params) {
return await sendEmail(params.recipient, params.body);
}
}
router.registerSkill(new EmailSenderSkill());
English:
# Route an intent
intent-router route "analyze this image"
# List available skills
intent-router skills
# Test matching with verbose output
intent-router test "weather query" --verbose
中文:
# 路由意图
intent-router route "分析这张图片"
# 列出可用技能
intent-router skills
# 测试匹配(详细输出)
intent-router test "天气查询" --verbose
English: Route user requests to specialized sub-agents (code generation, image analysis, data processing, etc.)
中文: 将用户请求路由到专门的子 Agent(代码生成、图像分析、数据处理等)
English: Determine which intent handler should process user messages based on content.
中文: 根据内容确定哪个意图处理器应处理用户消息。
English: Intelligent routing to microservices based on request intent rather than just URL patterns.
中文: 基于请求意图而非仅 URL 模式的微服务智能路由。
English: Map voice commands to appropriate action handlers with confidence scoring.
中文: 通过置信度评分将语音命令映射到适当的动作处理器。
English: Trigger automation based on natural language triggers without hardcoded rules.
中文: 基于自然语言触发器的自动化,无需硬编码规则。
English:
const router = new IntentRouter({
matchingStrategy: 'hybrid', // 'keyword' | 'semantic' | 'hybrid'
confidenceThreshold: 0.6, // Minimum confidence (0-1)
maxAlternatives: 3, // Number of alternatives
logLevel: 'info' // 'debug' | 'info' | 'warn' | 'error'
});
中文:
const router = new IntentRouter({
matchingStrategy: 'hybrid', // 'keyword' | 'semantic' | 'hybrid'
confidenceThreshold: 0.6, // 最低置信度 (0-1)
maxAlternatives: 3, // 备选数量
logLevel: 'info' // 'debug' | 'info' | 'warn' | 'error'
});
| Metric / 指标 | Value / 数值 | Notes / 说明 |
|---|---|---|
| Routing Speed / 路由速度 | < 5ms | Average per intent / 每个意图平均 |
| Memory Usage / 内存使用 | < 50MB | With 100 skills / 100个技能 |
| Package Size / 包大小 | ~500KB | Uncompressed / 未压缩 |
| Concurrent Skills / 并发技能 | 1000+ | Tested / 已测试 |
English:
中文:
English:
中文:
English:
中文:
English:
中文:
English:
中文:
English:
中文:
MIT License - See LICENSE file
English: Before installing, you can verify:
npm audit after installation中文: 安装前,你可以验证:
npm auditVersion: 1.0.0 Last Updated: 2024-03-13 Maintained: ✅ Actively maintained
Build intelligent agents with Intent Router! 使用意图路由器构建智能 Agent!