Docs menu · Reference

Returns a deterministic representative sample of vectors from a collection: the total live count and up to count entries (default 10), evenly strided over the ordered keys. Latest state only.

Paginated responses use opaque cursors. Clients should pass the returned cursor back to the same command shape and must not parse cursor contents.

Examples

A representative sample of stored vectors plus the total count.

CLI

$ strata vector collection create docs 3 cosine
$ strata vector upsert docs a [1.0,0.0,0.0]
$ strata vector upsert docs b [0.0,1.0,0.0]
$ strata vector sample docs

Wire

{"collection":"docs","dimension":3,"metric":"cosine","type":"vector_create_collection"}
{"collection":"docs","key":"a","type":"vector_upsert","vector":[1.0,0.0,0.0]}
{"collection":"docs","key":"b","type":"vector_upsert","vector":[0.0,1.0,0.0]}
{"collection":"docs","type":"vector_sample"}

Parameters

NameTypeRequiredDescription
collectionstringyesCollection name.
countintegernoOptional sample count. Defaults to 10.

Plus the optional scope: branch and space (default to the session branch and the "default" space).

Returns

SamplePage<VectorVersionedData>.

Errors

Invocation

  • CLI: strata vector sample
  • Wire type: vector_sample

agents: this page as markdown → /docs/reference/vector/sample.md