Class QdrantEmbeddingStore
Implements the IVectorStore interface using Qdrant as the backend. Provides operations for creating, deleting, updating, and querying vector data with associated metadata, leveraging Qdrant's vector search capabilities.
public sealed class QdrantEmbeddingStore : IVectorStore, IDisposable
- Inheritance
-
QdrantEmbeddingStore
- Implements
- Inherited Members
Remarks
Metadata values are stored as string payload fields (the MetadataCollection contract).
To support the typed comparisons of MetadataFilter (numeric and date ranges, boolean
equality) with Qdrant's native range and match conditions, the store additionally writes typed
shadow payload fields for every metadata value that parses as a number, an ISO 8601 date, or a
boolean: lmkit_typed_num_<key> (double), lmkit_typed_ts_<key> (Unix epoch
milliseconds, double), and lmkit_typed_bool_<key> (bool). Shadow fields are maintained
on upsert and metadata update, hidden from metadata read-back, and used transparently by filter
translation.
Documented limits: typed (number, date, boolean) comparisons only match points written by a store
version that maintains shadow fields; points written earlier match string comparisons only. Ordinal
text range comparisons (gt/gte/lt/lte on string values) are not supported
by Qdrant and throw NotSupportedException. Date values are shadowed only when stored
in ISO 8601 form (starting with yyyy-MM-dd).
Constructors
- QdrantEmbeddingStore(QdrantGrpcClient)
Initializes a new instance of the QdrantEmbeddingStore class using a pre-configured QdrantGrpcClient. This constructor is intended for use under .NET Framework to support HTTPS connections with secure gRPC communication.
- QdrantEmbeddingStore(QdrantClient, bool)
Initializes a new instance of the QdrantEmbeddingStore class using the specified QdrantClient.
- QdrantEmbeddingStore(Uri, string, string)
Initializes a new instance of the QdrantEmbeddingStore.
Methods
- CollectionExistsAsync(string, CancellationToken)
Asynchronously checks if a collection with the specified identifier exists in the storage system.
- CreateCollectionAsync(string, uint, IEnumerable<string>, CancellationToken)
Asynchronously creates a new collection for storing vectors of a fixed size.
- DeleteCollectionAsync(string, CancellationToken)
Asynchronously deletes the specified collection from the storage system.
- DeleteFromMetadataAsync(string, MetadataCollection, CancellationToken)
Asynchronously deletes all vector entries from the specified collection that match the provided metadata filter.
- DeleteFromMetadataAsync(string, MetadataFilter, CancellationToken)
Asynchronously deletes all vector entries from the specified collection whose metadata satisfies the given filter expression.
- Dispose()
Releases all resources used by the QdrantEmbeddingStore.
- GetMetadataAsync(string, string, CancellationToken)
Asynchronously retrieves the metadata associated with a specific vector entry in a collection.
- ListCollectionsAsync(CancellationToken)
Asynchronously lists all collection identifiers available in the storage system.
- RetrieveFromMetadataAsync(string, MetadataCollection, VectorRetrievalOptions, uint, CancellationToken)
Asynchronously retrieves vector entries from the specified collection that match the given metadata criteria.
- RetrieveFromMetadataAsync(string, MetadataFilter, VectorRetrievalOptions, uint, CancellationToken)
Asynchronously retrieves vector entries from the specified collection whose metadata satisfies the given filter expression.
- SearchSimilarVectorsAsync(string, float[], uint, VectorRetrievalOptions, MetadataCollection, CancellationToken)
Asynchronously searches for vectors within the specified collection that are similar to a given query vector.
- SearchSimilarVectorsAsync(string, float[], uint, VectorRetrievalOptions, MetadataFilter, CancellationToken)
Asynchronously searches for vectors within the specified collection that are similar to a given query vector, restricted to entries whose metadata satisfies the given filter expression.
- UpdateMetadataAsync(string, string, MetadataCollection, MetadataUpdateMode, CancellationToken)
Asynchronously updates the metadata associated with an existing vector entry in the specified collection.
- UpsertAsync(string, string, float[], MetadataCollection, CancellationToken)
Asynchronously inserts a new vector entry or updates an existing one in the specified collection, along with its associated metadata.
- UpsertBatchAsync(string, IEnumerable<(string Id, float[] Vectors, MetadataCollection Metadata)>, CancellationToken)
Upserts multiple vectors with their associated metadata into the specified collection in a single batch operation.