知识库检索节点补齐严格模式、默认回复及节点注册

- KnowledgeRetrievalNodeConfig 新增 is_strict / default_response 字段
- KnowledgeRetrievalNode 检索无结果时,严格模式开启返回默认回复,关闭返回空
- 检索模式优先级修正:节点明确选择覆盖知识库的混合检索配置
- 新增幂等注册 SQL(update 脚本 + 全量初始化),新老环境均可使用
This commit is contained in:
SUNLIZHAO\孙立钊
2026-09-11 19:57:21 +08:00
parent cca3090577
commit 422d935b26
4 changed files with 65 additions and 17 deletions

View File

@@ -3476,6 +3476,7 @@ INSERT INTO `t_workflow_component` VALUES (18, '5cd6ac69bbb411f0bb7840c2ba9a7fbc
INSERT INTO `t_workflow_component` VALUES (19, '5cd6c8eabbb411f0bb7840c2ba9a7fbc', 'Answer', '生成回答', '调用大语言模型回答问题', 0, 1, '2025-11-07 16:32:49', '2025-11-07 16:32:49', 0, '000000');
INSERT INTO `t_workflow_component` VALUES (26, 'bb00fc2f52c74fec82ee3f99725b56bb', 'Switcher', '条件分支', '根据条件执行不同分支', 0, 1, '2025-12-26 16:30:46', '2025-12-26 16:30:46', 0, '000000');
INSERT INTO `t_workflow_component` VALUES (37, 'a7f8c2d44e5b4c83a9d6f103c2b47e18', 'Google', '网络搜索', '调用智谱 Web Search 检索互联网信息', 40, 1, '2026-07-29 20:30:00', '2026-07-29 20:30:00', 0, '000000');
INSERT INTO `t_workflow_component` VALUES (38, 'b8e3c1d55f6a4d92b0e7f214d3c58a29', 'KnowledgeRetrieval', '知识库检索', '从知识库中检索相关内容,支持向量检索和混合检索', 30, 1, '2026-09-11 10:00:00', '2026-09-11 10:00:00', 0, '000000');
-- ----------------------------
-- Table structure for t_workflow_edge

View File

@@ -0,0 +1,24 @@
-- 知识库检索工作流节点注册
-- 为新安装和已有环境提供幂等的节点注册
INSERT INTO `t_workflow_component`
(`uuid`, `name`, `title`, `remark`, `display_order`, `is_enable`,
`create_time`, `update_time`, `is_deleted`, `tenant_id`)
SELECT
'b8e3c1d55f6a4d92b0e7f214d3c58a29',
'KnowledgeRetrieval',
'知识库检索',
'从知识库中检索相关内容,支持向量检索和混合检索',
30,
1,
NOW(),
NOW(),
0,
'000000'
FROM DUAL
WHERE NOT EXISTS (
SELECT 1
FROM `t_workflow_component`
WHERE `name` = 'KnowledgeRetrieval'
AND `tenant_id` = '000000'
);