BossAgents · GOAI New Intelligent Base Track Technical Architecture Document
Mapping Relationship with AgentTeams
The BossAgents position orchestration system naturally aligns with the AgentTeams layered architecture:
| AgentTeams Level | BossAgents Implementation | Responsibility |
|----------------|----------------|------|
| Manager | lite-scheduler.js + AI Workbench | Task reception, global scheduling, result aggregation |
| Team Leader | 3 Positions (POS-GOAI/POS-PROCURE/POS-INSPECT) | Scenario-based task orchestration, pipeline management |
| Worker | 10 GOAI Agents (Independent Prompt + Independent Toolset + Independent Context) | Executing specific subtasks |
Currently, all 3 positions are based on the AgentTeams sequential orchestration mode (buildChain() in position-runtime.js),
supporting hierarchical scheduling: Manager-level task distribution → Team Leader-level pipeline orchestration → Worker-level step-by-step execution.
System Architecture
┌─────────────────────────────────────────────────────────┐
│ L5 开放层 │
│ API Key鉴权(ba_前缀) · OpenAPI 3.0规范 · 在线调试文档 │
│ 27个API端点 · 71员工逐个可调用 · 双轨制鉴权 │
├─────────────────────────────────────────────────────────┤
│ L4 Interaction Layer │
│ HITS工作台 · AI对话 · 小程序 · 飞书 · 人在回路审核 │
│ 15个岗位均配人类负责人(human字段) │
├─────────────────────────────────────────────────────────┤
│ L3 编排层 │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ POS-GOAI │ │ POS-PROCURE │ │ POS-INSPECT │ │
│ │ 3Agent串行 │ │ 4Agent串行 │ │ 3Agent串行 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ + 12个业务岗位(parallel) + 4个跨岗位编队(TaskForce) │
│ position-runtime.js · CollaborationChain │
│ 事件总线(position-events.js) · SSE实时流 · 触发器热更新 │
├─────────────────────────────────────────────────────────┤
│ L2 能力层 │
│ ┌─────────────────────────────────────────────────┐ │
│ │ 6大原子能力: identify/validate/repair/ │ │
│ │ optimize/compare/generate/ │ │
│ │ create/import/inspect/valuate │ │
│ ├─────────────────────────────────────────────────┤ │
│ │ 71个数字员工 + 2个LLM协同Worker Skill │ │
│ │ goai-agent-worker · procurement-chain-worker │ │
│ ├─────────────────────────────────────────────────┤ │
│ │ Agent Card接入 · trace_span协议 │ │
│ │ dispatch/callback/audit 三接口 │ │
│ └─────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────┤
│ L1 底座层 │
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
│ │ 关系引擎 │ │ 规则引擎 │ │ SCSAI PLM │ │
│ │ 73.9万关系 │ │ 2306条规则 │ │ 13000对象 │ │
│ └────────────┘ └────────────┘ └────────────┘ │
│ ┌────────────┐ ┌────────────┐ │
│ │ MTCLAW │ │ SmartLLM │ │
│ │ 昇腾NPU │ │ Router │ │
│ │ 本地推理 │ │ 降级链 │ │
│ └────────────┘ └────────────┘ │
│ audit-logger · sqlite-compat · open-platform │
└─────────────────────────────────────────────────────────┘
行业×岗位×员工三层正交坐标系
BossAgents 的核心架构创新:行业、岗位、员工三层完全解耦。
| Dimension | Role | Quantity | Variability | Example |
|------|------|------|--------|------|
| Industry | Knowledge Coordinate System | 5 | Fixed Set | Phosphorus Chemical/Liquor/Machinery/General Machinery/Electronics Manufacturing |
| Position | Authority & Responsibility Entity | 15 | Adjustable | POS-OPERATOR(Operator Assistant)/POS-QA(Quality Administrator Assistant) |
| Employee | Capability Atom | 71 | Universal | DS-PROC-001(Procurement Assistant)/DS-PROC-DATA-001(Data Repair Specialist) |
Decoupling Benefits: Cost is N+M+K instead of N×M×K. The same group of 71 employees switches contexts based on the industry knowledge base and changes collaboration modes based on role orchestration. Adding a new industry only requires injecting an industry knowledge base, with no need to hire new employees; adding a new role only requires orchestrating existing employees, with no need to develop new Agents.
Industry Consumption Mechanism: 4 employees actually consume data along the industry dimension (DS-KBPIPE-001 Industry Knowledge Base Pipe Operator, DS-DOC-001 Document Digital Employee, DS-KNOWLEDGE-001 Knowledge Base Assistant, DS-PROC-DATA-001 Process Data Repair Operator), while the remaining employees are triggered based on role orchestration.
Human and Digital Employee Collaboration Mechanism
1. Human-in-Charge for Each Role (Human Layer)
Each role configures a human field to specify the human responsible:
| Role | Human-in-Charge | Employee Count |
|------|-----------|--------|
| POS-OPERATOR Operator Assistant | Operator / Team Leader | 4 |
| POS-QA Quality Administrator Assistant | Quality Administrator / Quality Manager | 5 |
| POS-PROCURE Procurement Specialist Assistant | Procurement Specialist / Procurement Manager | 5 |
| POS-BOSS Boss Assistant | Business Owner / General Manager | 9 |
| ... | ... | ... |
2. Human-in-the-Loop
- Formation Manual Checkpoints: Cross-role formations support requireHumanApproval: true. Execution automatically suspends at manual sign-off nodes, resuming only after human approval via POST /api/digital-staff/taskforce/resume.
- High-Risk Operation Mandatory Confirmation: Operations like procurement exceeding threshold amounts, ECR approval, Part release, etc., enforce human-in-the-loop.
- Real-time event push: Event bus SSE stream (GET /api/digital-staff/event/stream) pushes events in real time, allowing for human intervention at any time.
3. Cross-Role Task Force
Four task forces adopt DAG layering + shared blackboard + dual-layer conflict detection:
| Task Force | Trigger Scenario | DAG Structure |
|------|---------|---------|
| TF-COMPLAINT | Customer complaint | Quality → Production → Procurement → Customer Service |
| TF-LINE-STOP | Production line stoppage | Equipment → Production → Procurement → Scheduling |
| TF-NEW-PRODUCT | New product introduction | Design → Process → Quality → Procurement |
| TF-COST-ALERT | Cost warning | Finance → Procurement → Production → Quality |
Conflict detection: Hard collisions (mutual exclusion of the same resource) + Semantic disagreements (LLM judges contradictory suggestions) → Automatic arbitration or escalation to human.
Open Platform
Dual-track Authentication
| Track | Condition | Behavior |
|---|---|---|
| External API calls | Request carries a ba_ prefix Key | Authentication + Rate limiting + Call auditing |
| Internal frontend calls | No Key | Maintains original logic unchanged, zero frontend modifications |
API Endpoints (27)
| Category | Endpoint Count | Key Interfaces |
|---|---|---|
| Digital Staff | 5 | list/detail/run/logs/recommend |
| Role Collaboration | 4 | position/list/collaboration/rules/chain/trigger |
| Task Force | 4 | taskforce/adhoc/pending/resume/runs |
| Event Bus | 3 | event/triggers/event/event/stream |
| Scheduling | 3 | loops/goals/industry/list |
| Collaboration Loop | 2 | goai-demo/positions/collaboration |
| Agent Card | 3 | agents/dispatch/callback/audit |
| Platform Management | 3 | open/keys/usage/spec |
Online Debugging Documentation
GET /api/open/docs returns a complete Swagger UI-style documentation page, where 71 digital employees can be invoked one by one for testing, and each of the 27 API endpoints includes a "Try it" button.
Core Modules
1. Position Orchestration Engine (position-runtime.js)
- Function: Industry→Position→Employee three-layer model, supporting serial/parallel orchestration
- Serial Mode: Upstream results are automatically passed to downstream Agents via _upstreamResult
- Collaboration Chain: buildChain() generates visual collaboration chain data
- Unified Result Contract: normalizeResult() standardizes output format for all Agents
2. LLM Collaboration Worker
| Worker | File | Purpose |
|--------|------|------|
| goai-agent-worker | workers/goai-agent-worker.js | GOAI scenario + inspection loop, 6 independent systemPrompts |
| procurement-chain-worker | workers/procurement-chain-worker.js | Procurement loop, 4 independent systemPrompts |
Design principles:
- Each Agent has an independent systemPrompt, with completely distinct roles.
- Each Agent has independent context, only viewing structured data passed from upstream.
- Upstream results are passed as structured JSON, not natural language relay.
- LLM returns are forced into JSON format, parsed with extractJson() for error tolerance.
3. Skill Engineering Encapsulation
BossAgents encapsulate key capabilities into two types of reusable Skills:
1. Worker Skill (Internal Skill)
| Skill Name | Worker | Encapsulated Process | Reusable Scenarios |
|-----------|--------|---------|-----------|
| Procurement Closed-loop Skill | procurement-chain-worker | Inquiry→Comparison→Evaluation→Approval | Any role requiring procurement approval |
| GOAI Collaboration Skill | goai-agent-worker | Task decomposition→Procurement collaboration→Equipment collaboration | Any composite instruction scenario |
| Inspection Closed-loop Skill | goai-agent-worker | Inspection→Repair→Re-inspection | Any data quality governance scenario |
2. Agent Card Skill (External Integration Skill)
- Capability tags (capabilities) are declared via Agent Card JSON to enable skill discovery and matching.
- Any third-party Agent can be integrated as a Skill by implementing the dispatch/callback interface.
- Interface protocol: trace_span (refer to Agent Card specification document).
- Skills are reusable across scenarios: The Procurement Closed-loop Skill can be referenced in any role requiring procurement.
3. Audit Engine (audit-logger.js)
- trace_id: A global identifier that persists throughout a collaborative closed-loop process.
- span_index: Identifies the sequence number of each step in the closed loop.
- Fields: timestamp, trace_id, span_index, agent_id, action, detail, metadata
- Query: GET /api/agents/audit/{trace_id} returns the complete span chain.
- AgentLoop Integration: The structured trace_id/span data output by the audit-logger can seamlessly integrate with the AgentLoop observability platform, supporting full-link Trace visualization, Agent performance evaluation, and self-evolution tuning.
4. Agent Interface (goai-demo.js)
| Endpoint | Method | Function |
|---|---|---|
| /api/agents/dispatch | POST | Task dispatch, carrying customer_id + trace_id |
| /api/agents/callback | POST | Result callback, carrying span data |
| /api/agents/audit/{trace_id} | GET | Query the complete audit chain by trace_id |
5. Rule Engine (rule-engine.js)
- 2306 deterministic rules, zero hallucination, zero Token consumption.
- Supports 5 check types: model/instance/relationship/alignment/custom.
- Automatic repair (auto) + Manual repair (manual) grading.
- Collaboration with LLM: Rule engine takes priority, LLM serves as fallback.
- High-risk operations (e.g., purchase approval amount exceeding threshold) require manual confirmation (human-in-the-loop), supporting operation rollback. All rollback operations are also recorded in the audit chain.
6. SmartLLMRouter + MTCLAW
- Unified LLM scheduling entry point, supporting multi-model fallback chain
- Current model: deepseek-v4-flash (sensenova endpoint)
- Timeout 120s, supports transparent transmission of response_format and max_tokens
- MTCLAW scheduling engine: When MTCLAW_ENABLED=true, SmartLLMRouter prioritizes MTCLAW local inference (Ascend NPU accelerated, port 18790), falling back to remote API
- Edge-side privatization: MTCLAW local inference means LLM stays within the enterprise network, meeting manufacturing data security and compliance requirements
- Fallback chain: MTCLAW local → sensenova remote → backup model, automatic seamless switching
Data Scale
| Metric | Value | Source |
|---|---|---|
| Industrial object models | 13,000+ | SCSAI PLM AML knowledge base |
| Native relationships | 739,000 | SCSAI RelationshipType |
| Deterministic rules | 2,306 | rule_engine.db |
| Digital employees | 71 (including 10 GOAI-specific Agents) | digital_staff table |
| Positions | 15 (including 3 GOAI demo positions + 12 business positions) | local.yaml positions |
| Cross-position task forces | 4 (TF-COMPLAINT/TF-LINE-STOP/TF-NEW-PRODUCT/TF-COST-ALERT) | local.yaml task_forces |
| Industry validations | 5 | Phosphate chemical/White spirits/Machinery/General machinery/Electronics manufacturing |
Tech Stack
| Layer | Technology |
|----|------|
| Frontend | Vue 3 + Vite + Pinia |
| Backend | Node.js (Native HTTP) |
| Database | SQLite (better-sqlite3) + SCSAI AML |
| AI | DeepSeek v4 Flash (sensenova) |
| Rule Engine | Self-developed (rule-engine.js) |
| Audit | Self-developed (audit-logger.js + trace_id/span) |
| RAG | SCSAI PLM AML Knowledge Base (13,000+ object models) as RAG knowledge source, automatically retrieved and enhanced during Agent invocation |
| MCP | The system supports connecting external tools via the MCP (Model Context Protocol). Currently, similar tool discovery and invocation capabilities are implemented through Agent Card capabilities.
Open Source Plan
- Open Source License: Apache License 2.0
- Open Source Scope:
- ✅ Agent Card Specification (JSON Schema)
- ✅ trace_span Communication Protocol (dispatch/callback/audit three interfaces)
- ✅ position-runtime.js Position Orchestration Engine
- ✅ audit-logger.js Audit Engine
- Not Open Source: Industrial knowledge graph data (739,000 relationships), rule engine rule base (2,306 rules), business configuration data
- Experience Entry: ylxt.chat offers login-free access to all 71 digital employees
- Long-term Plan: Continuously open more Worker Skill interfaces, supporting community contributions of custom Skills
Deployment
# 启动
node server.js
# 验证
curl https://ylxt.chat/api/health
# 演示
curl https://ylxt.chat/api/goai-demo/positions
curl -X POST https://ylxt.chat/api/goai-demo/collaboration/goai \
-H "Content-Type: application/json" \
-d '{"instruction":"3号泵备件库存不足"}'
BossAgents