Every batch input is a rows_view<T> of a base pointer, a row count, the values per row and an optional byte stride, so a memory-mapped dataset feeds the index with no reshape and no copy.
An index owns entries, an executor_t owns the threads or streams a call runs on, and an arena_t holds what a call writes back.
#include <cstdio> // `std::printf`
#include <usearch/usearch.hpp> // `us::dense_index_t`, `us::executor_t`, `us::arena_t`, `us::deferred`
namespace us = unum::usearch;
int main() {
auto [index, index_status] = us::dense_index_t::init_ram(
{.metric = usearch_dense_metric_angular_k, .quantization = usearch_scalar_i8_k, .dimensions = 4});
if (index_status.failed()) return 1;
us::status_t const reserved = index.reserve(1000); // the calling thread; inserts grow on demand anyway
usearch_key_t keys[2] {};
keys[0].bytes[15] = 42;
keys[1].bytes[15] = 43;
float const slab[8] = {0.2f, 0.1f, 0.2f, 0.1f, 0.1f, 0.2f, 0.1f, 0.2f};
if (reserved.failed() || index.insert<float>(keys, {slab, 2, 4}).failed()) return 1;
auto [executor, executor_status] = us::executor_t::for_ram();
auto [arena, arena_status] = us::arena_t::make({.executor = executor.handle()});
auto [local_arena, local_arena_status] = us::arena_t::make();
float const query[4] = {0.2f, 0.1f, 0.2f, 0.1f};
auto [local, local_status] = index.search<float>({query, 1, 4}, 10, local_arena); // the calling thread
auto [pooled, pooled_status] = index.on(executor).search<float>({query, 1, 4}, 10, arena); // blocks on the executor
if (local_status.failed() || pooled_status.failed()) return 1;
us::deferred<usearch_matches_view_t> call = index.deferred(executor).search<float>({slab, 2, 4}, 10, arena);
auto [matches, status] = call.wait(); // blocks until final; destruction waits too
if (status.failed()) return 1;
std::printf("Found %zu and %zu matches\n", local.counts[0], matches.counts[1]);
return 0;
}Each verb names the scalar of the rows it passes, as in insert<float>, and every fallible call answers its value beside a status_t, unpacked as auto [value, status].
The index itself runs its verbs on the calling thread, and an arena made without an executor is host pages for it.