The data returned by the external knowledge interface is inconsistent with the output of the knowledge retrieval node. #21818

Open
opened 2026-02-21 20:14:27 -05:00 by yindo · 7 comments
Owner

Originally created by @SuperZhanggy on GitHub (Jan 21, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When retrieving an external knowledge base in the workflow, the number of slices returned by the external knowledge base interface is inconsistent with the number of slices output by the knowledge retrieval node.

The following is the data printed from the external interface logs.
{'records': [{'content': '1.2登录\n用户使用有效的手机钉钉账号扫码或者有效的用户名、密码,通过浏览器界面登录 Futai系统,进而进入到在 Futail系统中,点击选择【磐石 OMS】图标,即 Omni channel e-commerce center,中文全称:百秋 OMS订单管理系统,以下简称:OMS系统。\n打开浏览器(建议 Chrome浏览器),在地址栏输入线上环境 Futail登录地址:https://futail.ibaiqiu.com/systemList,分以下两种情况进入系统。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.8177475333213806, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.2非百秋员工登录(品牌或其他)\n需使用授权后的账号和密码才能进行登录,在登录页输入正确的账号、密码之后,即可进入到系统选择页面,点击选择【磐石 OMS】图标,即可进入品牌选择列表页,图示步骤如下:\nSign in2U Llsemame or F-mai Password Log in Log in with Dingtalk其他登装:Azure ADH图一:账号密码登录页面\n@m IM B智美BiS磐石规QMS连城 Futail HSB赢客OCRM+小精灵AOP容容云ACMI etp Center百应Oshop托马斯洞见 TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]4\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]5\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=fgLgWIP4UjlcktfdZygWlfcDnq4%3D&x-oss-process=image%2Fcrop%2Cx_253%2Cy_491%2Cw_926%2Ch_467\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=WSJj%2BcmG1uyPknji0mQaEkJopqw%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_1061%2Cw_942%2Ch_464\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/16.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=Y0IWo4vSKJVqJd6qAJocTnjxMu0%3D&x-oss-process=image%2Fcrop%2Cx_245%2Cy_164%2Cw_957%2Ch_322', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7834197878837585, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.1百秋员工登录\n若为百秋员工且被授权可以登录 OMS系统,则直接使用钉钉扫码后即可进入到系统选择页面,点击选择【磐石OMS】图标进入品牌选择列表页,图示步骤如下:\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]2\nSign in口Z 请使用钉钉扫描二维码登录◎刷新Log in with username or e-mail / passworc其他登录:Azure AD安图一:扫码登录页面\n@ HEART Q IMC Bil智美BiS磐石3QMS车城 Futail HSB赢客0CRM+小精灵AOP容容云ACMI etp Center百应Qshop托马斯洞见TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]3\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=eDFUMcKk%2B%2B86gHws4o86XO9wOaQ%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_160%2Cw_943%2Ch_492\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=xtDtQTTFoKtoeHx%2FltOmEAf%2FqC8%3D&x-oss-process=image%2Fcrop%2Cx_250%2Cy_755%2Cw_947%2Ch_459\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=qyAokl8HM2%2BJjuZLWNgeojbFLyI%3D&x-oss-process=image%2Fcrop%2Cx_246%2Cy_1302%2Cw_958%2Ch_324', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7226385474205017, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '场景简介:\n本场景聚焦门店发货订单从 “待配货”到 “已发货”的订单流程,适用于门店店员、运营人员等角色跟进物流配送类订单的接单与发货全流程,清晰掌握订单在不同节点的状态变化。\n详细介绍如下:\n消费者前端下单后,订单信息将自动同步至 OMS 系统,经系统完成发货主体匹配、合规校验与相关通知后,流转至对应门店的专属操作端口并更新状态,同时触发门店端提醒。\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]97\n门店相关人员登录端口后,可查询订单并完成库存核对与确认,补充必要物流相关信息后提交系统,通过后更新订单进度,并将状态及物流动态同步至前端平台,方便消费者实时追踪订单进展。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7113171219825745, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}]}

The following is the data output by the workflow knowledge retrieval node.
{
"result": [
{
"content": "1.2.1百秋员工登录\n若为百秋员工且被授权可以登录 OMS系统,则直接使用钉钉扫码后即可进入到系统选择页面,点击选���【磐石OMS】图标进入品牌选择列表页,图示步骤如下:\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]2\nSign in口Z 请使用钉钉扫描二维码登录◎刷新Log in with username or e-mail / passworc其他登录:Azure AD安图一:扫码登录页面\n@ HEART Q IMC Bil智美BiS磐石3QMS车城 Futail HSB赢客0CRM+小精灵AOP容容云ACMI etp Center百应Qshop托马斯洞见TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]3\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=eDFUMcKk%2B%2B86gHws4o86XO9wOaQ%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_160%2Cw_943%2Ch_492\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=xtDtQTTFoKtoeHx%2FltOmEAf%2FqC8%3D&x-oss-process=image%2Fcrop%2Cx_250%2Cy_755%2Cw_947%2Ch_459\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=qyAokl8HM2%2BJjuZLWNgeojbFLyI%3D&x-oss-process=image%2Fcrop%2Cx_246%2Cy_1302%2Cw_958%2Ch_324",
"metadata": {
"_source": "knowledge",
"data_source_type": "external",
"dataset_id": "0e32af18-f40c-48e0-b73a-a1f77f2160af",
"dataset_name": "OMS-百炼知识库",
"doc_metadata": {
"dataset_id": "0e32af18-f40c-48e0-b73a-a1f77f2160af",
"dataset_name": "OMS-百炼知识库",
"doc_id": "file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393",
"score": 0.80322265625,
"title": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx"
},
"document_id": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx",
"document_name": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx",
"position": 1,
"retriever_from": "workflow",
"score": 0.80322265625
},
"title": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx"
}
]
}

✔️ Expected Behavior

Does the knowledge retrieval node have a filtering mechanism that filters out the sliced ​​data returned by the external interface, or is there a bug here? I would appreciate your help in troubleshooting.

Actual Behavior

No response

