Skip to content

Local mode accepts relevance-feedback queries with an empty feedback list #1446

Description

@Harsh23Kashyap

Problem

An empty relevance-feedback list is rejected by Qdrant server validation, but local mode accepts the same query and runs a normal target-vector search instead.

This makes a query behave differently when an application switches between QdrantClient(":memory:") and a server-backed client.

Reproduction

from qdrant_client import QdrantClient, models

client = QdrantClient(":memory:")
client.create_collection(
    "demo",
    vectors_config=models.VectorParams(size=2, distance=models.Distance.DOT),
)
client.upsert(
    "demo",
    [
        models.PointStruct(id=1, vector=[1.0, 0.0]),
        models.PointStruct(id=2, vector=[0.0, 1.0]),
    ],
)

query = models.RelevanceFeedbackQuery(
    relevance_feedback=models.RelevanceFeedbackInput(
        target=[1.0, 0.0],
        feedback=[],
        strategy=models.NaiveFeedbackStrategy(
            naive=models.NaiveFeedbackStrategyParams(a=0.5, b=1.0, c=0.7)
        ),
    )
)

print(client.query_points("demo", query=query).points)

On current master (cf747f4), local mode returns:

[ScoredPoint(id=1, score=0.5, ...), ScoredPoint(id=2, score=0.0, ...)]

The server rejects the request with feedback elements must be non-empty.

I reproduced the local result twice from a clean checkout. The mismatch comes from local query validation checking the naive strategy's b bound but not the server's non-empty feedback rule.

Expected behavior

Local mode should reject an empty feedback list before executing the query, matching the server.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions