feat: 可配置方案引擎通用原型(Mock 检索)

需求未定稿时可先跑通追问/判定/出方案;槽位与判定树外置 YAML,后续可接 Ragflow。

Co-authored-by: haijd <haijd@163.com>
This commit is contained in:
Cursor Agent
2026-09-18 09:12:18 +00:00
co-authored by haijd
parent 93b0867eb3
commit 9c6afcb61a
24 changed files with 978 additions and 24 deletions
+71
View File
@@ -0,0 +1,71 @@
# 判定树:规则按 order 依次匹配,命中第一条即输出推荐
# 条件支持:slot_equals / slot_contains / always
version: 1
rules:
- id: prefer_a_line
order: 10
description: 明确倾向 A 类或传感场景
when_all:
- type: slot_contains
slot: tech_category
value: A
then:
product_bundle: ["XJ-A100", "XJ-A-GW"]
tech_line: A类传感
summary: 按 A 类传感路线匹配主机 + 网关组合,适合监测类诉求。
confidence: 0.82
- id: prefer_b_line
order: 20
description: 明确倾向 B 类或控制/产线
when_all:
- type: slot_contains
slot: tech_category
value: B
then:
product_bundle: ["XJ-B200", "XJ-B-IO"]
tech_line: B类控制
summary: 按 B 类控制路线匹配控制器 + IO 扩展,适合产线联动。
confidence: 0.8
- id: scenario_production
order: 30
description: 未指定大类但场景像产线 → 偏 B
when_all:
- type: slot_contains
slot: scenario
value: 产线
then:
product_bundle: ["XJ-B200", "XJ-B-IO"]
tech_line: B类控制(场景推断)
summary: 根据产线场景初步偏向 B 类控制方案,建议人工确认指标后锁定型号。
confidence: 0.68
- id: scenario_outdoor
order: 40
description: 户外监测 → 偏 A
when_all:
- type: slot_contains
slot: scenario
value: 户外
then:
product_bundle: ["XJ-A100", "XJ-A-GW"]
tech_line: A类传感(场景推断)
summary: 根据户外监测场景初步偏向 A 类传感方案,需确认防护与供电约束。
confidence: 0.66
- id: fallback_uncertain
order: 1000
description: 兜底:信息不足或不确定
when_all:
- type: always
then:
product_bundle: ["待专家确认"]
tech_line: 待判定
summary: 当前信息尚不足以稳定定型,建议补充指标或转人工销售确认。
confidence: 0.4
handoff: true
# 低于该置信度则建议转人工
handoff_confidence_below: 0.55
+31
View File
@@ -0,0 +1,31 @@
# Mock 检索语料:无 Ragflow 时用于演示「带引用的方案」
chunks:
- id: c1
title: XJ-A100 产品要点
product: XJ-A100
content: XJ-A100 适用于户外与环境监测类场景,支持宽温工作,需配合 XJ-A-GW 网关做数据汇聚。
tags: [A, 户外, 传感]
- id: c2
title: XJ-A-GW 网关
product: XJ-A-GW
content: XJ-A-GW 提供多节点接入与协议转换,常与 XJ-A100 组成监测方案。
tags: [A, 网关]
- id: c3
title: XJ-B200 控制主机
product: XJ-B200
content: XJ-B200 面向产线联动与设备控制,支持本地逻辑与扩展 IO。
tags: [B, 产线, 控制]
- id: c4
title: XJ-B-IO 扩展
product: XJ-B-IO
content: XJ-B-IO 用于扩展数字量/模拟量通道,与 XJ-B200 配套。
tags: [B, IO]
- id: c5
title: 方案注意事项
product: GENERAL
content: 正式报价前需确认现场供电、安装空间与是否已有同类设备,避免重复建设。
tags: [通用, 约束]
+36
View File
@@ -0,0 +1,36 @@
# 追问槽位:需求未定稿时可随时增删字段;引擎按 priority 顺序问未填项
version: 1
intent: solution_consult
slots:
- id: tech_category
label: 技术大类倾向
prompt: 目前更倾向哪一类技术路线?也可以说「不确定,希望你们推荐」。(示例:A类传感 / B类控制 / 不确定)
required: true
priority: 10
extract_hint: 用户提到的技术大类或不确定
- id: scenario
label: 应用场景
prompt: 客户主要用在什么场景或工况?(例如产线检测、户外监测、实验室标定等)
required: true
priority: 20
- id: key_metric
label: 关键指标
prompt: 有没有必须满足的关键指标或参数范围?(量程、精度、响应时间等,没有可以说「暂无」)
required: true
priority: 30
- id: constraints
label: 现场约束
prompt: 现场有哪些约束?(空间、已有设备、预算区间、交付区域等,没有可说「暂无」)
required: false
priority: 40
closing_prompt: 信息已较完整,正在为您匹配方案…
handoff_phrases:
- 转人工
- 人工客服
- 找销售
- 真人