Skip to main content
Loads a hosted sample dataset, ready to upsert and query, for quickstarts, demos, and tests without generating your own vectors. The dataset is downloaded from a public S3 bucket. On Node.js it’s cached on disk after the first call; other runtimes download it on every call.
loadSampleDataset is a top-level export:

Parameters

The download has a 120-second timeout, and the decompressed dataset is capped at 512 MB. Each dataset’s SHA-256 digest is pinned in the SDK and checked after download and on every cache read, so a tampered file is rejected and downloaded again. Decompression needs the runtime’s DecompressionStream.

Returns

Promise<SampleDataset>: The package also exports the SampleDataset, SampleFilter, and LoadSampleDatasetOptions types and the DEFAULT_SAMPLE_DATASET and SAMPLE_DATASETS_BASE_URL constants.

Exceptions

The dataset name is unknown, the download fails or times out, the file fails its SHA-256 check, it exceeds 512 MB, or the runtime has no DecompressionStream.

Example Usage