Position Assistant Three-Layer Model Architecture (Industry → Position → Employee) · 2026-08-10
This article defines the target architecture of the 'Position Assistant' and the core functionalities already implemented, serving as a baseline for alignment in subsequent incremental improvements.
Key Design Points (from product definition):
- Industries are fixed (a predefined set, cannot be arbitrarily added or deleted).
- Positions are configurable (bound to an industry, contain multiple employees, and can be configured with position-level/role-level parameters).
- Employees are generic (a single employee can serve multiple positions; parameters are dynamically adjusted based on Industry + Position).
- Position = Multi-Agent Collaboration: A position can schedule multiple employees to perform tasks in parallel or serially.
- All invocations converge into a dialog interface, with results presented uniformly.
I. Three-Layer Model
┌─────────────────────────────────────────────────────────────┐
│ 行业 industry(死 / 固定) │
│ phos_chem · baijiu · aerospace_machinery · general_machinery │
│ · electronics_manufacturing (来源: industry-profile-loader) │
└───────────────────────────┬─────────────────────────────────┘
│ 行业匹配岗位(industries 字段)
┌───────────────────────────▼─────────────────────────────────┐
│ 岗位 position(可调) │
│ 含多个员工 agents[],每个有 role;可配 params(岗位级默认) │
│ 例: 操作工助手 / 质量管理员助手 / 工艺工程师助手 ... │
└───────────────────────────┬─────────────────────────────────┘
│ 岗位匹配员工 + 调参
┌───────────────────────────▼─────────────────────────────────┐
│ 员工 staff(通用) │
│ 基础 params ⊕ 行业上下文 ⊕ 岗位级 params ⊕ 角色专属 params │
│ → 执行时拿到"适配后参数",无需为每个行业写一份员工 │
└──────────────────────────────────────────────────────────────┘
参数适配合并顺序(后者覆盖前者)
- 员工基础
params(staff 定义里) - 行业上下文
industry(critical_inspect_marks / kb_topics / ncr_root_cause_mapping / spc_rules…) - 岗位级默认
position.params(本岗位全员共享) - 角色专属
agent.params(该员工在此岗位内的覆盖,最高优先级)
合并后同时写入 _industryId / _positionId / _positionRole,worker 可直接读 parameters.industry 聚焦查询。
II. Currently Implemented (Operational, Verified)
1. Core Runtime server/boss-scheduler/position-runtime.js
- listIndustries() — Fixed industry set
- getPositions(industry?) — Filters positions by industry (if industries is not declared = serves all industries, default for gradual migration)
- resolveStaffParams(staffId, {industry, positionId}) — Three-level joint parameter merging
- getOrchestrationPlan(positionId, industry) — Position Collaboration Plan (preview before execution)
- runPosition(positionId, intent, {industry, mode}) — Position Multi-Agent Orchestration (parallel/serial, results uniformly merged)
- runStaffAdaptive(staffId, intent, {industry}) — Directly Call Staff (still parameterized by industry; without industry, only basic parameters = lower accuracy)
- normalizeResult(result) — Unified Result Contract (uniformly rendered by front-end dialog)
2. Industry-Binding Template server/boss-scheduler/profiles/local.yaml
POS-OPERATOR added industries: [phos_chem, baijiu] + position-level params + role-specific params (monitor_target/equip_focus), serving as a template for subsequent positions.
3. HTTP Entry server/routes/digital-staff-routes.js (Mounted in server.js)
- GET /api/digital-staff/industry/list
- GET /api/digital-staff/position/list?industry=
- GET /api/digital-staff/position/:id/plan?industry=
- POST /api/digital-staff/position/:id/run { industry, intent, mode }
- POST /api/digital-staff/staff/:id/adaptive-run { industry, intent }
The route intentionally avoids the single-segment detail path /api/digital-staff/:id to prevent accidental matching as a staff ID.
Validation Results: Three-layer parameter merging is correct (industry context + position-level + role-specific); industry filtering is correct (POS-OPERATOR is not visible in electronics); position orchestration fan-out and merging are correct (verified via mock); real staff DS-SYS-001@phos_chem adaptive execution succeeded; all 5 endpoint routes are correctly dispatched. Regression script: scripts/test-position-runtime.cjs.
III. Unified Result Contract (Frontend Rendering Baseline)
normalizeResult(result) =>
{
type, title, summary,
status: 'ok' | 'partial' | 'error' | 'confirm',
blocks: [...], // 卡片/结构化数据,员工返回 cards/blocks/data 原样承载
staffId?, role?,
raw // 原始结果,便于调试
}
// 岗位编排结果额外包裹:
{ type:'position', positionId, positionName, industry, intent, mode,
agents:[ normalizedResult... ], summary }
四、后续增量(一点一点做)
- [ ] 前端收敛(核心体验):行业选择器 → 岗位卡片 → 对话框;岗位内"一键协同"调用
position/:id/run;所有结果走normalizeResult统一卡片(StaffResultCard已存在,需对接契约)。 - [ ] 岗位行业绑定铺开:其余 9 个岗位补
industries+ 岗位级/角色级params(参照 POS-OPERATOR 模板)。 - [ ] worker 消费行业上下文:让各 worker 真正读取
parameters.industry(如知识检索按kb_topics聚焦、质检按critical_inspect_marks聚焦),使"调参"落到查询而非仅透传。 - [ ] 多智能体协同视图:复用
CollaborationChainGraph.vue在对话框渲染岗位编排的 Agent 链路与各自结论。 - [ ] 精度提示:直接调用(无岗位)vs 经岗位调用,前端标注"本次未带入岗位上下文,结果可能不够精确"。
- [ ] 事件驱动触发(可选):支持"新 NCR 建好 → 自动跑根因分析岗位"等,补上 cron/对话之外的第三类触发。
五、模型回答用户之问
| 用户之问 | 本架构如何回答 |
|---|---|
| Is the design correct? | Yes. The decoupling of industry (fixed) → position (configurable) → staff (generic + parameter tuning) is clear; the position acts as a multi-agent orchestrator. |
| Who are the users? | Business role personnel (access by industry + position) + Enterprise digitalization/IT (configuration & oversight) |
| How is it used? | Select industry → Select position → Dialog-based queries (precise task dispatch by position); or direct queries (staff adaptive execution, slightly lower precision) |
| What goal is achieved? | Upgrades "discovery + reporting" to "precise execution with position-based collaboration and industry context" |
| Does it help the enterprise? | Yes, provided that position-level closed-loop + industry parameter tuning truly reaches worker queries (increment 3). |
BossAgents