Using Knowledge Retrieval as a tool for agent #21045

Open
opened 2026-02-21 20:10:25 -05:00 by yindo · 3 comments
Owner

Originally created by @ooodwbooo on GitHub (Dec 15, 2025).

Originally assigned to: @fatelei on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

I’m using Dify’s Agent to handle complex professional tasks and internal knowledge queries. Currently, the knowledge base only provides fixed information support, and the Agent can’t actively retrieve knowledge based on its own planning. When facing questions that require specific data or updated content, the Agent either gives incomplete answers or relies on pre-set prompts, failing to leverage its strengths in task decomposition and autonomous reasoning. I hope the Agent can treat knowledge retrieval as a callable tool, deciding when and how to retrieve information independently to deliver more accurate and flexible results.

In reality, I encapsulated the knowledge retrieval process into a tool via a workflow and delegated its invocation to the agent, but this approach causes the citations to become invalid.

2. Additional context or comments

This feature aligns with the Agent’s ReAct reasoning framework and Agentic RAG trends, enabling the Agent to form a "think-retrieve-optimize" loop . It can avoid the Agent making up answers due to outdated or insufficient built-in knowledge, while reducing the cost of manually configuring knowledge-related prompt logic. It’s recommended to support configuring knowledge base selection and retrieval parameters (e.g., similarity threshold) in tool settings, and display retrieval records in the execution log for traceability.

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @ooodwbooo on GitHub (Dec 15, 2025). Originally assigned to: @fatelei on GitHub. ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. I’m using Dify’s Agent to handle complex professional tasks and internal knowledge queries. Currently, the knowledge base only provides fixed information support, and the Agent can’t actively retrieve knowledge based on its own planning. When facing questions that require specific data or updated content, the Agent either gives incomplete answers or relies on pre-set prompts, failing to leverage its strengths in task decomposition and autonomous reasoning. I hope the Agent can treat knowledge retrieval as a callable tool, deciding when and how to retrieve information independently to deliver more accurate and flexible results. In reality, I encapsulated the knowledge retrieval process into a tool via a workflow and delegated its invocation to the agent, but this approach causes the citations to become invalid. ### 2. Additional context or comments This feature aligns with the Agent’s ReAct reasoning framework and Agentic RAG trends, enabling the Agent to form a "think-retrieve-optimize" loop . It can avoid the Agent making up answers due to outdated or insufficient built-in knowledge, while reducing the cost of manually configuring knowledge-related prompt logic. It’s recommended to support configuring knowledge base selection and retrieval parameters (e.g., similarity threshold) in tool settings, and display retrieval records in the execution log for traceability. ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 🤖 feat:agent🔨 feat:tools labels 2026-02-21 20:10:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 16, 2026):

Hi, @ooodwbooo. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested enhancing Dify's Agent to autonomously invoke knowledge retrieval as a callable tool.
  • Current limitations include fixed knowledge bases and preset prompts leading to incomplete answers.
  • You suggested adding configurable retrieval parameters and execution log visibility for better traceability.
  • No further activity or comments have been posted since your initial request.
  • The issue remains unresolved and open for contributions.

Next Steps:

  • Please let me know if this feature request is still relevant to the latest version of Dify by commenting on this issue.
  • If I do not hear back within 15 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jan 16, 2026): Hi, @ooodwbooo. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested enhancing Dify's Agent to autonomously invoke knowledge retrieval as a callable tool. - Current limitations include fixed knowledge bases and preset prompts leading to incomplete answers. - You suggested adding configurable retrieval parameters and execution log visibility for better traceability. - No further activity or comments have been posted since your initial request. - The issue remains unresolved and open for contributions. **Next Steps:** - Please let me know if this feature request is still relevant to the latest version of Dify by commenting on this issue. - If I do not hear back within 15 days, I will automatically close this issue. Thank you for your understanding and contribution!
Author
Owner

@hxt365 commented on GitHub (Jan 29, 2026):

This is a crucial tool for the agent

@hxt365 commented on GitHub (Jan 29, 2026): This is a crucial tool for the agent
Author
Owner

@dosubot[bot] commented on GitHub (Jan 29, 2026):

@crazywoola The user has confirmed that the enhancement for the agent to autonomously invoke knowledge retrieval as a callable tool is still crucial. Could you please assist with this issue?

@dosubot[bot] commented on GitHub (Jan 29, 2026): @crazywoola The user has confirmed that the enhancement for the agent to autonomously invoke knowledge retrieval as a callable tool is still crucial. Could you please assist with this issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21045