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

    Function hnswResultsToHits

    • Convert HNSW search results to legacy, receipt-free EmbedSearchHit rows using a label-to-source-row lookup. This compatibility helper does not establish live-source authority and must not be used directly for persisted content egress; use hnswResultsToReceiptHits with current EmbedDb hydration for that path.

      Parameters

      • result: { distances: number[]; labels: number[] }

        Labels and cosine distances returned by the native HNSW index.

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

        Receipt-free source rows keyed by the labels assigned at build time.

      Returns EmbedSearchHit[]

      Legacy hits for labels present in the supplied lookup.

      const hits = hnswResultsToHits(result, loaded.rowsByLabel);