Type alias EnsureVectorIndexOptions

EnsureVectorIndexOptions: EnsureIndexOptionsType<"vector", [string], {
    parallelism?: number;
    params: {
        defaultNProbe?: number;
        dimension: number;
        factory?: string;
        metric: "cosine" | "l2";
        nLists: number;
        trainingIterations?: number;
    };
}>

Options for creating a vector index.

Type declaration

  • Optional parallelism?: number

    The number of threads to use for indexing. Default is 2.

  • params: {
        defaultNProbe?: number;
        dimension: number;
        factory?: string;
        metric: "cosine" | "l2";
        nLists: number;
        trainingIterations?: number;
    }

    Vector index parameters, following Faiss configuration.

    • Optional defaultNProbe?: number

      How many neighboring centroids to probe by default. Higher = slower, better recall.

    • dimension: number

      Vector dimension. Must match the length of vectors in documents.

    • Optional factory?: string

      Advanced Faiss index factory string. If not specified, defaults to IVF,Flat.

    • metric: "cosine" | "l2"

      Whether to use cosine or l2 (Euclidean) distance.

    • nLists: number

      Number of Voronoi cells (centroids) for IVF. Affects accuracy and index build time.

    • Optional trainingIterations?: number

      Training iterations for index build. Default is 25.