vector

batch_get

Read multiple vectors by key.

db.vectors.get_many(collection: 'str', keys: 'Sequence[str]') -> 'BatchResult'

wire vector_batch_get

Reads several vector keys and returns positional item results. Each item records found or missing state.

Itemwise batches return one positional item result per input item. The outer batch status summarizes whether all, some, or none of the items succeeded.

To see the complete help for this command, run:

help(db.vectors.get_many)

Example

Read many vectors at once.

_ = db.vectors.create_collection("docs", 3, metric="cosine")_ = db.vectors.upsert_many("docs", [{"key": "a", "vector": [1.0, 0.0, 0.0]}, {"key": "b", "vector": [0.0, 1.0, 0.0]}])[i.result.value.key for i in db.vectors.get_many("docs", ["a", "b"]).items]

Parameters

NameTypeRequiredDescription
collectionstringyesCollection name.
keysarrayyesKeys to read.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

BatchResult<Maybe<VectorVersionedData>>

  • dataBatchResult8
  • typestring

Errors

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

← All 22 Vectors commands

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