Index configuration
These keyword arguments toclient.create_index() configure the index. There is no index_config argument and no IndexIVFFlat / IndexIVFPQ / IndexIVFSQ types.
Key management
Pass exactly one of the two to
create_index(); passing both returns ValidationError.
Vector item
The dict shapeupsert() accepts:
Query result
query() returns a flat list for one query vector, and a list of lists for a batch:
distance (lower is closer). Hybrid queries (text=) return score instead (higher is more relevant).
MetadataResult
The item typequery_metadata() returns, importable as cyborgdb.MetadataResult:
Field selection
include picks the fields returned besides id:
get() defaults to ["vector", "contents", "metadata"]; query() defaults to [], which returns only id.
Metadata filtering
filters on query(), query_binary(), and query_metadata() uses MongoDB-style operators. Nested fields use dot-paths such as "loc.city".
Operators
$gt, $gte, $lt, and $lte require a number; any other value returns ValidationError. $not can’t be nested inside a field ({"price": {"$not": ...}} returns ValidationError); wrap the whole condition instead. $regex and $contains resolve from the index only on fields created with pattern: True: query() falls back to a slower post-filter otherwise, and query_metadata() rejects the filter.
Examples
Dates
CyborgDB has no date type. Store dates in metadata as integer milliseconds since the Unix epoch (UTC), so range operators work on them:datetime with:
"2026-01-15", only works with equality filters. Range operators need a number, so {"$gte": "2026-01-01"} returns ValidationError.