Go

USearch for Go

go get github.com/unum-cloud/USearch/golang 3.0.0-rc.1 · 4c3e5023

It needs Go 1.24 or newer with cgo enabled and a C toolchain, on Linux, macOS or Windows. It exposes dense indexes; sequence, matrix and geospatial indexes follow as the C library ships them.

Topics

InstallationThe package links libusearchstatic and includes the usearch/ headers, so both must sit on the compiler's search paths, such as /usr/local/lib and /usr/local/include, or be named through CGOLDFLAGS and CGOCFLAGS.
Quickstart
Executors37An index owns entries; an executor owns the threads or device streams a verb runs on, so one executor serves several indexes and the cost of spawning shows at the line that spawns it.
Keys9A key is 128 bits of opaque identity, rendered as a lowercase dashed UUID.
Inputs and Outputs34Every output whose length only the call knows, such as matches, rows, products, monoliths and cursor or stream batches, lands in an Arena you pass, and the verb answers a view over it without copying.
Metrics37
Residency2Where the payload lives is the constructor's name, as in the C lifecycle verbs, so a residency an index lacks has no constructor to call.
Serialization14Checkpoints ride the SafeGraphs interchange format, and the path extension picks the layout.
Filtered Search2A Predicate in the DenseSearchConfig admits only the keys it approves.
Refinement4Refine re-runs the neighbor selection over entries already in the graph, returning a DenseRefineReport: the entries re-selected and changed, the islands found and reconnected, and the closing audit.
Linear Algebra9Multiply reads an approximate sparse product off the graph: every pair the walk scored for each left row, in traversal order, rather than only the nearest.
Retrieval and Streaming24
Introspection8Health audits how much of the graph a search reaches from its landmarks; entries it misses stay unfound until a Refine re-links them.
Errors6Every failure carries a status shared with the C interface, so a fault this binding catches before the boundary reports the identity the engine would have reported for the same fault.
Platform Notes