the node "Knowledge Search" return empty
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.6.13
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I found that when I used the node "Knowledge Search" and this node was associated with multiple knowledge bases, the search results returned empty. At the same time, I could not see my search operation on the backtest page of the knowledge base.
✔️ Expected Behavior
The knowledge search node should return results, and I can see my search operation on the backtest page of the knowledge base.
❌ Actual Behavior
the search results returned empty. At the same time, I could not see my search operation on the backtest page of the knowledge base.
Hello @HaiShin! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this issue together!
The "Knowledge Search" node in Dify version 0.6.13 returning empty results and not showing search operations on the backtest page when associated with multiple knowledge bases is likely due to improper configuration of the retrieval strategy and recall mode.
To resolve this issue, follow these steps:
- Select Query Variable: Ensure that the correct query variable is chosen, typically
sys.queryfor dialogue applications. - Choose Knowledge Bases: Verify that the knowledge bases to be queried are correctly selected and pre-created in Dify.
- Configure Recall Mode and Knowledge Base Settings: Properly configure the recall mode and knowledge base settings. Dify offers different recall strategies such as "N-choose-1 Recall" and "Multi-way Recall" which need to be appropriately set based on the retrieval scenario.
- Connect and Configure Downstream Nodes: Ensure that the downstream nodes, usually LLM nodes, are correctly connected and configured to use the output variable
resultfrom the knowledge retrieval node.
Supporting evidence from the document:
- "选择查询变量,用于作为输入来检索知识库中的相关文本分段,在常见的对话类应用中一般将开始节点的
sys.query作为查询变量;" - "选择需要查询的知识库,可选知识库需要在 Dify 知识库内预先创建;"
- "配置召回模式和知识库设置;"
- "连接并配置下游节点,一般为 LLM 节点;"
Ensure that each knowledge base associated with the node has its retrieval strategy correctly configured and that the appropriate recall strategy is selected [1][2].
To continue talking to Dosu, mention @dosu.
Hello @HaiShin! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this issue together!
The "Knowledge Search" node in Dify version 0.6.13 returning empty results and not showing search operations on the backtest page when associated with multiple knowledge bases is likely due to improper configuration of the retrieval strategy and recall mode.
To resolve this issue, follow these steps:
- Select Query Variable: Ensure that the correct query variable is chosen, typically
sys.queryfor dialogue applications.- Choose Knowledge Bases: Verify that the knowledge bases to be queried are correctly selected and pre-created in Dify.
- Configure Recall Mode and Knowledge Base Settings: Properly configure the recall mode and knowledge base settings. Dify offers different recall strategies such as "N-choose-1 Recall" and "Multi-way Recall" which need to be appropriately set based on the retrieval scenario.
- Connect and Configure Downstream Nodes: Ensure that the downstream nodes, usually LLM nodes, are correctly connected and configured to use the output variable
resultfrom the knowledge retrieval node.Supporting evidence from the document:
- "选择查询变量,用于作为输入来检索知识库中的相关文本分段,在常见的对话类应用中一般将开始节点的
sys.query作为查询变量;"- "选择需要查询的知识库,可选知识库需要在 Dify 知识库内预先创建;"
- "配置召回模式和知识库设置;"
- "连接并配置下游节点,一般为 LLM 节点;"
Ensure that each knowledge base associated with the node has its retrieval strategy correctly configured and that the appropriate recall strategy is selected [1][2].
To continue talking to Dosu, mention @dosu.
Yes, I confirmed that I completed the above check, and it still returns null. At the same time, I ran the node alone and it also returned null.
If you've confirmed that all the steps were correctly followed and the "Knowledge Search" node still returns empty results, consider the following additional checks:
-
Check Knowledge Base Content: Ensure that the knowledge bases contain relevant and properly indexed data. If the knowledge base is empty or improperly indexed, the search will return no results.
-
Review Logs for Errors: Check the logs for any errors or warnings that might indicate issues with the knowledge retrieval process. This can provide insights into what might be going wrong.
-
Model Configuration: Verify that the model configuration, including the model name, provider, and credentials, is correctly set up. Ensure the model is not in a state of "NO_CONFIGURE", "NO_PERMISSION", or "QUOTA_EXCEEDED" [1].
-
Retrieval Strategy: Double-check the retrieval strategy settings. Ensure that the indexing strategy and retrieval mode are correctly configured. For example, in the "N-choose-1 Recall" mode, ensure a system reasoning model is selected, and in the "Multi-way Recall" mode, ensure a Rerank model is configured [2][3].
If these additional checks do not resolve the issue, there might be a deeper problem with the knowledge base content or the specific configuration settings.
To continue talking to Dosu, mention @dosu.
I am very sure that I have completed the above checks. In addition, I have also done related tests in the Dify cloud version and found that they all return empty.
I also have the same problem. When my application is only associated with one knowledge base, it takes effect, associates with two knowledge bases, and the search result is empty.
I also have the same problem. When my application is only associated with one knowledge base, it takes effect, associates with two knowledge bases, and the search result is empty.
I found that the above phenomenon is because of the recall setting. https://docs.dify.ai/v/zh-hans/guides/knowledge-base/integrate_knowledge_within_application#guan-lian-zhi-shi-ku-bing-zhi-ding-zhao-hui-mo-shi
谢谢
Is this issue resolved?
Is this issue resolved?
I haven't had time to try it yet, and I'm closing this issue after two days of verification