Originally created by @SuperZhanggy on GitHub (Jan 21, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When retrieving an external knowledge base in the workflow, the number of slices returned by the external knowledge base interface is inconsistent with the number of slices output by the knowledge retrieval node. The following is the data printed from the external interface logs. {'records': [{'content': '1.2登录\n用户使用有效的手机钉钉账号扫码或者有效的用户名、密码,通过浏览器界面登录 Futai系统,进而进入到在 Futail系统中,点击选择【磐石 OMS】图标,即 Omni channel e-commerce center,中文全称:百秋 OMS订单管理系统,以下简称:OMS系统。\n打开浏览器(建议 Chrome浏览器),在地址栏输入线上环境 Futail登录地址:https://futail.ibaiqiu.com/systemList,分以下两种情况进入系统。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.8177475333213806, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.2非百秋员工登录(品牌或其他)\n需使用授权后的账号和密码才能进行登录,在登录页输入正确的账号、密码之后,即可进入到系统选择页面,点击选择【磐石 OMS】图标,即可进入品牌选择列表页,图示步骤如下:\nSign in2U Llsemame or F-mai Password Log in Log in with Dingtalk其他登装:Azure ADH图一:账号密码登录页面\n@m IM B智美BiS磐石规QMS连城 Futail HSB赢客OCRM+小精灵AOP容容云ACMI etp Center百应Oshop托马斯洞见 TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]4\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]5\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=fgLgWIP4UjlcktfdZygWlfcDnq4%3D&x-oss-process=image%2Fcrop%2Cx_253%2Cy_491%2Cw_926%2Ch_467\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=WSJj%2BcmG1uyPknji0mQaEkJopqw%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_1061%2Cw_942%2Ch_464\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/16.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=Y0IWo4vSKJVqJd6qAJocTnjxMu0%3D&x-oss-process=image%2Fcrop%2Cx_245%2Cy_164%2Cw_957%2Ch_322', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7834197878837585, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.1百秋员工登录\n若为百秋员工且被授权可以登录 OMS系统,则直接使用钉钉扫码后即可进入到系统选择页面,点击选择【磐石OMS】图标进入品牌选择列表页,图示步骤如下:\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]2\nSign in口Z 请使用钉钉扫描二维码登录◎刷新Log in with username or e-mail / passworc其他登录:Azure AD安图一:扫码登录页面\n@ HEART Q IMC Bil智美BiS磐石3QMS车城 Futail HSB赢客0CRM+小精灵AOP容容云ACMI etp Center百应Qshop托马斯洞见TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]3\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=eDFUMcKk%2B%2B86gHws4o86XO9wOaQ%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_160%2Cw_943%2Ch_492\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=xtDtQTTFoKtoeHx%2FltOmEAf%2FqC8%3D&x-oss-process=image%2Fcrop%2Cx_250%2Cy_755%2Cw_947%2Ch_459\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=qyAokl8HM2%2BJjuZLWNgeojbFLyI%3D&x-oss-process=image%2Fcrop%2Cx_246%2Cy_1302%2Cw_958%2Ch_324', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7226385474205017, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '场景简介:\n本场景聚焦门店发货订单从 “待配货”到 “已发货”的订单流程,适用于门店店员、运营人员等角色跟进物流配送类订单的接单与发货全流程,清晰掌握订单在不同节点的状态变化。\n详细介绍如下:\n消费者前端下单后,订单信息将自动同步至 OMS 系统,经系统完成发货主体匹配、合规校验与相关通知后,流转至对应门店的专属操作端口并更新状态,同时触发门店端提醒。\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]97\n门店相关人员登录端口后,可查询订单并完成库存核对与确认,补充必要物流相关信息后提交系统,通过后更新订单进度,并将状态及物流动态同步至前端平台,方便消费者实时追踪订单进展。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7113171219825745, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}]} The following is the data output by the workflow knowledge retrieval node. { "result": [ { "content": "1.2.1百秋员工登录\n若为百秋员工且被授权可以登录 OMS系统,则直接使用钉钉扫码后即可进入到系统选择页面,点击选���【磐石OMS】图标进入品牌选择列表页,图示步骤如下:\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]2\nSign in口Z 请使用钉钉扫描二维码登录◎刷新Log in with username or e-mail / passworc其他登录:Azure AD安图一:扫码登录页面\n@ HEART Q IMC Bil智美BiS磐石3QMS车城 Futail HSB赢客0CRM+小精灵AOP容容云ACMI etp Center百应Qshop托马斯洞见TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]3\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=eDFUMcKk%2B%2B86gHws4o86XO9wOaQ%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_160%2Cw_943%2Ch_492\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=xtDtQTTFoKtoeHx%2FltOmEAf%2FqC8%3D&x-oss-process=image%2Fcrop%2Cx_250%2Cy_755%2Cw_947%2Ch_459\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769608533&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=qyAokl8HM2%2BJjuZLWNgeojbFLyI%3D&x-oss-process=image%2Fcrop%2Cx_246%2Cy_1302%2Cw_958%2Ch_324", "metadata": { "_source": "knowledge", "data_source_type": "external", "dataset_id": "0e32af18-f40c-48e0-b73a-a1f77f2160af", "dataset_name": "OMS-百炼知识库", "doc_metadata": { "dataset_id": "0e32af18-f40c-48e0-b73a-a1f77f2160af", "dataset_name": "OMS-百炼知识库", "doc_id": "file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393", "score": 0.80322265625, "title": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx" }, "document_id": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx", "document_name": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx", "position": 1, "retriever_from": "workflow", "score": 0.80322265625 }, "title": "上海百秋OMS订单管理系统产品使用说明书V1.0.docx" } ] } ### ✔️ Expected Behavior Does the knowledge retrieval node have a filtering mechanism that filters out the sliced ​​data returned by the external interface, or is there a bug here? I would appreciate your help in troubleshooting. ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 20:14:27 -05:00
Author
Owner

@SuperZhanggy commented on GitHub (Jan 21, 2026):

外部接口这边打印出来的日志显示有4条,查看知识检索节运行日志的输出却只有1条,请帮忙查看是什么原因

@SuperZhanggy commented on GitHub (Jan 21, 2026): 外部接口这边打印出来的日志显示有4条,查看知识检索节运行日志的输出却只有1条,请帮忙查看是什么原因
Author
Owner

@dosubot[bot] commented on GitHub (Jan 21, 2026):

出现这种情况,最常见的原因是知识检索节点有一套过滤和限制机制,会导致输出的条数少于外部接口返回的条数。主要包括:

  • top_k 参数:节点会根据配置(默认是 4,可以在知识库设置里调整)限制最多返回多少条。如果 top_k 设置为 1,无论外部接口返回多少条,最终只会输出 1 条 参考1
  • score_threshold:如果启用了分数阈值,低于阈值的内容会被过滤掉 参考2
  • 元数据过滤:如果配置了自动或手动元数据过滤条件,也可能导致部分内容被过滤 参考3

对于外部知识库,top_k 和 score_threshold 这些参数需要在知识库设置页面配置,工作流节点里的设置不会覆盖实际检索参数 参考4。如果知识库本身 top_k 配置为 1,即使外部接口返回 4 条,最终也只会输出 1 条。

建议你检查下知识库的 top_k、score_threshold 和元数据过滤配置,确保这些参数和你期望一致。如果参数已经对齐但问题依旧,可以开启 debug 日志,查看知识检索节点实际收到和输出的数据,进一步定位问题。

常见排查 checklist:

  1. 检查知识库设置里的 top_k 是否为 1。
  2. 检查是否启用了分数阈值过滤(score_threshold)。
  3. 检查是否有元数据过滤条件被启用。
  4. 确认外部接口和知识检索节点的参数设置一致。

只要参数一致,最终输出的条数就会和外部接口返回一致。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 21, 2026): <!-- Answer --> 出现这种情况,最常见的原因是知识检索节点有一套过滤和限制机制,会导致输出的条数少于外部接口返回的条数。主要包括: - top_k 参数:节点会根据配置(默认是 4,可以在知识库设置里调整)限制最多返回多少条。如果 top_k 设置为 1,无论外部接口返回多少条,最终只会输出 1 条 [参考1](https://github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py#L76-L533)。 - score_threshold:如果启用了分数阈值,低于阈值的内容会被过滤掉 [参考2](https://github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/rag/retrieval/dataset_retrieval.py#L68-L1120)。 - 元数据过滤:如果配置了自动或手动元数据过滤条件,也可能导致部分内容被过滤 [参考3](https://github.com/langgenius/dify/issues/22500#issuecomment-3204409382)。 对于外部知识库,top_k 和 score_threshold 这些参数需要在知识库设置页面配置,工作流节点里的设置不会覆盖实际检索参数 [参考4](https://github.com/langgenius/dify/issues/25439#issuecomment-3270130180)。如果知识库本身 top_k 配置为 1,即使外部接口返回 4 条,最终也只会输出 1 条。 建议你检查下知识库的 top_k、score_threshold 和元数据过滤配置,确保这些参数和你期望一致。如果参数已经对齐但问题依旧,可以开启 debug 日志,查看知识检索节点实际收到和输出的数据,进一步定位问题。 常见排查 checklist: 1. 检查知识库设置里的 top_k 是否为 1。 2. 检查是否启用了分数阈值过滤(score_threshold)。 3. 检查是否有元数据过滤条件被启用。 4. 确认外部接口和知识检索节点的参数设置一致。 只要参数一致,最终输出的条数就会和外部接口返回一致。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ba7fbc4e-f3f8-445b-ab54-3b3ed76bf483?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ba7fbc4e-f3f8-445b-ab54-3b3ed76bf483?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ba7fbc4e-f3f8-445b-ab54-3b3ed76bf483?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ba7fbc4e-f3f8-445b-ab54-3b3ed76bf483?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ba7fbc4e-f3f8-445b-ab54-3b3ed76bf483?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ba7fbc4e-f3f8-445b-ab54-3b3ed76bf483?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ba7fbc4e-f3f8-445b-ab54-3b3ed76bf483?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=%E5%87%BA%E7%8E%B0%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%EF%BC%8C%E6%9C%80%E5%B8%B8%E8%A7%81%E7%9A%84%E5%8E%9F%E5%9B%A0%E6%98%AF%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E6%9C%89%E4%B8%80%E5%A5%97%E8%BF%87%E6%BB%A4%E5%92%8C%E9%99%90%E5%88%B6%E6%9C%BA%E5%88%B6%EF%BC%8C%E4%BC%9A%E5%AF%BC%E8%87%B4%E8%BE%93%E5%87%BA%E7%9A%84%E6%9D%A1%E6%95%B0%E5%B0%91%E4%BA%8E%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E7%9A%84%E6%9D%A1%E6%95%B0%E3%80%82%E4%B8%BB%E8%A6%81%E5%8C%85%E6%8B%AC%EF%BC%9A%0A%0A-%20top_k%20%E5%8F%82%E6%95%B0%EF%BC%9A%E8%8A%82%E7%82%B9%E4%BC%9A%E6%A0%B9%E6%8D%AE%E9%85%8D%E7%BD%AE%EF%BC%88%E9%BB%98%E8%AE%A4%E6%98%AF%204%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E7%9F%A5%E8%AF%86%E5%BA%93%E8%AE%BE%E7%BD%AE%E9%87%8C%E8%B0%83%E6%95%B4%EF%BC%89%E9%99%90%E5%88%B6%E6%9C%80%E5%A4%9A%E8%BF%94%E5%9B%9E%E5%A4%9A%E5%B0%91%E6%9D%A1%E3%80%82%E5%A6%82%E6%9E%9C%20top_k%20%E8%AE%BE%E7%BD%AE%E4%B8%BA%201%EF%BC%8C%E6%97%A0%E8%AE%BA%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%A4%9A%E5%B0%91%E6%9D%A1%EF%BC%8C%E6%9C%80%E7%BB%88%E5%8F%AA%E4%BC%9A%E8%BE%93%E5%87%BA%201%20%E6%9D%A1%20%5B%E5%8F%82%E8%80%831%5D%28https%3A//github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py%23L76-L533%29%E3%80%82%0A-%20score_threshold%EF%BC%9A%E5%A6%82%E6%9E%9C%E5%90%AF%E7%94%A8%E4%BA%86%E5%88%86%E6%95%B0%E9%98%88%E5%80%BC%EF%BC%8C%E4%BD%8E%E4%BA%8E%E9%98%88%E5%80%BC%E7%9A%84%E5%86%85%E5%AE%B9%E4%BC%9A%E8%A2%AB%E8%BF%87%E6%BB%A4%E6%8E%89%20%5B%E5%8F%82%E8%80%832%5D%28https%3A//github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/rag/retrieval/dataset_retrieval.py%23L68-L1120%29%E3%80%82%0A-%20%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%EF%BC%9A%E5%A6%82%E6%9E%9C%E9%85%8D%E7%BD%AE%E4%BA%86%E8%87%AA%E5%8A%A8%E6%88%96%E6%89%8B%E5%8A%A8%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6%EF%BC%8C%E4%B9%9F%E5%8F%AF%E8%83%BD%E5%AF%BC%E8%87%B4%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9%E8%A2%AB%E8%BF%87%E6%BB%A4%20%5B%E5%8F%82%E8%80%833%5D%28https%3A//github.com/langgenius/dify/issues/22500%23issuecomment-3204409382%29%E3%80%82%0A%0A%E5%AF%B9%E4%BA%8E%E5%A4%96%E9%83%A8%E7%9F%A5%E8%AF%86%E5%BA%93%EF%BC%8Ctop_k%20%E5%92%8C%20score_threshold%20%E8%BF%99%E4%BA%9B%E5%8F%82%E6%95%B0%E9%9C%80%E8%A6%81%E5%9C%A8%E7%9F%A5%E8%AF%86%E5%BA%93%E8%AE%BE%E7%BD%AE%E9%A1%B5%E9%9D%A2%E9%85%8D%E7%BD%AE%EF%BC%8C%E5%B7%A5%E4%BD%9C%E6%B5%81%E8%8A%82%E7%82%B9%E9%87%8C%E7%9A%84%E8%AE%BE%E7%BD%AE%E4%B8%8D%E4%BC%9A%E8%A6%86%E7%9B%96%E5%AE%9E%E9%99%85%E6%A3%80%E7%B4%A2%E5%8F%82%E6%95%B0%20%5B%E5%8F%82%E8%80%834%5D%28https%3A//github.com/langgenius/dify/issues/25439%23issuecomment-3270130180%29%E3%80%82%E5%A6%82%E6%9E%9C%E7%9F%A5%E8%AF%86%E5%BA%93%E6%9C%AC%E8%BA%AB%20top_k%20%E9%85%8D%E7%BD%AE%E4%B8%BA%201%EF%BC%8C%E5%8D%B3%E4%BD%BF%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%204%20%E6%9D%A1%EF%BC%8C%E6%9C%80%E7%BB%88%E4%B9%9F%E5%8F%AA%E4%BC%9A%E8%BE%93%E5%87%BA%201%20%E6%9D%A1%E3%80%82%0A%0A%E5%BB%BA%E8%AE%AE%E4%BD%A0%E6%A3%80%E6%9F%A5%E4%B8%8B%E7%9F%A5%E8%AF%86%E5%BA%93%E7%9A%84%20top_k%E3%80%81score_threshold%20%E5%92%8C%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE%EF%BC%8C%E7%A1%AE%E4%BF%9D%E8%BF%99%E4%BA%9B%E5%8F%82%E6%95%B0%E5%92%8C%E4%BD%A0%E6%9C%9F%E6%9C%9B%E4%B8%80%E8%87%B4%E3%80%82%E5%A6%82%E6%9E%9C%E5%8F%82%E6%95%B0%E5%B7%B2%E7%BB%8F%E5%AF%B9%E9%BD%90%E4%BD%86%E9%97%AE%E9%A2%98%E4%BE%9D%E6%97%A7%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%BC%80%E5%90%AF%20debug%20%E6%97%A5%E5%BF%97%EF%BC%8C%E6%9F%A5%E7%9C%8B%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E5%AE%9E%E9%99%85%E6%94%B6%E5%88%B0%E5%92%8C%E8%BE%93%E5%87%BA%E7%9A%84%E6%95%B0%E6%8D%AE%EF%BC%8C%E8%BF%9B%E4%B8%80%E6%AD%A5%E5%AE%9A%E4%BD%8D%E9%97%AE%E9%A2%98%E3%80%82%0A%0A%E5%B8%B8%E8%A7%81%E6%8E%92%E6%9F%A5%20checklist%EF%BC%9A%0A1.%20%E6%A3%80%E6%9F%A5%E7%9F%A5%E8%AF%86%E5%BA%93%E8%AE%BE%E7%BD%AE%E9%87%8C%E7%9A%84%20top_k%20%E6%98%AF%E5%90%A6%E4%B8%BA%201%E3%80%82%0A2.%20%E6%A3%80%E6%9F%A5%E6%98%AF%E5%90%A6%E5%90%AF%E7%94%A8%E4%BA%86%E5%88%86%E6%95%B0%E9%98%88%E5%80%BC%E8%BF%87%E6%BB%A4%EF%BC%88score_threshold%EF%BC%89%E3%80%82%0A3.%20%E6%A3%80%E6%9F%A5%E6%98%AF%E5%90%A6%E6%9C%89%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6%E8%A2%AB%E5%90%AF%E7%94%A8%E3%80%82%0A4.%20%E7%A1%AE%E8%AE%A4%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E5%92%8C%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E7%9A%84%E5%8F%82%E6%95%B0%E8%AE%BE%E7%BD%AE%E4%B8%80%E8%87%B4%E3%80%82%0A%0A%E5%8F%AA%E8%A6%81%E5%8F%82%E6%95%B0%E4%B8%80%E8%87%B4%EF%BC%8C%E6%9C%80%E7%BB%88%E8%BE%93%E5%87%BA%E7%9A%84%E6%9D%A1%E6%95%B0%E5%B0%B1%E4%BC%9A%E5%92%8C%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E4%B8%80%E8%87%B4%E3%80%82)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31362)
Author
Owner

@SuperZhanggy commented on GitHub (Jan 21, 2026):

我确定知识检索节点 top_k 设的4 分数0.3,工作流这边调试,外部知识库接口打印的如下top_k 也确实是4,返回的结果也是4条,但是dify的对话日志=>追踪=>知识检索=>输出 中看到的只有1条

Image Image
@SuperZhanggy commented on GitHub (Jan 21, 2026): 我确定知识检索节点 top_k 设的4 分数0.3,工作流这边调试,外部知识库接口打印的如下top_k 也确实是4,返回的结果也是4条,但是dify的对话日志=>追踪=>知识检索=>输出 中看到的只有1条 <img width="505" height="706" alt="Image" src="https://github.com/user-attachments/assets/4b7becaa-04f4-4592-8bb6-d08b5aa134c9" /> <img width="1611" height="484" alt="Image" src="https://github.com/user-attachments/assets/d62432f3-d704-4efe-b682-e33c56ce93c3" />
Author
Owner

@dosubot[bot] commented on GitHub (Jan 21, 2026):

你遇到的“外部接口返回4条但知识检索节点只输出1条”现象,绝大多数情况下是由元数据过滤分数阈值rerank配置等机制导致的。根据 Dify 的实现,知识检索节点会在输出前依次应用:元数据过滤(自动/手动)、分数阈值过滤、rerank(重排序)、top_k 截断等逻辑。只要有一个环节过滤掉了部分内容,最终输出就会少于外部接口返回的条数代码参考

你的配置已经明确 top_k=4,score_threshold=0.3,且外部接口返回的4条分数都满足条件,说明问题很可能出在元数据过滤rerank环节:

  1. 元数据过滤:请检查知识检索节点和知识库的“元数据过滤模式”是否为“自动”或“手动”,以及具体的过滤条件。只要有条件不匹配,结果就会被过滤掉代码细节
  2. rerank模型:rerank 只会影响排序和分数,但不会强制只输出1条,除非top_k=1或过滤后只剩1条rerank实现
  3. 分数阈值:你已设为0.3,确认外部接口返回的4条分数都大于0.3即可排除这个因素。
  4. 去重:对于 external provider(外部知识库),不会做 doc_id 去重,但如果是 dify provider 会按 doc_id 去重。

排查建议:

  • 检查知识检索节点和知识库的“元数据过滤”设置,建议先设为“禁用”再测试。
  • 检查外部接口返回的每条数据的 metadata 字段,确认没有被过滤条件误伤。
  • 临时关闭 rerank,观察输出条数是否恢复为4条,以排除 rerank 相关 bug。
  • 开启 debug 日志,观察知识检索节点实际收到和输出的数据,定位是哪个环节过滤了结果。

只要所有过滤条件都关闭,top_k=4,score_threshold=0.3,外部接口返回4条,理论上输出也应为4条。如果还有问题,可以贴下 workflow 节点的详细配置和外部接口返回的完整数据结构,便于进一步定位相关讨论

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 21, 2026): <!-- Answer --> 你遇到的“外部接口返回4条但知识检索节点只输出1条”现象,绝大多数情况下是由**元数据过滤**或**分数阈值**、**rerank配置**等机制导致的。根据 Dify 的实现,知识检索节点会在输出前依次应用:元数据过滤(自动/手动)、分数阈值过滤、rerank(重排序)、top_k 截断等逻辑。只要有一个环节过滤掉了部分内容,最终输出就会少于外部接口返回的条数[代码参考](https://github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py#L233-L533)。 你的配置已经明确 top_k=4,score_threshold=0.3,且外部接口返回的4条分数都满足条件,说明问题很可能出在**元数据过滤**或**rerank**环节: 1. **元数据过滤**:请检查知识检索节点和知识库的“元数据过滤模式”是否为“自动”或“手动”,以及具体的过滤条件。只要有条件不匹配,结果就会被过滤掉[代码细节](https://github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py#L233-L533)。 2. **rerank模型**:rerank 只会影响排序和分数,但不会强制只输出1条,除非top_k=1或过滤后只剩1条[rerank实现](https://github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/rag/rerank/rerank_model.py#L15-L192)。 3. **分数阈值**:你已设为0.3,确认外部接口返回的4条分数都大于0.3即可排除这个因素。 4. **去重**:对于 external provider(外部知识库),不会做 doc_id 去重,但如果是 dify provider 会按 doc_id 去重。 排查建议: - 检查知识检索节点和知识库的“元数据过滤”设置,建议先设为“禁用”再测试。 - 检查外部接口返回的每条数据的 metadata 字段,确认没有被过滤条件误伤。 - 临时关闭 rerank,观察输出条数是否恢复为4条,以排除 rerank 相关 bug。 - 开启 debug 日志,观察知识检索节点实际收到和输出的数据,定位是哪个环节过滤了结果。 只要所有过滤条件都关闭,top_k=4,score_threshold=0.3,外部接口返回4条,理论上输出也应为4条。如果还有问题,可以贴下 workflow 节点的详细配置和外部接口返回的完整数据结构,便于进一步定位[相关讨论](https://github.com/langgenius/dify/issues/22500#issuecomment-3204409382)。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/faa9e8c3-2a71-41ae-b31c-89f65955d2ca?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/faa9e8c3-2a71-41ae-b31c-89f65955d2ca?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/faa9e8c3-2a71-41ae-b31c-89f65955d2ca?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/faa9e8c3-2a71-41ae-b31c-89f65955d2ca?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/faa9e8c3-2a71-41ae-b31c-89f65955d2ca?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/faa9e8c3-2a71-41ae-b31c-89f65955d2ca?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/faa9e8c3-2a71-41ae-b31c-89f65955d2ca?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=%E4%BD%A0%E9%81%87%E5%88%B0%E7%9A%84%E2%80%9C%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E4%E6%9D%A1%E4%BD%86%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E5%8F%AA%E8%BE%93%E5%87%BA1%E6%9D%A1%E2%80%9D%E7%8E%B0%E8%B1%A1%EF%BC%8C%E7%BB%9D%E5%A4%A7%E5%A4%9A%E6%95%B0%E6%83%85%E5%86%B5%E4%B8%8B%E6%98%AF%E7%94%B1%2A%2A%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%2A%2A%E6%88%96%2A%2A%E5%88%86%E6%95%B0%E9%98%88%E5%80%BC%2A%2A%E3%80%81%2A%2Arerank%E9%85%8D%E7%BD%AE%2A%2A%E7%AD%89%E6%9C%BA%E5%88%B6%E5%AF%BC%E8%87%B4%E7%9A%84%E3%80%82%E6%A0%B9%E6%8D%AE%20Dify%20%E7%9A%84%E5%AE%9E%E7%8E%B0%EF%BC%8C%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E4%BC%9A%E5%9C%A8%E8%BE%93%E5%87%BA%E5%89%8D%E4%BE%9D%E6%AC%A1%E5%BA%94%E7%94%A8%EF%BC%9A%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%EF%BC%88%E8%87%AA%E5%8A%A8/%E6%89%8B%E5%8A%A8%EF%BC%89%E3%80%81%E5%88%86%E6%95%B0%E9%98%88%E5%80%BC%E8%BF%87%E6%BB%A4%E3%80%81rerank%EF%BC%88%E9%87%8D%E6%8E%92%E5%BA%8F%EF%BC%89%E3%80%81top_k%20%E6%88%AA%E6%96%AD%E7%AD%89%E9%80%BB%E8%BE%91%E3%80%82%E5%8F%AA%E8%A6%81%E6%9C%89%E4%B8%80%E4%B8%AA%E7%8E%AF%E8%8A%82%E8%BF%87%E6%BB%A4%E6%8E%89%E4%BA%86%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9%EF%BC%8C%E6%9C%80%E7%BB%88%E8%BE%93%E5%87%BA%E5%B0%B1%E4%BC%9A%E5%B0%91%E4%BA%8E%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E7%9A%84%E6%9D%A1%E6%95%B0%5B%E4%BB%A3%E7%A0%81%E5%8F%82%E8%80%83%5D%28https%3A//github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py%23L233-L533%29%E3%80%82%0A%0A%E4%BD%A0%E7%9A%84%E9%85%8D%E7%BD%AE%E5%B7%B2%E7%BB%8F%E6%98%8E%E7%A1%AE%20top_k%3D4%EF%BC%8Cscore_threshold%3D0.3%EF%BC%8C%E4%B8%94%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E7%9A%844%E6%9D%A1%E5%88%86%E6%95%B0%E9%83%BD%E6%BB%A1%E8%B6%B3%E6%9D%A1%E4%BB%B6%EF%BC%8C%E8%AF%B4%E6%98%8E%E9%97%AE%E9%A2%98%E5%BE%88%E5%8F%AF%E8%83%BD%E5%87%BA%E5%9C%A8%2A%2A%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%2A%2A%E6%88%96%2A%2Arerank%2A%2A%E7%8E%AF%E8%8A%82%EF%BC%9A%0A%0A1.%20%2A%2A%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%2A%2A%EF%BC%9A%E8%AF%B7%E6%A3%80%E6%9F%A5%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E5%92%8C%E7%9F%A5%E8%AF%86%E5%BA%93%E7%9A%84%E2%80%9C%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%E6%A8%A1%E5%BC%8F%E2%80%9D%E6%98%AF%E5%90%A6%E4%B8%BA%E2%80%9C%E8%87%AA%E5%8A%A8%E2%80%9D%E6%88%96%E2%80%9C%E6%89%8B%E5%8A%A8%E2%80%9D%EF%BC%8C%E4%BB%A5%E5%8F%8A%E5%85%B7%E4%BD%93%E7%9A%84%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6%E3%80%82%E5%8F%AA%E8%A6%81%E6%9C%89%E6%9D%A1%E4%BB%B6%E4%B8%8D%E5%8C%B9%E9%85%8D%EF%BC%8C%E7%BB%93%E6%9E%9C%E5%B0%B1%E4%BC%9A%E8%A2%AB%E8%BF%87%E6%BB%A4%E6%8E%89%5B%E4%BB%A3%E7%A0%81%E7%BB%86%E8%8A%82%5D%28https%3A//github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py%23L233-L533%29%E3%80%82%0A2.%20%2A%2Arerank%E6%A8%A1%E5%9E%8B%2A%2A%EF%BC%9Arerank%20%E5%8F%AA%E4%BC%9A%E5%BD%B1%E5%93%8D%E6%8E%92%E5%BA%8F%E5%92%8C%E5%88%86%E6%95%B0%EF%BC%8C%E4%BD%86%E4%B8%8D%E4%BC%9A%E5%BC%BA%E5%88%B6%E5%8F%AA%E8%BE%93%E5%87%BA1%E6%9D%A1%EF%BC%8C%E9%99%A4%E9%9D%9Etop_k%3D1%E6%88%96%E8%BF%87%E6%BB%A4%E5%90%8E%E5%8F%AA%E5%89%A91%E6%9D%A1%5Brerank%E5%AE%9E%E7%8E%B0%5D%28https%3A//github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/rag/rerank/rerank_model.py%23L15-L192%29%E3%80%82%0A3.%20%2A%2A%E5%88%86%E6%95%B0%E9%98%88%E5%80%BC%2A%2A%EF%BC%9A%E4%BD%A0%E5%B7%B2%E8%AE%BE%E4%B8%BA0.3%EF%BC%8C%E7%A1%AE%E8%AE%A4%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E7%9A%844%E6%9D%A1%E5%88%86%E6%95%B0%E9%83%BD%E5%A4%A7%E4%BA%8E0.3%E5%8D%B3%E5%8F%AF%E6%8E%92%E9%99%A4%E8%BF%99%E4%B8%AA%E5%9B%A0%E7%B4%A0%E3%80%82%0A4.%20%2A%2A%E5%8E%BB%E9%87%8D%2A%2A%EF%BC%9A%E5%AF%B9%E4%BA%8E%20external%20provider%EF%BC%88%E5%A4%96%E9%83%A8%E7%9F%A5%E8%AF%86%E5%BA%93%EF%BC%89%EF%BC%8C%E4%B8%8D%E4%BC%9A%E5%81%9A%20doc_id%20%E5%8E%BB%E9%87%8D%EF%BC%8C%E4%BD%86%E5%A6%82%E6%9E%9C%E6%98%AF%20dify%20provider%20%E4%BC%9A%E6%8C%89%20doc_id%20%E5%8E%BB%E9%87%8D%E3%80%82%0A%0A%E6%8E%92%E6%9F%A5%E5%BB%BA%E8%AE%AE%EF%BC%9A%0A-%20%E6%A3%80%E6%9F%A5%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E5%92%8C%E7%9F%A5%E8%AF%86%E5%BA%93%E7%9A%84%E2%80%9C%E5%85%83%E6%95%B0%E6%8D%AE%E8%BF%87%E6%BB%A4%E2%80%9D%E8%AE%BE%E7%BD%AE%EF%BC%8C%E5%BB%BA%E8%AE%AE%E5%85%88%E8%AE%BE%E4%B8%BA%E2%80%9C%E7%A6%81%E7%94%A8%E2%80%9D%E5%86%8D%E6%B5%8B%E8%AF%95%E3%80%82%0A-%20%E6%A3%80%E6%9F%A5%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E7%9A%84%E6%AF%8F%E6%9D%A1%E6%95%B0%E6%8D%AE%E7%9A%84%20metadata%20%E5%AD%97%E6%AE%B5%EF%BC%8C%E7%A1%AE%E8%AE%A4%E6%B2%A1%E6%9C%89%E8%A2%AB%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6%E8%AF%AF%E4%BC%A4%E3%80%82%0A-%20%E4%B8%B4%E6%97%B6%E5%85%B3%E9%97%AD%20rerank%EF%BC%8C%E8%A7%82%E5%AF%9F%E8%BE%93%E5%87%BA%E6%9D%A1%E6%95%B0%E6%98%AF%E5%90%A6%E6%81%A2%E5%A4%8D%E4%B8%BA4%E6%9D%A1%EF%BC%8C%E4%BB%A5%E6%8E%92%E9%99%A4%20rerank%20%E7%9B%B8%E5%85%B3%20bug%E3%80%82%0A-%20%E5%BC%80%E5%90%AF%20debug%20%E6%97%A5%E5%BF%97%EF%BC%8C%E8%A7%82%E5%AF%9F%E7%9F%A5%E8%AF%86%E6%A3%80%E7%B4%A2%E8%8A%82%E7%82%B9%E5%AE%9E%E9%99%85%E6%94%B6%E5%88%B0%E5%92%8C%E8%BE%93%E5%87%BA%E7%9A%84%E6%95%B0%E6%8D%AE%EF%BC%8C%E5%AE%9A%E4%BD%8D%E6%98%AF%E5%93%AA%E4%B8%AA%E7%8E%AF%E8%8A%82%E8%BF%87%E6%BB%A4%E4%BA%86%E7%BB%93%E6%9E%9C%E3%80%82%0A%0A%E5%8F%AA%E8%A6%81%E6%89%80%E6%9C%89%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6%E9%83%BD%E5%85%B3%E9%97%AD%EF%BC%8Ctop_k%3D4%EF%BC%8Cscore_threshold%3D0.3%EF%BC%8C%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E4%E6%9D%A1%EF%BC%8C%E7%90%86%E8%AE%BA%E4%B8%8A%E8%BE%93%E5%87%BA%E4%B9%9F%E5%BA%94%E4%B8%BA4%E6%9D%A1%E3%80%82%E5%A6%82%E6%9E%9C%E8%BF%98%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E5%8F%AF%E4%BB%A5%E8%B4%B4%E4%B8%8B%20workflow%20%E8%8A%82%E7%82%B9%E7%9A%84%E8%AF%A6%E7%BB%86%E9%85%8D%E7%BD%AE%E5%92%8C%E5%A4%96%E9%83%A8%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E7%9A%84%E5%AE%8C%E6%95%B4%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%EF%BC%8C%E4%BE%BF%E4%BA%8E%E8%BF%9B%E4%B8%80%E6%AD%A5%E5%AE%9A%E4%BD%8D%5B%E7%9B%B8%E5%85%B3%E8%AE%A8%E8%AE%BA%5D%28https%3A//github.com/langgenius/dify/issues/22500%23issuecomment-3204409382%29%E3%80%82)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31362)
Author
Owner

@SuperZhanggy commented on GitHub (Jan 21, 2026):

Image

元数据过滤状态是禁用,外部接口返回的完整数据如下:
{'records': [{'content': '1.2登录\n用户使用有效的手机钉钉账号扫码或者有效的用户名、密码,通过浏览器界面登录 Futai系统,进而进入到在 Futail系统中,点击选择【磐石 OMS】图标,即 Omni channel e-commerce center,中文全称:百秋 OMS订单管理系统,以下简称:OMS系统。\n打开浏览器(建议 Chrome浏览器),在地址栏输入线上环境 Futail登录地址:https://futail.ibaiqiu.com/systemList,分以下两种情况进入系统。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.8162689805030823, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.2非百秋员工登录(品牌或其他)\n需使用授权后的账号和密码才能进行登录,在登录页输入正确的账号、密码之后,即可进入到系统选择页面,点击选择【磐石 OMS】图标,即可进入品牌选择列表页,图示步骤如下:\nSign in2U Llsemame or F-mai Password Log in Log in with Dingtalk其他登装:Azure ADH图一:账号密码登录页面\n@m IM B智美BiS磐石规QMS连城 Futail HSB赢客OCRM+小精灵AOP容容云ACMI etp Center百应Oshop托马斯洞见 TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]4\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]5\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=ZqnI0VBCDLEkTZ8dOJqJG8jGNdQ%3D&x-oss-process=image%2Fcrop%2Cx_253%2Cy_491%2Cw_926%2Ch_467\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=ZTrvqZXaqDob%2FJ9JeFI2Gt%2BdSik%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_1061%2Cw_942%2Ch_464\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/16.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=dG6PpegYOBnhE5tu691IYNdZlXY%3D&x-oss-process=image%2Fcrop%2Cx_245%2Cy_164%2Cw_957%2Ch_322', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7819863557815552, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.1百秋员工登录\n若为百秋员工且被授权可以登录 OMS系统,则直接使用钉钉扫码后即可进入到系统选择页面,点击选择【磐石OMS】图标进入品牌选择列表页,图示步骤如下:\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]2\nSign in口Z 请使用钉钉扫描二维码登录◎刷新Log in with username or e-mail / passworc其他登录:Azure AD安图一:扫码登录页面\n@ HEART Q IMC Bil智美BiS磐石3QMS车城 Futail HSB赢客0CRM+小精灵AOP容容云ACMI etp Center百应Qshop托马斯洞见TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]3\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=KvCKgiA%2BKDL0KFRyRbFzNWgBbqw%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_160%2Cw_943%2Ch_492\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=0qivbqeMdT0fUpHvi8mrj8oEtnI%3D&x-oss-process=image%2Fcrop%2Cx_250%2Cy_755%2Cw_947%2Ch_459\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=5PkNGkHaNzZijUvwA3fwXinX4Ho%3D&x-oss-process=image%2Fcrop%2Cx_246%2Cy_1302%2Cw_958%2Ch_324', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7254965901374817, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '场景简介:\n本场景聚焦门店发货订单从 “待配货”到 “已发货”的订单流程,适用于门店店员、运营人员等角色跟进物流配送类订单的接单与发货全流程,清晰掌握订单在不同节点的状态变化。\n详细介绍如下:\n消费者前端下单后,订单信息将自动同步至 OMS 系统,经系统完成发货主体匹配、合规校验与相关通知后,流转至对应门店的专属操作端口并更新状态,同时触发门店端提醒。\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]97\n门店相关人员登录端口后,可查询订单并完成库存核对与确认,补充必要物流相关信息后提交系统,通过后更新订单进度,并将状态及物流动态同步至前端平台,方便消费者实时追踪订单进展。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7152182459831238, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}]}

@SuperZhanggy commented on GitHub (Jan 21, 2026): <img width="563" height="594" alt="Image" src="https://github.com/user-attachments/assets/3aaced17-e682-4902-a9e4-3d7385acf5a6" /> 元数据过滤状态是禁用,外部接口返回的完整数据如下: {'records': [{'content': '1.2登录\n用户使用有效的手机钉钉账号扫码或者有效的用户名、密码,通过浏览器界面登录 Futai系统,进而进入到在 Futail系统中,点击选择【磐石 OMS】图标,即 Omni channel e-commerce center,中文全称:百秋 OMS订单管理系统,以下简称:OMS系统。\n打开浏览器(建议 Chrome浏览器),在地址栏输入线上环境 Futail登录地址:https://futail.ibaiqiu.com/systemList,分以下两种情况进入系统。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.8162689805030823, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.2非百秋员工登录(品牌或其他)\n需使用授权后的账号和密码才能进行登录,在登录页输入正确的账号、密码之后,即可进入到系统选择页面,点击选择【磐石 OMS】图标,即可进入品牌选择列表页,图示步骤如下:\nSign in2U Llsemame or F-mai Password Log in Log in with Dingtalk其他登装:Azure ADH图一:账号密码登录页面\n@m IM B智美BiS磐石规QMS连城 Futail HSB赢客OCRM+小精灵AOP容容云ACMI etp Center百应Oshop托马斯洞见 TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]4\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]5\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=ZqnI0VBCDLEkTZ8dOJqJG8jGNdQ%3D&x-oss-process=image%2Fcrop%2Cx_253%2Cy_491%2Cw_926%2Ch_467\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/15.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=ZTrvqZXaqDob%2FJ9JeFI2Gt%2BdSik%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_1061%2Cw_942%2Ch_464\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/16.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=dG6PpegYOBnhE5tu691IYNdZlXY%3D&x-oss-process=image%2Fcrop%2Cx_245%2Cy_164%2Cw_957%2Ch_322', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7819863557815552, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '1.2.1百秋员工登录\n若为百秋员工且被授权可以登录 OMS系统,则直接使用钉钉扫码后即可进入到系统选择页面,点击选择【磐石OMS】图标进入品牌选择列表页,图示步骤如下:\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]2\nSign in口Z 请使用钉钉扫描二维码登录◎刷新Log in with username or e-mail / passworc其他登录:Azure AD安图一:扫码登录页面\n@ HEART Q IMC Bil智美BiS磐石3QMS车城 Futail HSB赢客0CRM+小精灵AOP容容云ACMI etp Center百应Qshop托马斯洞见TMS魁星MMI 明察QUEEN TGA图二:系统选择页面\n请选择品牌OMS简体中文Demo图三:品牌列表选择页面\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]3\n\n以下是关联的图片信息:\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=KvCKgiA%2BKDL0KFRyRbFzNWgBbqw%3D&x-oss-process=image%2Fcrop%2Cx_252%2Cy_160%2Cw_943%2Ch_492\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=0qivbqeMdT0fUpHvi8mrj8oEtnI%3D&x-oss-process=image%2Fcrop%2Cx_250%2Cy_755%2Cw_947%2Ch_459\nhttp://docmind-api-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/1257896666798445/publicDocStructure/docmind-20260114-8421be29613b40fdbb7ec21e9ff0be0f/14.png?Expires=1769649144&OSSAccessKeyId=LTAI5tFEK2uEApeeYzxNMEci&Signature=5PkNGkHaNzZijUvwA3fwXinX4Ho%3D&x-oss-process=image%2Fcrop%2Cx_246%2Cy_1302%2Cw_958%2Ch_324', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7254965901374817, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}, {'content': '场景简介:\n本场景聚焦门店发货订单从 “待配货”到 “已发货”的订单流程,适用于门店店员、运营人员等角色跟进物流配送类订单的接单与发货全流程,清晰掌握订单在不同节点的状态变化。\n详细介绍如下:\n消费者前端下单后,订单信息将自动同步至 OMS 系统,经系统完成发货主体匹配、合规校验与相关通知后,流转至对应门店的专属操作端口并更新状态,同时触发门店端提醒。\nBUY QUICKLY\n上海百秋 OMS订单管理系统产品使用说明书 V1.0\n[empty]97\n门店相关人员登录端口后,可查询订单并完成库存核对与确认,补充必要物流相关信息后提交系统,通过后更新订单进度,并将状态及物流动态同步至前端平台,方便消费者实时追踪订单进展。\n', 'metadata': {'doc_id': 'file_fdd7a7280bce4e5399a0b49a9fb8966e_10130393'}, 'score': 0.7152182459831238, 'title': '上海百秋OMS订单管理系统产品使用说明书V1.0.docx'}]}
Author
Owner

@dosubot[bot] commented on GitHub (Jan 21, 2026):

Based on your config (metadata filtering disabled, top_k=4, score_threshold=0.3, rerank enabled) and the external API returning 4 records, all 4 should be eligible for output—unless something else filters them out. Dify does not deduplicate external provider results by doc_id, so that’s not the cause.

The most likely reasons for only 1 result showing are:

  1. If you use a Variable Aggregator or Template node after the knowledge retrieval node, by default these nodes only output the first available variable/result unless you enable advanced/group settings or explicitly merge arrays. This is a common cause for seeing only one result downstream even if the retrieval node outputs more. To merge all results, use a Code node or Template node to concatenate arrays, then (if needed) a Parameter Extractor node to parse the merged JSON string back to an array for downstream use. See details and workaround.

  2. If you check the raw output of the knowledge retrieval node (before any aggregation or template processing) and it already contains only 1 result, enable debug logs and check the node’s output directly. If all 4 records are present before aggregation, the issue is with the aggregation node config. If only 1 is present, there may be an unexpected filter or a bug in the rerank integration, but this is not the intended behavior for your settings see code logic.

Check your workflow: if you’re using a Variable Aggregator node, try enabling advanced/group settings or switch to a Code node to merge results. If you’re already doing this and still see only one result, share the raw output of the knowledge retrieval node for further troubleshooting.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 21, 2026): <!-- Answer --> Based on your config (metadata filtering disabled, top_k=4, score_threshold=0.3, rerank enabled) and the external API returning 4 records, all 4 should be eligible for output—unless something else filters them out. Dify does not deduplicate external provider results by doc_id, so that’s not the cause. The most likely reasons for only 1 result showing are: 1. If you use a Variable Aggregator or Template node after the knowledge retrieval node, by default these nodes only output the first available variable/result unless you enable advanced/group settings or explicitly merge arrays. This is a common cause for seeing only one result downstream even if the retrieval node outputs more. To merge all results, use a Code node or Template node to concatenate arrays, then (if needed) a Parameter Extractor node to parse the merged JSON string back to an array for downstream use. [See details and workaround](https://github.com/langgenius/dify/discussions/30584). 2. If you check the raw output of the knowledge retrieval node (before any aggregation or template processing) and it already contains only 1 result, enable debug logs and check the node’s output directly. If all 4 records are present before aggregation, the issue is with the aggregation node config. If only 1 is present, there may be an unexpected filter or a bug in the rerank integration, but this is not the intended behavior for your settings [see code logic](https://github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py#L223-L534). Check your workflow: if you’re using a Variable Aggregator node, try enabling advanced/group settings or switch to a Code node to merge results. If you’re already doing this and still see only one result, share the raw output of the knowledge retrieval node for further troubleshooting. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/3b98f093-d9d7-4685-9f6f-01df24a14dff?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3b98f093-d9d7-4685-9f6f-01df24a14dff?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3b98f093-d9d7-4685-9f6f-01df24a14dff?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3b98f093-d9d7-4685-9f6f-01df24a14dff?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3b98f093-d9d7-4685-9f6f-01df24a14dff?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3b98f093-d9d7-4685-9f6f-01df24a14dff?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3b98f093-d9d7-4685-9f6f-01df24a14dff?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Based%20on%20your%20config%20%28metadata%20filtering%20disabled%2C%20top_k%3D4%2C%20score_threshold%3D0.3%2C%20rerank%20enabled%29%20and%20the%20external%20API%20returning%204%20records%2C%20all%204%20should%20be%20eligible%20for%20output%E2%80%94unless%20something%20else%20filters%20them%20out.%20Dify%20does%20not%20deduplicate%20external%20provider%20results%20by%20doc_id%2C%20so%20that%E2%80%99s%20not%20the%20cause.%0A%0AThe%20most%20likely%20reasons%20for%20only%201%20result%20showing%20are%3A%0A%0A1.%20If%20you%20use%20a%20Variable%20Aggregator%20or%20Template%20node%20after%20the%20knowledge%20retrieval%20node%2C%20by%20default%20these%20nodes%20only%20output%20the%20first%20available%20variable/result%20unless%20you%20enable%20advanced/group%20settings%20or%20explicitly%20merge%20arrays.%20This%20is%20a%20common%20cause%20for%20seeing%20only%20one%20result%20downstream%20even%20if%20the%20retrieval%20node%20outputs%20more.%20To%20merge%20all%20results%2C%20use%20a%20Code%20node%20or%20Template%20node%20to%20concatenate%20arrays%2C%20then%20%28if%20needed%29%20a%20Parameter%20Extractor%20node%20to%20parse%20the%20merged%20JSON%20string%20back%20to%20an%20array%20for%20downstream%20use.%20%5BSee%20details%20and%20workaround%5D%28https%3A//github.com/langgenius/dify/discussions/30584%29.%0A%0A2.%20If%20you%20check%20the%20raw%20output%20of%20the%20knowledge%20retrieval%20node%20%28before%20any%20aggregation%20or%20template%20processing%29%20and%20it%20already%20contains%20only%201%20result%2C%20enable%20debug%20logs%20and%20check%20the%20node%E2%80%99s%20output%20directly.%20If%20all%204%20records%20are%20present%20before%20aggregation%2C%20the%20issue%20is%20with%20the%20aggregation%20node%20config.%20If%20only%201%20is%20present%2C%20there%20may%20be%20an%20unexpected%20filter%20or%20a%20bug%20in%20the%20rerank%20integration%2C%20but%20this%20is%20not%20the%20intended%20behavior%20for%20your%20settings%20%5Bsee%20code%20logic%5D%28https%3A//github.com/langgenius/dify/blob/211c57f7b62fe3578c77fcb00aebc5760e8e5466/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py%23L223-L534%29.%0A%0ACheck%20your%20workflow%3A%20if%20you%E2%80%99re%20using%20a%20Variable%20Aggregator%20node%2C%20try%20enabling%20advanced/group%20settings%20or%20switch%20to%20a%20Code%20node%20to%20merge%20results.%20If%20you%E2%80%99re%20already%20doing%20this%20and%20still%20see%20only%20one%20result%2C%20share%20the%20raw%20output%20of%20the%20knowledge%20retrieval%20node%20for%20further%20troubleshooting.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31362)
Author
Owner

@SuperZhanggy commented on GitHub (Jan 21, 2026):

Image

我发现把知识检索的rerank 关掉,4条数据正常返回的;如果打开,并且设置top_k为4 阈值 0.3 ,似乎把检索到的chunks 又重排序过滤了一遍,并且我这里设置阈值0.3 没有生效,生效的阈值是0.8 或者其它,这是我的猜测,我希望转人工帮我看一下我的问题

@SuperZhanggy commented on GitHub (Jan 21, 2026): <img width="645" height="599" alt="Image" src="https://github.com/user-attachments/assets/0f24e098-62d2-4093-b8b2-02e5a3b48d20" /> 我发现把知识检索的rerank 关掉,4条数据正常返回的;如果打开,并且设置top_k为4 阈值 0.3 ,似乎把检索到的chunks 又重排序过滤了一遍,并且我这里设置阈值0.3 没有生效,生效的阈值是0.8 或者其它,这是我的猜测,我希望转人工帮我看一下我的问题
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21818