Knowledge: Hybrid Search configuration is not retained #8088

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

Originally created by @DavideDelbianco on GitHub (Feb 8, 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

Cloud

Steps to reproduce

Create an High Quality KB and set the Search Method to Hybrid Search.
For good measure set the retrieval mode to Weighted Score and alter the wights to anything other than the default 0.7/0.3

✔️ Expected Behavior

Opening the KB settings should show the Hybrid Search with Weighted Score as the selected method

Actual Behavior

The KB shows the search mode set to Hybrid with no method selected, checking the settings with API confirms the method is set to null and the weighted search config was not saved. only after using the UI to setup the parameters again will save the correct configuration

Originally created by @DavideDelbianco on GitHub (Feb 8, 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 Cloud ### Steps to reproduce Create an High Quality KB and set the Search Method to Hybrid Search. For good measure set the retrieval mode to Weighted Score and alter the wights to anything other than the default 0.7/0.3 ### ✔️ Expected Behavior Opening the KB settings should show the Hybrid Search with Weighted Score as the selected method ### ❌ Actual Behavior The KB shows the search mode set to Hybrid with no method selected, checking the settings with API confirms the method is set to null and the weighted search config was not saved. only after using the UI to setup the parameters again will save the correct configuration
yindo added the 🐞 bugcloud labels 2026-02-21 18:23:51 -05:00
yindo closed this issue 2026-02-21 18:23:51 -05:00
Author
Owner

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

I found a similar open issue regarding the configuration of the Knowledge APIs to use hybrid search in weighted score mode. The suggested solution involves ensuring that the weights parameter is correctly structured as a dictionary in your payload. Here's an example configuration:

payload = {
  'retrieval_model': 'hybrid_search',
  'reranking': True,
  'reranking_mode': 'weighted_score',
  'weights': {
      "vector_setting": {
          "vector_weight": 0.7,
          "embedding_provider_name": "tongyi",
          "embedding_model_name": "gte-rerank"
      },
      "keyword_setting": {
          "keyword_weight": 0.3
      }
  },
  'top_k': 10,
  'score_threshold_enabled': 0.4
}

Ensure that the datasets meet the conditions for the WeightedScore mode, as inconsistent or external datasets might cause the configuration to default to other settings. You may need to manually update the settings in the UI after creation if the UI does not retain the configuration [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 (Feb 8, 2025): <!-- Answer --> I found a similar open issue regarding the configuration of the Knowledge APIs to use hybrid search in weighted score mode. The suggested solution involves ensuring that the `weights` parameter is correctly structured as a dictionary in your payload. Here's an example configuration: ```python payload = { 'retrieval_model': 'hybrid_search', 'reranking': True, 'reranking_mode': 'weighted_score', 'weights': { "vector_setting": { "vector_weight": 0.7, "embedding_provider_name": "tongyi", "embedding_model_name": "gte-rerank" }, "keyword_setting": { "keyword_weight": 0.3 } }, 'top_k': 10, 'score_threshold_enabled': 0.4 } ``` Ensure that the datasets meet the conditions for the `WeightedScore` mode, as inconsistent or external datasets might cause the configuration to default to other settings. You may need to manually update the settings in the UI after creation if the UI does not retain the configuration <sup>[[1]](https://github.com/langgenius/dify/issues/13426)</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/406c1189-bd1b-4b23-822f-4384fefc6ec6?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/406c1189-bd1b-4b23-822f-4384fefc6ec6?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/406c1189-bd1b-4b23-822f-4384fefc6ec6?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/406c1189-bd1b-4b23-822f-4384fefc6ec6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/406c1189-bd1b-4b23-822f-4384fefc6ec6?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/406c1189-bd1b-4b23-822f-4384fefc6ec6?feedback_type=other)</sup>
Author
Owner

@DavideDelbianco commented on GitHub (Mar 15, 2025):

The issue is still current to the latest version 1.0.1

@DavideDelbianco commented on GitHub (Mar 15, 2025): The issue is still current to the latest version 1.0.1
Author
Owner

@dosubot[bot] commented on GitHub (Mar 15, 2025):

@takatost, the user DavideDelbianco has indicated that the issue is still relevant in the latest version 1.0.1. Could you please assist them with this?

@dosubot[bot] commented on GitHub (Mar 15, 2025): @takatost, the user DavideDelbianco has indicated that the issue is still relevant in the latest version 1.0.1. Could you please assist them with this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8088