跳转到内容
RailWise KB已发布

RAILWISE-CLI AI Multi-Agent System Overview

RAILWISE-CLI is RailWise's AI-powered multi-agent CLI system for engineering surveying, integrating multiple professional AI Agents for full-process automation of engineering measurement, data processing, and report generation

复核 2026-07-09入门公开可引用RailWise 技术团队
learning-path

RAILWISE-CLI AI Multi-Agent System Overview

Section titled “RAILWISE-CLI AI Multi-Agent System Overview”

RAILWISE-CLI is an AI-powered multi-agent command-line system for engineering surveying launched by Ningbo RailWise Engineering Technology Co., Ltd. (RailWise). Built on the TypeScript/Bun technology stack, it integrates multiple professional domain AI Agents, providing full-process automation capabilities from data acquisition, processing to report generation for engineering surveying and safety monitoring digitalization scenarios.

Scenario Description
Rail Transit Monitoring Automated monitoring of control protection zones during shield tunneling construction
Bridge Health Monitoring Monitoring of viaduct pier displacement, settlement, and inclination
Excavation Engineering Monitoring Monitoring of surrounding building and pipeline deformation for deep excavation
Tunnel Engineering Monitoring Tunnel convergence and ground surface settlement monitoring
Data Processing Batch cleaning, transformation, and analysis of measurement data
Report Generation Automated compilation of monitoring daily, weekly, and monthly reports
Item Version
RAILWISE-CLI 1.2.0
Bun Runtime 1.1.x
TypeScript 5.5.x
AI Engine RailWise Neural Engine v2

RAILWISE-CLI adopts a Multi-Agent Collaboration Architecture, where agents coordinate through a message bus, with an Orchestrator uniformly scheduling tasks.

┌─────────────────────────────────────────────────────────────┐
│ RAILWISE-CLI Architecture │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Survey │ │ Analysis │ │ Report │ │
│ │ Agent │ │ Agent │ │ Agent │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ ▼ │
│ ┌─────────────────────┐ │
│ │ Orchestrator │ │
│ │ Workflow Engine / │ │
│ │ Scheduler │ │
│ └─────────────────────┘ │
│ │ │
│ ┌────────────────┼────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Data │ │ Model │ │ External │ │
│ │ Storage │ │ Inference │ │ Interface │ │
│ │ PostgreSQL │ │ ONNX/WASM │ │ API/SDK │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
Layer Technology Description
Runtime Bun High-performance JavaScript runtime
Language TypeScript Type-safe development experience
AI Inference ONNX Runtime / WASM Local model inference, no cloud dependency
Data Storage PostgreSQL / SQLite Structured data persistence
Message Communication Built-in EventBus Asynchronous inter-agent communication
Configuration Management TOML / JSON Flexible configuration file formats

The Survey Agent is responsible for interacting with total stations, levels, and other measurement equipment to execute automated measurement tasks.

Core Capabilities:

  • Total station auto-targeting and reading
  • Real-time measurement data acquisition and validation
  • Intelligent optimization of measurement plans
  • Equipment status monitoring and anomaly alerting

Example Invocation:

Terminal window
# Launch single measurement task
railwise-cli survey execute --project "Raocheng Highway Utility Tunnel Project Section 1" --station "TS-01" --points "P1,P2,P3,P4,P5" --rounds 3 --output-format json
# Launch continuous monitoring mode
railwise-cli survey monitor --project "Line 3 Control Protection Zone" --interval 300 --duration 4h --alert-threshold 2.0

The Analysis Agent is responsible for in-depth analysis of measurement data, identifying trends, anomalies, and potential risks.

Core Capabilities:

  • Time-series trend analysis
  • Deformation rate calculation and prediction
  • Anomaly detection (based on statistics and machine learning)
  • Multi-point correlation analysis
  • Automatic alert level determination

Example Invocation:

Terminal window
# Execute data analysis
railwise-cli analyze trend --project "Line 3 Control Protection Zone" --start-date 2026-07-01 --end-date 2026-07-08 --metrics "displacement,velocity,acceleration" --output report.html
# Anomaly detection
railwise-cli analyze anomaly --dataset "survey_data_2026Q3" --method isolation-forest --sensitivity high

The Report Agent is responsible for automatically generating professional monitoring reports based on analysis results.

