{ "components": { "schemas": { "AliasOperations": { "anyOf": [ { "description": "Create alternative name for a collection. Collection will be available under both names for search, retrieve,", "type": "object", "required": [ "create_alias" ], "properties": { "create_alias": { "type": "object", "required": [ "alias_name", "collection_name" ], "properties": { "alias_name": { "type": "string" }, "collection_name": { "type": "string" } } } }, "additionalProperties": false }, { "description": "Delete alias if exists", "type": "object", "required": [ "delete_alias" ], "properties": { "delete_alias": { "type": "object", "required": [ "alias_name" ], "properties": { "alias_name": { "type": "string" } } } }, "additionalProperties": false }, { "description": "Change alias to a new one", "type": "object", "required": [ "rename_alias" ], "properties": { "rename_alias": { "type": "object", "required": [ "new_alias_name", "old_alias_name" ], "properties": { "new_alias_name": { "type": "string" }, "old_alias_name": { "type": "string" } } } }, "additionalProperties": false } ] }, "CollectionConfig": { "type": "object", "required": [ "hnsw_config", "optimizer_config", "params", "wal_config" ], "properties": { "hnsw_config": { "$ref": "#/components/schemas/HnswConfig" }, "optimizer_config": { "$ref": "#/components/schemas/OptimizersConfig" }, "params": { "$ref": "#/components/schemas/CollectionParams" }, "wal_config": { "$ref": "#/components/schemas/WalConfig" } } }, "CollectionDescription": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "CollectionInfo": { "description": "Current statistics and configuration of the collection.", "type": "object", "required": [ "config", "disk_data_size", "ram_data_size", "segments_count", "status", "vectors_count" ], "properties": { "config": { "$ref": "#/components/schemas/CollectionConfig" }, "disk_data_size": { "description": "Disk space, used by collection", "type": "integer", "format": "uint", "minimum": 0 }, "ram_data_size": { "description": "RAM used by collection", "type": "integer", "format": "uint", "minimum": 0 }, "segments_count": { "description": "Number of segments in collection", "type": "integer", "format": "uint", "minimum": 0 }, "status": { "$ref": "#/components/schemas/CollectionStatus" }, "vectors_count": { "description": "Number of vectors in collection", "type": "integer", "format": "uint", "minimum": 0 } } }, "CollectionParams": { "type": "object", "required": [ "distance", "vector_size" ], "properties": { "distance": { "$ref": "#/components/schemas/Distance" }, "vector_size": { "description": "Size of a vectors used", "type": "integer", "format": "uint", "minimum": 0 } } }, "CollectionStatus": { "type": "string", "enum": [ "green", "yellow", "red" ] }, "CollectionUpdateOperations": { "anyOf": [ { "$ref": "#/components/schemas/PointOperations" }, { "$ref": "#/components/schemas/PayloadOps" }, { "$ref": "#/components/schemas/FieldIndexOperations" } ] }, "CollectionsResponse": { "type": "object", "required": [ "collections" ], "properties": { "collections": { "type": "array", "items": { "$ref": "#/components/schemas/CollectionDescription" } } } }, "Condition": { "anyOf": [ { "$ref": "#/components/schemas/FieldCondition" }, { "$ref": "#/components/schemas/HasIdCondition" }, { "$ref": "#/components/schemas/Filter" } ] }, "Distance": { "description": "Type of internal tags, build from payload Distance function types used to compare vectors", "type": "string", "enum": [ "Cosine", "Euclid", "Dot" ] }, "FieldCondition": { "type": "object", "required": [ "key" ], "properties": { "geo_bounding_box": { "description": "Check if points geo location lies in a given area", "anyOf": [ { "$ref": "#/components/schemas/GeoBoundingBox" }, { "nullable": true } ] }, "geo_radius": { "description": "Check if geo point is within a given radius", "anyOf": [ { "$ref": "#/components/schemas/GeoRadius" }, { "nullable": true } ] }, "key": { "type": "string" }, "match": { "description": "Check if point has field with a given value", "anyOf": [ { "$ref": "#/components/schemas/Match" }, { "nullable": true } ] }, "range": { "description": "Check if points value lies in a given range", "anyOf": [ { "$ref": "#/components/schemas/Range" }, { "nullable": true } ] } } }, "FieldIndexOperations": { "anyOf": [ { "description": "Create index for payload field", "type": "object", "required": [ "create_index" ], "properties": { "create_index": { "type": "string" } }, "additionalProperties": false }, { "description": "Delete index for the field", "type": "object", "required": [ "delete_index" ], "properties": { "delete_index": { "type": "string" } }, "additionalProperties": false } ] }, "Filter": { "type": "object", "properties": { "must": { "description": "All conditions must match", "type": "array", "items": { "$ref": "#/components/schemas/Condition" }, "nullable": true }, "must_not": { "description": "All conditions must NOT match", "type": "array", "items": { "$ref": "#/components/schemas/Condition" }, "nullable": true }, "should": { "description": "At least one of thous conditions should match", "type": "array", "items": { "$ref": "#/components/schemas/Condition" }, "nullable": true } }, "additionalProperties": false }, "GeoBoundingBox": { "type": "object", "required": [ "bottom_right", "top_left" ], "properties": { "bottom_right": { "$ref": "#/components/schemas/GeoPoint" }, "top_left": { "$ref": "#/components/schemas/GeoPoint" } } }, "GeoPoint": { "type": "object", "required": [ "lat", "lon" ], "properties": { "lat": { "type": "number", "format": "double" }, "lon": { "type": "number", "format": "double" } } }, "GeoRadius": { "type": "object", "required": [ "center", "radius" ], "properties": { "center": { "$ref": "#/components/schemas/GeoPoint" }, "radius": { "description": "Radius of the area in meters", "type": "number", "format": "double" } } }, "HasIdCondition": { "type": "object", "required": [ "has_id" ], "properties": { "has_id": { "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 }, "uniqueItems": true } } }, "HnswConfig": { "type": "object", "required": [ "ef_construct", "full_scan_threshold", "m" ], "properties": { "ef_construct": { "description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index.", "type": "integer", "format": "uint", "minimum": 0 }, "full_scan_threshold": { "description": "Minimal amount of points for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required.", "type": "integer", "format": "uint", "minimum": 0 }, "m": { "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", "type": "integer", "format": "uint", "minimum": 0 } } }, "HnswConfigDiff": { "type": "object", "properties": { "ef_construct": { "description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index.", "type": "integer", "format": "uint", "minimum": 0, "nullable": true }, "full_scan_threshold": { "description": "Minimal amount of points for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required.", "type": "integer", "format": "uint", "minimum": 0, "nullable": true }, "m": { "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", "type": "integer", "format": "uint", "minimum": 0, "nullable": true } } }, "Match": { "type": "object", "properties": { "integer": { "description": "Integer value to match", "type": "integer", "format": "int64", "nullable": true }, "keyword": { "description": "Keyword value to match", "type": "string", "nullable": true } } }, "OptimizersConfig": { "type": "object", "required": [ "deleted_threshold", "flush_interval_sec", "indexing_threshold", "max_segment_number", "memmap_threshold", "payload_indexing_threshold", "vacuum_min_vector_number" ], "properties": { "deleted_threshold": { "description": "The minimal fraction of deleted vectors in a segment, required to perform segment optimization", "type": "number", "format": "double" }, "flush_interval_sec": { "description": "Minimum interval between forced flushes.", "type": "integer", "format": "uint64", "minimum": 0 }, "indexing_threshold": { "description": "Maximum number of vectors allowed for plain index. Default value based on https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md", "type": "integer", "format": "uint", "minimum": 0 }, "max_segment_number": { "description": "If the number of segments exceeds this value, the optimizer will merge the smallest segments.", "type": "integer", "format": "uint", "minimum": 0 }, "memmap_threshold": { "description": "Maximum number of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmaped file.", "type": "integer", "format": "uint", "minimum": 0 }, "payload_indexing_threshold": { "description": "Starting from this amount of vectors per-segment the engine will start building index for payload.", "type": "integer", "format": "uint", "minimum": 0 }, "vacuum_min_vector_number": { "description": "The minimal number of vectors in a segment, required to perform segment optimization", "type": "integer", "format": "uint", "minimum": 0 } } }, "OptimizersConfigDiff": { "type": "object", "properties": { "deleted_threshold": { "description": "The minimal fraction of deleted vectors in a segment, required to perform segment optimization", "type": "number", "format": "double", "nullable": true }, "flush_interval_sec": { "description": "Minimum interval between forced flushes.", "type": "integer", "format": "uint64", "minimum": 0, "nullable": true }, "indexing_threshold": { "description": "Maximum number of vectors allowed for plain index. Default value based on https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md", "type": "integer", "format": "uint", "minimum": 0, "nullable": true }, "max_segment_number": { "description": "If the number of segments exceeds this value, the optimizer will merge the smallest segments.", "type": "integer", "format": "uint", "minimum": 0, "nullable": true }, "memmap_threshold": { "description": "Maximum number of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmaped file.", "type": "integer", "format": "uint", "minimum": 0, "nullable": true }, "payload_indexing_threshold": { "description": "Starting from this amount of vectors per-segment the engine will start building index for payload.", "type": "integer", "format": "uint", "minimum": 0, "nullable": true }, "vacuum_min_vector_number": { "description": "The minimal number of vectors in a segment, required to perform segment optimization", "type": "integer", "format": "uint", "minimum": 0, "nullable": true } } }, "PayloadInterface": { "anyOf": [ { "$ref": "#/components/schemas/PayloadVariant_for_String" }, { "$ref": "#/components/schemas/PayloadVariant_for_int64" }, { "$ref": "#/components/schemas/PayloadVariant_for_double" }, { "$ref": "#/components/schemas/PayloadInterfaceStrict" } ] }, "PayloadInterfaceStrict": { "anyOf": [ { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "keyword" ] }, "value": { "$ref": "#/components/schemas/PayloadVariant_for_String" } } }, { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "integer" ] }, "value": { "$ref": "#/components/schemas/PayloadVariant_for_int64" } } }, { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "float" ] }, "value": { "$ref": "#/components/schemas/PayloadVariant_for_double" } } }, { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "geo" ] }, "value": { "$ref": "#/components/schemas/PayloadVariant_for_GeoPoint" } } } ] }, "PayloadOps": { "description": "Define operations description for point payloads manipulation", "anyOf": [ { "description": "Set payload value, overrides if it is already exists", "type": "object", "required": [ "set_payload" ], "properties": { "set_payload": { "type": "object", "required": [ "payload", "points" ], "properties": { "payload": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/PayloadInterface" } }, "points": { "description": "Assigns payload to each point in this list", "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } } } } }, "additionalProperties": false }, { "description": "Deletes specified payload values if they are assigned", "type": "object", "required": [ "delete_payload" ], "properties": { "delete_payload": { "type": "object", "required": [ "keys", "points" ], "properties": { "keys": { "type": "array", "items": { "type": "string" } }, "points": { "description": "Deletes values from each point in this list", "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } } } } }, "additionalProperties": false }, { "description": "Drops all Payload values associated with given points.", "type": "object", "required": [ "clear_payload" ], "properties": { "clear_payload": { "type": "object", "required": [ "points" ], "properties": { "points": { "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } } } } }, "additionalProperties": false } ] }, "PayloadType": { "anyOf": [ { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "keyword" ] }, "value": { "type": "array", "items": { "type": "string" } } } }, { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "integer" ] }, "value": { "type": "array", "items": { "type": "integer", "format": "int64" } } } }, { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "float" ] }, "value": { "type": "array", "items": { "type": "number", "format": "double" } } } }, { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "geo" ] }, "value": { "type": "array", "items": { "$ref": "#/components/schemas/GeoPoint" } } } } ] }, "PayloadVariant_for_GeoPoint": { "anyOf": [ { "$ref": "#/components/schemas/GeoPoint" }, { "type": "array", "items": { "$ref": "#/components/schemas/GeoPoint" } } ] }, "PayloadVariant_for_String": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "PayloadVariant_for_double": { "anyOf": [ { "type": "number", "format": "double" }, { "type": "array", "items": { "type": "number", "format": "double" } } ] }, "PayloadVariant_for_int64": { "anyOf": [ { "type": "integer", "format": "int64" }, { "type": "array", "items": { "type": "integer", "format": "int64" } } ] }, "PointInsertOperations": { "anyOf": [ { "description": "Inset points from a batch.", "type": "object", "required": [ "batch" ], "properties": { "batch": { "type": "object", "required": [ "ids", "vectors" ], "properties": { "ids": { "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } }, "payloads": { "type": "array", "items": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/PayloadInterface" }, "nullable": true }, "nullable": true }, "vectors": { "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "float" } } } } } }, "additionalProperties": false }, { "description": "Insert points from a list", "type": "object", "required": [ "points" ], "properties": { "points": { "type": "array", "items": { "$ref": "#/components/schemas/PointStruct" } } }, "additionalProperties": false } ] }, "PointOperations": { "anyOf": [ { "description": "Insert or update points", "type": "object", "required": [ "upsert_points" ], "properties": { "upsert_points": { "$ref": "#/components/schemas/PointInsertOperations" } }, "additionalProperties": false }, { "description": "Delete point if exists", "type": "object", "required": [ "delete_points" ], "properties": { "delete_points": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } } } } }, "additionalProperties": false } ] }, "PointRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } } } }, "PointStruct": { "type": "object", "required": [ "id", "vector" ], "properties": { "id": { "description": "Point id", "type": "integer", "format": "uint64", "minimum": 0 }, "payload": { "description": "Payload values (optional)", "type": "object", "additionalProperties": { "$ref": "#/components/schemas/PayloadInterface" }, "nullable": true }, "vector": { "description": "Vector", "type": "array", "items": { "type": "number", "format": "float" } } } }, "Range": { "type": "object", "properties": { "gt": { "description": "point.key > range.gt", "type": "number", "format": "double", "nullable": true }, "gte": { "description": "point.key >= range.gte", "type": "number", "format": "double", "nullable": true }, "lt": { "description": "point.key < range.lt", "type": "number", "format": "double", "nullable": true }, "lte": { "description": "point.key <= range.lte", "type": "number", "format": "double", "nullable": true } } }, "RecommendRequest": { "description": "Search request", "type": "object", "required": [ "negative", "positive", "top" ], "properties": { "filter": { "description": "Look only for points which satisfies this conditions", "anyOf": [ { "$ref": "#/components/schemas/Filter" }, { "nullable": true } ] }, "negative": { "description": "Try to avoid vectors like this", "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } }, "params": { "description": "Additional search params", "anyOf": [ { "$ref": "#/components/schemas/SearchParams" }, { "nullable": true } ] }, "positive": { "description": "Look for vectors closest to those", "type": "array", "items": { "type": "integer", "format": "uint64", "minimum": 0 } }, "top": { "description": "Max number of result to return", "type": "integer", "format": "uint", "minimum": 0 } } }, "Record": { "description": "Point data", "type": "object", "required": [ "id" ], "properties": { "id": { "description": "Id of the point", "type": "integer", "format": "uint64", "minimum": 0 }, "payload": { "description": "Payload - values assigned to the point", "type": "object", "additionalProperties": { "$ref": "#/components/schemas/PayloadType" }, "nullable": true }, "vector": { "description": "Vector of the point", "type": "array", "items": { "type": "number", "format": "float" }, "nullable": true } } }, "ScoredPoint": { "type": "object", "required": [ "id", "score" ], "properties": { "id": { "description": "Point id", "type": "integer", "format": "uint64", "minimum": 0 }, "score": { "description": "Points vector distance to the query vector", "type": "number", "format": "float" } } }, "SearchParams": { "description": "Additional parameters of the search", "type": "object", "properties": { "hnsw_ef": { "description": "Params relevant to HNSW index /// Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search.", "type": "integer", "format": "uint", "minimum": 0, "nullable": true } } }, "SearchRequest": { "description": "Search request", "type": "object", "required": [ "top", "vector" ], "properties": { "filter": { "description": "Look only for points which satisfies this conditions", "anyOf": [ { "$ref": "#/components/schemas/Filter" }, { "nullable": true } ] }, "params": { "description": "Additional search params", "anyOf": [ { "$ref": "#/components/schemas/SearchParams" }, { "nullable": true } ] }, "top": { "description": "Max number of result to return", "type": "integer", "format": "uint", "minimum": 0 }, "vector": { "description": "Look for vectors closest to this", "type": "array", "items": { "type": "number", "format": "float" } } } }, "StorageOperations": { "anyOf": [ { "description": "Create new collection and (optionally) specify index params", "type": "object", "required": [ "create_collection" ], "properties": { "create_collection": { "type": "object", "required": [ "distance", "name", "vector_size" ], "properties": { "distance": { "$ref": "#/components/schemas/Distance" }, "hnsw_config": { "description": "Custom params for HNSW index. If none - values from service configuration file are used.", "anyOf": [ { "$ref": "#/components/schemas/HnswConfigDiff" }, { "nullable": true } ] }, "name": { "type": "string" }, "optimizers_config": { "description": "Custom params for Optimizers. If none - values from service configuration file are used.", "anyOf": [ { "$ref": "#/components/schemas/OptimizersConfigDiff" }, { "nullable": true } ] }, "vector_size": { "type": "integer", "format": "uint", "minimum": 0 }, "wal_config": { "description": "Custom params for WAL. If none - values from service configuration file are used.", "anyOf": [ { "$ref": "#/components/schemas/WalConfigDiff" }, { "nullable": true } ] } } } }, "additionalProperties": false }, { "description": "Update parameters of the existing collection", "type": "object", "required": [ "update_collection" ], "properties": { "update_collection": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "optimizers_config": { "description": "Custom params for Optimizers. If none - values from service configuration file are used. This operation is blocking, it will only proceed ones all current optimizations are complete", "anyOf": [ { "$ref": "#/components/schemas/OptimizersConfigDiff" }, { "nullable": true } ] } } } }, "additionalProperties": false }, { "description": "Delete collection with given name", "type": "object", "required": [ "delete_collection" ], "properties": { "delete_collection": { "type": "string" } }, "additionalProperties": false }, { "description": "Perform changes of collection aliases. Alias changes are atomic, meaning that no collection modifications can happen between alias operations.", "type": "object", "required": [ "change_aliases" ], "properties": { "change_aliases": { "type": "object", "required": [ "actions" ], "properties": { "actions": { "type": "array", "items": { "$ref": "#/components/schemas/AliasOperations" } } } } }, "additionalProperties": false } ] }, "UpdateResult": { "type": "object", "required": [ "operation_id", "status" ], "properties": { "operation_id": { "description": "Sequential number of the operation", "type": "integer", "format": "uint64", "minimum": 0 }, "status": { "$ref": "#/components/schemas/UpdateStatus" } } }, "UpdateStatus": { "type": "string", "enum": [ "acknowledged", "completed" ] }, "WalConfig": { "type": "object", "required": [ "wal_capacity_mb", "wal_segments_ahead" ], "properties": { "wal_capacity_mb": { "description": "Size of a single WAL segment in MB", "type": "integer", "format": "uint", "minimum": 0 }, "wal_segments_ahead": { "description": "Number of WAL segments to create ahead of actually used ones", "type": "integer", "format": "uint", "minimum": 0 } } }, "WalConfigDiff": { "type": "object", "properties": { "wal_capacity_mb": { "description": "Size of a single WAL segment in MB", "type": "integer", "format": "uint", "minimum": 0, "nullable": true }, "wal_segments_ahead": { "description": "Number of WAL segments to create ahead of actually used ones", "type": "integer", "format": "uint", "minimum": 0, "nullable": true } } } } } }