import numpy as npimport usearchfrom usearch import DenseIndex, DenseMetric, Scalarindex = DenseIndex.init_ram( dimensions=256, # Scalars per vector metric=DenseMetric.ANGULAR, # INNER, ANGULAR, EUCLIDEAN, HAMMING or JACCARD quantization=Scalar.BF16, # The stored scalar type: BF16...E2M3, I8, U8, U1X8 connectivity=16, # Connections per node; 0 derives it from the geometry)vectors = np.random.rand(10_000, 256).astype(np.float32)index.reserve(len(vectors)) # Optional capacity hint; inserts grow on demandindex.insert(np.arange(len(vectors)), vectors) # On the calling threadpool = usearch.Executor.for_ram() # The workers a receiver namesarena = usearch.Arena(pool) # The memory results land in, made where the pool computesmatches = index.on(pool).search(vectors[:100], 10, arena) # Blocking, on the poolassert len(index) == 10_000assert np.asarray(matches.distances).shape == (100, 10)key, distance = matches[0][0]assert distance < 0.001