Add support for Amazon Bedrock Knowledge Base document filtering using metadata #5600
nick-elpedes
started this conversation in
Ideas
Replies: 3 comments 1 reply
-
Edited initial post to include a possible proposal of implementation in langchain js |
Beta Was this translation helpful? Give feedback.
0 replies
-
Any updates on this? This is a crucial functionality for something we are trying to build. |
Beta Was this translation helpful? Give feedback.
0 replies
-
If it helps, it was implemented in libs/langchain-aws/src/retrievers/bedrock.ts and released 3 days ago in version 0.0.6 of the langchain/aws. But I agree, it would make more sense do extend the langchain/community implementation instead of having two. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked
Feature request
When using Bedrock to retrieve data using the AWS SDK, you are allowed to pass filters to only retrieve certain documents in your knowledge base that are tagged with metadata. This functionality should be added to Langchain, since it supports the bedrock:Retrieve function. This would allow for greater output control when using langchain to query an Amazon Knowledge Base, since you can specify what documents are available for retrieval using filters.
Filtering Using Metadata
Example API Request
Motivation
Currently, langchain supports retrieving metadata from the returned documents (see #5535 ). However, langchain does not currently support the filter aspect of the retrieval function from Bedrock. It is frustrating to have to use AWS SDK for half of a chain and use langchain for the other half. It would be nice if all the parts of the retrieval function were available to be used in langchain.
Proposal (If applicable)
Change the Amazon Knowledge Base query functionality to support filtering by metadata
Maybe something like this?
Beta Was this translation helpful? Give feedback.
All reactions