Support metadata-based search in knowledge base API #11946

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

Originally created by @liangliang4ward on GitHub (Mar 21, 2025).

Self Checks

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

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

Currently, the knowledge base API only supports text-based searches, but it would be highly beneficial to enable searching via metadata fields.

Feature Request:

Add support for querying knowledge base items using metadata attributes (e.g., tags, creation date, author, file type).
Provide a flexible query mechanism that allows combining full-text and metadata searches.
Ensure efficient indexing to maintain performance.
Use Case:
Users need to filter knowledge base entries based on metadata attributes instead of only relying on text search. For instance, retrieving all PDFs uploaded in the last 30 days or searching for documents tagged with "compliance".

Looking forward to your consideration!

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @liangliang4ward on GitHub (Mar 21, 2025). ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Currently, the knowledge base API only supports text-based searches, but it would be highly beneficial to enable searching via metadata fields. Feature Request: Add support for querying knowledge base items using metadata attributes (e.g., tags, creation date, author, file type). Provide a flexible query mechanism that allows combining full-text and metadata searches. Ensure efficient indexing to maintain performance. Use Case: Users need to filter knowledge base entries based on metadata attributes instead of only relying on text search. For instance, retrieving all PDFs uploaded in the last 30 days or searching for documents tagged with "compliance". Looking forward to your consideration! ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 19:04:53 -05:00
yindo closed this issue 2026-02-21 19:04:53 -05:00
Author
Owner

@gemchen commented on GitHub (Mar 21, 2025):

according to the dev logs:
version 1.1.0 already support metadata filter.

BUT, I tried the filter in the workflow, it's not work as in the blog. E.g. I set a filter with “document_name” start with "xxx", it still retrival all docs.

@gemchen commented on GitHub (Mar 21, 2025): according to the [dev logs](https://dify.ai/blog/dify-v1-1-0-filtering-knowledge-retrieval-with-customized-metadata): version 1.1.0 already support metadata filter. BUT, I tried the filter in the workflow, it's not work as in the blog. E.g. I set a filter with “document_name” start with "xxx", it still retrival all docs.
Author
Owner

@liangliang4ward commented on GitHub (Mar 21, 2025):

according to the dev logs: version 1.1.0 already support metadata filter.

BUT, I tried the filter in the workflow, it's not work as in the blog. E.g. I set a filter with “document_name” start with "xxx", it still retrival all docs.

Although the knowledge base node already supports metadata filtering, the API has not yet supported it.

@liangliang4ward commented on GitHub (Mar 21, 2025): > according to the [dev logs](https://dify.ai/blog/dify-v1-1-0-filtering-knowledge-retrieval-with-customized-metadata): version 1.1.0 already support metadata filter. > > BUT, I tried the filter in the workflow, it's not work as in the blog. E.g. I set a filter with “document_name” start with "xxx", it still retrival all docs. Although the knowledge base node already supports metadata filtering, the API has not yet supported it.
Author
Owner

@crazywoola commented on GitHub (Mar 21, 2025):

What's your version? We have a bunch of fixes related to this one https://github.com/langgenius/dify/pulls?q=is%3Apr+author%3AJohnJyong+is%3Aclosed

@crazywoola commented on GitHub (Mar 21, 2025): What's your version? We have a bunch of fixes related to this one https://github.com/langgenius/dify/pulls?q=is%3Apr+author%3AJohnJyong+is%3Aclosed
Author
Owner

@liangliang4ward commented on GitHub (Mar 23, 2025):

What's your version? We have a bunch of fixes related to this one https://github.com/langgenius/dify/pulls?q=is%3Apr+author%3AJohnJyong+is%3Aclosed

Image this api need support metadata serach

@liangliang4ward commented on GitHub (Mar 23, 2025): > What's your version? We have a bunch of fixes related to this one https://github.com/langgenius/dify/pulls?q=is%3Apr+author%3AJohnJyong+is%3Aclosed ![Image](https://github.com/user-attachments/assets/a91d137f-d38b-4c13-bff5-bc1623b3d2df) this api need support metadata serach
Author
Owner

@JulyMood commented on GitHub (Mar 27, 2025):

+1

@JulyMood commented on GitHub (Mar 27, 2025): +1
Author
Owner

@kamtang0823 commented on GitHub (Mar 27, 2025):

+1

@kamtang0823 commented on GitHub (Mar 27, 2025): +1
Author
Owner

@yathaarthmagi commented on GitHub (Mar 28, 2025):

+1, without this the api is insufficient.

@yathaarthmagi commented on GitHub (Mar 28, 2025): +1, without this the api is insufficient.
Author
Owner

@yathaarthmagi commented on GitHub (Mar 29, 2025):

Just wanted to know whether this addition to the knowledge api is planned ? The knowledge base features provided by dify are great, however, without metadata filtering in the search api, it will not for work for us! Really hope that gets added in the near future!

@yathaarthmagi commented on GitHub (Mar 29, 2025): Just wanted to know whether this addition to the knowledge api is planned ? The knowledge base features provided by dify are great, however, without metadata filtering in the search api, it will not for work for us! Really hope that gets added in the near future!
Author
Owner

@loshaless commented on GitHub (Apr 1, 2025):

+1

@loshaless commented on GitHub (Apr 1, 2025): +1
Author
Owner

@yathaarthmagi commented on GitHub (Apr 17, 2025):

Is this on the cards ?

@yathaarthmagi commented on GitHub (Apr 17, 2025): Is this on the cards ?
Author
Owner

@JulesFonsecaDiiage commented on GitHub (Apr 17, 2025):

+1

@JulesFonsecaDiiage commented on GitHub (Apr 17, 2025): +1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11946