JavaScript · Introspection

Introspection

import * as usearch from 'usearch'; 3.0.0-rc.1 · 4c3e5023

const { metadata, size, capacity, memoryUsage, cpuClass, gpuClass, shardsCount } = index.describe();
metadata.dimensions;                                   // The frozen geometry, as a checkpoint reports it
const containsKey = index.contains(42n);               // Whether a key is in the index
const count = index.count(42n);                        // The number of vectors under a key
const { audited, reachable } = index.health();        // How much of the graph a search reaches

usearch.version();
usearch.capabilitiesCompiled();
usearch.capabilitiesAvailable();

health audits from the search landmarks, and entries it misses stay unfound until a refine re-links them; its sweeps counts the levels the audit took to converge.

API

Types

DenseIndexDescriptionA live index's frozen metadata and current counters, each read once.
usearch.ts:286 ↗
interface DenseIndexDescription

Fields

metadataDenseMetadataThe frozen metric, quantization, dimensions and connectivity, as a checkpoint reports them.
sizenumberStored entries.
capacitynumberEntries hosted without growing again.
memoryUsagenumberBytes the handle holds; traversal scratch is the executor's.
cpuClassstringThe CPU class dispatch picked on this machine by its canonical name.
gpuClassstringThe GPU class dispatch picked on the index's devices; "unknown" for a host index.
shardsCountnumberLive shards.
DenseReachabilityOne reachability audit: the population it judged, and how much of it a search reaches.
usearch.ts:304 ↗
interface DenseReachability

Fields

auditednumberEntries published when the audit started; compare reachable against this, never a later size.
reachablenumberOf those, the entries a search reaches from the landmarks; the rest stay unfound until a refine.
sweepsnumberLevels the sweep took to converge.
backSweepsnumberLevels the sweep back toward the entry point took, where an audit sweeps both ways.

Functions

versionThe library's version, as the release tooling stamped it.
usearch.ts:126 ↗
function version(): string
capabilitiesCompiledThe hardware capabilities this binary was compiled with, comma-separated.
usearch.ts:131 ↗
function capabilitiesCompiled(): string
capabilitiesAvailableThe hardware capabilities the current machine offers at runtime, comma-separated.
usearch.ts:136 ↗
function capabilitiesAvailable(): string