RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • GFlow Approval Workflow (opens new window)
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • GFlow Approval Workflow (opens new window)
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

    • Extension Components Overview
    • filter

    • action

    • transform

    • external

    • ai

      • LLM
      • generate-image
      • Agent
      • Intent Recognition
        • Configuration
          • Intent Structure
        • Execution Result
        • Configuration Example
        • Application Example
      • Local Intent Recognition
      • MCP Client
      • MCP Server
    • ci

    • IoT

    • Stream Processing

    • Service Discovery

    • file

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • Agent Framework

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

目录

Intent Recognition

The ai/intent component: v0.36.0+ classifies user input into intents using an LLM, and routes the result to matching downstream nodes as a Relation Type — AI-based smart routing.

For latency- and cost-sensitive scenarios, use Local Intent Recognition instead.

# Configuration

Field Type Description Default
url string OpenAI API-compatible endpoint https://ai.gitee.com/v1
key string API key
model string Model name Qwen2.5-72B-Instruct
input string User input expression, supports ${msg.key} and ${metadata.key}. Empty = msg.GetData()
intents []Intent Predefined intent list (at least one required)
defaultIntent string Default intent (used when recognition fails) default
systemPrompt string Custom system prompt, supports ${include()} file references. Empty = built-in default prompt
temperature float32 Model temperature 0.1
maxTokens int Maximum output length, 0 = model default 0

# Intent Structure

Field Type Description
name string Intent name (used as the Relation Type for routing)
description string Intent description (helps the LLM distinguish intents)

# Execution Result

  • The recognized intent is written to msg.Metadata["intent"]; msg.Data is left untouched (the original message passes through)
  • Routed via TellNext(msg, intentName) to the matching connection type
  • If the result is not in the predefined list, defaultIntent is used

# Configuration Example

{
  "id": "node_intent",
  "type": "ai/intent",
  "name": "Intent Classification",
  "configuration": {
    "url": "https://ai.gitee.com/v1",
    "key": "sk-xxx",
    "model": "Qwen2.5-72B-Instruct",
    "temperature": 0.1,
    "intents": [
      {"name": "query", "description": "The user asks for information or a question"},
      {"name": "action", "description": "The user requests an operation"},
      {"name": "complaint", "description": "The user complains or expresses dissatisfaction"},
      {"name": "greeting", "description": "The user greets"}
    ],
    "defaultIntent": "unknown"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# Application Example

Smart customer-service routing:

{
  "ruleChain": {"id": "smart-router", "name": "Smart Router", "root": true},
  "metadata": {
    "firstNodeIndex": 0,
    "nodes": [
      {
        "id": "node_intent", "type": "ai/intent", "name": "Intent Recognition",
        "configuration": {
          "url": "https://ai.gitee.com/v1", "key": "sk-xxx",
          "model": "Qwen2.5-72B-Instruct", "temperature": 0.1,
          "intents": [
            {"name": "query", "description": "Ask for information"},
            {"name": "action", "description": "Perform an operation"},
            {"name": "complaint", "description": "File a complaint"}
          ],
          "defaultIntent": "unknown"
        }
      },
      {"id": "node_query", "type": "ai/llm", "name": "Answer Query",
        "configuration": {"url": "...", "key": "...", "model": "...", "systemPrompt": "Answer the user's question"}},
      {"id": "node_action", "type": "restApiCall", "name": "Execute Action",
        "configuration": {"url": "http://api/action", "requestMethod": "POST"}},
      {"id": "node_complaint", "type": "restApiCall", "name": "Escalate to Human",
        "configuration": {"url": "http://api/ticket", "requestMethod": "POST"}}
    ],
    "connections": [
      {"fromId": "node_intent", "toId": "node_query", "type": "query"},
      {"fromId": "node_intent", "toId": "node_action", "type": "action"},
      {"fromId": "node_intent", "toId": "node_complaint", "type": "complaint"}
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Edit this page on GitHub (opens new window)
Last Updated: 2026/09/11, 05:25:57
Agent
Local Intent Recognition

← Agent Local Intent Recognition→

Theme by Vdoing | Copyright © 2023-2026 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式