enquire-mcp API reference - v4.0.0-rc.7
    Preparing search index...

    Interface HnswSearchContext

    v2.13.0 — optional HNSW context. When passed, embeddingsSearch routes the k-NN lookup through the in-memory approximate nearest-neighbor index instead of the O(n) brute-force cosine in EmbedDb.search(). rowByLabel is sidecar/bootstrap metadata established at HNSW build time (typically labels are embeddings.id, set in EmbedDb.getAllVectors()).

    interface HnswSearchContext {
        dbInstanceUuid: string;
        dbMutationEpoch: number;
        ef?: number;
        health?: Readonly<{ hnswUsable: boolean }>;
        index: {
            size: number;
            searchKnn(
                q: Float32Array,
                k: number,
                opts?: { ef?: number },
            ): { distances: number[]; labels: number[] };
        };
        modelAlias: string;
        rowByLabel: ReadonlyMap<
            number,
            {
                chunk_index: number;
                kind: "md"
                | "pdf";
                line_end: number;
                line_start: number;
                rel_path: string;
                text_preview: string;
            },
        >;
    }
    Index
    dbInstanceUuid: string

    Physical EmbedDb instance from which this graph was admitted.

    dbMutationEpoch: number

    Durable EmbedDb mutation epoch from which this graph was admitted.

    ef?: number
    health?: Readonly<{ hnswUsable: boolean }>

    Mutable watcher health shared by reference. A false HNSW flag routes the request through the authoritative EmbedDb brute-force path after an uncertain native live-update instead of querying a partial graph.

    index: {
        size: number;
        searchKnn(
            q: Float32Array,
            k: number,
            opts?: { ef?: number },
        ): { distances: number[]; labels: number[] };
    }
    modelAlias: string

    v3.6.2 HN-4 — embedding-model alias the HNSW index was built with (e.g. "multilingual" or "bge"). At search time we verify that the embedder used to encode the query produces vectors in the SAME vector space as the index. CRIT-1 (v3.6.1) fixed the build-side silent destruction; this is the corresponding search-side guard.

    If the search-time embedder model doesn't match this alias, the stored vectors and the query vector are from different vector spaces — cosine returns garbage similarities. We throw instead of returning garbage; the agent / user can correct the --embedding-model flag and retry.

    rowByLabel: ReadonlyMap<
        number,
        {
            chunk_index: number;
            kind: "md"
            | "pdf";
            line_end: number;
            line_start: number;
            rel_path: string;
            text_preview: string;
        },
    >