dify icon indicating copy to clipboard operation
dify copied to clipboard

When using an external RAG knowledge base in chatflow, the knowledge retrieval returns an empty list [].

Open lanwilliam opened this issue 9 months ago • 2 comments

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

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create an external knowledge base API
  2. Create a connected external knowledge base。
  3. Test retrieval, work wel。
  4. create an agent with chatflow。
  5. Add a knowledge retrieval node.
  6. Configure the recall settings of the knowledge retrieval node.
  7. Rerank model can't off。
  8. test the node result:[]

Image

Image

Image

Image

Image

Image

Image

Image Rag works well.

✔️ Expected Behavior

the same as test retrieval in the knowledge base.

❌ Actual Behavior

result:[]

lanwilliam avatar Mar 10 '25 08:03 lanwilliam

@lanwilliam Hello! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together!

There is a known issue that might be causing the knowledge retrieval to return an empty list when using an external RAG knowledge base in chatflow. This issue could be related to a bug in Dify v0.15.3, where the rerank model switch in 'Recall Settings' automatically turns on, leading to empty results even when it is disabled. This was fixed in a later update, so ensuring you are using the latest version might resolve the issue.

Additionally, the external knowledge base API response must follow a specific JSON structure. The response should include a 'records' array with objects containing 'metadata', 'score', 'title', and 'content' fields. If the response does not match this structure, no data will be displayed even if the HTTP status code is 200 [1].

To continue talking to Dosu, mention @dosu.


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

dosubot[bot] avatar Mar 10 '25 08:03 dosubot[bot]

i meet the same problem, maybe you can reopen and close the rerank settings before republishing the chatbox. It's absolutly a frontend bug.

JiquanZhong avatar Mar 13 '25 12:03 JiquanZhong

Hi, @lanwilliam. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a bug in Dify version 1.0.0 involving an external RAG knowledge base resulting in an empty list during knowledge retrieval.
  • I suggested the issue might be related to a known bug with the rerank model switch in 'Recall Settings'.
  • @JiquanZhong confirmed the issue and proposed a workaround by reopening and closing the rerank settings before republishing the chatbox.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If no updates are provided, the issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Apr 13 '25 16:04 dosubot[bot]