Output from Retrieval Testing in Knowledge Base and from Knowledge Retrieval in workflow are different #7498

Closed
opened 2026-02-21 18:20:54 -05:00 by yindo · 6 comments
Owner

Originally created by @liangnet on GitHub (Jan 2, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.12.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1 use same knowledge and same configuration
截圖 2025-01-03 上午11 08 39

2 can get output in Retrieval Testing and the score is 0.08 larger than the score threshold 0.05 (because the context is sentitive so I marked them)
截圖 2025-01-03 上午11 07 27

3 cannot get output from Knowledge Retrieval in workflow. So, I turned off the score threshold to debug what happened. The scored shown in followed image said they are round 0.008 different from the 0.08 in Retrieval Testing
截圖 2025-01-03 上午11 09 37

✔️ Expected Behavior

same output either from Knowledge Retrieval in workflow or from Retrieval Testing

Actual Behavior

they are often different!!

Originally created by @liangnet on GitHub (Jan 2, 2025). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.12.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1 use same knowledge and same configuration ![截圖 2025-01-03 上午11 08 39](https://github.com/user-attachments/assets/85968321-3206-4283-b465-d620547e02f4) 2 can get output in Retrieval Testing and the score is 0.08 larger than the score threshold 0.05 (because the context is sentitive so I marked them) ![截圖 2025-01-03 上午11 07 27](https://github.com/user-attachments/assets/dc607780-bd7f-4017-81a1-9526cf1e6fc4) 3 cannot get output from Knowledge Retrieval in workflow. So, I turned off the score threshold to debug what happened. The scored shown in followed image said they are round 0.008 different from the 0.08 in Retrieval Testing ![截圖 2025-01-03 上午11 09 37](https://github.com/user-attachments/assets/de23c624-7947-458e-b73d-96df37f0cb3b) ### ✔️ Expected Behavior same output either from Knowledge Retrieval in workflow or from Retrieval Testing ### ❌ Actual Behavior they are often different!!
yindo added the 🐞 bugoutdated labels 2026-02-21 18:20:54 -05:00
yindo closed this issue 2026-02-21 18:20:54 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 2, 2025):

@liangnet Hello there! I'm here to help with any bugs, questions, or contributions you may have for Dify. Let's figure this out together while we wait for a human maintainer.

I found a similar open issue that might be relevant to your problem. The suggested solution involves considering the recall mode you are using. Dify supports two recall modes: N选1召回模式 (N-to-1 recall mode) and 多路召回模式 (multi-path recall mode). Here are the steps you can take:

  1. Switch to Multi-path Recall Mode: If you are currently using the N选1召回模式, consider switching to the 多路召回模式. This mode is more robust for applications with multiple datasets and can provide higher quality recall results.

  2. Configure Rerank Model: Ensure that you have configured the Rerank model correctly to improve the semantic reordering of the retrieved documents.

Additionally, ensure that your workflow configurations are synchronized correctly. You can use the WorkflowToolConfigurationUtils class to check and validate your workflow graph variables and tool parameter configurations. This should help resolve the inconsistency between the workflow query results and the backend knowledge base recall results [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Jan 2, 2025): <!-- Greeting --> @liangnet Hello there! I'm here to help with any bugs, questions, or contributions you may have for Dify. Let's figure this out together while we wait for a human maintainer. <!-- Answer --> I found a similar open issue that might be relevant to your problem. The suggested solution involves considering the recall mode you are using. Dify supports two recall modes: N选1召回模式 (N-to-1 recall mode) and 多路召回模式 (multi-path recall mode). Here are the steps you can take: 1. **Switch to Multi-path Recall Mode**: If you are currently using the N选1召回模式, consider switching to the 多路召回模式. This mode is more robust for applications with multiple datasets and can provide higher quality recall results. 2. **Configure Rerank Model**: Ensure that you have configured the Rerank model correctly to improve the semantic reordering of the retrieved documents. Additionally, ensure that your workflow configurations are synchronized correctly. You can use the `WorkflowToolConfigurationUtils` class to check and validate your workflow graph variables and tool parameter configurations. This should help resolve the inconsistency between the workflow query results and the backend knowledge base recall results <sup>[[1]](https://github.com/langgenius/dify/issues/5207)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b56b1fe5-04e0-42ef-9405-8552650311cf?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b56b1fe5-04e0-42ef-9405-8552650311cf?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b56b1fe5-04e0-42ef-9405-8552650311cf?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b56b1fe5-04e0-42ef-9405-8552650311cf?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b56b1fe5-04e0-42ef-9405-8552650311cf?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/b56b1fe5-04e0-42ef-9405-8552650311cf?feedback_type=other)</sup>
Author
Owner

@liangnet commented on GitHub (Jan 2, 2025):

@dosu No, it is not about N-to-1 or Multipath. The outputs from two tools should be same but they are different.

@liangnet commented on GitHub (Jan 2, 2025): @dosu No, it is not about N-to-1 or Multipath. The outputs from two tools should be same but they are different.
Author
Owner

@dosubot[bot] commented on GitHub (Jan 2, 2025):

Could you provide more details about the configurations and settings used in both the Retrieval Testing and the Knowledge Retrieval in the workflow? This might include any specific parameters, thresholds, or models that are being used. Additionally, are there any logs or error messages that appear when the outputs differ? This information could help in identifying the cause of the discrepancy.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Jan 2, 2025): <!-- Answer --> Could you provide more details about the configurations and settings used in both the Retrieval Testing and the Knowledge Retrieval in the workflow? This might include any specific parameters, thresholds, or models that are being used. Additionally, are there any logs or error messages that appear when the outputs differ? This information could help in identifying the cause of the discrepancy. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/471be328-7b9d-4557-a614-0539d76f9bd7?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/471be328-7b9d-4557-a614-0539d76f9bd7?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/471be328-7b9d-4557-a614-0539d76f9bd7?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/471be328-7b9d-4557-a614-0539d76f9bd7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/471be328-7b9d-4557-a614-0539d76f9bd7?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/471be328-7b9d-4557-a614-0539d76f9bd7?feedback_type=other)</sup>
Author
Owner

@liangnet commented on GitHub (Jan 2, 2025):

1 config of Retrieval Testing in Knowledge Base
截圖 2025-01-03 上午11 44 53
2 config of Knowledge Retrieval in workflow (to debug so I turned off the score threshold)
image

@liangnet commented on GitHub (Jan 2, 2025): 1 config of Retrieval Testing in Knowledge Base ![截圖 2025-01-03 上午11 44 53](https://github.com/user-attachments/assets/a68bbc4a-d571-48ff-838f-91793826e20d) 2 config of Knowledge Retrieval in workflow (to debug so I turned off the score threshold) ![image](https://github.com/user-attachments/assets/f91ee5a6-1f1f-4cb2-8bde-725e35a9cac7)
Author
Owner

@crazywoola commented on GitHub (Jan 3, 2025):

Please upgrade to latest version and check the settings in Node and Knowledge base.

@crazywoola commented on GitHub (Jan 3, 2025): Please upgrade to latest version and check the settings in Node and Knowledge base.
Author
Owner

@liangnet commented on GitHub (Jan 3, 2025):

after upgrading to the latest version 0.14.2, this issue is not solved. These two score are still different.

@liangnet commented on GitHub (Jan 3, 2025): after upgrading to the latest version 0.14.2, this issue is not solved. These two score are still different.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7498