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

Qdrant Not Returning Filtered Documents as Expected #5633

Open
Mohana-Murugan opened this issue Dec 10, 2024 · 1 comment
Open

Qdrant Not Returning Filtered Documents as Expected #5633

Mohana-Murugan opened this issue Dec 10, 2024 · 1 comment

Comments

@Mohana-Murugan
Copy link

My exact issues are as follows

  • I have stored the RAG PDF under: user_id: K5617, Agent_id: 5307, Company ID: 101.
  • I have stored the HR Policies under: user_id: K5618, Agent_id: 5308, Company ID: 102

It works fine:
pic-1
pic-1

When IDs do not match:
pic-1

It provides the following wrong answer
pic-1

I am using the same embedding model, 'BAAI/bge-small-en-v1.5,' for storing and retrieving. However, I cannot identify the reason why I am getting these results.

When I pass this to the LLM, the model provides answers based on its pre-trained documents instead of retrieving information from Qdrant using a filter.

Without any filter, Qdrant works fine for us, and there is no doubt about that.

Originally posted by @Mohana-Murugan in #5863 (reply in thread)

@timvisee
Copy link
Member

Hi @Mohana-Murugan.

Could you print results or print result.payload for both queries. That'll allow me to see two things; first, the structure of your payload, and second if the results contain any entries that clearly don't match your filter.

Also, could you try if using explicit types for the payload filter as documented here makes any difference?

I mean something like this:

query_filter=models.Filter(
    must=[
        models.FieldCondition(
            key="user_id",
            match=models.MatchValue(
                value="K5617",
            ),
        ),
        models.FieldCondition(
            key="company_id",
            match=models.MatchValue(
                value="101",
            ),
        ),
        models.FieldCondition(
            key="agent_id",
            match=models.MatchValue(
                value="5307",
            ),
        ),
    ]
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants