Question Classifier + Knowledge + Chatbot Demo bug!! #5574

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

Originally created by @zzkzzk1984 on GitHub (Sep 12, 2024).

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.8.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When using problem classification, each time before entering branch 1, branch 3 will be triggered once, and the process does not show its triggering, and the reason for the trigger is not known.

image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @zzkzzk1984 on GitHub (Sep 12, 2024). ### 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.8.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When using problem classification, each time before entering branch 1, branch 3 will be triggered once, and the process does not show its triggering, and the reason for the trigger is not known. ![image](https://github.com/user-attachments/assets/c824321f-f324-48d6-9d2a-d060d05e66ba) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:11:42 -05:00
yindo closed this issue 2026-02-21 18:11:42 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 12, 2024):

@zzkzzk1984 Hello! I'm here to assist you with bugs, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer.

I found some similar issues and discussions that might be relevant to the problem you're experiencing:

  1. Discussions:

  2. Issues:

Regarding your specific issue where branch 3 gets triggered before branch 1, this behavior is likely due to the classification model categorizing the input question as "その他の問題" (other questions) before considering it as "アフターサービスに関する問題" (after-sales related questions) or "製品の操作に関する問題" (product operation related questions). This is based on the predefined classification labels/descriptions and the model's interpretation of the input [5][6][7].

To further investigate, you might want to check the specific conditions or rules defined in the question_classifier_node.py that determine the triggering of branches. These conditions are based on the category_id extracted from the result text. Ensure that the result_text is successfully parsed into JSON and contains both category_name and category_id, and that the category_id matches one of the category_ids in node_data.classes [8].

Additionally, review the JSON response formats expected by the QUESTION_CLASSIFIER_ASSISTANT_PROMPT_2 and QUESTION_CLASSIFIER_COMPLETION_PROMPT sections to ensure they are correctly formatted and do not contain common errors [9][8].

If these steps do not resolve the issue, further details about the problem may be needed.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Sep 12, 2024): <!-- Greeting --> @zzkzzk1984 Hello! I'm here to assist you with bugs, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer. <!-- Answer --> I found some similar issues and discussions that might be relevant to the problem you're experiencing: 1. **Discussions:** - [This is a major issue with parallel execution in the workflow. In version 0.8.0, the issue classifier was treated as a parallel execution branch.](https://github.com/langgenius/dify/discussions/8285) <sup>[[1]](https://github.com/langgenius/dify/discussions/8285)</sup> - [The classifier cannot understand the meaning](https://github.com/langgenius/dify/discussions/5341) <sup>[[2]](https://github.com/langgenius/dify/discussions/5341)</sup> 2. **Issues:** - [Not getting correct results with Classification (bug in 3+ categories)](https://github.com/langgenius/dify/issues/4111) (Closed) - The suggested solution was to check if you are using double quotes or single quotes in your class descriptions. Using double quotes in class descriptions can cause formatting issues with the `class_name` output, leading to incorrect node direction. Removing or replacing double quotes with single quotes in class descriptions should resolve the issue <sup>[[3]](https://github.com/langgenius/dify/issues/4111)</sup>. - [工作流的问题分类器后续步骤偶尔会错乱Workflow's issue classifier subsequent steps occasionally get messed up](https://github.com/langgenius/dify/issues/3240) (Closed) - Suggested solutions included checking for typos in JSON responses, verifying example XML tags, and ensuring correct transition between steps in the workflow <sup>[[4]](https://github.com/langgenius/dify/issues/3240)</sup>. Regarding your specific issue where branch 3 gets triggered before branch 1, this behavior is likely due to the classification model categorizing the input question as "その他の問題" (other questions) before considering it as "アフターサービスに関する問題" (after-sales related questions) or "製品の操作に関する問題" (product operation related questions). This is based on the predefined classification labels/descriptions and the model's interpretation of the input <sup>[[5]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/workflow/node/question-classifier.md)</sup><sup>[[6]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/workflow/node/question-classifier.md)</sup><sup>[[7]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/question-classifier.md)</sup>. To further investigate, you might want to check the specific conditions or rules defined in the `question_classifier_node.py` that determine the triggering of branches. These conditions are based on the `category_id` extracted from the result text. Ensure that the `result_text` is successfully parsed into JSON and contains both `category_name` and `category_id`, and that the `category_id` matches one of the `category_id`s in `node_data.classes` <sup>[[8]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/question_classifier/question_classifier_node.py)</sup>. Additionally, review the JSON response formats expected by the `QUESTION_CLASSIFIER_ASSISTANT_PROMPT_2` and `QUESTION_CLASSIFIER_COMPLETION_PROMPT` sections to ensure they are correctly formatted and do not contain common errors <sup>[[9]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/question_classifier/template_prompts.py)</sup><sup>[[8]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/question_classifier/question_classifier_node.py)</sup>. If these steps do not resolve the issue, further details about the problem may be needed. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Sep 12, 2024):

Duplicated, this is resolved in main branch.

@crazywoola commented on GitHub (Sep 12, 2024): Duplicated, this is resolved in main branch.
Author
Owner

@crazywoola commented on GitHub (Sep 12, 2024):

https://github.com/langgenius/dify/pull/8225

@crazywoola commented on GitHub (Sep 12, 2024): https://github.com/langgenius/dify/pull/8225
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5574