vector

upsert

Insert or replace one vector.

strata vector upsert

wire vector_upsert

Upserts one vector key with a dense embedding and optional metadata. The vector dimension must match the collection configuration. With `text` instead of a vector, the text is embedded through the collection's recorded model on the same inference path as `inference.embed`, so the `inference.*` failures listed below apply only to that form; a supplied vector never reaches the inference runtime.

Successful mutations return an acknowledgement of the outcome: for a state-changing write, the affected target with the mutation effect and commit facts; for mutations that produce a domain result (such as a branch or a promotion outcome), that result object.

To see the complete help for this command, run:

strata vector upsert --help

Example

Insert or replace a vector with optional metadata.

strata vector collection create docs 3 --metric cosinecreated collection docs (3 dimensions, cosine)strata vector upsert docs a '[1.0,0.0,0.0]' --metadata '{"tag":"x"}'created a in docsstrata vector exists docs atrue

Parameters

NameTypeRequiredDescription
collectionstringyesCollection name.
keystringyesVector key.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
metadataanynoOptional metadata.
spacestring or nullnoTarget product space. Defaults to `"default"`.
textstring or nullnoText to embed with the collection's recorded model, instead of supplying a vector (D10). Exactly one of `vector` or `text`.
vectorarraynoDense embedding. Accepted at wire (f64) precision and narrowed to the stored f32; a value that underflows or overflows f32 is rejected. Empty when `text` is supplied instead. A vector carries no model, so when the collection records an embedding model, Strata cannot check this vector against it: supplying one is the caller's statement that the recorded model produced it. Only `text` is embedded under the record.

Returns

MutationAck

  • dataobject
  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

CodeRetryCommit outcome
failed_precondition.engine.runtime_closednevernot_started
not_found.engine.branchnevernot_applicable
invalid_argument.engine.product_spacenevernot_started
invalid_argument.engine.vector_collectionnevernot_started
invalid_argument.engine.vector_keynevernot_started
not_found.engine.vector_collectionnevernot_applicable
invalid_argument.engine.vector_dimensionnevernot_started
invalid_argument.engine.vector_embeddingnevernot_started
invalid_argument.engine.vector_metadatanevernot_started
invalid_argument.executor.vector_dimensionnevernot_started
invalid_argument.executor.vector_inputnevernot_started
failed_precondition.engine.embedding_model_missingnevernot_started
inference.invalid_requestnevernot_applicable
inference.unsupported_operationnevernot_applicable
inference.missing_modelafter_state_changenot_applicable
inference.unknown_modelnevernot_applicable
inference.io_failureafter_state_changenot_applicable
inference.model_load_failedafter_state_changenot_applicable
inference.local_runtime_failedafter_state_changenot_applicable
inference.registry_corruptnevernot_applicable
inference.missing_api_keyafter_state_changenot_applicable
inference.provider_auth_failedafter_state_changenot_applicable
inference.provider_unavailablesame_requestnot_applicable
inference.provider_timeoutsame_requestnot_applicable
inference.provider_rate_limitedafter_state_changenot_applicable
inference.provider_quota_exhaustedafter_state_changenot_applicable
inference.provider_model_not_foundnevernot_applicable
inference.provider_malformed_responsesame_requestnot_applicable
inference.unsupported_providernevernot_applicable
inference.unsupported_parameternevernot_applicable
← All 24 Vectors commands

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