Install and import from @langchain/qdrant instead.

Interface for the arguments that can be passed to the QdrantVectorStore constructor. It includes options for specifying a QdrantClient instance, the URL and API key for a Qdrant database, and the name and configuration for a collection.

interface QdrantLibArgs {
    apiKey?: string;
    client?: QdrantClient;
    collectionConfig?: {
        hnsw_config?: null | Record<string, unknown> | {
            ef_construct?: null | number;
            full_scan_threshold?: null | number;
            m?: null | number;
            max_indexing_threads?: null | number;
            on_disk?: null | boolean;
            payload_m?: null | number;
        };
        init_from?: null | Record<string, unknown> | {
            collection: string;
        };
        on_disk_payload?: null | boolean;
        optimizers_config?: null | Record<string, unknown> | {
            default_segment_number?: null | number;
            deleted_threshold?: null | number;
            flush_interval_sec?: null | number;
            indexing_threshold?: null | number;
            max_optimization_threads?:
                | null
                | number
                | Record<string, unknown>
                | "auto";
            max_segment_size?: null | number;
            memmap_threshold?: null | number;
            vacuum_min_vector_number?: null | number;
        };
        quantization_config?:
            | null
            | Record<string, unknown>
            | {
                scalar: {
                    always_ram?: null | boolean;
                    quantile?: null | number;
                    type: "int8";
                };
            }
            | {
                product: {
                    always_ram?: null | boolean;
                    compression:
                        | "x4"
                        | "x8"
                        | "x16"
                        | "x32"
                        | "x64";
                };
            }
            | {
                binary: {
                    always_ram?: null | boolean;
                    encoding?:
                        | null
                        | Record<string, unknown>
                        | "one_bit"
                        | "two_bits"
                        | "one_and_half_bits";
                    query_encoding?:
                        | null
                        | "default"
                        | Record<string, unknown>
                        | "binary"
                        | "scalar4bits"
                        | "scalar8bits";
                };
            };
        replication_factor?: null | number;
        shard_number?: null | number;
        sharding_method?:
            | null
            | Record<string, unknown>
            | "auto"
            | "custom";
        sparse_vectors?: null | {
            [key: string]: components["schemas"]["SparseVectorParams"] | undefined;
        };
        strict_mode_config?: null | Record<string, unknown> | {
            condition_max_size?: null | number;
            enabled?: null | boolean;
            filter_max_conditions?: null | number;
            max_collection_payload_size_bytes?: null | number;
            max_collection_vector_size_bytes?: null | number;
            max_points_count?: null | number;
            max_query_limit?: null | number;
            max_timeout?: null | number;
            multivector_config?: null | Record<string, unknown> | {
                [key: string]: components["schemas"]["StrictModeMultivector"] | undefined;
            };
            read_rate_limit?: null | number;
            search_allow_exact?: null | boolean;
            search_max_hnsw_ef?: null | number;
            search_max_oversampling?: null | number;
            sparse_config?: null | Record<string, unknown> | {
                [key: string]: components["schemas"]["StrictModeSparse"] | undefined;
            };
            unindexed_filtering_retrieve?: null | boolean;
            unindexed_filtering_update?: null | boolean;
            upsert_max_batchsize?: null | number;
            write_rate_limit?: null | number;
        };
        vectors?: {
            datatype?:
                | null
                | Record<string, unknown>
                | "float32"
                | "uint8"
                | "float16";
            distance:
                | "Cosine"
                | "Euclid"
                | "Dot"
                | "Manhattan";
            hnsw_config?: null | Record<string, unknown> | {
                ef_construct?: null | number;
                full_scan_threshold?: null | number;
                m?: null | number;
                max_indexing_threads?: null | number;
                on_disk?: null | boolean;
                payload_m?: null | number;
            };
            multivector_config?: null | Record<string, unknown> | {
                comparator: "max_sim";
            };
            on_disk?: null | boolean;
            quantization_config?:
                | null
                | Record<string, unknown>
                | {
                    scalar: {
                        always_ram?: null | boolean;
                        quantile?: null | number;
                        type: "int8";
                    };
                }
                | {
                    product: {
                        always_ram?: null | boolean;
                        compression:
                            | "x4"
                            | "x8"
                            | "x16"
                            | "x32"
                            | "x64";
                    };
                }
                | {
                    binary: {
                        always_ram?: null | boolean;
                        encoding?:
                            | null
                            | Record<string, unknown>
                            | "one_bit"
                            | "two_bits"
                            | "one_and_half_bits";
                        query_encoding?:
                            | null
                            | "default"
                            | Record<string, unknown>
                            | "binary"
                            | "scalar4bits"
                            | "scalar8bits";
                    };
                };
            size: number;
        } | {
            [key: string]: components["schemas"]["VectorParams"] | undefined;
        };
        wal_config?: null | Record<string, unknown> | {
            wal_capacity_mb?: null | number;
            wal_segments_ahead?: null | number;
        };
        write_consistency_factor?: null | number;
    };
    collectionName?: string;
    contentPayloadKey?: string;
    customPayload?: Record<string, any>[];
    metadataPayloadKey?: string;
    url?: string;
}

Properties

apiKey?: string
client?: QdrantClient
collectionConfig?: {
    hnsw_config?: null | Record<string, unknown> | {
        ef_construct?: null | number;
        full_scan_threshold?: null | number;
        m?: null | number;
        max_indexing_threads?: null | number;
        on_disk?: null | boolean;
        payload_m?: null | number;
    };
    init_from?: null | Record<string, unknown> | {
        collection: string;
    };
    on_disk_payload?: null | boolean;
    optimizers_config?: null | Record<string, unknown> | {
        default_segment_number?: null | number;
        deleted_threshold?: null | number;
        flush_interval_sec?: null | number;
        indexing_threshold?: null | number;
        max_optimization_threads?:
            | null
            | number
            | Record<string, unknown>
            | "auto";
        max_segment_size?: null | number;
        memmap_threshold?: null | number;
        vacuum_min_vector_number?: null | number;
    };
    quantization_config?:
        | null
        | Record<string, unknown>
        | {
            scalar: {
                always_ram?: null | boolean;
                quantile?: null | number;
                type: "int8";
            };
        }
        | {
            product: {
                always_ram?: null | boolean;
                compression:
                    | "x4"
                    | "x8"
                    | "x16"
                    | "x32"
                    | "x64";
            };
        }
        | {
            binary: {
                always_ram?: null | boolean;
                encoding?:
                    | null
                    | Record<string, unknown>
                    | "one_bit"
                    | "two_bits"
                    | "one_and_half_bits";
                query_encoding?:
                    | null
                    | "default"
                    | Record<string, unknown>
                    | "binary"
                    | "scalar4bits"
                    | "scalar8bits";
            };
        };
    replication_factor?: null | number;
    shard_number?: null | number;
    sharding_method?:
        | null
        | Record<string, unknown>
        | "auto"
        | "custom";
    sparse_vectors?: null | {
        [key: string]: components["schemas"]["SparseVectorParams"] | undefined;
    };
    strict_mode_config?: null | Record<string, unknown> | {
        condition_max_size?: null | number;
        enabled?: null | boolean;
        filter_max_conditions?: null | number;
        max_collection_payload_size_bytes?: null | number;
        max_collection_vector_size_bytes?: null | number;
        max_points_count?: null | number;
        max_query_limit?: null | number;
        max_timeout?: null | number;
        multivector_config?: null | Record<string, unknown> | {
            [key: string]: components["schemas"]["StrictModeMultivector"] | undefined;
        };
        read_rate_limit?: null | number;
        search_allow_exact?: null | boolean;
        search_max_hnsw_ef?: null | number;
        search_max_oversampling?: null | number;
        sparse_config?: null | Record<string, unknown> | {
            [key: string]: components["schemas"]["StrictModeSparse"] | undefined;
        };
        unindexed_filtering_retrieve?: null | boolean;
        unindexed_filtering_update?: null | boolean;
        upsert_max_batchsize?: null | number;
        write_rate_limit?: null | number;
    };
    vectors?: {
        datatype?:
            | null
            | Record<string, unknown>
            | "float32"
            | "uint8"
            | "float16";
        distance:
            | "Cosine"
            | "Euclid"
            | "Dot"
            | "Manhattan";
        hnsw_config?: null | Record<string, unknown> | {
            ef_construct?: null | number;
            full_scan_threshold?: null | number;
            m?: null | number;
            max_indexing_threads?: null | number;
            on_disk?: null | boolean;
            payload_m?: null | number;
        };
        multivector_config?: null | Record<string, unknown> | {
            comparator: "max_sim";
        };
        on_disk?: null | boolean;
        quantization_config?:
            | null
            | Record<string, unknown>
            | {
                scalar: {
                    always_ram?: null | boolean;
                    quantile?: null | number;
                    type: "int8";
                };
            }
            | {
                product: {
                    always_ram?: null | boolean;
                    compression:
                        | "x4"
                        | "x8"
                        | "x16"
                        | "x32"
                        | "x64";
                };
            }
            | {
                binary: {
                    always_ram?: null | boolean;
                    encoding?:
                        | null
                        | Record<string, unknown>
                        | "one_bit"
                        | "two_bits"
                        | "one_and_half_bits";
                    query_encoding?:
                        | null
                        | "default"
                        | Record<string, unknown>
                        | "binary"
                        | "scalar4bits"
                        | "scalar8bits";
                };
            };
        size: number;
    } | {
        [key: string]: components["schemas"]["VectorParams"] | undefined;
    };
    wal_config?: null | Record<string, unknown> | {
        wal_capacity_mb?: null | number;
        wal_segments_ahead?: null | number;
    };
    write_consistency_factor?: null | number;
}

Type declaration

  • Optionalhnsw_config?: null | Record<string, unknown> | {
        ef_construct?: null | number;
        full_scan_threshold?: null | number;
        m?: null | number;
        max_indexing_threads?: null | number;
        on_disk?: null | boolean;
        payload_m?: null | number;
    }

    Custom params for HNSW index. If none - values from service configuration file are used.

  • Optionalinit_from?: null | Record<string, unknown> | {
        collection: string;
    }

    Specify other collection to copy data from.

    null
    
  • Optionalon_disk_payload?: null | boolean

    If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.

    Default: true

    null
    
  • Optionaloptimizers_config?: null | Record<string, unknown> | {
        default_segment_number?: null | number;
        deleted_threshold?: null | number;
        flush_interval_sec?: null | number;
        indexing_threshold?: null | number;
        max_optimization_threads?:
            | null
            | number
            | Record<string, unknown>
            | "auto";
        max_segment_size?: null | number;
        memmap_threshold?: null | number;
        vacuum_min_vector_number?: null | number;
    }

    Custom params for Optimizers. If none - values from service configuration file are used.

  • Optionalquantization_config?:
        | null
        | Record<string, unknown>
        | {
            scalar: {
                always_ram?: null | boolean;
                quantile?: null | number;
                type: "int8";
            };
        }
        | {
            product: {
                always_ram?: null | boolean;
                compression:
                    | "x4"
                    | "x8"
                    | "x16"
                    | "x32"
                    | "x64";
            };
        }
        | {
            binary: {
                always_ram?: null | boolean;
                encoding?:
                    | null
                    | Record<string, unknown>
                    | "one_bit"
                    | "two_bits"
                    | "one_and_half_bits";
                query_encoding?:
                    | null
                    | "default"
                    | Record<string, unknown>
                    | "binary"
                    | "scalar4bits"
                    | "scalar8bits";
            };
        }

    Quantization parameters. If none - quantization is disabled.

    null
    
  • Optionalreplication_factor?: null | number

    Format: uint32

    Number of shards replicas. Default is 1 Minimum is 1

    null
    
  • Optionalshard_number?: null | number

    Format: uint32

    For auto sharding: Number of shards in collection. - Default is 1 for standalone, otherwise equal to the number of nodes - Minimum is 1

    For custom sharding: Number of shards in collection per shard group. - Default is 1, meaning that each shard key will be mapped to a single shard - Minimum is 1

    null
    
  • Optionalsharding_method?:
        | null
        | Record<string, unknown>
        | "auto"
        | "custom"

    Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key

    null
    
  • Optionalsparse_vectors?: null | {
        [key: string]: components["schemas"]["SparseVectorParams"] | undefined;
    }

    Sparse vector data config.

  • Optionalstrict_mode_config?: null | Record<string, unknown> | {
        condition_max_size?: null | number;
        enabled?: null | boolean;
        filter_max_conditions?: null | number;
        max_collection_payload_size_bytes?: null | number;
        max_collection_vector_size_bytes?: null | number;
        max_points_count?: null | number;
        max_query_limit?: null | number;
        max_timeout?: null | number;
        multivector_config?: null | Record<string, unknown> | {
            [key: string]: components["schemas"]["StrictModeMultivector"] | undefined;
        };
        read_rate_limit?: null | number;
        search_allow_exact?: null | boolean;
        search_max_hnsw_ef?: null | number;
        search_max_oversampling?: null | number;
        sparse_config?: null | Record<string, unknown> | {
            [key: string]: components["schemas"]["StrictModeSparse"] | undefined;
        };
        unindexed_filtering_retrieve?: null | boolean;
        unindexed_filtering_update?: null | boolean;
        upsert_max_batchsize?: null | number;
        write_rate_limit?: null | number;
    }

    Strict-mode config.

  • Optionalvectors?: {
        datatype?:
            | null
            | Record<string, unknown>
            | "float32"
            | "uint8"
            | "float16";
        distance:
            | "Cosine"
            | "Euclid"
            | "Dot"
            | "Manhattan";
        hnsw_config?: null | Record<string, unknown> | {
            ef_construct?: null | number;
            full_scan_threshold?: null | number;
            m?: null | number;
            max_indexing_threads?: null | number;
            on_disk?: null | boolean;
            payload_m?: null | number;
        };
        multivector_config?: null | Record<string, unknown> | {
            comparator: "max_sim";
        };
        on_disk?: null | boolean;
        quantization_config?:
            | null
            | Record<string, unknown>
            | {
                scalar: {
                    always_ram?: null | boolean;
                    quantile?: null | number;
                    type: "int8";
                };
            }
            | {
                product: {
                    always_ram?: null | boolean;
                    compression:
                        | "x4"
                        | "x8"
                        | "x16"
                        | "x32"
                        | "x64";
                };
            }
            | {
                binary: {
                    always_ram?: null | boolean;
                    encoding?:
                        | null
                        | Record<string, unknown>
                        | "one_bit"
                        | "two_bits"
                        | "one_and_half_bits";
                    query_encoding?:
                        | null
                        | "default"
                        | Record<string, unknown>
                        | "binary"
                        | "scalar4bits"
                        | "scalar8bits";
                };
            };
        size: number;
    } | {
        [key: string]: components["schemas"]["VectorParams"] | undefined;
    }
  • Optionalwal_config?: null | Record<string, unknown> | {
        wal_capacity_mb?: null | number;
        wal_segments_ahead?: null | number;
    }

    Custom params for WAL. If none - values from service configuration file are used.

  • Optionalwrite_consistency_factor?: null | number

    Format: uint32

    Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.

    null
    
collectionName?: string
contentPayloadKey?: string
customPayload?: Record<string, any>[]
metadataPayloadKey?: string
url?: string