dify icon indicating copy to clipboard operation
dify copied to clipboard

Support metadata-based search in knowledge base API

Open liangliang4ward opened this issue 9 months ago • 9 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [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.

liangliang4ward avatar Mar 21 '25 08:03 liangliang4ward

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 avatar Mar 21 '25 09:03 gemchen

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 avatar Mar 21 '25 09:03 liangliang4ward

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 avatar Mar 21 '25 10:03 crazywoola

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 avatar Mar 24 '25 01:03 liangliang4ward

+1

JulyMood avatar Mar 27 '25 10:03 JulyMood

+1

kamtang0823 avatar Mar 27 '25 10:03 kamtang0823

+1, without this the api is insufficient.

yathaarthmagi avatar Mar 28 '25 21:03 yathaarthmagi

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 avatar Mar 29 '25 09:03 yathaarthmagi

+1

loshaless avatar Apr 01 '25 06:04 loshaless

Is this on the cards ?

yathaarthmagi avatar Apr 17 '25 05:04 yathaarthmagi

+1

JulesFonsecaDiiage avatar Apr 17 '25 14:04 JulesFonsecaDiiage