Dify connection to the external knowledge base (Ragflow) #8543

Closed
opened 2026-02-21 18:26:15 -05:00 by yindo · 3 comments
Owner

Originally created by @baldperson on GitHub (Feb 23, 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.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The Dify connection to the external knowledge base (Ragflow) showed a 200 status in the Squid logs, but no data was returned during the “Retrieval Testing”. However, after a few hours without any changes or actions on my part, the “Retrieval Testing” was able to return data normally. Why is this happening?
this is squid log:
INFO [Dummy-9] [_client.py:1038] - HTTP Request: POST http://10.191.12.71/api/v1/dify/retrieval "HTTP/1.1 200 OK"
but no data was returned during the “Retrieval Testing”.
Even though the firewalls on both servers are turned off, the result is still the same. please Could anyone explain the cause of this issue

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @baldperson on GitHub (Feb 23, 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.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The Dify connection to the external knowledge base (Ragflow) showed a 200 status in the Squid logs, but no data was returned during the “Retrieval Testing”. However, after a few hours without any changes or actions on my part, the “Retrieval Testing” was able to return data normally. Why is this happening? this is squid log: INFO [Dummy-9] [_client.py:1038] - HTTP Request: POST http://10.191.12.71/api/v1/dify/retrieval "HTTP/1.1 200 OK" but no data was returned during the “Retrieval Testing”. Even though the firewalls on both servers are turned off, the result is still the same. please Could anyone explain the cause of this issue ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 18:26:15 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 23, 2025):

Hey @baldperson! I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's tackle this issue together!

In Dify version 0.15.3, there was a known issue where the rerank model switch in the 'Recall Settings' would automatically turn on when using an external knowledge base, even after being manually disabled. This caused the knowledge retrieval module to return empty results instead of the expected search results from the external knowledge base API. This issue was due to the reranking_enable setting incorrectly defaulting to true. The bug has been fixed in a recent update through PR #13721. This might explain why you initially received a 200 status with no data returned, and later, the retrieval testing worked as expected without any changes on your part [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] commented on GitHub (Feb 23, 2025): <!-- Greeting --> Hey @baldperson! I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's tackle this issue together! <!-- Answer --> In Dify version 0.15.3, there was a known issue where the rerank model switch in the 'Recall Settings' would automatically turn on when using an external knowledge base, even after being manually disabled. This caused the knowledge retrieval module to return empty results instead of the expected search results from the external knowledge base API. This issue was due to the `reranking_enable` setting incorrectly defaulting to true. The bug has been fixed in a recent update through PR #13721. This might explain why you initially received a 200 status with no data returned, and later, the retrieval testing worked as expected without any changes on your part <sup>[[1]](https://github.com/langgenius/dify/issues/13770)</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/ac26b52f-7736-4797-9258-3cb55ede4b49?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/ac26b52f-7736-4797-9258-3cb55ede4b49?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/ac26b52f-7736-4797-9258-3cb55ede4b49?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/ac26b52f-7736-4797-9258-3cb55ede4b49?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ac26b52f-7736-4797-9258-3cb55ede4b49?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/ac26b52f-7736-4797-9258-3cb55ede4b49?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ac26b52f-7736-4797-9258-3cb55ede4b49?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 23, 2025):

https://docs.dify.ai/guides/knowledge-base/external-knowledge-api-documentation

See response example in above doc.

HTTP/1.1 200
Content-type: application/json
{
    "records": [{
                    "metadata": {
                            "path": "s3://dify/knowledge.txt",
                            "description": "dify knowledge document"
                    },
                    "score": 0.98,
                    "title": "knowledge.txt",
                    "content": "This is the document for external knowledge."
            },
            {
                    "metadata": {
                            "path": "s3://dify/introduce.txt",
                            "description": "dify introduce"
                    },
                    "score": 0.66,
                    "title": "introduce.txt",
                    "content": "The Innovation Engine for GenAI Applications"
            }
    ]
}

You need to make sure the response looks like this. Return code 200 doesn't mean it comply with this standard.

@crazywoola commented on GitHub (Feb 23, 2025): https://docs.dify.ai/guides/knowledge-base/external-knowledge-api-documentation See response example in above doc. ``` HTTP/1.1 200 Content-type: application/json { "records": [{ "metadata": { "path": "s3://dify/knowledge.txt", "description": "dify knowledge document" }, "score": 0.98, "title": "knowledge.txt", "content": "This is the document for external knowledge." }, { "metadata": { "path": "s3://dify/introduce.txt", "description": "dify introduce" }, "score": 0.66, "title": "introduce.txt", "content": "The Innovation Engine for GenAI Applications" } ] } ``` You need to make sure the response looks like this. Return code 200 doesn't mean it comply with this standard.
Author
Owner

@baldperson commented on GitHub (Feb 23, 2025):

https://docs.dify.ai/guides/knowledge-base/external-knowledge-api-documentation

See response example in above doc.

HTTP/1.1 200
Content-type: application/json
{
    "records": [{
                    "metadata": {
                            "path": "s3://dify/knowledge.txt",
                            "description": "dify knowledge document"
                    },
                    "score": 0.98,
                    "title": "knowledge.txt",
                    "content": "This is the document for external knowledge."
            },
            {
                    "metadata": {
                            "path": "s3://dify/introduce.txt",
                            "description": "dify introduce"
                    },
                    "score": 0.66,
                    "title": "introduce.txt",
                    "content": "The Innovation Engine for GenAI Applications"
            }
    ]
}

You need to make sure the response looks like this. Return code 200 doesn't mean it comply with this standard.

thank you ,i will try this way

https://docs.dify.ai/guides/knowledge-base/external-knowledge-api-documentation

See response example in above doc.

HTTP/1.1 200
Content-type: application/json
{
    "records": [{
                    "metadata": {
                            "path": "s3://dify/knowledge.txt",
                            "description": "dify knowledge document"
                    },
                    "score": 0.98,
                    "title": "knowledge.txt",
                    "content": "This is the document for external knowledge."
            },
            {
                    "metadata": {
                            "path": "s3://dify/introduce.txt",
                            "description": "dify introduce"
                    },
                    "score": 0.66,
                    "title": "introduce.txt",
                    "content": "The Innovation Engine for GenAI Applications"
            }
    ]
}

You need to make sure the response looks like this. Return code 200 doesn't mean it comply with this standard.
@crazywoola hello,Sorry, my skills are not good.
I sent the example request using curl, and the response I received is as follows. After comparing it with the example response, I noticed that the metadata section in the curl response is empty, but the content section contains data. Currently, I am getting data from Dify's retrieval testing. Could you help me check if this is normal? Also, which application in Dify should I check the logs for the retrieval testing response?
Image

Image

@baldperson commented on GitHub (Feb 23, 2025): > https://docs.dify.ai/guides/knowledge-base/external-knowledge-api-documentation > > See response example in above doc. > > ``` > HTTP/1.1 200 > Content-type: application/json > { > "records": [{ > "metadata": { > "path": "s3://dify/knowledge.txt", > "description": "dify knowledge document" > }, > "score": 0.98, > "title": "knowledge.txt", > "content": "This is the document for external knowledge." > }, > { > "metadata": { > "path": "s3://dify/introduce.txt", > "description": "dify introduce" > }, > "score": 0.66, > "title": "introduce.txt", > "content": "The Innovation Engine for GenAI Applications" > } > ] > } > ``` > > You need to make sure the response looks like this. Return code 200 doesn't mean it comply with this standard. thank you ,i will try this way > https://docs.dify.ai/guides/knowledge-base/external-knowledge-api-documentation > > See response example in above doc. > > ``` > HTTP/1.1 200 > Content-type: application/json > { > "records": [{ > "metadata": { > "path": "s3://dify/knowledge.txt", > "description": "dify knowledge document" > }, > "score": 0.98, > "title": "knowledge.txt", > "content": "This is the document for external knowledge." > }, > { > "metadata": { > "path": "s3://dify/introduce.txt", > "description": "dify introduce" > }, > "score": 0.66, > "title": "introduce.txt", > "content": "The Innovation Engine for GenAI Applications" > } > ] > } > ``` > > You need to make sure the response looks like this. Return code 200 doesn't mean it comply with this standard. @crazywoola hello,Sorry, my skills are not good. I sent the example request using curl, and the response I received is as follows. After comparing it with the example response, I noticed that the metadata section in the curl response is empty, but the content section contains data. Currently, I am getting data from Dify's retrieval testing. Could you help me check if this is normal? Also, which application in Dify should I check the logs for the retrieval testing response? ![Image](https://github.com/user-attachments/assets/3deb6943-e4ce-4c78-a979-2b21e399adb1) ![Image](https://github.com/user-attachments/assets/d28519de-64e1-4488-88d1-7a689754cda9)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8543