Knowledge APIs: Create Empty KB lacks configuration for search_method
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.1.3
Cloud or Self Hosted
Cloud
Steps to reproduce
Use the knowledge API to create an empty dataset, and specify it will use "indexing_technique": "high_quality"
✔️ Expected Behavior
The first uploaded document that specify the retrieval_model with "search_method": "hybrid_search" Should set the KB retrieval method to hybrid search
❌ Actual Behavior
Because during the creation of an empty KB high_quality was specified, the default search_method will be set to "vector_search" What is the point of allowing to specify the search_method during the creation of the KB without allowing to specify the search_method configuration?
The issue you're encountering seems to be related to the default behavior of the Knowledge API when creating a Knowledge Base (KB) with a specified indexing_technique. Currently, the API defaults the search_method to "semantic_search" when creating a KB, and it appears that there is no direct way to specify or override the search_method during the initial creation of an empty KB [1].
The expected behavior you described, where the first uploaded document with a specified retrieval_model should set the KB retrieval method, is not currently supported. The default search_method is set to "semantic_search", and there is no mechanism to change this during the creation of the KB or through the first document upload [1].
This limitation might require a feature update to allow specifying the search_method during KB creation or to adjust it based on the first document's retrieval model. You might consider suggesting this as a feature request if it aligns with your needs.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
I still think it would be beneficial to add the search_method configuration during KB creation, even if you can achieve the same result by uploading a fake document right after creating the KB.
It would streamline document addition to KB, because it is confusing for an API to have a field in the upload requests that 99% of the time is not used because the first document decided the KB settings.
@crazywoola, the user DavideDelbianco has indicated that they still find it beneficial to add the search_method configuration during KB creation, as it would streamline the process and reduce confusion. Could you please assist them with this issue?
(Claude Sonnet 4)
I'll take a look at that GitHub issue to help you determine whether it's a bug or enhancement request.Based on the GitHub issue details, this appears to be more of an enhancement request rather than a bug, though there's a reasonable argument for either classification.
Here's the situation: When creating an empty knowledge base via API with "indexing_technique": "high_quality", the system defaults to "vector_search" for the search method, but the API doesn't currently allow specifying the search_method configuration during KB creation. The user expects that setting "search_method": "hybrid_search" when uploading the first document should change the KB's retrieval method, but it doesn't.
Why it's likely an enhancement:
- The current behavior is working "as designed" - no existing functionality is broken
- The request is asking for new functionality (ability to specify search_method during KB creation)
- The system is behaving consistently with its current implementation
Why it could be considered a bug:
- There's an API design inconsistency - you can specify
indexing_techniquebut notsearch_methodduring creation - The behavior doesn't match reasonable user expectations
- The question "What is the point of allowing to specify the search_method during the creation of the KB without allowing to specify the search_method configuration?" suggests a logical flaw
My assessment: Enhancement request - but it's addressing a legitimate design inconsistency that makes the API less intuitive. It would be reasonable for the maintainers to treat this as a medium-priority enhancement to improve API consistency and user experience.
This was resolved, but the change is not documented