semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

UpsertVectorsAsync in the QdrantVectorDbClient class

Open kenkenken123 opened this issue 2 years ago • 2 comments

UpsertVectorsAsync in the QdrantVectorDbClient class will not upsert. Because the code encounters some data in the database, it will jump out of the loop, so it is not added to the UpsertVector.

Below is the code: Microsoft.SemanticKernel.Connectors.Memory.Qdrant.QdrantVectorDbClient.UpsertVectorsAsync

foreach (var record in vectorData) { QdrantVectorRecord? existingRecord = await this.GetVectorsByIdAsync(collectionName, new[] { record.PointId }, false, cancellationToken).FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false);

        if (existingRecord != null)
        {
            continue;
        }

        requestBuilder.UpsertVector(record);
    }

kenkenken123 avatar May 17 '23 08:05 kenkenken123

@awharrison-28 can you take a look?

evchaki avatar May 18 '23 20:05 evchaki

it also seems strange that update is skipped if its an existinf record, even though method is called "upsert" - we have scenarios where we are updating the embeddings for an existing record. Can this limitation also be removed as part of the fix, so it always updates existing records?

amsingha avatar May 24 '23 23:05 amsingha