For the complete documentation index, see llms.txt. This page is also available as Markdown.

Upsert and search vectors

Upsert asset- or frame-level vectors in batches and run scoped nearest-neighbor search.

Outcome: Upsert asset- or frame-level vectors in batches and run scoped nearest-neighbor search.

space.upsert("ASSET_ID", [0.1, 0.2, 0.3], frame_index=12)

space.upsert_many([
    {"asset_id": "ASSET_A", "vector": [0.1, 0.2, 0.3]},
    {"asset_id": "ASSET_B", "frame_index": 4, "vector": [0.3, 0.2, 0.1]},
])

results = space.search(
    [0.1, 0.2, 0.3],
    limit=25,
    project_id="PROJECT_ID",
    level="frame",
)

Every vector must match the space dimension. level distinguishes compatible search granularity; project_id scopes results where supported. Preserve the model, preprocessing, normalization, and source version outside the raw vector so the index remains interpretable.

Operating contract

Concern
Required behavior

Execution surface

Pinned unitlab==3.0.0 application environment on Python 3.10+.

Identity

Least-privilege API key supplied through approved configuration.

Target resolution

Stable resource IDs and an explicitly bounded target set.

Success evidence

Typed return fields, server-side state, and downstream acceptance of the result.

Failure and recovery boundary

Condition
Response

Authentication or authorization fails

Stop, correct the service identity or access model, rotate exposed credentials, and rerun a read-only check.

Validation or entitlement rejects the operation

Correct the input or entitlement; do not retry an unchanged request.

A request times out

Inspect remote state before repeating a mutation because the server may have accepted it.

Asynchronous processing exceeds its deadline

Preserve the Batch Queue or release ID, continue bounded monitoring, and inspect item-level failures.

Only part of a batch succeeds

Keep successful identifiers, isolate failed rows, and retry only the corrected subset.


Explore related Unitlab capabilities: Unitlab’s data curation platform