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

    Function buildHnsw

    • Build a fresh in-memory HNSW from labeled vectors.

      vectors must be L2-normalized — the cosine distance space treats inputs as already-unit-length, so unnormalized inputs produce wrong distances. The EmbedDb already L2-normalizes at insert time, so the usual call path (loadAllVectors → buildHnsw) is safe by construction.

      Throws if dim doesn't match any vector's length, if maxElements is less than the input count, or if hnswlib-node failed to load.

      Parameters

      Returns Promise<HnswIndex>