LLM node Output exception in RAG chat flow #13202

Closed
opened 2026-02-21 19:11:03 -05:00 by yindo · 2 comments
Owner

Originally created by @FanJun1986 on GitHub (Apr 22, 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

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image
As shown in the knowledge base query chatflow above, it contains two LLM nodes. The first one is used for user intent analysis with memory enabled, while the second one is for generating responses with memory disabled. When entering a multi-turn conversation, by the 2nd or 3rd turn, the actual output of the first LLM node includes the results of knowledge retrieval for the next node as well as the analysis output of the LLM.

✔️ Expected Behavior

During multi-turn conversations, the output of the first LLM node is the normal result of user intent analysis. The output should be derived from the input content and obtained after processing by the model.

Actual Behavior

Upon tracking the output in the preview, it was found that the actual output is the information processed by the subsequent knowledge retrieval and LLM nodes.

Originally created by @FanJun1986 on GitHub (Apr 22, 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 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/b49dbc13-16b4-4792-b772-0263e4aee441) As shown in the knowledge base query chatflow above, it contains two LLM nodes. The first one is used for user intent analysis with memory enabled, while the second one is for generating responses with memory disabled. When entering a multi-turn conversation, by the 2nd or 3rd turn, the actual output of the first LLM node includes the results of knowledge retrieval for the next node as well as the analysis output of the LLM. ### ✔️ Expected Behavior During multi-turn conversations, the output of the first LLM node is the normal result of user intent analysis. The output should be derived from the input content and obtained after processing by the model. ### ❌ Actual Behavior Upon tracking the output in the preview, it was found that the actual output is the information processed by the subsequent knowledge retrieval and LLM nodes.
yindo added the 🐞 bug label 2026-02-21 19:11:03 -05:00
yindo closed this issue 2026-02-21 19:11:03 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 22, 2025):

Hello @FanJun1986! I'm Dosu, your friendly bot here to help you tackle bugs, answer your questions, and navigate the world of contributions while we wait for a human maintainer. Let's get started!

I found a similar open issue titled "The chatbot workflow returns answers containing other branches," which was closed after a pull request fixed the problem. The pull request addressed the issue by fixing answer node stream processing in conditional branches [1].

To address the problem you're experiencing, you might want to check the configurations of your LLM nodes. Ensure that the memory settings are correctly configured to prevent unintended data sharing between nodes. You can also use the debugging and tracing features available in Dify to track the data flow between nodes. This involves using the responseItem.workflowProcess object and its callbacks to trace the execution and data flow, which can help identify where the unintended data inclusion occurs [2].

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 (Apr 22, 2025): <!-- Greeting --> Hello @FanJun1986! I'm [Dosu](https://dosu.dev), your friendly bot here to help you tackle bugs, answer your questions, and navigate the world of contributions while we wait for a human maintainer. Let's get started! <!-- Answer --> I found a similar open issue titled "The chatbot workflow returns answers containing other branches," which was closed after a pull request fixed the problem. The pull request addressed the issue by fixing answer node stream processing in conditional branches <sup>[[1]](https://github.com/langgenius/dify/issues/10564)</sup>. To address the problem you're experiencing, you might want to check the configurations of your LLM nodes. Ensure that the memory settings are correctly configured to prevent unintended data sharing between nodes. You can also use the debugging and tracing features available in Dify to track the data flow between nodes. This involves using the `responseItem.workflowProcess` object and its callbacks to trace the execution and data flow, which can help identify where the unintended data inclusion occurs <sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/panel/debug-and-preview/hooks.ts)</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/6d9c0a2d-63e2-41f1-9d42-c157821b774c?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6d9c0a2d-63e2-41f1-9d42-c157821b774c?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6d9c0a2d-63e2-41f1-9d42-c157821b774c?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6d9c0a2d-63e2-41f1-9d42-c157821b774c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6d9c0a2d-63e2-41f1-9d42-c157821b774c?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/6d9c0a2d-63e2-41f1-9d42-c157821b774c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6d9c0a2d-63e2-41f1-9d42-c157821b774c?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 22, 2025):

the actual output of the first LLM node includes the results of knowledge retrieval for the next node as well as the analysis output of the LLM

I think you have already answered your question "The first one is used for user intent analysis with memory enabled".

For more concrete solution, you can disable both memory function and use conversational variables instead.

@crazywoola commented on GitHub (Apr 22, 2025): > the actual output of the first LLM node includes the results of knowledge retrieval for the next node as well as the analysis output of the LLM I think you have already answered your question "The first one is used for user intent analysis with memory enabled". For more concrete solution, you can disable both memory function and use conversational variables instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13202