Interface CollectionVectorOptions

Represents the options for the vector search.

Field

dimension - The dimension of the vectors.

Field

metric - The similarity metric to use for the vector search.

Field

service - Options related to configuring the automatic embedding service (vectorize)

interface CollectionVectorOptions {
    dimension?: number;
    metric?: "cosine" | "euclidean" | "dot_product";
    service?: VectorizeServiceOptions;
    sourceModel?: string;
}

Properties

dimension?: number

The dimension of the vectors stored in the collections.

If service is not provided, this must be set. Otherwise, the necessity of this being set comes on a per-model basis:

  • Some models have default vector dimensions which may be flexibly modified
  • Some models have no default dimension, and must be given an explicit one
  • Some models require a specific dimension that's already set by default

You can find out more information about each model in the DataStax docs, or through DbAdmin.findEmbeddingProviders.

metric?: "cosine" | "euclidean" | "dot_product"

The similarity metric to use for the vector search.

See intro to vector databases for more details.

The options for defining the embedding service used for vectorize, to automatically transform your text into a vector ready for semantic vector searching.

You can find out more information about each provider/model in the DataStax docs, or through DbAdmin.findEmbeddingProviders.

sourceModel?: string

Configures the index with the fastest settings for a given source of embeddings vectors.

As of time of writing, example sourceModels include 'openai-v3-large', 'cohere-v3', 'bert', and a handful of others.

If no source model if provided, this setting will default to 'other'.