For the same knowledge base, why can the chat assistant answer the answer of the knowledge base normally, but the probability of the agent answering the answer is less than 1 in 10? #13505

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

Originally created by @mu-dan on GitHub (Apr 28, 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.3.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

同样的知识库,为什么聊天助手可以正常回答知识库的答案,而agent添加知识库之后,有的时候不调用知识库且假设输出结果,有时候调用也不按照知识库的答案输出结果
For the same knowledge base, why can the chat assistant answer the answer of the knowledge base normally, but after the agent adds the knowledge base, sometimes it does not call the knowledge base and assumes the output result, and sometimes the call does not output the result according to the answer of the knowledge base

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @mu-dan on GitHub (Apr 28, 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.3.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 同样的知识库,为什么聊天助手可以正常回答知识库的答案,而agent添加知识库之后,有的时候不调用知识库且假设输出结果,有时候调用也不按照知识库的答案输出结果 For the same knowledge base, why can the chat assistant answer the answer of the knowledge base normally, but after the agent adds the knowledge base, sometimes it does not call the knowledge base and assumes the output result, and sometimes the call does not output the result according to the answer of the knowledge base ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🙋‍♂️ question label 2026-02-21 19:12:26 -05:00
yindo closed this issue 2026-02-21 19:12:26 -05:00
Author
Owner

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

Hello @mu-dan! I'm Dosu, your friendly bug-fixing bot. I'm here to help you solve issues, answer questions, and guide you as you contribute. While you're waiting for a human maintainer, feel free to share what's on your mind!

The issue you're experiencing is due to differences in how the chat assistant and the agent handle knowledge base retrieval. The chat assistant has built-in knowledge base retrieval functionality that automatically injects context from the knowledge base into the prompt for every question. This allows it to leverage semantic-level retrieval effectively, resulting in more accurate answers from the knowledge base [1].

In contrast, the agent lacks this built-in retrieval functionality and treats the knowledge base as an external tool. It makes autonomous decisions about whether to use the knowledge base, which can lead to inconsistent results. The agent's decision-making process may not always choose to use the knowledge base, or it may not retrieve the correct information due to limitations in its implementation [2][3].

To improve the agent's use of the knowledge base, you can adjust configuration settings such as retrieval mode, Top K, and score threshold. Additionally, providing detailed descriptions and explicit retrieval instructions for the knowledge base can help guide the agent in making better use of the stored content [4].

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 28, 2025): <!-- Greeting --> Hello @mu-dan! I'm [Dosu](https://dosu.dev), your friendly bug-fixing bot. I'm here to help you solve issues, answer questions, and guide you as you contribute. While you're waiting for a human maintainer, feel free to share what's on your mind! <!-- Answer --> The issue you're experiencing is due to differences in how the chat assistant and the agent handle knowledge base retrieval. The chat assistant has built-in knowledge base retrieval functionality that automatically injects context from the knowledge base into the prompt for every question. This allows it to leverage semantic-level retrieval effectively, resulting in more accurate answers from the knowledge base <sup>[[1]](https://github.com/langgenius/dify/issues/15669)</sup>. In contrast, the agent lacks this built-in retrieval functionality and treats the knowledge base as an external tool. It makes autonomous decisions about whether to use the knowledge base, which can lead to inconsistent results. The agent's decision-making process may not always choose to use the knowledge base, or it may not retrieve the correct information due to limitations in its implementation <sup>[[2]](https://github.com/langgenius/dify/issues/16964)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/18333)</sup>. To improve the agent's use of the knowledge base, you can adjust configuration settings such as retrieval mode, Top K, and score threshold. Additionally, providing detailed descriptions and explicit retrieval instructions for the knowledge base can help guide the agent in making better use of the stored content <sup>[[4]](https://github.com/langgenius/dify/issues/18331)</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/fd22e930-6012-406b-b165-9f5de3835d3d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/fd22e930-6012-406b-b165-9f5de3835d3d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/fd22e930-6012-406b-b165-9f5de3835d3d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/fd22e930-6012-406b-b165-9f5de3835d3d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fd22e930-6012-406b-b165-9f5de3835d3d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/fd22e930-6012-406b-b165-9f5de3835d3d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fd22e930-6012-406b-b165-9f5de3835d3d?feedback_type=other)</sup>
Author
Owner

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

In contrast, the agent lacks this built-in retrieval functionality and treats the knowledge base as an external tool. It makes autonomous decisions about whether to use the knowledge base, which can lead to inconsistent results. The agent's decision-making process may not always choose to use the knowledge base, or it may not retrieve the correct information due to limitations in its implementation https://github.com/langgenius/dify/issues/16964https://github.com/langgenius/dify/issues/18333.

You should refine the description of the knowledge.

@crazywoola commented on GitHub (Apr 28, 2025): > In contrast, the agent lacks this built-in retrieval functionality and treats the knowledge base as an external tool. It makes autonomous decisions about whether to use the knowledge base, which can lead to inconsistent results. The agent's decision-making process may not always choose to use the knowledge base, or it may not retrieve the correct information due to limitations in its implementation https://github.com/langgenius/dify/issues/16964https://github.com/langgenius/dify/issues/18333. You should refine the description of the knowledge.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13505