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
RAILWISE-CLI AI Multi-Agent System Overview
Section titled “RAILWISE-CLI AI Multi-Agent System Overview”Table of Contents
Section titled “Table of Contents”- Overview
- System Architecture
- Core Agents
- Installation & Configuration
- Command Line Interface
- Workflow Orchestration
- Integration with External AI Platforms
- Best Practices
- Limitations & Notes
- FAQ
- Changelog
- Related Documents
Overview
Section titled “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.
Applicable Scenarios
Section titled “Applicable 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 |
Version Information
Section titled “Version Information”| Item | Version |
|---|---|
| RAILWISE-CLI | 1.2.0 |
| Bun Runtime | 1.1.x |
| TypeScript | 5.5.x |
| AI Engine | RailWise Neural Engine v2 |
System Architecture
Section titled “System Architecture”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 │ ││ └─────────────┘ └─────────────┘ └─────────────┘ │└─────────────────────────────────────────────────────────────┘Technology Stack
Section titled “Technology Stack”| 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 |
Core Agents
Section titled “Core Agents”1. Survey Agent
Section titled “1. Survey Agent”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:
# Launch single measurement taskrailwise-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 moderailwise-cli survey monitor --project "Line 3 Control Protection Zone" --interval 300 --duration 4h --alert-threshold 2.02. Analysis Agent
Section titled “2. Analysis Agent”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:
# Execute data analysisrailwise-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 detectionrailwise-cli analyze anomaly --dataset "survey_data_2026Q3" --method isolation-forest --sensitivity high3. Report Agent
Section titled “3. Report Agent”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:
# Generate daily reportrailwise-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 reportrailwise-cli report weekly --project "Line 3 Control Protection Zone" --week 2026-W27 --include-charts --output "Weekly_Report_2026W27.docx"4. Coordinator Agent
Section titled “4. Coordinator Agent”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
Installation & Configuration
Section titled “Installation & Configuration”Environment Requirements
Section titled “Environment Requirements”| 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 |
Installation Steps
Section titled “Installation Steps”# Install globally with npmnpm install -g @railwise/cli
# Or install with Bunbun install -g @railwise/cli
# Verify installationrailwise-cli --version# Output: RAILWISE-CLI v1.2.0
# Initialize configurationrailwise-cli initConfiguration File
Section titled “Configuration File”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 = truemax_concurrent_agents = 4
[survey]default_instrument = "total_station"measurement_rounds = 3precision_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 initwill guide you through configuration file generation. API Key can be obtained from the RailWise Developer Platform.
Command Line Interface
Section titled “Command Line Interface”Global Options
Section titled “Global Options”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 operationsCommand List
Section titled “Command List”| 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 |
Usage Examples
Section titled “Usage Examples”# View all agent statusesrailwise-cli agent list
# Launch specific workflowrailwise-cli workflow run --name "daily_monitoring" --project "Line 3 Control Protection Zone" --schedule "0 */4 * * *"
# Validate configuration filerailwise-cli config validateWorkflow Orchestration
Section titled “Workflow Orchestration”RAILWISE-CLI supports defining complex workflows through YAML files to achieve multi-agent collaboration.
Workflow Definition File
Section titled “Workflow Definition File”name: daily_monitoringversion: "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}}"Execute Workflow
Section titled “Execute Workflow”# Manual workflow executionrailwise-cli workflow run --file workflow_daily_monitoring.yaml
# Register scheduled workflowrailwise-cli workflow register --file workflow_daily_monitoring.yaml
# View workflow execution historyrailwise-cli workflow logs --name daily_monitoring --limit 10Integration with External AI Platforms
Section titled “Integration with External AI Platforms”RAILWISE-CLI supports integration with mainstream AI development platforms through MCP (Model Context Protocol).
Supported AI Platforms
Section titled “Supported AI Platforms”| 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 |
MCP Server Configuration
Section titled “MCP Server Configuration”{ "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.
Best Practices
Section titled “Best Practices”1. Configuration Management
Section titled “1. Configuration Management”- 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)
# Environment variable examplesexport RAILWISE_API_KEY="rw_live_xxxxxxxxxxxxxxxx"export RAILWISE_WORKSPACE="/data/railwise/prod"2. Workflow Design
Section titled “2. Workflow Design”- Break complex tasks into multiple small steps for easier debugging and retry
- Set reasonable timeout and retry strategies for each step
- Use
depends_onto clarify dependencies between steps - Add conditional judgments to key steps to avoid unnecessary execution
3. Performance Optimization
Section titled “3. Performance Optimization”- Enable local model inference (
enable_local_inference = true) to reduce network latency - Reasonably set
max_concurrent_agentsto avoid resource contention - Use
--batch-sizeparameter for chunked processing with large data volumes
4. Logging and Monitoring
Section titled “4. Logging and Monitoring”# View real-time logsrailwise-cli agent logs --follow
# Export execution reportrailwise-cli workflow report --name daily_monitoring --format htmlLimitations & Notes
Section titled “Limitations & Notes”| 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.
Q1: Command not found after installation?
Section titled “Q1: Command not found after installation?”Ensure Bun/npm global installation path is added to system PATH:
# Check installation pathwhich railwise-cli# orwhere railwise-cli
# If not found, add pathexport PATH="$PATH:$(bun pm bin -g)"Q2: How to handle API Key expiration?
Section titled “Q2: How to handle API Key expiration?”# Re-loginrailwise-cli auth login
# Or manually refresh Tokenrailwise-cli auth refreshQ3: How to troubleshoot workflow execution failure?
Section titled “Q3: How to troubleshoot workflow execution failure?”# View detailed logsrailwise-cli workflow logs --name <workflow_name> --verbose
# Validate workflow definitionrailwise-cli workflow validate --file <workflow_file>
# Single-step debuggingrailwise-cli workflow run --file <workflow_file> --step <step_id> --dry-runQ4: How to customize report templates?
Section titled “Q4: How to customize report templates?”# Export default templaterailwise-cli report template --export --name gb50911-2013 --output ./templates/
# Use custom template after modificationrailwise-cli report daily --template ./templates/my_custom_template.htmlQ5: 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.
Changelog
Section titled “Changelog”| 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 |
Related Documents
Section titled “Related Documents”- WorkWise AI Workbench Integration Guide
- RAILWISE-TSM Total Station Automated AI Tools
- RAILWISE-OS Monitoring Business AI Assistant
- MCP Server Integration Guide
- API REST Reference Documentation
- SDK TypeScript Guide
Technical Support: For questions, please contact the RailWise Technical Support Team
- Email: support@railwise.cn
- Phone: 0574-XXXXXXXX
- Documentation Feedback: GitHub Issues
