RAILWISE-CLI AI多智能体系统概述
RAILWISE-CLI是RailWise推出的AI工程测绘多智能体CLI系统,集成多个专业AI Agent,实现工程测量、数据处理、报告生成的全流程自动化。
RAILWISE-CLI AI多智能体系统概述
Section titled “RAILWISE-CLI AI多智能体系统概述”RAILWISE-CLI 是宁波睿威工程技术有限公司(RailWise)推出的 AI工程测绘多智能体命令行系统。该系统基于 TypeScript/Bun 技术栈构建,集成了多个专业领域 AI Agent,面向工程测量与安全监测数字化场景,提供从数据采集、处理到报告生成的全流程自动化能力。
| 场景 | 说明 |
|---|---|
| 轨道交通监测 | 盾构施工期间控制保护区自动化监测 |
| 桥梁健康监测 | 高架桥墩位移、沉降、倾斜监测 |
| 基坑工程监测 | 深基坑周边建筑物、管线变形监测 |
| 隧道工程监测 | 隧道收敛、地表沉降监测 |
| 数据处理 | 测量数据批量清洗、转换、分析 |
| 报告生成 | 监测日报、周报、月报的自动化编制 |
| 项目 | 版本 |
|---|---|
| RAILWISE-CLI | 1.2.0 |
| Bun Runtime | 1.1.x |
| TypeScript | 5.5.x |
| AI Engine | RailWise Neural Engine v2 |
RAILWISE-CLI 采用 多智能体协作架构(Multi-Agent Collaboration Architecture),各智能体通过消息总线进行协调,由编排器(Orchestrator)统一调度。
┌─────────────────────────────────────────────────────────────┐│ RAILWISE-CLI 架构 │├─────────────────────────────────────────────────────────────┤│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ││ │ 测量智能体 │ │ 分析智能体 │ │ 报告智能体 │ ││ │ (Survey) │ │ (Analysis) │ │ (Report) │ ││ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ ││ │ │ │ ││ └────────────────┼────────────────┘ ││ ▼ ││ ┌─────────────────────┐ ││ │ 编排器 (Orchestrator) │ ││ │ 工作流引擎 / 调度器 │ ││ └─────────────────────┘ ││ │ ││ ┌────────────────┼────────────────┐ ││ ▼ ▼ ▼ ││ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ││ │ 数据存储层 │ │ 模型推理层 │ │ 外部接口层 │ ││ │ PostgreSQL │ │ ONNX/WASM │ │ API/SDK │ ││ └─────────────┘ └─────────────┘ └─────────────┘ │└─────────────────────────────────────────────────────────────┘| 层级 | 技术 | 说明 |
|---|---|---|
| 运行时 | Bun | 高性能 JavaScript 运行时 |
| 语言 | TypeScript | 类型安全的开发体验 |
| AI推理 | ONNX Runtime / WASM | 本地模型推理,无需云端依赖 |
| 数据存储 | PostgreSQL / SQLite | 结构化数据持久化 |
| 消息通信 | 内置 EventBus | 智能体间异步通信 |
| 配置管理 | TOML / JSON | 灵活的配置文件格式 |
1. 测量智能体(Survey Agent)
Section titled “1. 测量智能体(Survey Agent)”测量智能体负责与全站仪、水准仪等测量设备进行交互,执行自动化测量任务。
核心能力:
- 全站仪自动照准与读数
- 测量数据实时采集与校验
- 测量方案的智能优化
- 设备状态监控与异常报警
示例调用:
# 启动单次测量任务railwise-cli survey execute \ --project "绕城高速管廊工程1标段" \ --station "TS-01" \ --points "P1,P2,P3,P4,P5" \ --rounds 3 \ --output-format json
# 启动连续监测模式railwise-cli survey monitor \ --project "3号线控制保护区" \ --interval 300 \ --duration 4h \ --alert-threshold 2.02. 分析智能体(Analysis Agent)
Section titled “2. 分析智能体(Analysis Agent)”分析智能体负责对测量数据进行深度分析,识别趋势、异常和潜在风险。
核心能力:
- 时间序列趋势分析
- 变形速率计算与预测
- 异常值检测(基于统计与机器学习)
- 多测点关联分析
- 预警等级自动判定
示例调用:
# 执行数据分析railwise-cli analyze trend \ --project "3号线控制保护区" \ --start-date 2026-07-01 \ --end-date 2026-07-08 \ --metrics "displacement,velocity,acceleration" \ --output report.html
# 异常检测railwise-cli analyze anomaly \ --dataset "survey_data_2026Q3" \ --method isolation-forest \ --sensitivity high3. 报告智能体(Report Agent)
Section titled “3. 报告智能体(Report Agent)”报告智能体负责根据分析结果自动生成专业监测报告。
核心能力:
- 监测日报/周报/月报自动生成
- 图表自动绘制与排版
- 规范条文自动引用
- 多格式输出(PDF/Word/HTML)
- 报告质量自检
示例调用:
# 生成日报railwise-cli report daily \ --project "绕城高速管廊工程1标段" \ --date 2026-07-08 \ --template "gb50911-2013" \ --output "日报_20260708.pdf"
# 生成周报railwise-cli report weekly \ --project "3号线控制保护区" \ --week 2026-W27 \ --include-charts \ --output "周报_2026W27.docx"4. 协调智能体(Coordinator Agent)
Section titled “4. 协调智能体(Coordinator Agent)”协调智能体负责多智能体间的任务调度与资源分配。
核心能力:
- 工作流定义与执行
- 任务优先级管理
- 智能体负载均衡
- 错误恢复与重试
- 执行日志记录
| 项目 | 最低要求 | 推荐配置 |
|---|---|---|
| 操作系统 | macOS 12+ / Windows 10+ / Linux | macOS 14 / Windows 11 / Ubuntu 22.04 |
| Bun | 1.1.0 | 最新稳定版 |
| 内存 | 4 GB | 8 GB |
| 磁盘 | 2 GB 可用空间 | 10 GB 可用空间 |
| 网络 | 可访问RailWise API | 稳定互联网连接 |
# 使用 npm 全局安装npm install -g @railwise/cli
# 或使用 Bun 安装bun install -g @railwise/cli
# 验证安装railwise-cli --version# 输出: RAILWISE-CLI v1.2.0
# 初始化配置railwise-cli init配置文件位于 ~/.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 = "宁波睿威工程技术有限公司"提示: 首次运行
railwise-cli init会引导您完成配置文件的生成。API Key 请在 RailWise开发者平台 获取。
railwise-cli [全局选项] <命令> [子命令] [选项]
全局选项: -v, --version 显示版本号 -h, --help 显示帮助信息 -c, --config <path> 指定配置文件路径 -o, --output <path> 指定输出路径 -f, --format <format> 输出格式: json, yaml, table, html --verbose 显示详细日志 --dry-run 模拟运行,不执行实际操作| 命令 | 说明 | 子命令 |
|---|---|---|
survey |
测量相关操作 | execute, monitor, calibrate, status |
analyze |
数据分析 | trend, anomaly, correlation, forecast |
report |
报告生成 | daily, weekly, monthly, custom |
agent |
智能体管理 | list, status, start, stop, logs |
workflow |
工作流管理 | run, list, create, validate |
config |
配置管理 | get, set, reset, validate |
auth |
认证管理 | login, logout, status, refresh |
# 查看所有智能体状态railwise-cli agent list
# 启动特定工作流railwise-cli workflow run \ --name "daily_monitoring" \ --project "3号线控制保护区" \ --schedule "0 */4 * * *"
# 验证配置文件railwise-cli config validateRAILWISE-CLI 支持通过 YAML 文件定义复杂的工作流,实现多智能体的协作。
工作流定义文件
Section titled “工作流定义文件”name: daily_monitoringversion: "1.0"description: 日常监测工作流 - 每4小时执行一次
schedule: cron: "0 */4 * * *" timezone: "Asia/Shanghai"
project: id: "proj_rw_2026_001" name: "绕城高速管廊工程1标段"
steps: - id: step_1 name: "数据采集" 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: "数据分析" agent: analysis action: trend depends_on: [step_1] params: metrics: ["displacement", "velocity"] alert_threshold: 2.0 timeout: 300
- id: step_3 name: "报告生成" 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: "预警通知" 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}}"# 手动执行工作流railwise-cli workflow run --file workflow_daily_monitoring.yaml
# 注册定时工作流railwise-cli workflow register --file workflow_daily_monitoring.yaml
# 查看工作流执行历史railwise-cli workflow logs --name daily_monitoring --limit 10与外部AI平台集成
Section titled “与外部AI平台集成”RAILWISE-CLI 支持通过 MCP(Model Context Protocol) 与主流 AI 开发平台集成。
支持的AI平台
Section titled “支持的AI平台”| 平台 | 集成方式 | 状态 |
|---|---|---|
| Cursor | MCP Server | ✅ 已支持 |
| Claude Desktop | MCP Server | ✅ 已支持 |
| Windsurf | MCP Server | ✅ 已支持 |
| VS Code + Copilot | 扩展插件 | 🔄 开发中 |
| JetBrains | 插件 | 📋 规划中 |
MCP Server 配置
Section titled “MCP Server 配置”{ "mcpServers": { "railwise": { "command": "railwise-cli", "args": ["mcp", "serve"], "env": { "RAILWISE_API_KEY": "rw_live_xxxxxxxxxxxxxxxx" } } }}配置完成后,在 Cursor 中即可通过自然语言调用 RAILWISE-CLI 的功能:
用户: "执行3号线控制保护区的测量任务"AI: 调用 railwise-cli survey execute --project "3号线控制保护区" ...1. 配置管理
Section titled “1. 配置管理”- 使用环境变量存储敏感信息(API Key、密码)
- 将项目配置与工作流定义纳入版本控制
- 不同环境(开发/测试/生产)使用独立的配置文件
# 环境变量示例export RAILWISE_API_KEY="rw_live_xxxxxxxxxxxxxxxx"export RAILWISE_WORKSPACE="/data/railwise/prod"2. 工作流设计
Section titled “2. 工作流设计”- 将复杂任务拆分为多个小步骤,便于调试和重试
- 为每个步骤设置合理的超时和重试策略
- 使用
depends_on明确步骤间的依赖关系 - 关键步骤添加条件判断,避免不必要的执行
3. 性能优化
Section titled “3. 性能优化”- 启用本地模型推理(
enable_local_inference = true)减少网络延迟 - 合理设置
max_concurrent_agents,避免资源竞争 - 大数据量分析时使用
--batch-size参数分块处理
4. 日志与监控
Section titled “4. 日志与监控”# 查看实时日志railwise-cli agent logs --follow
# 导出执行报告railwise-cli workflow report --name daily_monitoring --format html限制与注意事项
Section titled “限制与注意事项”| 限制项 | 说明 |
|---|---|
| 并发智能体数 | 默认最多4个,可通过配置调整 |
| 单次测量点数 | 建议不超过500个测点 |
| 报告生成大小 | 单份报告不超过100页 |
| 本地模型支持 | 仅支持 ONNX 格式模型 |
| 网络依赖 | 部分功能需要连接 RailWise API |
| 操作系统 | 暂不支持 ARM32 架构 |
注意: 在生产环境中使用前,请务必在测试环境验证工作流的正确性。
Q1: 安装后无法找到命令?
Section titled “Q1: 安装后无法找到命令?”确保 Bun/npm 的全局安装路径已添加到系统 PATH:
# 检查安装路径which railwise-cli# 或where railwise-cli
# 如果未找到,添加路径export PATH="$PATH:$(bun pm bin -g)"Q2: API Key 失效如何处理?
Section titled “Q2: API Key 失效如何处理?”# 重新登录railwise-cli auth login
# 或手动刷新 Tokenrailwise-cli auth refreshQ3: 工作流执行失败如何排查?
Section titled “Q3: 工作流执行失败如何排查?”# 查看详细日志railwise-cli workflow logs --name <workflow_name> --verbose
# 验证工作流定义railwise-cli workflow validate --file <workflow_file>
# 单步调试railwise-cli workflow run --file <workflow_file> --step <step_id> --dry-runQ4: 如何自定义报告模板?
Section titled “Q4: 如何自定义报告模板?”# 导出默认模板railwise-cli report template --export --name gb50911-2013 --output ./templates/
# 修改后使用自定义模板railwise-cli report daily --template ./templates/my_custom_template.htmlQ5: 支持哪些全站仪品牌?
Section titled “Q5: 支持哪些全站仪品牌?”目前支持以下品牌的全站仪自动化接口:
- Leica(徕卡)
- Trimble(天宝)
- Topcon(拓普康)
- Sokkia(索佳)
- South(南方测绘)
其他品牌请联系技术支持获取适配方案。
| 版本 | 日期 | 变更内容 |
|---|---|---|
| 1.2.0 | 2026-07-08 | 新增 MCP Server 支持;优化工作流引擎;新增异常检测算法 |
| 1.1.0 | 2026-05-20 | 新增报告智能体;支持自定义模板;优化测量精度 |
| 1.0.0 | 2026-03-15 | 初始版本发布;支持测量、分析、报告三大智能体 |
- WorkWise AI工作台集成指南
- RAILWISE-TSM全站仪自动化AI工具
- RAILWISE-OS监测业务AI助手
- MCP Server 集成指南
- API REST 参考文档
- SDK TypeScript 使用指南
技术支持: 如有疑问,请联系 RailWise 技术支持团队
- 邮箱:support@railwise.cn
- 电话:0574-XXXXXXXX
- 文档反馈:GitHub Issues
