MTClaw × BossAgents Digital Employee Integration Verification Report

MTClaw × BossAgents Digital Employee Integration Verification Report

1. Project Overview

1.1 Objective

To complete the full integration verification of the digital employee with MTClaw for the HICOOL Developer Challenge · MTClaw Agent Track, demonstrating that the three scenario processes can be executed end-to-end, thereby qualifying for the semi-finals.

1.2 Three Scenario Definitions

  • Scenario A: MTClaw Scheduling + Ollama On-Device Model (gemma3:4b)
  • Scenario B: MTClaw Scheduling + Cloud Model (deepseek-r1:8b)
  • Scenario D: No MTClaw, BossAgents Direct Execution

1.3 Core Understanding

  • MTClaw is a tool routing agent, not a workflow engine.
  • MTClaw only routes to the worker entry point and does not intervene in the worker's internal execution.
  • BossAgents is responsible for orchestrating multi-step workflows (rule engine + LLM) within the worker.
  • MTClaw's acceleration benefit comes from "extracting high-frequency deterministic operations from the large model chain."

2. Technical Architecture

2.1 Architecture Diagram

用户请求
    ↓
【场景A/B】MTClaw路由层
    ├─ 匹配工具? → 本地执行wrapper → 调用BossAgents API → 返回结果
    └─ 不匹配? → 透传给上游大模型 → 返回结果
    
【场景D】BossAgents直接执行
    └─ 规则引擎判断 → LLM推理 → 返回结果

2.2 关键组件

  1. MTClaw配置:C:\Users\Administrator\.function-router\config.json
  • routing.model: gemma3:4b(调度模型,快速路由)
  • upstream.model: deepseek-r1:8b(上游模型,处理复杂请求)
  1. BossAgents配置:D:\bossagents\server\data\demo\config.json
  • mtclaw.enabled: true
  • mtclaw.base_url: http://127.0.0.1:18790/v1
  1. Wrapper脚本:C:\Users\Administrator\.function-router\scripts\*.js
  • 8个数字员工对应的wrapper脚本
  • 每个wrapper调用BossAgents API并返回结果

三、集成过程

3.1 已解决的问题

#### 问题1:编码问题

Phenomenon: Encoding error when BossAgents passes Chinese text to MTClaw; MTClaw receives garbled characters and cannot understand the intent.

Solution:

headers: { 'Content-Type': 'application/json; charset=utf-8' },
body: new TextEncoder().encode(JSON.stringify({...}))

#### 问题2:Wrapper脚本问题

Phenomenon: The original wrapper script only returned routing decisions without actually calling the BossAgents API.

Solution: Modify the wrapper script to actually call https://ylxt.chat/api/digital-staff/run.

Example:

const result = await makeRequest('https://ylxt.chat/api/digital-staff/run', {
  staff_id: 'procurement_assistant',
  input: input
});

3.2 已完成的工作

  1. ✅ MTClaw编码修复
  • 添加UTF-8编码头
  • 使用TextEncoder确保中文正确传递
  1. ✅ Wrapper脚本创建/Repair(8个数字员工)
  • procurement_assistant.js
  • vendor_manager.js
  • cost_optimizer.js
  • SCSAI_creator.js
  • ecr_reviewer.js
  • data_clerk.js
  • system_health.js
  • content_generator.js
  1. ✅ BossAgents MTClaw配置
  • 启用MTClaw:enabled: true
  • 配置base_url:http://127.0.0.1:18790/v1
  1. ✅ 三场景验证
  • 场景A:MTClaw路由成功,业务执行成功
  • 场景B:MTClaw路由成功,业务执行成功
  • 场景D:BossAgents直接执行成功
  1. ✅ 批量测试脚本
  • mtclaw-benchmark.js
  • mtclaw-three-scenario-benchmark.js
  • mtclaw-quick-benchmark.js
  • verify-three-scenarios.js

四、验证结果

4.1 服务状态

  • BossAgents服务:✅ 正常运行(https://ylxt.chat)
  • MTClaw服务:✅ 正常运行(http://localhost:18790)

4.2 三场景验证结果

测试用例:采购助手(procurement_assistant)

Test Input: Please help me query today's purchase orders.

| Scenario | Status | Duration | Description |

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

| Scenario A | ✅ Success | 15974ms | MTClaw + Ollama On-Device Scheduling |

| Scenario B | ✅ Success | 15572ms | MTClaw + Cloud Scheduling |

| Scenario D | ✅ Success | 6189ms | BossAgents direct execution |

4.3 Performance Analysis

#### Routing Performance

  • gemma3:4b (Scheduling Model): Average routing time 5-70ms
  • deepseek-r1:8b (Upstream Model): Average routing time 300-1300ms

#### Scenario Comparison

  • Scenario D is fastest: No MTClaw routing overhead, direct execution
  • Scenarios A/B are slower: Include MTClaw routing overhead + LLM inference time
  • Acceleration scenario: High-frequency deterministic operations (e.g., system health checks, data queries) can be significantly accelerated via MTClaw local execution

4.4 Key Findings

  1. MTClaw routing itself is fast: 5-70ms
  2. Main time consumption is in LLM inference: 10-15 seconds
  3. Scenario D is suitable for: Complex tasks requiring full workflow orchestration
  4. Scenarios A/B are suitable for: Hybrid scenarios requiring tool routing + workflow orchestration

V. Demo Page

5.1 Access Address

https://ylxt.chat/demo/unified-demo.html

5.2 演示功能

  • 三场景切换(A/B/D)
  • 8个数字员工选择
  • 实时执行结果展示
  • 性能指标对比

六、竞赛材料

6.1 代码仓库

  • BossAgents主仓库:D:\bossagents
  • MTClaw配置:C:\Users\Administrator\.function-router\

6.2 关键文件

  1. 配置文件
  • MTClaw主配置:config.json
  • 工具定义:function-builtin.jsonl
  • BossAgents配置:server/data/demo/config.json
  1. Wrapper脚本(8个)
  • 位于:C:\Users\Administrator\.function-router\scripts\
  1. 测试脚本(4个)
  • 位于:D:\bossagents\scripts\
  1. 演示页面
  • D:\bossagents\public\demo\unified-demo.html

6.3 验证命令

# 启动BossAgents服务
cd D:\bossagents
node server.js

# 启动MTClaw服务
cd C:\Users\Administrator\.function-router
node server.js

# 运行三场景验证
node scripts/verify-three-scenarios.js

# 运行性能测试
node scripts/mtclaw-quick-benchmark.js

七、结论

7.1 完成情况

✅ 三场景验证全部通过

  • Scenario A (MTClaw + Ollama on-device): Success
  • Scenario B (MTClaw + Cloud): Success
  • Scenario D (BossAgents direct execution): Success

7.2 Technical Value

  1. Proves the feasibility of MTClaw × BossAgents integration
  2. Implements a layered architecture of tool routing + workflow orchestration
  3. Provides complete implementation and verification for three scenarios
  4. Qualifies for entry into the next competition round

7.3 Future Optimization Directions

  1. Performance optimization: Optimize LLM inference speed, reduce end-to-end latency
  2. Tool expansion: Add more digital employees and tools
  3. Monitoring & alerting: Add execution monitoring and exception alerts
  4. Documentation improvement: Supplement API documentation and user guides

Report generation time: 2026-07-22

Validation environment: Windows 11, Node.js v18+

Service versions: BossAgents v1.0, MTClaw v1.0

← 返回案例列表

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 →
🤖
🎁