Core Capabilities:

  • Automated generation of daily, weekly, and monthly monitoring reports
  • Automatic chart drawing and layout
  • Automatic citation of standard clauses
  • Multi-format output (PDF/Word/HTML)
  • Report quality self-check

Example Invocation:

Terminal window
# Generate daily report
railwise-cli report daily --project "Raocheng Highway Utility Tunnel Project Section 1" --date 2026-07-08 --template "gb50911-2013" --output "Daily_Report_20260708.pdf"
# Generate weekly report
railwise-cli report weekly --project "Line 3 Control Protection Zone" --week 2026-W27 --include-charts --output "Weekly_Report_2026W27.docx"

The Coordinator Agent is responsible for task scheduling and resource allocation among multiple agents.

Core Capabilities:

  • Workflow definition and execution
  • Task priority management
  • Agent load balancing
  • Error recovery and retry
  • Execution log recording

Item Minimum Recommended
OS macOS 12+ / Windows 10+ / Linux macOS 14 / Windows 11 / Ubuntu 22.04
Bun 1.1.0 Latest stable
Memory 4 GB 8 GB
Disk 2 GB free 10 GB free
Network Access to RailWise API Stable internet connection
Terminal window
# Install globally with npm
npm install -g @railwise/cli
# Or install with Bun
bun install -g @railwise/cli
# Verify installation
railwise-cli --version
# Output: RAILWISE-CLI v1.2.0
# Initialize configuration
railwise-cli init

Configuration file located at ~/.railwise/config.toml:

[core]
workspace = "/Users/wangjiawei/RailWise/projects"
log_level = "info"
timezone = "Asia/Shanghai"
[api]
base_url = "https://api.railwise.cn/v2"
api_key = "rw_live_xxxxxxxxxxxxxxxx"
timeout = 30
[ai]
model_path = "~/.railwise/models"
enable_local_inference = true
max_concurrent_agents = 4
[survey]
default_instrument = "total_station"
measurement_rounds = 3
precision_threshold = 0.5
[report]
default_template = "gb50911-2013"
output_format = "pdf"
company_name = "Ningbo RailWise Engineering Technology Co., Ltd."

Note: First run of railwise-cli init will guide you through configuration file generation. API Key can be obtained from the RailWise Developer Platform.


Terminal window
railwise-cli [global options] <command> [subcommand] [options]
Global Options:
-v, --version Show version number
-h, --help Show help information
-c, --config <path> Specify configuration file path
-o, --output <path> Specify output path
-f, --format <format> Output format: json, yaml, table, html
--verbose Show detailed logs
--dry-run Simulate run, no actual operations
Command Description Subcommands
survey Survey operations execute, monitor, calibrate, status
analyze Data analysis trend, anomaly, correlation, forecast
report Report generation daily, weekly, monthly, custom
agent Agent management list, status, start, stop, logs
workflow Workflow management run, list, create, validate
config Configuration management get, set, reset, validate
auth Authentication management login, logout, status, refresh
Terminal window
# View all agent statuses
railwise-cli agent list
# Launch specific workflow
railwise-cli workflow run --name "daily_monitoring" --project "Line 3 Control Protection Zone" --schedule "0 */4 * * *"
# Validate configuration file
railwise-cli config validate

RAILWISE-CLI supports defining complex workflows through YAML files to achieve multi-agent collaboration.

workflow_daily_monitoring.yaml
name: daily_monitoring
version: "1.0"
description: Daily monitoring workflow — execute every 4 hours
schedule:
cron: "0 */4 * * *"
timezone: "Asia/Shanghai"
project:
id: "proj_rw_2026_001"
name: "Raocheng Highway Utility Tunnel Project Section 1"
steps:
- id: step_1
name: "Data Acquisition"
agent: survey
action: execute
params:
station: "TS-01"
points: ["P1", "P2", "P3", "P4", "P5"]
rounds: 3
timeout: 1800
retry:
max_attempts: 3
backoff: exponential
- id: step_2
name: "Data Analysis"
agent: analysis
action: trend
depends_on: [step_1]
params:
metrics: ["displacement", "velocity"]
alert_threshold: 2.0
timeout: 300
- id: step_3
name: "Report Generation"
agent: report
action: daily
depends_on: [step_2]
params:
template: "gb50911-2013"
include_charts: true
timeout: 120
condition:
if: "step_2.alert_level != 'normal'"
then: "continue"
else: "continue"
- id: step_4
name: "Alert Notification"
agent: notification
action: send
depends_on: [step_2]
condition:
if: "step_2.alert_level in ['yellow', 'orange', 'red']"
params:
channels: ["email", "sms", "app"]
template: "alert_{{alert_level}}"
Terminal window
# Manual workflow execution
railwise-cli workflow run --file workflow_daily_monitoring.yaml
# Register scheduled workflow
railwise-cli workflow register --file workflow_daily_monitoring.yaml
# View workflow execution history
railwise-cli workflow logs --name daily_monitoring --limit 10

