@photostructure/sqlite-diskann
    Preparing search index...

    Interface DiskAnnIndexOptions

    Configuration options for creating a DiskANN index

    interface DiskAnnIndexOptions {
        buildSearchListSize?: number;
        dimension: number;
        maxDegree?: number;
        metadataColumns?: MetadataColumn[];
        metric?: DistanceMetric;
        normalizeVectors?: boolean;
    }
    Index

    Properties

    buildSearchListSize?: number

    Search list size during index construction (default: 100) Higher values improve index quality but slow down insertions

    dimension: number

    Vector dimension (must be > 0)

    maxDegree?: number

    Maximum degree of graph nodes (default: 64) Higher values improve recall but increase memory and index size

    metadataColumns?: MetadataColumn[]

    Optional metadata columns to store alongside vectors Enables filtered search: WHERE vector MATCH ? AND k = 10 AND category = 'landscape'

    {
    metadataColumns: [
    { name: 'category', type: 'TEXT' },
    { name: 'year', type: 'INTEGER' },
    { name: 'score', type: 'REAL' }
    ]
    }

    Distance metric

    • "cosine": Cosine similarity (default for normalized embeddings)
    • "euclidean": L2 distance
    • "dot": Dot product (inner product)
    normalizeVectors?: boolean

    Whether to normalize vectors during insertion (default: false) Set to true for cosine similarity with non-normalized inputs