BossAgents × MTClaw Summit Technical Documentation

BossAgents × MTClaw Summit Technical Documentation

1. Architecture Overview

┌─────────────────────────────────────────────────────────────────┐
│                     用户接入层(多端统一)                        │
│   Web浏览器 │ 微信小程序 │ 飞书机器人 │ 开放API                  │
└──────────┬──────────┬──────────┬──────────┬─────────────────────┘
           │          │          │          │
┌──────────▼──────────▼──────────▼──────────▼─────────────────────┐
│                  BossAgents 主服务 (Node.js :3006)               │
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────┐    │
│  │ SmartRouter │  │ BossScheduler│  │  Digital Staff Engine│    │
│  │  (调度中枢) │  │  (任务编排)  │  │   (56个数字员工)    │    │
│  └──────┬──────┘  └──────┬───────┘  └──────────┬──────────┘    │
│         │                │                      │               │
│  ┌──────▼────────────────▼──────────────────────▼──────────┐   │
│  │              MTClaw Function Router (:18790)             │   │
│  │     L1 关键词规则 → L2 端侧推理 → L3 云端兜底          │   │
│  └────────────────────────┬────────────────────────────────┘   │
│                             │                                   │
│  ┌────────────────────────▼────────────────────────────────┐   │
│  │                 LLM Provider 层                          │   │
│  │  Ollama qwen2:7b (端侧) │ SenseNova (云端)             │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘

2. MTClaw 三层路由机制

2.1 路由流程

用户请求 → SmartRouter → MTClaw Function Router
                              │
                    ┌─────────▼─────────┐
                    │  L1: 关键词规则匹配  │
                    │  (12个高频词)       │
                    └────┬────────┬─────┘
                    命中  │        │ 未命中
                    (0 Token)     │
                         │   ┌────▼─────────┐
                         │   │ L2: 端侧推理   │
                         │   │ Ollama本地模型 │
                         │   └────┬────┬────┘
                         │   成功  │    │ 失败
                         │        │ ┌──▼──────────┐
                         │        │ │ L3: 云端兜底  │
                         │        │ │ SenseNova    │
                         │        │ └─────────────┘
                         ▼        ▼
                    返回结果 + 加速证据

2.2 L1 关键词规则(12词)

| 类别 | 关键词 |

|------|--------|

| Chip Design | RTL, Verilog, Synthesis, Lint, Compilation, Simulation |

| Procurement | Sourcing, Price Comparison, Supplier, Quotation |

| Inventory | Stock, Level, Inventory Check |

| General | Query, Report, Weekly Report |

2.3 Acceleration Principle

  • L1 Hit: Zero Token Consumption, Latency
  • L2 Hit: Edge-side Inference, Latency 300-600ms, Low Token Consumption (Local Ollama)
  • L3 Hit: Cloud Fallback, Latency 1200-2000ms, High Token Consumption (SenseNova API)
  • Speedup Ratio: Direct Cloud Connection Latency / MTClaw Routing Latency

2.4 MTClaw Secondary Development Code

Core Modified Files:

  • MTClaw/scripts/ — Custom Routing Scripts
  • server/services/mtclaw-metrics-collector.js — Performance Metrics Collection
  • server/routes/chipwise-routes.js — ChipWise Routing Integration
  • server/services/llm.js — LLM Provider Layer (noFallback/timeout Passthrough)

3. Subagent Design

3.1 Digital Employee Architecture

Digital Staff Engine
├── Handler层 (意图识别 + 参数提取)
│   ├── chipwise-handler.js  — 芯片设计7步流程
│   ├── procurement-handler.js — 采购比价
│   ├── inventory-handler.js  — 库存管理
│   └── doc-handler.js        — 文档生成
├── Worker层 (任务执行)
│   ├── chip-worker.js   — RTLGenerate/编译/综合/仿真
│   ├── proc-worker.js   — 供应商比价
│   └── doc-worker.js    — 文档渲染
└── Profile层 (YAML画像)
    └── profiles/local.yaml — 56个员工定义(唯一真相源)

3.2 ChipWise Engine 8步流程

| 步骤 | 能力 | LLM策略 | 超时 |

|------|------|----------|------|

| ① Toolchain Detection | EDA Health Check | None | 120s |

| ② Specification Identification | identify | Ollama→SenseNova (Speed Priority) | 15s |

| ③ RTL Generation | create | SenseNova (Cloud-Only Strong Model) | 180s |

| ④ EDA Compilation & Verification | compile+lint | None (iverilog+verible) | 120s |

| ⑤ Rule Engine Check | 47 Rules (12 IEEE) | None | 60s |

| ⑥ Relationship Engine Analysis | Module Dependency + Signal Chain | None | 60s |

| ⑦ Simulation Verification | Testbench Execution | None (iverilog+VVP) | 120s |

| ⑧ Timeline Summary | Full Process Traceability | None | 5s |

3.3 Fast/Slow Model Routing

  • identify (fast): Ollama qwen2:7b on-device inference, latency ~500ms
  • create (strong): SenseNova cloud-based large model, latency ~15s, maxTokens 16384
  • No fallback to Ollama for create: On-device 7B model generates insufficient RTL quality

4. EDA Toolchain

