AI Features
RuleGo-Server's AI capabilities are built on the "rule chain as Agent" concept. It includes a built-in AI Agent assistant, supports Skill management, and can integrate with AI programming tools like Claude Code and Cursor to enable intelligent rule chain management.
For complete documentation on AI extension components (agent framework architecture, ai/agent node configuration, tool system, aspect framework, session management, LLM/intent recognition/MCP component references), see AI Extension Components.
# Architecture Overview
User/AI Tools
|
v
OpenAI Compatible API ----------------------------------
POST /api/v1/rules/{id}/v1/chat/completions |
| |
v |
Rule Chain (ai/agent node) |
| |
|-- System Prompt (AGENTS.md) |
|-- LLM Call (Global Config) |
|-- Tool Calls |
|-- MCP self tools (rule chain management) |
|-- skill tools (knowledge/skills) |
|-- builtin tools |
|
MCP Endpoint <------------------------------------------
/api/v1/mcp/{apiKey}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Prerequisites
Configure LLM connection information in the [global] section of config.conf:
[global]
llm_url = https://api.openai.com/v1
llm_api_key = sk-xxx
llm_model = gpt-4o
2
3
4
Supports all LLM services compatible with the OpenAI API (DeepSeek, Qwen, Ollama, etc.).
# Built-in AI Agents
# assistant — Rule Chain Assistant
A multi-turn conversational AI assistant capable of creating, modifying, and deploying rule chains.
Endpoint:
POST /api/v1/rules/assistant/v1/chat/completions
Features:
- Rule chain based on
ai/agentnode - System prompt loaded via
${include()}fromdata/system/agents/_assistant/AGENTS.md - Up to 25 rounds of tool call iterations (maxStep: 25)
- Supported MCP tools:
list_rule_chains,get_rule_chain,preview_rule_chain,save_rule_chain,delete_rule_chain,operate_rule_chain,execute_rule_chain,list_components,get_component_doc,list_node_pool - Supported builtin tools:
skill(dynamically load skill knowledge) - Supports SSE streaming output
Use Cases:
- Conversational creation/modification of rule chains in the editor's AI assistant panel
- Automated rule chain management via API calls
Prompt files are stored in
data/system/agents/{agentId}/AGENTS.md. Manage prompts and model configuration via API; see REST API Reference.
# Skill Management
Skills are knowledge fragments provided to AI Agents, stored as SKILL.md files, enabling the Agent to understand domain-specific knowledge. They can be managed through the editor or API; see REST API Reference.
Scope: Currently only global (globally shared) is supported.
The skill directory path is controlled by the skill_path configuration option in config.conf.
# Built-in Skills
The system includes a built-in StreamSQL skill (data/system/agents/_assistant/skills/streamsql/SKILL.md), providing complete usage reference for StreamSQL components.
# Custom AI Agents
Any rule chain containing an ai/agent node can serve as an AI Agent and automatically gets an OpenAI-compatible endpoint.
# Creation Steps
- Create a new rule chain
- Add an
ai/agenttype node - Configure node parameters:
systemPrompt: System prompturl/key/model: LLM connection configuration (can use${global.xxx}to reference global variables, e.g.,${global.llm_url})maxStep: Maximum tool call roundstools: Tool list
# Tool Configuration
{
"tools": [
{
"type": "mcp",
"config": {
"server": "self",
"tools": ["list_rule_chains", "get_rule_chain", "save_rule_chain"]
}
},
{
"type": "builtin",
"name": "skill",
"config": {
"globalDirs": ["${global.skill_path}"],
"useChinese": true
}
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
server: "self": Callback to the built-in MCP servicetype: "builtin", "name: "skill": Load skill files
# Input Parameter Definition
Define the Agent's input parameter format through additionalInfo.inputSchema:
{
"additionalInfo": {
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Query content"
}
},
"required": ["query"]
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
Once configured, this Agent will also register as a tool in MCP with the corresponding parameter format.
# Managing Rule Chains via MCP
RuleGo-Server includes built-in MCP tools, supporting AI programming tools like Claude Code, Cursor, and Trae to manage rule chains through natural language — create, view, modify, deploy, and execute, all without manually writing JSON.
For client configuration, available tool list, and usage examples, see MCP Service.
# Using AI in the Editor
For an illustrated guide, see AI Assistant Tutorial.
# Rule Chain AI Assistant Panel
After opening a rule chain in the editor, an AI assistant panel appears on the right:
- Multi-turn conversation with context including the current rule chain
- AI can directly preview and save modifications to the canvas
- Quick prompt suggestions
- Supports message copy and regeneration
- Chat history is stored locally per rule chain
# One-Click AI Generation
The [AI Generate] button in the toolbar:
- Enter a requirement description
- Provides common scenario example prompts (data filtering, IoT, API orchestration, AI Agent, etc.)
- One-click generate rule chain JSON and load it onto the canvas
# AI Agent Chat
When the rule chain category is AI Agent, the bottom of the editor displays the full Agent chat interface:
- Supports displaying reasoning process
- Shows tool calls (read, write, edit, bash, rulechain, mcp, skill) and their status
- SSE streaming output with progress indicator for each tool
For an illustrated tutorial, see Creating an Agent Tutorial.