产品文档已发布
RAILWISE-CLI 智能体配置详解
深入讲解四大内置智能体(测量、平差、监测、质检)的配置参数、扩展机制与自定义开发
产品文档
RAILWISE-CLI 智能体配置详解
Section titled “RAILWISE-CLI 智能体配置详解”目标读者:需要自定义智能体行为的高级用户、二次开发人员
预计阅读时间:20 分钟
前置要求:已完成 cli-quickstart.md 快速入门
1. 智能体架构概览
Section titled “1. 智能体架构概览”RAILWISE-CLI 采用 多智能体协作架构(Multi-Agent Collaboration),每个智能体是独立的任务执行单元,通过消息总线进行协作。系统内置四大核心智能体:
| 智能体 | 标识符 | 职责 | 典型任务 |
|---|---|---|---|
| 测量智能体 | surveyor |
原始数据解析与预处理 | 数据导入、坐标转换、观测值提取 |
| 平差智能体 | adjuster |
测量平差与精度评定 | 间接平差、条件平差、精度分析 |
| 监测智能体 | monitor |
变形监测与预警分析 | 时序分析、趋势预测、预警分级 |
| 质检智能体 | inspector |
数据质量检查与合规校验 | 限差检查、粗差探测、规范符合性 |
1.1 智能体生命周期
Section titled “1.1 智能体生命周期”初始化 (init) → 配置加载 (config) → 任务接收 (receive)→ 执行处理 (process) → 结果输出 (output) → 日志归档 (archive)2. 内置智能体配置
Section titled “2. 内置智能体配置”2.1 测量智能体(surveyor)
Section titled “2.1 测量智能体(surveyor)”配置文件路径:.railwise/agents/surveyor.yaml
agent: name: "surveyor" version: "1.2.0" description: "原始测量数据解析与预处理智能体"
# 支持的仪器品牌与型号instruments: leica: models: ["TS16", "TS60", "LS15", "LS10"] formats: ["gsi", "gsi16", "fiducial"] default_encoding: "utf-8" topcon: models: ["GT-1200", "GM-52"] formats: ["topcon-raw", "sdr"] south: models: ["NTS-362R", "NTS-372R"] formats: ["south-raw"] trimble: models: ["S9", "R12"] formats: ["trimble-dc", "rinex"]
# 坐标系统配置coordinate_systems: default: "CGCS2000" supported: - name: "CGCS2000" epsg: 4490 projection: "高斯-克吕格 3度带" - name: "宁波2000" epsg: 4547 local_params: central_meridian: 121.0 false_easting: 500000 false_northing: 0
# 数据预处理规则preprocessing: auto_detect_encoding: true skip_invalid_records: false # 遇到错误记录时:false=报错,true=跳过 fill_missing_station_names: true default_instrument_height: 1.600 # 默认仪器高(米) default_prism_height: 1.500 # 默认棱镜高(米)如需添加地方独立坐标系,请在 local_params 中定义中央子午线、假东、假北等参数。支持七参数和四参数转换。
2.2 平差智能体(adjuster)
Section titled “2.2 平差智能体(adjuster)”配置文件路径:.railwise/agents/adjuster.yaml
agent: name: "adjuster" version: "1.2.0" description: "测量平差与精度评定智能体"
# 平差方法配置adjustment_methods: indirect: name: "间接平差" suitable_for: ["水准网", "导线网", "GPS网"] solver: "最小二乘法" max_iterations: 100 convergence_threshold: 1.0e-6
conditional: name: "条件平差" suitable_for: ["单一水准路线", "闭合导线"] solver: "最小二乘法"
robust: name: "稳健平差" suitable_for: ["含粗差数据"] solver: "Huber法" tuning_constant: 1.345
# 定权方案weight_schemes: by_distance: name: "按距离定权" formula: "P = C / S" # C 为常数,S 为测站距离(km) default_c: 100 by_observations: name: "按测回数定权" formula: "P = n" # n 为测回数 equal: name: "等权" formula: "P = 1"
# 精度评定precision_evaluation: compute_unit_variance: true compute_point_errors: true compute_relative_errors: true confidence_level: 0.95 error_ellipse_scale: 1.0 # 误差椭圆缩放系数2.3 监测智能体(monitor)
Section titled “2.3 监测智能体(monitor)”配置文件路径:.railwise/agents/monitor.yaml
agent: name: "monitor" version: "1.2.0" description: "变形监测与预警分析智能体"
# 监测类型配置monitor_types: settlement: name: "沉降监测" unit: "mm" warning_thresholds: [2, 4, 6] # 黄、橙、红三级预警(mm/次) cumulative_limit: 30 # 累计沉降限值(mm) horizontal: name: "水平位移" unit: "mm" warning_thresholds: [3, 5, 8] convergence: name: "收敛监测" unit: "mm" warning_thresholds: [5, 10, 15] inclinometer: name: "测斜" unit: "mm/m" warning_thresholds: [2, 4, 6]
# 预警方法alert_methods: standard: name: "规范法" description: "依据 GB 50497 / JGJ 8 等规范阈值" statistical: name: "统计法" description: "基于历史数据的 3σ 原则" min_history_points: 10 combined: name: "综合法" description: "规范法与统计法取严格者"
# 时序分析time_series: trend_model: "线性回归" # 可选:线性回归 / 多项式 / 指数平滑 prediction_horizon: 7 # 预测未来 7 期 seasonal_adjustment: false
# 报告输出reporting: include_trend_chart: true include_prediction: true alert_summary_format: "表格+文字"规范法阈值依据 GB 50497-2019 附录取值,但实际工程中需结合地质条件、支护形式、周边环境保护等级综合确定。修改阈值前请咨询项目技术负责人。
2.4 质检智能体(inspector)
Section titled “2.4 质检智能体(inspector)”配置文件路径:.railwise/agents/inspector.yaml
agent: name: "inspector" version: "1.2.0" description: "数据质量检查与合规校验智能体"
# 检查项配置check_items: # 限差检查 tolerance: enabled: true checks: - name: "水准测量限差" standard: "GB 50026-2020" category: "二等水准" items: ["前后视距差", "累积视距差", "红黑面读数差", "高差之差"] - name: "导线测量限差" standard: "GB 50026-2020" category: "一级导线" items: ["测角中误差", "方位角闭合差", "导线全长相对闭合差"]
# 粗差探测 outlier_detection: enabled: true methods: ["Baarda法", "Tau检验"] significance_level: 0.05 min_redundancy: 1
# 规范符合性 compliance: enabled: true standards: ["GB 50026", "GB 50497", "GB 50911", "JGJ 8"] check_items: ["观测频次", "精度等级", "仪器标称精度"]
# 输出配置output: format: "detailed" # detailed / summary / json fail_fast: false # true=发现首个错误即停止 generate_correction_suggestions: true3. 自定义智能体开发
Section titled “3. 自定义智能体开发”3.1 创建自定义智能体
Section titled “3.1 创建自定义智能体”在 .railwise/agents/ 目录下创建新的 YAML 配置文件:
agent: name: "uav-survey" version: "1.0.0" description: "无人机航测数据处理智能体" extends: "surveyor" # 继承内置智能体能力
# 自定义参数capabilities: - "photo_alignment" - "point_cloud_generation" - "dsm_creation" - "orthomosaic_export"
supported_formats: - "exif" - "geotiff" - "las" - "ply"
processing: ground_sample_distance: 0.02 # 地面采样距离(米) overlap_forward: 80 # 航向重叠度(%) overlap_side: 70 # 旁向重叠度(%)3.2 注册与使用
Section titled “3.2 注册与使用”# 注册自定义智能体railwise agent register .railwise/agents/custom-uav.yaml
# 在工作流中引用```yamlsteps: - name: "无人机数据处理" agent: "uav-survey" action: "process" input: "data/uav/flight_001/"4. 智能体间通信与协作
Section titled “4. 智能体间通信与协作”4.1 消息格式
Section titled “4.1 消息格式”智能体通过标准消息格式交换数据:
interface AgentMessage { id: string; // 消息唯一标识 from: string; // 发送方智能体名称 to: string; // 接收方智能体名称("*" 表示广播) type: "data" | "command" | "event" | "error"; payload: unknown; // 消息载荷 timestamp: string; // ISO 8601 时间戳 metadata: { workflowId: string; stepIndex: number; priority: "low" | "normal" | "high" | "critical"; };}4.2 工作流中的数据传递
Section titled “4.2 工作流中的数据传递”steps: - name: "数据导入" agent: "surveyor" action: "import" output_var: "raw_data" # 将结果存入变量
- name: "数据质检" agent: "inspector" action: "check" input_var: "raw_data" # 引用上一步变量 output_var: "check_result"
- name: "条件执行平差" agent: "adjuster" action: "adjust" input_var: "raw_data" condition: "check_result.passed" # 条件执行5. 性能调优
Section titled “5. 性能调优”5.1 并发控制
Section titled “5.1 并发控制”performance: max_concurrent_agents: 4 # 最大并发智能体数 memory_limit_per_agent: "512MB" enable_parallel_processing: true5.2 缓存策略
Section titled “5.2 缓存策略”cache: enabled: true directory: ".railwise/cache" ttl: 86400 # 缓存有效期(秒) max_size: "2GB"6. 相关文档
Section titled “6. 相关文档”- cli-quickstart.md — 快速入门指南
- cli-workflow-orchestration.md — 工作流编排
- cli-data-formats.md — 数据格式支持
- cli-troubleshooting.md — 常见问题排查