| Tool | Version | Installation Method | Purpose |

|------|------|----------|------|

| iverilog | 11.0 | conda (WSL) | Verilog compilation + simulation |

| Yosys | 0.51 | conda (WSL) | RTL synthesis |

| Verible | 2024-06-10 | Pre-compiled (WSL) | Verilog Lint |

| riscv-gcc | 16.1.0 | conda (WSL) | RISC-V cross-compilation |

Execution method: Node.js → execSync('wsl ...') → wsl-eda.sh wrapper → conda environment

5. Latency and Performance Evaluation Data

5.1 MTClaw Routing Latency (Measured on 2026-08-02)

| Routing Layer | Average Latency | Token Consumption | Hit Rate (Measured 50 times) |

|--------|----------|-----------|-----------------|

| L1 Rule | ~11ms | 0 | 30.0% (15/50) |

| L2 On-device | ~450ms | ~100 | 46.0% (23/50) |

| L3 Cloud | ~1700ms | ~600 | 24.0% (12/50) |

| Direct Cloud Connection | ~2060ms | ~800 | — |

Measured data source: /api/mtclaw-metrics endpoint, statistics from 50 requests

  • L1 vs L3 Speedup Ratio: 187x (11ms vs 2060ms)
  • Token Savings: 80% (MTClaw 10875 vs Direct Cloud Connection 54184)
  • Routing Success Rate: 98% (49/50)

5.2 ChipWise End-to-End Latency

StepLatencyDescription
② Identification~2sOllama On-Device Inference
③ Generation~20sSenseNova 8-Module RTL
④ Compilation~5siverilog WSL
④ Lint~3sVerible WSL
⑤ Rules~1sLocal Execution of 47 Rules
⑥ Relationships~1sLocal Construction of Module Dependency Graph
⑦ Simulation~8siverilog+VVP WSL
Total~40sEnd-to-End

5.3 Speedup Ratio Calculation (Based on Measured Data)

  • MTClaw Weighted Average Latency: 0.30×11 + 0.46×450 + 0.24×1700 = 627ms
  • Direct Cloud Connection Latency: 2060ms
  • Overall Speedup Ratio: 3.3x
  • L1 vs. Cloud Direct Connection Acceleration Ratio: 187x (Zero Token Consumption)
  • Token Saving Rate: 80%

6. Open Source Benchmark

Based on the MTClaw standard benchmark test set:

  • Routing Accuracy: >95% (L1+L2+L3 Three-layer Coverage)
  • On-device Inference Availability: >98% (Ollama Local Service)
  • Cloud Fallback Success Rate: 100% (SenseNova API)

7. Development Issues and Solutions

#IssueRoot CauseSolution
1Server Crash (>2min Response)10.7 Million Audit LogsCleanup + VACUUM + 3-day Retention Period
2ChipWise API Timeoutawait in Non-async FunctionChange to async Function
3LLM Call Chain Dead LinkGlobal _selected Pointing to 429 cloudbaseChipWise Independent Priority
4Ollama Fixed 60s Timeout TruncationcallLLM Not Passing Through timeoutDestructure options to Extract timeout and Pass to _callModel
5WSL exec not respondingNode.js exec/execFile exception with wsl.exeSwitch to execSync
6LLM-generated RTL missing riscv_topPrompt does not enforce top-level moduleAdd rules 13+14
7wire vs reg compilation errorLLM does not distinguish Verilog signal typesPrompt rules 11/12 + repair rule 5
8CORS cross-origin issueMTClaw(:18790) has no CORSBossAgents backend proxy
9DeadlockBackend synchronous call to MTClaw → MTClaw callback to BossAgentsAsynchronous call + timeout protection
10DeepSeek 402 insufficient balanceAPI account overdrawnSwitch to SenseNova as primary cloud service
11L1 routing script execution KeyError('name')STATE.tools whitelist check uses t["name"] instead of t["function"]["name"]Fix to t.get("function",{}).get("name","")
12L2 routing execute_tool lacks exception handlingQwen selects tool, script execution throws exception → 500Add try/except to return error JSON
13SmartRouter ping detection triggers L2 routing"ping" message goes through Qwen tool selection → 5 rounds of failureSwitch to lightweight GET detection via /v1/models

8. Demo Entry

  • Chipwise Engine Demo: https://ylxt.chat/chipwise-demo
  • MTClaw Performance Dashboard: https://ylxt.chat/mtclaw-dashboard
  • API Endpoint: https://ylxt.chat/api/mtclaw-metrics

9. Startup Sequence

# 1. 启动WSL (EDA工具链)
wsl -d Ubuntu-22.04 -- echo "WSL OK"

# 2. 确认Ollama运行
ollama list  # 应显示 qwen2:7b

# 3. 启动BossAgents
node server.js

# 4. 访问演示
# 浏览器打开 https://ylxt.chat/chipwise-demo
← 返回案例列表

Try 左帮右臂 Industrial Agent — your digital workforce

Available as a WeChat mini program, web app (ylxt.chat) and desktop client. Start from whichever fits your workflow.

🌐 Web App 💻 Desktop Download 📞 Call 189-8606-6876
WeChat mini program QR
Scan for the WeChat mini program
Share:
🤖 Try Now →
🤖
🎁