usearch_dense_get writes every vector stored under one key into an arena, shard by shard and in insertion order within each, as the Arenas example shows; an absent key leaves vectors->dataNULL.
A cursor walks the graph, every entry in storage order or breadth-first from starts, its keys and, when asked, each entry’s links copied into an arena batch by batch:
Each shard’s publication watermark is read as the walk enters it, so an entry once passed is never revisited, while a later shard may carry entries published after the walk began.
Opened at starts, a cursor yields their own entries first, in the order given, then breadth-first the entries they link to, each entry once, so the first entries pulled carry the starts’ immediate links. links is a usearch_keys_tape_view_t, entry i spanning offsets[i] up to offsets[i+1], and the vectors themselves come from usearch_dense_get.
When a predicate is selective enough that no wanted can be guessed upfront, a search stream keeps pulling matches in distance order:
No residency implements streams yet, so usearch_dense_search_stream_init answers usearch_status_unsupported_k today.
A stream keeps the walk’s state between pulls, never a thread, so any number of them may stay open on one executor.
Cursors and streams keep no hold on the index either: every pull passes the index it was opened on, any other is refused with usearch_status_invalid_argument_k, and an overlapping pull reports usearch_status_contended_k.
API
Types
usearch_dense_cursor_tA walk over the graph yielding each entry's key with the keys it links to, every entry as stored or breadth-first from start keys, which export, migration, and visualization read.
Each shard's publication watermark is read as the walk enters that shard, so an entry once passed is never revisited, while a later shard may still carry entries published after the walk began. Each pull names the index again; an overlapping pull reports usearch_status_contended_k.
usearch_dense_search_stream_tA resumable search over one query: best-first traversal is naturally pausable, so the stream keeps the walk's frontier & visited set between pulls and yields matches lazily.
Callers that post-filter aggressively pull until satisfied instead of guessing wanted upfront. The stream holds state, never a thread, so any number of them may stay open on one executor. Each pull names the index again; an overlapping pull reports usearch_status_contended_k.
usearch_geospatial_cursor_tA consistent snapshot cursor over the graph.
Captures the publication watermark at creation, so concurrent inserts never appear mid-iteration, and yields each entry's key with the keys it links to - every entry as stored, or breadth-first from start keys - which export, migration, and visualization feed off. Each pull names the index again; an overlapping pull reports usearch_status_contended_k.
usearch_sequence_cursor_tA consistent snapshot cursor over the graph.
Captures the publication watermark at creation, so concurrent inserts never appear mid-iteration, and yields each entry's key with the keys it links to - every entry as stored, or breadth-first from start keys - which export, migration, and visualization feed off. Each pull names the index again; an overlapping pull reports usearch_status_contended_k.
usearch_shapes_cursor_tA consistent snapshot cursor over the graph.
Captures the publication watermark at creation, so concurrent inserts never appear mid-iteration, and yields each entry's key with the keys it links to - every entry as stored, or breadth-first from start keys - which export, migration, and visualization feed off. Each pull names the index again; an overlapping pull reports usearch_status_contended_k.
Functions
usearch_dense_getRetrieves every vector stored under one key into arena, one row per entry sharing the key, shard by shard and in insertion order within each - one call, however many there are.
usearch_status_contended_k The arena serves another call, another call holds the executor or its pool, or a destructive window overlapped the read twice.
Without starts the cursor yields every entry as stored. With them it yields the start keys' own entries first, in the order given, then the entries those link to, breadth-first, each entry once, so a caller wanting only the starts' immediate links reads the links of the first pulled entries. A key the index lacks starts nothing, and a key several entries share starts from its first stored entry.
usearch_dense_cursor_nextCopies the next batch of entries out of the cursor into arena, each with the keys it links to, in the order usearch_dense_cursor_init describes; the vectors themselves come from usearch_dense_get.
Links name only entries published when the pull ran, as the graph stored them then. The keys are copied rather than borrowed from the index, so the batch stays valid until the next call given the same arena, however the cursor moves meanwhile.
The optional output for each entry's links, the keys of the entries it links to, entry i spanning offsets[i] up to offsets[i+1], inside arena; NULL skips them.
writtensize_t *
Output for the entries written; zero when the walk is exhausted.
Waits until every deferred call naming the handle is final.
usearch_*_sample× 4Draws keys around focus, or across the whole index, each hanging from a shown or earlier draw and placed in three dimensions beside the shown ones - so a view grows one connected sample as it zooms, never scanning the index.
The draws follow the graph: along paths joining the focus to each other and toward the nearest shown key, then around each focus key as far as its nearest neighbor on those paths, ranked by seed so a closer view draws a superset of a farther one. A key holding several entries draws each as its own, named by its entry ordinal. Each draw is placed by its distances to its nearest shown keys, the shown keys keeping their coordinates; with nothing shown, its row is projected through a seeded Gaussian matrix.
The draws follow the graph: along paths joining the focus to each other and toward the nearest shown key, then around each focus key as far as its nearest neighbor on those paths, ranked by seed so a closer view draws a superset of a farther one. A key holding several entries draws each as its own, named by its entry ordinal. Each draw is placed at its Earth-fixed position, so shown_coordinates place nothing.
The draws follow the graph: along paths joining the focus to each other and toward the nearest shown key, then around each focus key as far as its nearest neighbor on those paths, ranked by seed so a closer view draws a superset of a farther one. A key holding several entries draws each as its own, named by its entry ordinal. Each draw is placed by its distances to its nearest shown keys, the shown keys keeping their coordinates; with nothing shown, the draws are scaled against one another.
Ordering beyond the expansion horizon is best-effort nearest rather than globally exact, so a caller pulling far past the breadth it configured sees the ranking degrade rather than the stream end.
Output for the pull, as one row of a search inside arena: up to wanted more matches, their number in matches->counts[0], zero once the walk is drained.
Without starts the cursor yields every entry as stored. With them it yields the start keys' own entries first, in the order given, then the entries those link to, breadth-first, each entry once, so a caller wanting only the starts' immediate links reads the links of the first pulled entries. A key the index lacks starts nothing, and a key several entries share starts from the first stored.
usearch_geospatial_cursor_nextCopies the next batch of entries out of the cursor into arena, each with the keys it links to, in the order usearch_geospatial_cursor_init describes; the observations themselves come from usearch_geospatial_get.
Links name only entries the snapshot holds, as the graph stored them when the pull ran. The keys are copied rather than borrowed from the index, so the batch stays valid until the next call given the same arena, however the cursor moves meanwhile.
The optional output for each entry's links, the keys of the entries it links to in the graph, entry i spanning offsets[i] up to offsets[i+1], inside arena; NULL skips them.
writtensize_t *
Output for the entries written; zero when the snapshot is exhausted.
usearch_sequence_getRetrieves every sequence stored under one key as an Apache Arrow tape, in insertion order - one call, however many and however long they turn out to be.
Without starts the cursor yields every entry as stored. With them it yields the start keys' own entries first, in the order given, then the entries those link to, breadth-first, each entry once, so a caller wanting only the starts' immediate links reads the links of the first pulled entries. A key the index lacks starts nothing, and a key several entries share starts from the first stored.
usearch_sequence_cursor_nextCopies the next batch of entries out of the cursor into arena, each with the keys it links to, in the order usearch_sequence_cursor_init describes; the sequences themselves come from usearch_sequence_get.
Links name only entries the snapshot holds, as the graph stored them when the pull ran. The keys are copied rather than borrowed from the index, so the batch stays valid until the next call given the same arena, however the cursor moves meanwhile.
The optional output for each entry's links, the keys of the entries it links to in the graph, entry i spanning offsets[i] up to offsets[i+1], inside arena; NULL skips them.
writtensize_t *
Output for the entries written; zero when the snapshot is exhausted.
usearch_shapes_getRetrieves every shape stored under one key as an Apache Arrow tape, in insertion order - one call, however many and however large they turn out to be.
Without starts the cursor yields every entry as stored. With them it yields the start keys' own entries first, in the order given, then the entries those link to, breadth-first, each entry once, so a caller wanting only the starts' immediate links reads the links of the first pulled entries. A key the index lacks starts nothing, and a key several entries share starts from the first stored.
usearch_shapes_cursor_nextCopies the next batch of entries out of the cursor into arena, each with the keys it links to, in the order usearch_shapes_cursor_init describes; the shapes themselves come from usearch_shapes_get.
Links name only entries the snapshot holds, as the graph stored them when the pull ran. The keys are copied rather than borrowed from the index, so the batch stays valid until the next call given the same arena, however the cursor moves meanwhile.
The optional output for each entry's links, the keys of the entries it links to in the graph, entry i spanning offsets[i] up to offsets[i+1], inside arena; NULL skips them.
writtensize_t *
Output for the entries written; zero when the snapshot is exhausted.