Top K behavior is incompatible between index method Economical
and High Quality
#12144
Open
5 tasks done
Labels
🐞 bug
Something isn't working
Self Checks
Dify version
0.14.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Top K behavior is incompatible between index method
Economical
andHigh Quality
.There are two Top K settings in Dify. One is for the knowledge and another is for the Retrieval Setting of the context.
When using
Economical
knowledge, Top K for the knowledge seems to be overwritten by Top K for Retrieval Setting.In other words, with
Economical
knowledge, Top K for Retrieval Setting seems to be used in actual retrieval and Top K for the knowledge seems not to be used.On the other hand, with
High Quality
knowledge, Top K for the knowledge seems to be used in actual retrieval and Top K for Retrieval Setting seems not to be used.Steps to reproduce:
1. Create
Economical
knowledge andHigh Quality
knowledgeCreate two knowledges one with index method
Economical
and another with index methodHigh Quality
.2. Set Top K for both knowledges
For both knowledges(
Economical
andHigh Quality
), set the specific value to Top K (e.g. Top K = 2).Economical, Top K = 2:
High Quality, Top K = 2:
3. Create chatbot with
Economical
knowledge and chatbot withHigh Quality
knowledgeCreate two chatbots one with the context including only
Economical
knowledge and another with the context including onlyHigh Quality
knowledge. And, in Retrieval Setting, set the different value from the value in step 2 to Top K (e.g. Top K = 10).4. Compare the number of chunks retrieved by two chatbots
For two chatbots(
Economical
andHigh Quality
), input a query respectively, and compare the number of chunks retrieved by two chatbots.✔️ Expected Behavior
The priority for two Top K settings (one for knowledge and another for Retrieval Setting) is same between index method
Economical
andHigh Quality
.❌ Actual Behavior
Retrieval result with
Economical
knowledgeThe number of the retrieved chunks is same as Top K value in Retrieval Setting as follows.
Retrieval result with
High Quality
knowledgeThe number of the retrieved chunks is different from Top K value in Retrieval Setting and same as Top K value for the knowledge.
The text was updated successfully, but these errors were encountered: