Install and import from @langchain/qdrant instead.

Class that extends the VectorStore base class to interact with a Qdrant database. It includes methods for adding documents and vectors to the Qdrant database, searching for similar vectors, and ensuring the existence of a collection in the database.

Hierarchy

  • VectorStore
    • QdrantVectorStore

Constructors

Properties

FilterType: {
    min_should?: null | Record<string, unknown> | {
        conditions: (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[];
        min_count: number;
    };
    must?: null | (
        | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
        | {
            geo_bounding_box?: null | Record<string, unknown> | {
                bottom_right: {
                    lat: number;
                    lon: number;
                };
                top_left: {
                    lat: number;
                    lon: number;
                };
            };
            geo_polygon?: null | Record<string, unknown> | {
                exterior: {
                    points: {
                        lat: number;
                        lon: number;
                    }[];
                };
                interiors?: null | {
                    points: (...)[];
                }[];
            };
            geo_radius?: null | Record<string, unknown> | {
                center: {
                    lat: number;
                    lon: number;
                };
                radius: number;
            };
            key: string;
            match?:
                | null
                | Record<string, unknown>
                | {
                    value: string | number | boolean;
                }
                | {
                    text: string;
                }
                | {
                    any: string[] | number[];
                }
                | {
                    except: string[] | number[];
                };
            range?:
                | null
                | Record<string, unknown>
                | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                }
                | {
                    gt?: null | string;
                    gte?: null | string;
                    lt?: null | string;
                    lte?: null | string;
                };
            values_count?: null | Record<string, unknown> | {
                gt?: null | number;
                gte?: null | number;
                lt?: null | number;
                lte?: null | number;
            };
        }
        | {
            is_empty: {
                key: string;
            };
        }
        | {
            is_null: {
                key: string;
            };
        }
        | {
            has_id: (string | number)[];
        }
        | {
            nested: {
                filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                key: string;
            };
        })[];
    must_not?: null | (
        | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
        | {
            geo_bounding_box?: null | Record<string, unknown> | {
                bottom_right: {
                    lat: number;
                    lon: number;
                };
                top_left: {
                    lat: number;
                    lon: number;
                };
            };
            geo_polygon?: null | Record<string, unknown> | {
                exterior: {
                    points: {
                        lat: number;
                        lon: number;
                    }[];
                };
                interiors?: null | {
                    points: (...)[];
                }[];
            };
            geo_radius?: null | Record<string, unknown> | {
                center: {
                    lat: number;
                    lon: number;
                };
                radius: number;
            };
            key: string;
            match?:
                | null
                | Record<string, unknown>
                | {
                    value: string | number | boolean;
                }
                | {
                    text: string;
                }
                | {
                    any: string[] | number[];
                }
                | {
                    except: string[] | number[];
                };
            range?:
                | null
                | Record<string, unknown>
                | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                }
                | {
                    gt?: null | string;
                    gte?: null | string;
                    lt?: null | string;
                    lte?: null | string;
                };
            values_count?: null | Record<string, unknown> | {
                gt?: null | number;
                gte?: null | number;
                lt?: null | number;
                lte?: null | number;
            };
        }
        | {
            is_empty: {
                key: string;
            };
        }
        | {
            is_null: {
                key: string;
            };
        }
        | {
            has_id: (string | number)[];
        }
        | {
            nested: {
                filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                key: string;
            };
        })[];
    should?: null | (
        | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
        | {
            geo_bounding_box?: null | Record<string, unknown> | {
                bottom_right: {
                    lat: number;
                    lon: number;
                };
                top_left: {
                    lat: number;
                    lon: number;
                };
            };
            geo_polygon?: null | Record<string, unknown> | {
                exterior: {
                    points: {
                        lat: number;
                        lon: number;
                    }[];
                };
                interiors?: null | {
                    points: (...)[];
                }[];
            };
            geo_radius?: null | Record<string, unknown> | {
                center: {
                    lat: number;
                    lon: number;
                };
                radius: number;
            };
            key: string;
            match?:
                | null
                | Record<string, unknown>
                | {
                    value: string | number | boolean;
                }
                | {
                    text: string;
                }
                | {
                    any: string[] | number[];
                }
                | {
                    except: string[] | number[];
                };
            range?:
                | null
                | Record<string, unknown>
                | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                }
                | {
                    gt?: null | string;
                    gte?: null | string;
                    lt?: null | string;
                    lte?: null | string;
                };
            values_count?: null | Record<string, unknown> | {
                gt?: null | number;
                gte?: null | number;
                lt?: null | number;
                lte?: null | number;
            };
        }
        | {
            is_empty: {
                key: string;
            };
        }
        | {
            is_null: {
                key: string;
            };
        }
        | {
            has_id: (string | number)[];
        }
        | {
            nested: {
                filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                key: string;
            };
        })[];
}

Type declaration

  • Optionalmin_should?: null | Record<string, unknown> | {
        conditions: (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[];
        min_count: number;
    }

    At least minimum amount of given conditions should match

  • Optionalmust?: null | (
        | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
        | {
            geo_bounding_box?: null | Record<string, unknown> | {
                bottom_right: {
                    lat: number;
                    lon: number;
                };
                top_left: {
                    lat: number;
                    lon: number;
                };
            };
            geo_polygon?: null | Record<string, unknown> | {
                exterior: {
                    points: {
                        lat: number;
                        lon: number;
                    }[];
                };
                interiors?: null | {
                    points: (...)[];
                }[];
            };
            geo_radius?: null | Record<string, unknown> | {
                center: {
                    lat: number;
                    lon: number;
                };
                radius: number;
            };
            key: string;
            match?:
                | null
                | Record<string, unknown>
                | {
                    value: string | number | boolean;
                }
                | {
                    text: string;
                }
                | {
                    any: string[] | number[];
                }
                | {
                    except: string[] | number[];
                };
            range?:
                | null
                | Record<string, unknown>
                | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                }
                | {
                    gt?: null | string;
                    gte?: null | string;
                    lt?: null | string;
                    lte?: null | string;
                };
            values_count?: null | Record<string, unknown> | {
                gt?: null | number;
                gte?: null | number;
                lt?: null | number;
                lte?: null | number;
            };
        }
        | {
            is_empty: {
                key: string;
            };
        }
        | {
            is_null: {
                key: string;
            };
        }
        | {
            has_id: (string | number)[];
        }
        | {
            nested: {
                filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                key: string;
            };
        })[]

    All conditions must match

  • Optionalmust_not?: null | (
        | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
        | {
            geo_bounding_box?: null | Record<string, unknown> | {
                bottom_right: {
                    lat: number;
                    lon: number;
                };
                top_left: {
                    lat: number;
                    lon: number;
                };
            };
            geo_polygon?: null | Record<string, unknown> | {
                exterior: {
                    points: {
                        lat: number;
                        lon: number;
                    }[];
                };
                interiors?: null | {
                    points: (...)[];
                }[];
            };
            geo_radius?: null | Record<string, unknown> | {
                center: {
                    lat: number;
                    lon: number;
                };
                radius: number;
            };
            key: string;
            match?:
                | null
                | Record<string, unknown>
                | {
                    value: string | number | boolean;
                }
                | {
                    text: string;
                }
                | {
                    any: string[] | number[];
                }
                | {
                    except: string[] | number[];
                };
            range?:
                | null
                | Record<string, unknown>
                | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                }
                | {
                    gt?: null | string;
                    gte?: null | string;
                    lt?: null | string;
                    lte?: null | string;
                };
            values_count?: null | Record<string, unknown> | {
                gt?: null | number;
                gte?: null | number;
                lt?: null | number;
                lte?: null | number;
            };
        }
        | {
            is_empty: {
                key: string;
            };
        }
        | {
            is_null: {
                key: string;
            };
        }
        | {
            has_id: (string | number)[];
        }
        | {
            nested: {
                filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                key: string;
            };
        })[]

    All conditions must NOT match

  • Optionalshould?: null | (
        | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
        | {
            geo_bounding_box?: null | Record<string, unknown> | {
                bottom_right: {
                    lat: number;
                    lon: number;
                };
                top_left: {
                    lat: number;
                    lon: number;
                };
            };
            geo_polygon?: null | Record<string, unknown> | {
                exterior: {
                    points: {
                        lat: number;
                        lon: number;
                    }[];
                };
                interiors?: null | {
                    points: (...)[];
                }[];
            };
            geo_radius?: null | Record<string, unknown> | {
                center: {
                    lat: number;
                    lon: number;
                };
                radius: number;
            };
            key: string;
            match?:
                | null
                | Record<string, unknown>
                | {
                    value: string | number | boolean;
                }
                | {
                    text: string;
                }
                | {
                    any: string[] | number[];
                }
                | {
                    except: string[] | number[];
                };
            range?:
                | null
                | Record<string, unknown>
                | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                }
                | {
                    gt?: null | string;
                    gte?: null | string;
                    lt?: null | string;
                    lte?: null | string;
                };
            values_count?: null | Record<string, unknown> | {
                gt?: null | number;
                gte?: null | number;
                lt?: null | number;
                lte?: null | number;
            };
        }
        | {
            is_empty: {
                key: string;
            };
        }
        | {
            is_null: {
                key: string;
            };
        }
        | {
            has_id: (string | number)[];
        }
        | {
            nested: {
                filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                key: string;
            };
        })[]

    At least one of those conditions should match

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;
        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;
            };
        };
    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;
    };
    vectors?: {
        datatype?:
            | null
            | Record<string, unknown>
            | "float32"
            | "uint8";
        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;
        };
        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;
                };
            };
        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.

    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;
        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;
            };
        }

    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.

  • Optionalvectors?: {
        datatype?:
            | null
            | Record<string, unknown>
            | "float32"
            | "uint8";
        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;
        };
        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;
                };
            };
        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
embeddings: EmbeddingsInterface

Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.

metadataPayloadKey: string

Methods

  • Method to add documents to the Qdrant database. It generates vectors from the documents using the Embeddings instance and then adds the vectors to the database.

    Parameters

    • documents: Document<Record<string, any>>[]

      Array of Document instances to be added to the Qdrant database.

    • OptionaldocumentOptions: QdrantAddDocumentOptions

      Optional QdrantAddDocumentOptions which has a list of JSON objects for extra querying

    Returns Promise<void>

    Promise that resolves when the documents have been added to the database.

  • Method to add vectors to the Qdrant database. Each vector is associated with a document, which is stored as the payload for a point in the database.

    Parameters

    • vectors: number[][]

      Array of vectors to be added to the Qdrant database.

    • documents: Document<Record<string, any>>[]

      Array of Document instances associated with the vectors.

    • OptionaldocumentOptions: QdrantAddDocumentOptions

      Optional QdrantAddDocumentOptions which has a list of JSON objects for extra querying

    Returns Promise<void>

    Promise that resolves when the vectors have been added to the database.

  • Creates a VectorStoreRetriever instance with flexible configuration options.

    Parameters

    • OptionalkOrFields: number | Partial<VectorStoreRetrieverInput<QdrantVectorStore>>

      If a number is provided, it sets the k parameter (number of items to retrieve).

      • If an object is provided, it should contain various configuration options.
    • Optionalfilter: {
          min_should?: null | Record<string, unknown> | {
              conditions: (
                  | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                  | {
                      geo_bounding_box?: null | Record<string, unknown> | {
                          bottom_right: {
                              lat: number;
                              lon: number;
                          };
                          top_left: {
                              lat: number;
                              lon: number;
                          };
                      };
                      geo_polygon?: null | Record<string, unknown> | {
                          exterior: {
                              points: (...)[];
                          };
                          interiors?: null | (...)[];
                      };
                      geo_radius?: null | Record<string, unknown> | {
                          center: {
                              lat: number;
                              lon: number;
                          };
                          radius: number;
                      };
                      key: string;
                      match?:
                          | null
                          | Record<string, unknown>
                          | {
                              value: string | number | boolean;
                          }
                          | {
                              text: string;
                          }
                          | {
                              any: (...)[] | (...)[];
                          }
                          | {
                              except: (...)[] | (...)[];
                          };
                      range?:
                          | null
                          | Record<string, unknown>
                          | {
                              gt?: null | number;
                              gte?: null | number;
                              lt?: null | number;
                              lte?: null | number;
                          }
                          | {
                              gt?: null | string;
                              gte?: null | string;
                              lt?: null | string;
                              lte?: null | string;
                          };
                      values_count?: null | Record<string, unknown> | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      };
                  }
                  | {
                      is_empty: {
                          key: string;
                      };
                  }
                  | {
                      is_null: {
                          key: string;
                      };
                  }
                  | {
                      has_id: (string | number)[];
                  }
                  | {
                      nested: {
                          filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                          key: string;
                      };
                  })[];
              min_count: number;
          };
          must?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          must_not?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          should?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
      }

      Optional filter criteria to limit the items retrieved based on the specified filter type.

      • Optionalmin_should?: null | Record<string, unknown> | {
            conditions: (
                | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                | {
                    geo_bounding_box?: null | Record<string, unknown> | {
                        bottom_right: {
                            lat: number;
                            lon: number;
                        };
                        top_left: {
                            lat: number;
                            lon: number;
                        };
                    };
                    geo_polygon?: null | Record<string, unknown> | {
                        exterior: {
                            points: (...)[];
                        };
                        interiors?: null | (...)[];
                    };
                    geo_radius?: null | Record<string, unknown> | {
                        center: {
                            lat: number;
                            lon: number;
                        };
                        radius: number;
                    };
                    key: string;
                    match?:
                        | null
                        | Record<string, unknown>
                        | {
                            value: string | number | boolean;
                        }
                        | {
                            text: string;
                        }
                        | {
                            any: (...)[] | (...)[];
                        }
                        | {
                            except: (...)[] | (...)[];
                        };
                    range?:
                        | null
                        | Record<string, unknown>
                        | {
                            gt?: null | number;
                            gte?: null | number;
                            lt?: null | number;
                            lte?: null | number;
                        }
                        | {
                            gt?: null | string;
                            gte?: null | string;
                            lt?: null | string;
                            lte?: null | string;
                        };
                    values_count?: null | Record<string, unknown> | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    };
                }
                | {
                    is_empty: {
                        key: string;
                    };
                }
                | {
                    is_null: {
                        key: string;
                    };
                }
                | {
                    has_id: (string | number)[];
                }
                | {
                    nested: {
                        filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                        key: string;
                    };
                })[];
            min_count: number;
        }

        At least minimum amount of given conditions should match

      • Optionalmust?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must match

      • Optionalmust_not?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must NOT match

      • Optionalshould?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        At least one of those conditions should match

    • Optionalcallbacks: Callbacks

      Optional callbacks that may be triggered at specific stages of the retrieval process.

    • Optionaltags: string[]

      Tags to categorize or label the VectorStoreRetriever. Defaults to an empty array if not provided.

    • Optionalmetadata: Record<string, unknown>

      Additional metadata as key-value pairs to add contextual information for the retrieval process.

    • Optionalverbose: boolean

      If true, enables detailed logging for the retrieval process. Defaults to false.

    Returns VectorStoreRetriever<QdrantVectorStore>

    • A configured VectorStoreRetriever instance based on the provided parameters.

    Basic usage with a k value:

    const retriever = myVectorStore.asRetriever(5);
    

    Usage with a configuration object:

    const retriever = myVectorStore.asRetriever({
    k: 10,
    filter: myFilter,
    tags: ['example', 'test'],
    verbose: true,
    searchType: 'mmr',
    searchKwargs: { alpha: 0.5 },
    });
  • Deletes documents from the vector store based on the specified parameters.

    Parameters

    • Optional_params: Record<string, any>

      Flexible key-value pairs defining conditions for document deletion.

    Returns Promise<void>

    A promise that resolves once the deletion is complete.

  • Method to ensure the existence of a collection in the Qdrant database. If the collection does not exist, it is created.

    Returns Promise<void>

    Promise that resolves when the existence of the collection has been ensured.

  • Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.

    Parameters

    • query: string

      Text to look up documents similar to.

    • options: MaxMarginalRelevanceSearchOptions<{
          min_should?: null | Record<string, unknown> | {
              conditions: (
                  | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                  | {
                      geo_bounding_box?: null | Record<string, unknown> | {
                          bottom_right: {
                              lat: number;
                              lon: number;
                          };
                          top_left: {
                              lat: number;
                              lon: number;
                          };
                      };
                      geo_polygon?: null | Record<string, unknown> | {
                          exterior: {
                              points: (...)[];
                          };
                          interiors?: null | (...)[];
                      };
                      geo_radius?: null | Record<string, unknown> | {
                          center: {
                              lat: number;
                              lon: number;
                          };
                          radius: number;
                      };
                      key: string;
                      match?:
                          | null
                          | Record<string, unknown>
                          | {
                              value: string | number | boolean;
                          }
                          | {
                              text: string;
                          }
                          | {
                              any: (...)[] | (...)[];
                          }
                          | {
                              except: (...)[] | (...)[];
                          };
                      range?:
                          | null
                          | Record<string, unknown>
                          | {
                              gt?: null | number;
                              gte?: null | number;
                              lt?: null | number;
                              lte?: null | number;
                          }
                          | {
                              gt?: null | string;
                              gte?: null | string;
                              lt?: null | string;
                              lte?: null | string;
                          };
                      values_count?: null | Record<string, unknown> | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      };
                  }
                  | {
                      is_empty: {
                          key: string;
                      };
                  }
                  | {
                      is_null: {
                          key: string;
                      };
                  }
                  | {
                      has_id: (string | number)[];
                  }
                  | {
                      nested: {
                          filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                          key: string;
                      };
                  })[];
              min_count: number;
          };
          must?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          must_not?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          should?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
      }>
    • _callbacks: undefined | Callbacks

    Returns Promise<DocumentInterface<Record<string, any>>[]>

    • List of documents selected by maximal marginal relevance.
  • Searches for documents similar to a text query by embedding the query and performing a similarity search on the resulting vector.

    Parameters

    • query: string

      Text query for finding similar documents.

    • Optionalk: number

      Number of similar results to return. Defaults to 4.

    • Optionalfilter: {
          min_should?: null | Record<string, unknown> | {
              conditions: (
                  | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                  | {
                      geo_bounding_box?: null | Record<string, unknown> | {
                          bottom_right: {
                              lat: number;
                              lon: number;
                          };
                          top_left: {
                              lat: number;
                              lon: number;
                          };
                      };
                      geo_polygon?: null | Record<string, unknown> | {
                          exterior: {
                              points: (...)[];
                          };
                          interiors?: null | (...)[];
                      };
                      geo_radius?: null | Record<string, unknown> | {
                          center: {
                              lat: number;
                              lon: number;
                          };
                          radius: number;
                      };
                      key: string;
                      match?:
                          | null
                          | Record<string, unknown>
                          | {
                              value: string | number | boolean;
                          }
                          | {
                              text: string;
                          }
                          | {
                              any: (...)[] | (...)[];
                          }
                          | {
                              except: (...)[] | (...)[];
                          };
                      range?:
                          | null
                          | Record<string, unknown>
                          | {
                              gt?: null | number;
                              gte?: null | number;
                              lt?: null | number;
                              lte?: null | number;
                          }
                          | {
                              gt?: null | string;
                              gte?: null | string;
                              lt?: null | string;
                              lte?: null | string;
                          };
                      values_count?: null | Record<string, unknown> | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      };
                  }
                  | {
                      is_empty: {
                          key: string;
                      };
                  }
                  | {
                      is_null: {
                          key: string;
                      };
                  }
                  | {
                      has_id: (string | number)[];
                  }
                  | {
                      nested: {
                          filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                          key: string;
                      };
                  })[];
              min_count: number;
          };
          must?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          must_not?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          should?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
      }

      Optional filter based on FilterType.

      • Optionalmin_should?: null | Record<string, unknown> | {
            conditions: (
                | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                | {
                    geo_bounding_box?: null | Record<string, unknown> | {
                        bottom_right: {
                            lat: number;
                            lon: number;
                        };
                        top_left: {
                            lat: number;
                            lon: number;
                        };
                    };
                    geo_polygon?: null | Record<string, unknown> | {
                        exterior: {
                            points: (...)[];
                        };
                        interiors?: null | (...)[];
                    };
                    geo_radius?: null | Record<string, unknown> | {
                        center: {
                            lat: number;
                            lon: number;
                        };
                        radius: number;
                    };
                    key: string;
                    match?:
                        | null
                        | Record<string, unknown>
                        | {
                            value: string | number | boolean;
                        }
                        | {
                            text: string;
                        }
                        | {
                            any: (...)[] | (...)[];
                        }
                        | {
                            except: (...)[] | (...)[];
                        };
                    range?:
                        | null
                        | Record<string, unknown>
                        | {
                            gt?: null | number;
                            gte?: null | number;
                            lt?: null | number;
                            lte?: null | number;
                        }
                        | {
                            gt?: null | string;
                            gte?: null | string;
                            lt?: null | string;
                            lte?: null | string;
                        };
                    values_count?: null | Record<string, unknown> | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    };
                }
                | {
                    is_empty: {
                        key: string;
                    };
                }
                | {
                    is_null: {
                        key: string;
                    };
                }
                | {
                    has_id: (string | number)[];
                }
                | {
                    nested: {
                        filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                        key: string;
                    };
                })[];
            min_count: number;
        }

        At least minimum amount of given conditions should match

      • Optionalmust?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must match

      • Optionalmust_not?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must NOT match

      • Optionalshould?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        At least one of those conditions should match

    • Optional_callbacks: Callbacks

      Optional callbacks for monitoring search progress

    Returns Promise<DocumentInterface<Record<string, any>>[]>

    A promise resolving to an array of DocumentInterface instances representing similar documents.

  • Method to search for vectors in the Qdrant database that are similar to a given query vector. The search results include the score and payload (metadata and content) for each similar vector.

    Parameters

    • query: number[]

      Query vector to search for similar vectors in the Qdrant database.

    • Optionalk: number

      Optional number of similar vectors to return. If not specified, all similar vectors are returned.

    • Optionalfilter: {
          min_should?: null | Record<string, unknown> | {
              conditions: (
                  | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                  | {
                      geo_bounding_box?: null | Record<string, unknown> | {
                          bottom_right: {
                              lat: number;
                              lon: number;
                          };
                          top_left: {
                              lat: number;
                              lon: number;
                          };
                      };
                      geo_polygon?: null | Record<string, unknown> | {
                          exterior: {
                              points: (...)[];
                          };
                          interiors?: null | (...)[];
                      };
                      geo_radius?: null | Record<string, unknown> | {
                          center: {
                              lat: number;
                              lon: number;
                          };
                          radius: number;
                      };
                      key: string;
                      match?:
                          | null
                          | Record<string, unknown>
                          | {
                              value: string | number | boolean;
                          }
                          | {
                              text: string;
                          }
                          | {
                              any: (...)[] | (...)[];
                          }
                          | {
                              except: (...)[] | (...)[];
                          };
                      range?:
                          | null
                          | Record<string, unknown>
                          | {
                              gt?: null | number;
                              gte?: null | number;
                              lt?: null | number;
                              lte?: null | number;
                          }
                          | {
                              gt?: null | string;
                              gte?: null | string;
                              lt?: null | string;
                              lte?: null | string;
                          };
                      values_count?: null | Record<string, unknown> | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      };
                  }
                  | {
                      is_empty: {
                          key: string;
                      };
                  }
                  | {
                      is_null: {
                          key: string;
                      };
                  }
                  | {
                      has_id: (string | number)[];
                  }
                  | {
                      nested: {
                          filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                          key: string;
                      };
                  })[];
              min_count: number;
          };
          must?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          must_not?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          should?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
      }

      Optional filter to apply to the search results.

      • Optionalmin_should?: null | Record<string, unknown> | {
            conditions: (
                | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                | {
                    geo_bounding_box?: null | Record<string, unknown> | {
                        bottom_right: {
                            lat: number;
                            lon: number;
                        };
                        top_left: {
                            lat: number;
                            lon: number;
                        };
                    };
                    geo_polygon?: null | Record<string, unknown> | {
                        exterior: {
                            points: (...)[];
                        };
                        interiors?: null | (...)[];
                    };
                    geo_radius?: null | Record<string, unknown> | {
                        center: {
                            lat: number;
                            lon: number;
                        };
                        radius: number;
                    };
                    key: string;
                    match?:
                        | null
                        | Record<string, unknown>
                        | {
                            value: string | number | boolean;
                        }
                        | {
                            text: string;
                        }
                        | {
                            any: (...)[] | (...)[];
                        }
                        | {
                            except: (...)[] | (...)[];
                        };
                    range?:
                        | null
                        | Record<string, unknown>
                        | {
                            gt?: null | number;
                            gte?: null | number;
                            lt?: null | number;
                            lte?: null | number;
                        }
                        | {
                            gt?: null | string;
                            gte?: null | string;
                            lt?: null | string;
                            lte?: null | string;
                        };
                    values_count?: null | Record<string, unknown> | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    };
                }
                | {
                    is_empty: {
                        key: string;
                    };
                }
                | {
                    is_null: {
                        key: string;
                    };
                }
                | {
                    has_id: (string | number)[];
                }
                | {
                    nested: {
                        filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                        key: string;
                    };
                })[];
            min_count: number;
        }

        At least minimum amount of given conditions should match

      • Optionalmust?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must match

      • Optionalmust_not?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must NOT match

      • Optionalshould?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        At least one of those conditions should match

    Returns Promise<[Document<Record<string, any>>, number][]>

    Promise that resolves with an array of tuples, where each tuple includes a Document instance and a score for a similar vector.

  • Searches for documents similar to a text query by embedding the query, and returns results with similarity scores.

    Parameters

    • query: string

      Text query for finding similar documents.

    • Optionalk: number

      Number of similar results to return. Defaults to 4.

    • Optionalfilter: {
          min_should?: null | Record<string, unknown> | {
              conditions: (
                  | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                  | {
                      geo_bounding_box?: null | Record<string, unknown> | {
                          bottom_right: {
                              lat: number;
                              lon: number;
                          };
                          top_left: {
                              lat: number;
                              lon: number;
                          };
                      };
                      geo_polygon?: null | Record<string, unknown> | {
                          exterior: {
                              points: (...)[];
                          };
                          interiors?: null | (...)[];
                      };
                      geo_radius?: null | Record<string, unknown> | {
                          center: {
                              lat: number;
                              lon: number;
                          };
                          radius: number;
                      };
                      key: string;
                      match?:
                          | null
                          | Record<string, unknown>
                          | {
                              value: string | number | boolean;
                          }
                          | {
                              text: string;
                          }
                          | {
                              any: (...)[] | (...)[];
                          }
                          | {
                              except: (...)[] | (...)[];
                          };
                      range?:
                          | null
                          | Record<string, unknown>
                          | {
                              gt?: null | number;
                              gte?: null | number;
                              lt?: null | number;
                              lte?: null | number;
                          }
                          | {
                              gt?: null | string;
                              gte?: null | string;
                              lt?: null | string;
                              lte?: null | string;
                          };
                      values_count?: null | Record<string, unknown> | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      };
                  }
                  | {
                      is_empty: {
                          key: string;
                      };
                  }
                  | {
                      is_null: {
                          key: string;
                      };
                  }
                  | {
                      has_id: (string | number)[];
                  }
                  | {
                      nested: {
                          filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                          key: string;
                      };
                  })[];
              min_count: number;
          };
          must?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          must_not?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
          should?: null | (
              | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
              | {
                  geo_bounding_box?: null | Record<string, unknown> | {
                      bottom_right: {
                          lat: number;
                          lon: number;
                      };
                      top_left: {
                          lat: number;
                          lon: number;
                      };
                  };
                  geo_polygon?: null | Record<string, unknown> | {
                      exterior: {
                          points: {
                              lat: ...;
                              lon: ...;
                          }[];
                      };
                      interiors?: null | {
                          points: ...;
                      }[];
                  };
                  geo_radius?: null | Record<string, unknown> | {
                      center: {
                          lat: number;
                          lon: number;
                      };
                      radius: number;
                  };
                  key: string;
                  match?:
                      | null
                      | Record<string, unknown>
                      | {
                          value: string | number | boolean;
                      }
                      | {
                          text: string;
                      }
                      | {
                          any: string[] | number[];
                      }
                      | {
                          except: string[] | number[];
                      };
                  range?:
                      | null
                      | Record<string, unknown>
                      | {
                          gt?: null | number;
                          gte?: null | number;
                          lt?: null | number;
                          lte?: null | number;
                      }
                      | {
                          gt?: null | string;
                          gte?: null | string;
                          lt?: null | string;
                          lte?: null | string;
                      };
                  values_count?: null | Record<string, unknown> | {
                      gt?: null | number;
                      gte?: null | number;
                      lt?: null | number;
                      lte?: null | number;
                  };
              }
              | {
                  is_empty: {
                      key: string;
                  };
              }
              | {
                  is_null: {
                      key: string;
                  };
              }
              | {
                  has_id: (string | number)[];
              }
              | {
                  nested: {
                      filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                      key: string;
                  };
              })[];
      }

      Optional filter based on FilterType.

      • Optionalmin_should?: null | Record<string, unknown> | {
            conditions: (
                | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
                | {
                    geo_bounding_box?: null | Record<string, unknown> | {
                        bottom_right: {
                            lat: number;
                            lon: number;
                        };
                        top_left: {
                            lat: number;
                            lon: number;
                        };
                    };
                    geo_polygon?: null | Record<string, unknown> | {
                        exterior: {
                            points: (...)[];
                        };
                        interiors?: null | (...)[];
                    };
                    geo_radius?: null | Record<string, unknown> | {
                        center: {
                            lat: number;
                            lon: number;
                        };
                        radius: number;
                    };
                    key: string;
                    match?:
                        | null
                        | Record<string, unknown>
                        | {
                            value: string | number | boolean;
                        }
                        | {
                            text: string;
                        }
                        | {
                            any: (...)[] | (...)[];
                        }
                        | {
                            except: (...)[] | (...)[];
                        };
                    range?:
                        | null
                        | Record<string, unknown>
                        | {
                            gt?: null | number;
                            gte?: null | number;
                            lt?: null | number;
                            lte?: null | number;
                        }
                        | {
                            gt?: null | string;
                            gte?: null | string;
                            lt?: null | string;
                            lte?: null | string;
                        };
                    values_count?: null | Record<string, unknown> | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    };
                }
                | {
                    is_empty: {
                        key: string;
                    };
                }
                | {
                    is_null: {
                        key: string;
                    };
                }
                | {
                    has_id: (string | number)[];
                }
                | {
                    nested: {
                        filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                        key: string;
                    };
                })[];
            min_count: number;
        }

        At least minimum amount of given conditions should match

      • Optionalmust?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must match

      • Optionalmust_not?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        All conditions must NOT match

      • Optionalshould?: null | (
            | ({ should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...)
            | {
                geo_bounding_box?: null | Record<string, unknown> | {
                    bottom_right: {
                        lat: number;
                        lon: number;
                    };
                    top_left: {
                        lat: number;
                        lon: number;
                    };
                };
                geo_polygon?: null | Record<string, unknown> | {
                    exterior: {
                        points: {
                            lat: ...;
                            lon: ...;
                        }[];
                    };
                    interiors?: null | {
                        points: ...;
                    }[];
                };
                geo_radius?: null | Record<string, unknown> | {
                    center: {
                        lat: number;
                        lon: number;
                    };
                    radius: number;
                };
                key: string;
                match?:
                    | null
                    | Record<string, unknown>
                    | {
                        value: string | number | boolean;
                    }
                    | {
                        text: string;
                    }
                    | {
                        any: string[] | number[];
                    }
                    | {
                        except: string[] | number[];
                    };
                range?:
                    | null
                    | Record<string, unknown>
                    | {
                        gt?: null | number;
                        gte?: null | number;
                        lt?: null | number;
                        lte?: null | number;
                    }
                    | {
                        gt?: null | string;
                        gte?: null | string;
                        lt?: null | string;
                        lte?: null | string;
                    };
                values_count?: null | Record<string, unknown> | {
                    gt?: null | number;
                    gte?: null | number;
                    lt?: null | number;
                    lte?: null | number;
                };
            }
            | {
                is_empty: {
                    key: string;
                };
            }
            | {
                is_null: {
                    key: string;
                };
            }
            | {
                has_id: (string | number)[];
            }
            | {
                nested: {
                    filter: { should?: (... | { key: string; match?: Record<string, unknown> | { value: string | number | boolean; } | { text: string; } | { any: string[] | number[]; } | { except: string[] | number[]; } | null | undefined; ... 4 more ...; values_count?: Record<...> | ... 2 more ... | undefined; } | { ...; } | { ...; } | { ...;...;
                    key: string;
                };
            })[]

        At least one of those conditions should match

    • Optional_callbacks: Callbacks

      Optional callbacks for monitoring search progress

    Returns Promise<[DocumentInterface<Record<string, any>>, number][]>

    A promise resolving to an array of tuples, each containing a document and its similarity score.

  • Returns Serialized

  • Static method to create a QdrantVectorStore instance from Document instances. The documents are added to the Qdrant database.

    Parameters

    • docs: Document<Record<string, any>>[]

      Array of Document instances to be added to the Qdrant database.

    • embeddings: EmbeddingsInterface

      Embeddings instance used to generate vectors from the documents.

    • dbConfig: QdrantLibArgs

      QdrantLibArgs instance specifying the configuration for the Qdrant database.

    Returns Promise<QdrantVectorStore>

    Promise that resolves with a new QdrantVectorStore instance.

  • Static method to create a QdrantVectorStore instance from an existing collection in the Qdrant database.

    Parameters

    • embeddings: EmbeddingsInterface

      Embeddings instance used to generate vectors from the documents in the collection.

    • dbConfig: QdrantLibArgs

      QdrantLibArgs instance specifying the configuration for the Qdrant database.

    Returns Promise<QdrantVectorStore>

    Promise that resolves with a new QdrantVectorStore instance.

  • Static method to create a QdrantVectorStore instance from texts. Each text is associated with metadata and converted to a Document instance, which is then added to the Qdrant database.

    Parameters

    • texts: string[]

      Array of texts to be converted to Document instances and added to the Qdrant database.

    • metadatas: object | object[]

      Array or single object of metadata to be associated with the texts.

    • embeddings: EmbeddingsInterface

      Embeddings instance used to generate vectors from the texts.

    • dbConfig: QdrantLibArgs

      QdrantLibArgs instance specifying the configuration for the Qdrant database.

    Returns Promise<QdrantVectorStore>

    Promise that resolves with a new QdrantVectorStore instance.