Skip to content
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

FAISS filter is not working #26379

Closed
5 tasks done
yairTray opened this issue Sep 12, 2024 · 5 comments · Fixed by #28207
Closed
5 tasks done

FAISS filter is not working #26379

yairTray opened this issue Sep 12, 2024 · 5 comments · Fixed by #28207
Labels
investigate Flagged for investigation. Ɑ: vector store Related to vector store module

Comments

@yairTray
Copy link

yairTray commented Sep 12, 2024

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

k=2

combined_filter = {
"$and": [
schema_filter,
handler_filter,
]
}
base_retriever = vectorstore.as_retriever(
search_kwargs={"k": k, "filter": combined_filter}
)
filtered_docs = await base_retriever.ainvoke(query)

Error Message and Stack Trace (if applicable)

No response

Description

i see that the faiss vectorstore include documents with the right schema_type and handler_type but no documents are return in the filtered_docs variable.

System Info

langchain version : 0.2.16
langchaion_community version : 0.2.16

@langcarl langcarl bot added the investigate Flagged for investigation. label Sep 12, 2024
@dosubot dosubot bot added the Ɑ: vector store Related to vector store module label Sep 12, 2024
@keenborder786
Copy link
Contributor

keenborder786 commented Sep 13, 2024

Can you share the schema_filter and handler_filter definition?

@yairTray
Copy link
Author

yairTray commented Sep 15, 2024

sure.
schema_filter = {"schema_type": {"$eq": schema_type}}
handler_filter = {"handler_type": {"$eq": handler_type}}

@RuofanChen03
Copy link
Contributor

Hi, I was able to replicate the issue. Were you able to resolve this issue?

@yairTray
Copy link
Author

yairTray commented Oct 6, 2024

no, the problem still happen.

@RuofanChen03
Copy link
Contributor

RuofanChen03 commented Oct 22, 2024

Hi, my group (@vincentzhang15 @TANYAL77 @LikeWang10067) and I (students from UofT for a course) are working on a fix, which would allow filters to be built with your desired syntax. Hoping to fix this soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Flagged for investigation. Ɑ: vector store Related to vector store module
Projects
None yet
3 participants