-
Notifications
You must be signed in to change notification settings - Fork 15k
Metadata filtering with Manual option in Agent mode does not take effect when specifying input variables. #20314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @suntp! I'm Dosu and I’m helping the dify team. You've correctly identified a real issue: in Agent mode, manual metadata filtering does not take effect when specifying input variables because the system uses the display name instead of the variable name for filtering. This mismatch prevents the input from matching documents in the knowledge base as expected. This is a known limitation in Dify Agent applications. The Agent application was originally designed to support only external data tools and did not include the necessary code for knowledge base retrieval and metadata filtering, unlike Chatflow mode. As a result, metadata filtering in Agent mode has not worked as intended in past versions, including 1.4.1. There is a related discussion and confirmation of this limitation, along with a temporary fix provided in PR #19020 (issue reference). The root cause is that the metadata filtering condition is identified by a A recent fix has addressed a related issue where the What you can do:
If you need more details on how to apply the fix or where to make the change, let me know! To reply, just mention my name @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
hi,I've already identified the location of the problematic code and fixed it locally, as shown in the image below. Am I allowed to submit the code to resolve this bug? @crazywoola @JohnJyong ![]() |
…e effect when specifying input variables.(langgenius#20314)
Self Checks
Dify version
1.4.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
1、The specific settings in Agent mode are shown in the figure below.
2、I have found the cause of the problem. In Agent mode, the setting variable name for metadata filtering uses the display name; in chatflow mode, the variable name uses the variable name itself.The specific settings in Chatflow mode are shown in the figure below.
✔️ Expected Behavior
The input should hit the documents in the knowledge base.
❌ Actual Behavior
The input does not hit the documents in the knowledge base.
The text was updated successfully, but these errors were encountered: