-
-
Notifications
You must be signed in to change notification settings - Fork 17k
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
Feature/Add support for state-based metadata filter to Retriever Tool #3501
Feature/Add support for state-based metadata filter to Retriever Tool #3501
Conversation
Interesting! do you have an example use case? |
Sure. We've found that our RAG flow often returns irrelevant documents. To be a bit more precise, result documents contain some content related to some words used by the user but are found in documents on a completely different subject. So, we've tasked one of our LLM Nodes to figure out the subject of the conversation and save that to state (at this point we can form a metadata filter object). Later down the line, we would like to take that subject and use it to narrow down the query to the vector store. Is there a way to implement this flow using existing functionality? I couldn't find one and had to add this property to a Retriever Tool. |
This would not allow complex/nested filters, right? |
Do you have an example of that? Under the hood it's just a simple JSON that adds on top of existing filter |
Here is an example from pinecone documentation: Would the functionality you suggested support this kind of syntax? |
yep definitely. If thats okay I can make the changes on this PR, you can then try it out |
Sounds good! |
Updated, try and test see if it works @serhiy-matoffo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging
so excited to try this out. As of now I'm trying to use metadata filter like so for postgres: EDIT:
We still plan to adopt this feature and dynamically filter from agent state. Unfortunately the most power lies in integrating it with pinecone. |
@HenryHengZJ Please advise .. Also the above filter mechanism (which had worked through "Test Retrieval Query" doesnt work for this new feature. Somehow the filter is not passed down to the postgres query. |
Extended Retriever Tool to support metadata filter based on the object stored in agent state.