Docs menu · Reference

Upserts one vector key with a dense embedding and optional metadata. The vector dimension must match the collection configuration.

Successful mutations return an acknowledgement that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.

Examples

Insert or replace a vector with optional metadata.

CLI

$ strata vector collection create docs 3 cosine
$ strata vector upsert docs a [1.0,0.0,0.0] --metadata {"tag":"x"}
$ strata vector exists docs a

Wire

{"collection":"docs","dimension":3,"metric":"cosine","type":"vector_create_collection"}
{"collection":"docs","key":"a","metadata":{"tag":"x"},"type":"vector_upsert","vector":[1.0,0.0,0.0]}
{"collection":"docs","key":"a","type":"vector_exists"}

Parameters

NameTypeRequiredDescription
collectionstringyesCollection name.
keystringyesVector key.
metadataanynoOptional metadata.
vectornumber[]yesDense embedding.

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

Returns

MutationAck<VectorWrite>.

Errors

Invocation

  • CLI: strata vector upsert
  • Wire type: vector_upsert

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