RAILWISE-CLI supports integration with mainstream AI development platforms through MCP (Model Context Protocol).

Platform Integration Method Status
Cursor MCP Server ✅ Supported
Claude Desktop MCP Server ✅ Supported
Windsurf MCP Server ✅ Supported
VS Code + Copilot Extension plugin 🔄 In development
JetBrains Plugin 📋 Planned
~/.cursor/mcp.json
{
"mcpServers": {
"railwise": {
"command": "railwise-cli",
"args": ["mcp", "serve"],
"env": {
"RAILWISE_API_KEY": "rw_live_xxxxxxxxxxxxxxxx"
}
}
}
}

After configuration, RAILWISE-CLI functionality can be invoked through natural language in Cursor:

User: "Execute measurement task for Line 3 control protection zone"
AI: Call railwise-cli survey execute --project "Line 3 Control Protection Zone" ...

See MCP Server Integration Guide for details.


  • Use environment variables for sensitive information (API Key, passwords)
  • Include project configurations and workflow definitions in version control
  • Use independent configuration files for different environments (dev/test/prod)
Terminal window
# Environment variable examples
export RAILWISE_API_KEY="rw_live_xxxxxxxxxxxxxxxx"
export RAILWISE_WORKSPACE="/data/railwise/prod"
  • Break complex tasks into multiple small steps for easier debugging and retry
  • Set reasonable timeout and retry strategies for each step
  • Use depends_on to clarify dependencies between steps
  • Add conditional judgments to key steps to avoid unnecessary execution
  • Enable local model inference (enable_local_inference = true) to reduce network latency
  • Reasonably set max_concurrent_agents to avoid resource contention
  • Use --batch-size parameter for chunked processing with large data volumes
Terminal window
# View real-time logs
railwise-cli agent logs --follow
# Export execution report
railwise-cli workflow report --name daily_monitoring --format html

Limitation Item Description
Concurrent agent count Default maximum 4, adjustable via configuration
Single measurement point count Recommended not to exceed 500 points
Report generation size Single report not to exceed 100 pages
Local model support Only ONNX format models supported
Network dependency Some features require connection to RailWise API
Operating system ARM32 architecture not currently supported

Note: Before using in production environments, please verify workflow correctness in test environments.


Ensure Bun/npm global installation path is added to system PATH:

Terminal window
# Check installation path
which railwise-cli
# or
where railwise-cli
# If not found, add path
export PATH="$PATH:$(bun pm bin -g)"
Terminal window
# Re-login
railwise-cli auth login
# Or manually refresh Token
railwise-cli auth refresh

Q3: How to troubleshoot workflow execution failure?

Section titled “Q3: How to troubleshoot workflow execution failure?”
Terminal window
# View detailed logs
railwise-cli workflow logs --name <workflow_name> --verbose
# Validate workflow definition
railwise-cli workflow validate --file <workflow_file>
# Single-step debugging
railwise-cli workflow run --file <workflow_file> --step <step_id> --dry-run
Terminal window
# Export default template
railwise-cli report template --export --name gb50911-2013 --output ./templates/
# Use custom template after modification
railwise-cli report daily --template ./templates/my_custom_template.html

Q5: Which total station brands are supported?

Section titled “Q5: Which total station brands are supported?”

Currently supported total station brands for automated interfaces:

  • Leica (徕卡)
  • Trimble (天宝)
  • Topcon (拓普康)
  • Sokkia (索佳)
  • South (南方测绘)

Other brands please contact technical support for adaptation solutions.


Version Date Changes
1.2.0 2026-07-08 Added MCP Server support; optimized workflow engine; added anomaly detection algorithm
1.1.0 2026-05-20 Added report agent; supported custom templates; optimized measurement precision
1.0.0 2026-03-15 Initial release; supported survey, analysis, and report agents


Technical Support: For questions, please contact the RailWise Technical Support Team