points.proto 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232
  1. syntax = "proto3";
  2. package qdrant;
  3. option csharp_namespace = "Qdrant.Client.Grpc";
  4. import "collections.proto";
  5. import "google/protobuf/timestamp.proto";
  6. import "json_with_int.proto";
  7. enum WriteOrderingType {
  8. Weak = 0; // Write operations may be reordered, works faster, default
  9. Medium = 1; // Write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change
  10. Strong = 2; // Write operations go through the permanent leader, consistent, but may be unavailable if leader is down
  11. }
  12. message WriteOrdering {
  13. WriteOrderingType type = 1; // Write ordering guarantees
  14. }
  15. enum ReadConsistencyType {
  16. All = 0; // Send request to all nodes and return points which are present on all of them
  17. Majority = 1; // Send requests to all nodes and return points which are present on majority of them
  18. Quorum = 2; // Send requests to half + 1 nodes, return points which are present on all of them
  19. }
  20. message ReadConsistency {
  21. oneof value {
  22. ReadConsistencyType type = 1; // Common read consistency configurations
  23. uint64 factor = 2; // Send request to a specified number of nodes, and return points which are present on all of them
  24. }
  25. }
  26. // ---------------------------------------------
  27. // ------------- Point Id Requests -------------
  28. // ---------------------------------------------
  29. message PointId {
  30. oneof point_id_options {
  31. uint64 num = 1; // Numerical ID of the point
  32. string uuid = 2; // UUID
  33. }
  34. }
  35. message SparseIndices {
  36. repeated uint32 data = 1;
  37. }
  38. message Document {
  39. string text = 1; // Text of the document
  40. string model = 3; // Model name
  41. map<string, Value> options = 4; // Model options
  42. }
  43. message Image {
  44. Value image = 1; // Image data, either base64 encoded or URL
  45. string model = 2; // Model name
  46. map<string, Value> options = 3; // Model options
  47. }
  48. message InferenceObject {
  49. Value object = 1; // Object to infer
  50. string model = 2; // Model name
  51. map<string, Value> options = 3; // Model options
  52. }
  53. // Legacy vector format, which determines the vector type by the configuration of its fields.
  54. message Vector {
  55. repeated float data = 1; // Vector data (flatten for multi vectors), deprecated
  56. optional SparseIndices indices = 2; // Sparse indices for sparse vectors, deprecated
  57. optional uint32 vectors_count = 3; // Number of vectors per multi vector, deprecated
  58. oneof vector {
  59. DenseVector dense = 101; // Dense vector
  60. SparseVector sparse = 102; // Sparse vector
  61. MultiDenseVector multi_dense = 103; // Multi dense vector
  62. Document document = 104;
  63. Image image = 105;
  64. InferenceObject object = 106;
  65. }
  66. }
  67. message VectorOutput {
  68. repeated float data = 1; // Vector data (flatten for multi vectors), deprecated
  69. optional SparseIndices indices = 2; // Sparse indices for sparse vectors, deprecated
  70. optional uint32 vectors_count = 3; // Number of vectors per multi vector, deprecated
  71. oneof vector {
  72. DenseVector dense = 101; // Dense vector
  73. SparseVector sparse = 102; // Sparse vector
  74. MultiDenseVector multi_dense = 103; // Multi dense vector
  75. }
  76. }
  77. message DenseVector {
  78. repeated float data = 1;
  79. }
  80. message SparseVector {
  81. repeated float values = 1;
  82. repeated uint32 indices = 2;
  83. }
  84. message MultiDenseVector {
  85. repeated DenseVector vectors = 1;
  86. }
  87. // Vector type to be used in queries. Ids will be substituted with their corresponding vectors from the collection.
  88. message VectorInput {
  89. oneof variant {
  90. PointId id = 1;
  91. DenseVector dense = 2;
  92. SparseVector sparse = 3;
  93. MultiDenseVector multi_dense = 4;
  94. Document document = 5;
  95. Image image = 6;
  96. InferenceObject object = 7;
  97. }
  98. }
  99. // ---------------------------------------------
  100. // ----------------- ShardKeySelector ----------
  101. // ---------------------------------------------
  102. message ShardKeySelector {
  103. repeated ShardKey shard_keys = 1; // List of shard keys which should be used in the request
  104. }
  105. // ---------------------------------------------
  106. // ---------------- RPC Requests ---------------
  107. // ---------------------------------------------
  108. message UpsertPoints {
  109. string collection_name = 1; // name of the collection
  110. optional bool wait = 2; // Wait until the changes have been applied?
  111. repeated PointStruct points = 3;
  112. optional WriteOrdering ordering = 4; // Write ordering guarantees
  113. optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys
  114. }
  115. message DeletePoints {
  116. string collection_name = 1; // name of the collection
  117. optional bool wait = 2; // Wait until the changes have been applied?
  118. PointsSelector points = 3; // Affected points
  119. optional WriteOrdering ordering = 4; // Write ordering guarantees
  120. optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys
  121. }
  122. message GetPoints {
  123. string collection_name = 1; // name of the collection
  124. repeated PointId ids = 2; // List of points to retrieve
  125. reserved 3; // deprecated "with_vector" field
  126. WithPayloadSelector with_payload = 4; // Options for specifying which payload to include or not
  127. optional WithVectorsSelector with_vectors = 5; // Options for specifying which vectors to include into response
  128. optional ReadConsistency read_consistency = 6; // Options for specifying read consistency guarantees
  129. optional ShardKeySelector shard_key_selector = 7; // Specify in which shards to look for the points, if not specified - look in all shards
  130. optional uint64 timeout = 8; // If set, overrides global timeout setting for this request. Unit is seconds.
  131. }
  132. message UpdatePointVectors {
  133. string collection_name = 1; // name of the collection
  134. optional bool wait = 2; // Wait until the changes have been applied?
  135. repeated PointVectors points = 3; // List of points and vectors to update
  136. optional WriteOrdering ordering = 4; // Write ordering guarantees
  137. optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys
  138. }
  139. message PointVectors {
  140. PointId id = 1; // ID to update vectors for
  141. Vectors vectors = 2; // Named vectors to update, leave others intact
  142. }
  143. message DeletePointVectors {
  144. string collection_name = 1; // name of the collection
  145. optional bool wait = 2; // Wait until the changes have been applied?
  146. PointsSelector points_selector = 3; // Affected points
  147. VectorsSelector vectors = 4; // List of vector names to delete
  148. optional WriteOrdering ordering = 5; // Write ordering guarantees
  149. optional ShardKeySelector shard_key_selector = 6; // Option for custom sharding to specify used shard keys
  150. }
  151. message SetPayloadPoints {
  152. string collection_name = 1; // name of the collection
  153. optional bool wait = 2; // Wait until the changes have been applied?
  154. map<string, Value> payload = 3; // New payload values
  155. reserved 4; // List of point to modify, deprecated
  156. optional PointsSelector points_selector = 5; // Affected points
  157. optional WriteOrdering ordering = 6; // Write ordering guarantees
  158. optional ShardKeySelector shard_key_selector = 7; // Option for custom sharding to specify used shard keys
  159. optional string key = 8; // Option for indicate property of payload
  160. }
  161. message DeletePayloadPoints {
  162. string collection_name = 1; // name of the collection
  163. optional bool wait = 2; // Wait until the changes have been applied?
  164. repeated string keys = 3; // List of keys to delete
  165. reserved 4; // Affected points, deprecated
  166. optional PointsSelector points_selector = 5; // Affected points
  167. optional WriteOrdering ordering = 6; // Write ordering guarantees
  168. optional ShardKeySelector shard_key_selector = 7; // Option for custom sharding to specify used shard keys
  169. }
  170. message ClearPayloadPoints {
  171. string collection_name = 1; // name of the collection
  172. optional bool wait = 2; // Wait until the changes have been applied?
  173. PointsSelector points = 3; // Affected points
  174. optional WriteOrdering ordering = 4; // Write ordering guarantees
  175. optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys
  176. }
  177. enum FieldType {
  178. FieldTypeKeyword = 0;
  179. FieldTypeInteger = 1;
  180. FieldTypeFloat = 2;
  181. FieldTypeGeo = 3;
  182. FieldTypeText = 4;
  183. FieldTypeBool = 5;
  184. FieldTypeDatetime = 6;
  185. FieldTypeUuid = 7;
  186. }
  187. message CreateFieldIndexCollection {
  188. string collection_name = 1; // name of the collection
  189. optional bool wait = 2; // Wait until the changes have been applied?
  190. string field_name = 3; // Field name to index
  191. optional FieldType field_type = 4; // Field type.
  192. optional PayloadIndexParams field_index_params = 5; // Payload index params.
  193. optional WriteOrdering ordering = 6; // Write ordering guarantees
  194. }
  195. message DeleteFieldIndexCollection {
  196. string collection_name = 1; // name of the collection
  197. optional bool wait = 2; // Wait until the changes have been applied?
  198. string field_name = 3; // Field name to delete
  199. optional WriteOrdering ordering = 4; // Write ordering guarantees
  200. }
  201. message PayloadIncludeSelector {
  202. repeated string fields = 1; // List of payload keys to include into result
  203. }
  204. message PayloadExcludeSelector {
  205. repeated string fields = 1; // List of payload keys to exclude from the result
  206. }
  207. message WithPayloadSelector {
  208. oneof selector_options {
  209. bool enable = 1; // If `true` - return all payload, if `false` - none
  210. PayloadIncludeSelector include = 2;
  211. PayloadExcludeSelector exclude = 3;
  212. }
  213. }
  214. message NamedVectors {
  215. map<string, Vector> vectors = 1;
  216. }
  217. message NamedVectorsOutput {
  218. map<string, VectorOutput> vectors = 1;
  219. }
  220. message Vectors {
  221. oneof vectors_options {
  222. Vector vector = 1;
  223. NamedVectors vectors = 2;
  224. }
  225. }
  226. message VectorsOutput {
  227. oneof vectors_options {
  228. VectorOutput vector = 1;
  229. NamedVectorsOutput vectors = 2;
  230. }
  231. }
  232. message VectorsSelector {
  233. repeated string names = 1; // List of vectors to include into result
  234. }
  235. message WithVectorsSelector {
  236. oneof selector_options {
  237. bool enable = 1; // If `true` - return all vectors, if `false` - none
  238. VectorsSelector include = 2; // List of payload keys to include into result
  239. }
  240. }
  241. message QuantizationSearchParams {
  242. /*
  243. If set to true, search will ignore quantized vector data
  244. */
  245. optional bool ignore = 1;
  246. /*
  247. If true, use original vectors to re-score top-k results. If ignored, qdrant decides automatically does rescore enabled or not.
  248. */
  249. optional bool rescore = 2;
  250. /*
  251. Oversampling factor for quantization.
  252. Defines how many extra vectors should be pre-selected using quantized index,
  253. and then re-scored using original vectors.
  254. For example, if `oversampling` is 2.4 and `limit` is 100, then 240 vectors will be pre-selected using quantized index,
  255. and then top-100 will be returned after re-scoring.
  256. */
  257. optional double oversampling = 3;
  258. }
  259. message SearchParams {
  260. /*
  261. Params relevant to HNSW index. Size of the beam in a beam-search.
  262. Larger the value - more accurate the result, more time required for search.
  263. */
  264. optional uint64 hnsw_ef = 1;
  265. /*
  266. Search without approximation. If set to true, search may run long but with exact results.
  267. */
  268. optional bool exact = 2;
  269. /*
  270. If set to true, search will ignore quantized vector data
  271. */
  272. optional QuantizationSearchParams quantization = 3;
  273. /*
  274. If enabled, the engine will only perform search among indexed or small segments.
  275. Using this option prevents slow searches in case of delayed index, but does not
  276. guarantee that all uploaded vectors will be included in search results
  277. */
  278. optional bool indexed_only = 4;
  279. }
  280. message SearchPoints {
  281. string collection_name = 1; // name of the collection
  282. repeated float vector = 2; // vector
  283. Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions
  284. uint64 limit = 4; // Max number of result
  285. reserved 5; // deprecated "with_vector" field
  286. WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not
  287. SearchParams params = 7; // Search config
  288. optional float score_threshold = 8; // If provided - cut off results with worse scores
  289. optional uint64 offset = 9; // Offset of the result
  290. optional string vector_name = 10; // Which vector to use for search, if not specified - use default vector
  291. optional WithVectorsSelector with_vectors = 11; // Options for specifying which vectors to include into response
  292. optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees
  293. optional uint64 timeout = 13; // If set, overrides global timeout setting for this request. Unit is seconds.
  294. optional ShardKeySelector shard_key_selector = 14; // Specify in which shards to look for the points, if not specified - look in all shards
  295. optional SparseIndices sparse_indices = 15;
  296. }
  297. message SearchBatchPoints {
  298. string collection_name = 1; // Name of the collection
  299. repeated SearchPoints search_points = 2;
  300. optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees
  301. optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds.
  302. }
  303. message WithLookup {
  304. string collection = 1; // Name of the collection to use for points lookup
  305. optional WithPayloadSelector with_payload = 2; // Options for specifying which payload to include (or not)
  306. optional WithVectorsSelector with_vectors = 3; // Options for specifying which vectors to include (or not)
  307. }
  308. message SearchPointGroups {
  309. string collection_name = 1; // Name of the collection
  310. repeated float vector = 2; // Vector to compare against
  311. Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions
  312. uint32 limit = 4; // Max number of result
  313. WithPayloadSelector with_payload = 5; // Options for specifying which payload to include or not
  314. SearchParams params = 6; // Search config
  315. optional float score_threshold = 7; // If provided - cut off results with worse scores
  316. optional string vector_name = 8; // Which vector to use for search, if not specified - use default vector
  317. optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response
  318. string group_by = 10; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups.
  319. uint32 group_size = 11; // Maximum amount of points to return per group
  320. optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees
  321. optional WithLookup with_lookup = 13; // Options for specifying how to use the group id to lookup points in another collection
  322. optional uint64 timeout = 14; // If set, overrides global timeout setting for this request. Unit is seconds.
  323. optional ShardKeySelector shard_key_selector = 15; // Specify in which shards to look for the points, if not specified - look in all shards
  324. optional SparseIndices sparse_indices = 16;
  325. }
  326. enum Direction {
  327. Asc = 0;
  328. Desc = 1;
  329. }
  330. message StartFrom {
  331. oneof value {
  332. double float = 1;
  333. int64 integer = 2;
  334. google.protobuf.Timestamp timestamp = 3;
  335. string datetime = 4;
  336. }
  337. }
  338. message OrderBy {
  339. string key = 1; // Payload key to order by
  340. optional Direction direction = 2; // Ascending or descending order
  341. optional StartFrom start_from = 3; // Start from this value
  342. }
  343. message ScrollPoints {
  344. string collection_name = 1;
  345. Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions
  346. optional PointId offset = 3; // Start with this ID
  347. optional uint32 limit = 4; // Max number of result
  348. reserved 5; // deprecated "with_vector" field
  349. WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not
  350. optional WithVectorsSelector with_vectors = 7; // Options for specifying which vectors to include into response
  351. optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees
  352. optional ShardKeySelector shard_key_selector = 9; // Specify in which shards to look for the points, if not specified - look in all shards
  353. optional OrderBy order_by = 10; // Order the records by a payload field
  354. optional uint64 timeout = 11; // If set, overrides global timeout setting for this request. Unit is seconds.
  355. }
  356. // How to use positive and negative vectors to find the results, default is `AverageVector`.
  357. enum RecommendStrategy {
  358. // Average positive and negative vectors and create a single query with the formula
  359. // `query = avg_pos + avg_pos - avg_neg`. Then performs normal search.
  360. AverageVector = 0;
  361. // Uses custom search objective. Each candidate is compared against all
  362. // examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
  363. // If the `max_neg_score` is chosen then it is squared and negated.
  364. BestScore = 1;
  365. // Uses custom search objective. Compares against all inputs, sums all the scores.
  366. // Scores against positive vectors are added, against negatives are subtracted.
  367. SumScores = 2;
  368. }
  369. message LookupLocation {
  370. string collection_name = 1;
  371. optional string vector_name = 2; // Which vector to use for search, if not specified - use default vector
  372. optional ShardKeySelector shard_key_selector = 3; // Specify in which shards to look for the points, if not specified - look in all shards
  373. }
  374. message RecommendPoints {
  375. string collection_name = 1; // name of the collection
  376. repeated PointId positive = 2; // Look for vectors closest to the vectors from these points
  377. repeated PointId negative = 3; // Try to avoid vectors like the vector from these points
  378. Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions
  379. uint64 limit = 5; // Max number of result
  380. reserved 6; // deprecated "with_vector" field
  381. WithPayloadSelector with_payload = 7; // Options for specifying which payload to include or not
  382. SearchParams params = 8; // Search config
  383. optional float score_threshold = 9; // If provided - cut off results with worse scores
  384. optional uint64 offset = 10; // Offset of the result
  385. optional string using = 11; // Define which vector to use for recommendation, if not specified - default vector
  386. optional WithVectorsSelector with_vectors = 12; // Options for specifying which vectors to include into response
  387. optional LookupLocation lookup_from = 13; // Name of the collection to use for points lookup, if not specified - use current collection
  388. optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
  389. optional RecommendStrategy strategy = 16; // How to use the example vectors to find the results
  390. repeated Vector positive_vectors = 17; // Look for vectors closest to those
  391. repeated Vector negative_vectors = 18; // Try to avoid vectors like this
  392. optional uint64 timeout = 19; // If set, overrides global timeout setting for this request. Unit is seconds.
  393. optional ShardKeySelector shard_key_selector = 20; // Specify in which shards to look for the points, if not specified - look in all shards
  394. }
  395. message RecommendBatchPoints {
  396. string collection_name = 1; // Name of the collection
  397. repeated RecommendPoints recommend_points = 2;
  398. optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees
  399. optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds.
  400. }
  401. message RecommendPointGroups {
  402. string collection_name = 1; // Name of the collection
  403. repeated PointId positive = 2; // Look for vectors closest to the vectors from these points
  404. repeated PointId negative = 3; // Try to avoid vectors like the vector from these points
  405. Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions
  406. uint32 limit = 5; // Max number of groups in result
  407. WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not
  408. SearchParams params = 7; // Search config
  409. optional float score_threshold = 8; // If provided - cut off results with worse scores
  410. optional string using = 9; // Define which vector to use for recommendation, if not specified - default vector
  411. optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into response
  412. optional LookupLocation lookup_from = 11; // Name of the collection to use for points lookup, if not specified - use current collection
  413. string group_by = 12; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups.
  414. uint32 group_size = 13; // Maximum amount of points to return per group
  415. optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
  416. optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection
  417. optional RecommendStrategy strategy = 17; // How to use the example vectors to find the results
  418. repeated Vector positive_vectors = 18; // Look for vectors closest to those
  419. repeated Vector negative_vectors = 19; // Try to avoid vectors like this
  420. optional uint64 timeout = 20; // If set, overrides global timeout setting for this request. Unit is seconds.
  421. optional ShardKeySelector shard_key_selector = 21; // Specify in which shards to look for the points, if not specified - look in all shards
  422. }
  423. message TargetVector {
  424. oneof target {
  425. VectorExample single = 1;
  426. // leaving extensibility for possibly adding multi-target
  427. }
  428. }
  429. message VectorExample {
  430. oneof example {
  431. PointId id = 1;
  432. Vector vector = 2;
  433. }
  434. }
  435. message ContextExamplePair {
  436. VectorExample positive = 1;
  437. VectorExample negative = 2;
  438. }
  439. message DiscoverPoints {
  440. string collection_name = 1; // name of the collection
  441. TargetVector target = 2; // Use this as the primary search objective
  442. repeated ContextExamplePair context = 3; // Search will be constrained by these pairs of examples
  443. Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions
  444. uint64 limit = 5; // Max number of result
  445. WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not
  446. SearchParams params = 7; // Search config
  447. optional uint64 offset = 8; // Offset of the result
  448. optional string using = 9; // Define which vector to use for recommendation, if not specified - default vector
  449. optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into response
  450. optional LookupLocation lookup_from = 11; // Name of the collection to use for points lookup, if not specified - use current collection
  451. optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees
  452. optional uint64 timeout = 13; // If set, overrides global timeout setting for this request. Unit is seconds.
  453. optional ShardKeySelector shard_key_selector = 14; // Specify in which shards to look for the points, if not specified - look in all shards
  454. }
  455. message DiscoverBatchPoints {
  456. string collection_name = 1; // Name of the collection
  457. repeated DiscoverPoints discover_points = 2;
  458. optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees
  459. optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds.
  460. }
  461. message CountPoints {
  462. string collection_name = 1; // Name of the collection
  463. Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions
  464. optional bool exact = 3; // If `true` - return exact count, if `false` - return approximate count
  465. optional ReadConsistency read_consistency = 4; // Options for specifying read consistency guarantees
  466. optional ShardKeySelector shard_key_selector = 5; // Specify in which shards to look for the points, if not specified - look in all shards
  467. optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
  468. }
  469. message RecommendInput {
  470. repeated VectorInput positive = 1; // Look for vectors closest to the vectors from these points
  471. repeated VectorInput negative = 2; // Try to avoid vectors like the vector from these points
  472. optional RecommendStrategy strategy = 3; // How to use the provided vectors to find the results
  473. }
  474. message ContextInputPair {
  475. VectorInput positive = 1; // A positive vector
  476. VectorInput negative = 2; // Repel from this vector
  477. }
  478. message DiscoverInput {
  479. VectorInput target = 1; // Use this as the primary search objective
  480. ContextInput context = 2; // Search space will be constrained by these pairs of vectors
  481. }
  482. message ContextInput {
  483. repeated ContextInputPair pairs = 1; // Search space will be constrained by these pairs of vectors
  484. }
  485. enum Fusion {
  486. RRF = 0; // Reciprocal Rank Fusion
  487. DBSF = 1; // Distribution-Based Score Fusion
  488. }
  489. // Sample points from the collection
  490. //
  491. // Available sampling methods:
  492. //
  493. // * `random` - Random sampling
  494. enum Sample {
  495. Random = 0;
  496. }
  497. message Formula {
  498. Expression expression = 1;
  499. map<string, Value> defaults = 2;
  500. }
  501. message Expression {
  502. oneof variant {
  503. float constant = 1;
  504. string variable = 2; // Payload key or reference to score.
  505. Condition condition = 3; // Payload condition. If true, becomes 1.0; otherwise 0.0
  506. GeoDistance geo_distance = 4; // Geographic distance in meters
  507. string datetime = 5; // Date-time constant
  508. string datetime_key = 6; // Payload key with date-time values
  509. MultExpression mult = 7; // Multiply
  510. SumExpression sum = 8; // Sum
  511. DivExpression div = 9; // Divide
  512. Expression neg = 10; // Negate
  513. Expression abs = 11; // Absolute value
  514. Expression sqrt = 12; // Square root
  515. PowExpression pow = 13; // Power
  516. Expression exp = 14; // Exponential
  517. Expression log10 = 15; // Logarithm
  518. Expression ln = 16; // Natural logarithm
  519. DecayParamsExpression exp_decay = 17; // Exponential decay
  520. DecayParamsExpression gauss_decay = 18; // Gaussian decay
  521. DecayParamsExpression lin_decay = 19; // Linear decay
  522. }
  523. }
  524. message GeoDistance {
  525. GeoPoint origin = 1;
  526. string to = 2;
  527. }
  528. message MultExpression {
  529. repeated Expression mult = 1;
  530. }
  531. message SumExpression {
  532. repeated Expression sum = 1;
  533. }
  534. message DivExpression {
  535. Expression left = 1;
  536. Expression right = 2;
  537. optional float by_zero_default = 3;
  538. }
  539. message PowExpression {
  540. Expression base = 1;
  541. Expression exponent = 2;
  542. }
  543. message DecayParamsExpression {
  544. // The variable to decay
  545. Expression x = 1;
  546. // The target value to start decaying from. Defaults to 0.
  547. optional Expression target = 2;
  548. // The scale factor of the decay, in terms of `x`. Defaults to 1.0. Must be a non-zero positive number.
  549. optional float scale = 3;
  550. // The midpoint of the decay. Defaults to 0.5. Output will be this value when `|x - target| == scale`.
  551. optional float midpoint = 4;
  552. }
  553. message NearestInputWithMmr {
  554. // The vector to search for nearest neighbors.
  555. VectorInput nearest = 1;
  556. // Perform MMR (Maximal Marginal Relevance) reranking after search,
  557. // using the same vector in this query to calculate relevance.
  558. Mmr mmr = 2;
  559. }
  560. // Maximal Marginal Relevance (MMR) algorithm for re-ranking the points.
  561. message Mmr {
  562. // Tunable parameter for the MMR algorithm.
  563. // Determines the balance between diversity and relevance.
  564. //
  565. // A higher value favors diversity (dissimilarity to selected results),
  566. // while a lower value favors relevance (similarity to the query vector).
  567. //
  568. // Must be in the range [0, 1].
  569. // Default value is 0.5.
  570. optional float diversity = 2;
  571. // The maximum number of candidates to consider for re-ranking.
  572. //
  573. // If not specified, the `limit` value is used.
  574. optional uint32 candidates_limit = 3;
  575. }
  576. message Query {
  577. oneof variant {
  578. VectorInput nearest = 1; // Find the nearest neighbors to this vector.
  579. RecommendInput recommend = 2; // Use multiple positive and negative vectors to find the results.
  580. DiscoverInput discover = 3; // Search for nearest points, but constrain the search space with context
  581. ContextInput context = 4; // Return points that live in positive areas.
  582. OrderBy order_by = 5; // Order the points by a payload field.
  583. Fusion fusion = 6; // Fuse the results of multiple prefetches.
  584. Sample sample = 7; // Sample points from the collection.
  585. Formula formula = 8; // Score boosting via an arbitrary formula
  586. NearestInputWithMmr nearest_with_mmr = 9; // Search nearest neighbors, but re-rank based on the Maximal Marginal Relevance algorithm.
  587. }
  588. }
  589. message PrefetchQuery {
  590. repeated PrefetchQuery prefetch = 1; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.
  591. optional Query query = 2; // Query to perform. If missing, returns points ordered by their IDs.
  592. optional string using = 3; // Define which vector to use for querying. If missing, the default vector is is used.
  593. optional Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions.
  594. optional SearchParams params = 5; // Search params for when there is no prefetch.
  595. optional float score_threshold = 6; // Return points with scores better than this threshold.
  596. optional uint64 limit = 7; // Max number of points. Default is 10
  597. optional LookupLocation lookup_from = 8; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector
  598. }
  599. message QueryPoints {
  600. string collection_name = 1; // Name of the collection
  601. repeated PrefetchQuery prefetch = 2; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.
  602. optional Query query = 3; // Query to perform. If missing, returns points ordered by their IDs.
  603. optional string using = 4; // Define which vector to use for querying. If missing, the default vector is used.
  604. optional Filter filter = 5; // Filter conditions - return only those points that satisfy the specified conditions.
  605. optional SearchParams params = 6; // Search params for when there is no prefetch.
  606. optional float score_threshold = 7; // Return points with scores better than this threshold.
  607. optional uint64 limit = 8; // Max number of points. Default is 10.
  608. optional uint64 offset = 9; // Offset of the result. Skip this many points. Default is 0.
  609. optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into the response.
  610. optional WithPayloadSelector with_payload = 11; // Options for specifying which payload to include or not.
  611. optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees.
  612. optional ShardKeySelector shard_key_selector = 13; // Specify in which shards to look for the points, if not specified - look in all shards.
  613. optional LookupLocation lookup_from = 14; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector
  614. optional uint64 timeout = 15; // If set, overrides global timeout setting for this request. Unit is seconds.
  615. }
  616. message QueryBatchPoints {
  617. string collection_name = 1;
  618. repeated QueryPoints query_points = 2;
  619. optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees
  620. optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds.
  621. }
  622. message QueryPointGroups {
  623. string collection_name = 1; // Name of the collection
  624. repeated PrefetchQuery prefetch = 2; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.
  625. optional Query query = 3; // Query to perform. If missing, returns points ordered by their IDs.
  626. optional string using = 4; // Define which vector to use for querying. If missing, the default vector is used.
  627. optional Filter filter = 5; // Filter conditions - return only those points that satisfy the specified conditions.
  628. optional SearchParams params = 6; // Search params for when there is no prefetch.
  629. optional float score_threshold = 7; // Return points with scores better than this threshold.
  630. WithPayloadSelector with_payload = 8; // Options for specifying which payload to include or not
  631. optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response
  632. optional LookupLocation lookup_from = 10; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector
  633. optional uint64 limit = 11; // Max number of points. Default is 3.
  634. optional uint64 group_size = 12; // Maximum amount of points to return per group. Default to 10.
  635. string group_by = 13; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups.
  636. optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
  637. optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection
  638. optional uint64 timeout = 16; // If set, overrides global timeout setting for this request. Unit is seconds.
  639. optional ShardKeySelector shard_key_selector = 17; // Specify in which shards to look for the points, if not specified - look in all shards
  640. }
  641. message FacetCounts {
  642. string collection_name = 1; // Name of the collection
  643. string key = 2; // Payload key of the facet
  644. optional Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions.
  645. optional uint64 limit = 4; // Max number of facets. Default is 10.
  646. optional bool exact = 5; // If true, return exact counts, slower but useful for debugging purposes. Default is false.
  647. optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
  648. optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
  649. optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
  650. }
  651. message FacetValue {
  652. oneof variant {
  653. string string_value = 1; // String value from the facet
  654. int64 integer_value = 2; // Integer value from the facet
  655. bool bool_value = 3; // Boolean value from the facet
  656. }
  657. }
  658. message FacetHit {
  659. FacetValue value = 1; // Value from the facet
  660. uint64 count = 2; // Number of points with this value
  661. }
  662. message SearchMatrixPoints {
  663. string collection_name = 1; // Name of the collection
  664. optional Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions.
  665. optional uint64 sample = 3; // How many points to select and search within. Default is 10.
  666. optional uint64 limit = 4; // How many neighbours per sample to find. Default is 3.
  667. optional string using = 5; // Define which vector to use for querying. If missing, the default vector is is used.
  668. optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
  669. optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
  670. optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
  671. }
  672. message SearchMatrixPairs {
  673. repeated SearchMatrixPair pairs = 1; // List of pairs of points with scores
  674. }
  675. message SearchMatrixPair {
  676. PointId a = 1; // first id of the pair
  677. PointId b = 2; // second id of the pair
  678. float score = 3; // score of the pair
  679. }
  680. message SearchMatrixOffsets {
  681. repeated uint64 offsets_row = 1; // Row indices of the matrix
  682. repeated uint64 offsets_col = 2; // Column indices of the matrix
  683. repeated float scores = 3; // Scores associated with matrix coordinates
  684. repeated PointId ids = 4; // Ids of the points in order
  685. }
  686. message PointsUpdateOperation {
  687. message PointStructList {
  688. repeated PointStruct points = 1;
  689. optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys
  690. }
  691. message SetPayload {
  692. map<string, Value> payload = 1;
  693. optional PointsSelector points_selector = 2; // Affected points
  694. optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys
  695. optional string key = 4; // Option for indicate property of payload
  696. }
  697. message OverwritePayload {
  698. map<string, Value> payload = 1;
  699. optional PointsSelector points_selector = 2; // Affected points
  700. optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys
  701. optional string key = 4; // Option for indicate property of payload
  702. }
  703. message DeletePayload {
  704. repeated string keys = 1;
  705. optional PointsSelector points_selector = 2; // Affected points
  706. optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys
  707. }
  708. message UpdateVectors {
  709. repeated PointVectors points = 1; // List of points and vectors to update
  710. optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys
  711. }
  712. message DeleteVectors {
  713. PointsSelector points_selector = 1; // Affected points
  714. VectorsSelector vectors = 2; // List of vector names to delete
  715. optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys
  716. }
  717. message DeletePoints {
  718. PointsSelector points = 1; // Affected points
  719. optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys
  720. }
  721. message ClearPayload {
  722. PointsSelector points = 1; // Affected points
  723. optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys
  724. }
  725. oneof operation {
  726. PointStructList upsert = 1;
  727. PointsSelector delete_deprecated = 2 [deprecated=true];
  728. SetPayload set_payload = 3;
  729. OverwritePayload overwrite_payload = 4;
  730. DeletePayload delete_payload = 5;
  731. PointsSelector clear_payload_deprecated = 6 [deprecated=true];
  732. UpdateVectors update_vectors = 7;
  733. DeleteVectors delete_vectors = 8;
  734. DeletePoints delete_points = 9;
  735. ClearPayload clear_payload = 10;
  736. }
  737. }
  738. message UpdateBatchPoints {
  739. string collection_name = 1; // name of the collection
  740. optional bool wait = 2; // Wait until the changes have been applied?
  741. repeated PointsUpdateOperation operations = 3;
  742. optional WriteOrdering ordering = 4; // Write ordering guarantees
  743. }
  744. // ---------------------------------------------
  745. // ---------------- RPC Response ---------------
  746. // ---------------------------------------------
  747. message PointsOperationResponse {
  748. UpdateResult result = 1;
  749. double time = 2; // Time spent to process
  750. optional Usage usage = 3;
  751. }
  752. message UpdateResult {
  753. optional uint64 operation_id = 1; // Number of operation
  754. UpdateStatus status = 2; // Operation status
  755. }
  756. enum UpdateStatus {
  757. UnknownUpdateStatus = 0;
  758. Acknowledged = 1; // Update is received, but not processed yet
  759. Completed = 2; // Update is applied and ready for search
  760. ClockRejected = 3; // Internal: update is rejected due to an outdated clock
  761. }
  762. message OrderValue {
  763. oneof variant {
  764. int64 int = 1;
  765. double float = 2;
  766. }
  767. }
  768. message ScoredPoint {
  769. PointId id = 1; // Point id
  770. map<string, Value> payload = 2; // Payload
  771. float score = 3; // Similarity score
  772. reserved 4; // deprecated "vector" field
  773. uint64 version = 5; // Last update operation applied to this point
  774. optional VectorsOutput vectors = 6; // Vectors to search
  775. optional ShardKey shard_key = 7; // Shard key
  776. optional OrderValue order_value = 8; // Order by value
  777. }
  778. message GroupId {
  779. oneof kind {
  780. // Represents a double value.
  781. uint64 unsigned_value = 1;
  782. // Represents an integer value
  783. int64 integer_value = 2;
  784. // Represents a string value.
  785. string string_value = 3;
  786. }
  787. }
  788. message PointGroup {
  789. GroupId id = 1; // Group id
  790. repeated ScoredPoint hits = 2; // Points in the group
  791. RetrievedPoint lookup = 3; // Point(s) from the lookup collection that matches the group id
  792. }
  793. message GroupsResult {
  794. repeated PointGroup groups = 1; // Groups
  795. }
  796. message SearchResponse {
  797. repeated ScoredPoint result = 1;
  798. double time = 2; // Time spent to process
  799. optional Usage usage = 3;
  800. }
  801. message QueryResponse {
  802. repeated ScoredPoint result = 1;
  803. double time = 2; // Time spent to process
  804. optional Usage usage = 3;
  805. }
  806. message QueryBatchResponse {
  807. repeated BatchResult result = 1;
  808. double time = 2; // Time spent to process
  809. optional Usage usage = 3;
  810. }
  811. message QueryGroupsResponse {
  812. GroupsResult result = 1;
  813. double time = 2; // Time spent to process
  814. optional Usage usage = 3;
  815. }
  816. message BatchResult {
  817. repeated ScoredPoint result = 1;
  818. }
  819. message SearchBatchResponse {
  820. repeated BatchResult result = 1;
  821. double time = 2; // Time spent to process
  822. optional Usage usage = 3;
  823. }
  824. message SearchGroupsResponse {
  825. GroupsResult result = 1;
  826. double time = 2; // Time spent to process
  827. optional Usage usage = 3;
  828. }
  829. message CountResponse {
  830. CountResult result = 1;
  831. double time = 2; // Time spent to process
  832. optional Usage usage = 3;
  833. }
  834. message ScrollResponse {
  835. optional PointId next_page_offset = 1; // Use this offset for the next query
  836. repeated RetrievedPoint result = 2;
  837. double time = 3; // Time spent to process
  838. optional Usage usage = 4;
  839. }
  840. message CountResult {
  841. uint64 count = 1;
  842. }
  843. message RetrievedPoint {
  844. PointId id = 1;
  845. map<string, Value> payload = 2;
  846. reserved 3; // deprecated "vector" field
  847. optional VectorsOutput vectors = 4;
  848. optional ShardKey shard_key = 5; // Shard key
  849. optional OrderValue order_value = 6; // Order-by value
  850. }
  851. message GetResponse {
  852. repeated RetrievedPoint result = 1;
  853. double time = 2; // Time spent to process
  854. optional Usage usage = 3;
  855. }
  856. message RecommendResponse {
  857. repeated ScoredPoint result = 1;
  858. double time = 2; // Time spent to process
  859. optional Usage usage = 3;
  860. }
  861. message RecommendBatchResponse {
  862. repeated BatchResult result = 1;
  863. double time = 2; // Time spent to process
  864. optional Usage usage = 3;
  865. }
  866. message DiscoverResponse {
  867. repeated ScoredPoint result = 1;
  868. double time = 2; // Time spent to process
  869. optional Usage usage = 3;
  870. }
  871. message DiscoverBatchResponse {
  872. repeated BatchResult result = 1;
  873. double time = 2; // Time spent to process
  874. optional Usage usage = 3;
  875. }
  876. message RecommendGroupsResponse {
  877. GroupsResult result = 1;
  878. double time = 2; // Time spent to process
  879. optional Usage usage = 3;
  880. }
  881. message UpdateBatchResponse {
  882. repeated UpdateResult result = 1;
  883. double time = 2; // Time spent to process
  884. optional Usage usage = 3;
  885. }
  886. message FacetResponse {
  887. repeated FacetHit hits = 1;
  888. double time = 2; // Time spent to process
  889. }
  890. message SearchMatrixPairsResponse {
  891. SearchMatrixPairs result = 1;
  892. double time = 2; // Time spent to process
  893. optional Usage usage = 3;
  894. }
  895. message SearchMatrixOffsetsResponse {
  896. SearchMatrixOffsets result = 1;
  897. double time = 2; // Time spent to process
  898. optional Usage usage = 3;
  899. }
  900. // ---------------------------------------------
  901. // ------------- Filter Conditions -------------
  902. // ---------------------------------------------
  903. message Filter {
  904. repeated Condition should = 1; // At least one of those conditions should match
  905. repeated Condition must = 2; // All conditions must match
  906. repeated Condition must_not = 3; // All conditions must NOT match
  907. optional MinShould min_should = 4; // At least minimum amount of given conditions should match
  908. }
  909. message MinShould {
  910. repeated Condition conditions = 1;
  911. uint64 min_count = 2;
  912. }
  913. message Condition {
  914. oneof condition_one_of {
  915. FieldCondition field = 1;
  916. IsEmptyCondition is_empty = 2;
  917. HasIdCondition has_id = 3;
  918. Filter filter = 4;
  919. IsNullCondition is_null = 5;
  920. NestedCondition nested = 6;
  921. HasVectorCondition has_vector = 7;
  922. }
  923. }
  924. message IsEmptyCondition {
  925. string key = 1;
  926. }
  927. message IsNullCondition {
  928. string key = 1;
  929. }
  930. message HasIdCondition {
  931. repeated PointId has_id = 1;
  932. }
  933. message HasVectorCondition {
  934. string has_vector = 1;
  935. }
  936. message NestedCondition {
  937. string key = 1; // Path to nested object
  938. Filter filter = 2; // Filter condition
  939. }
  940. message FieldCondition {
  941. string key = 1;
  942. Match match = 2; // Check if point has field with a given value
  943. Range range = 3; // Check if points value lies in a given range
  944. GeoBoundingBox geo_bounding_box = 4; // Check if points geolocation lies in a given area
  945. GeoRadius geo_radius = 5; // Check if geo point is within a given radius
  946. ValuesCount values_count = 6; // Check number of values for a specific field
  947. GeoPolygon geo_polygon = 7; // Check if geo point is within a given polygon
  948. DatetimeRange datetime_range = 8; // Check if datetime is within a given range
  949. optional bool is_empty = 9; // Check if field is empty
  950. optional bool is_null = 10; // Check if field is null
  951. }
  952. message Match {
  953. oneof match_value {
  954. string keyword = 1; // Match string keyword
  955. int64 integer = 2; // Match integer
  956. bool boolean = 3; // Match boolean
  957. string text = 4; // Match text
  958. RepeatedStrings keywords = 5; // Match multiple keywords
  959. RepeatedIntegers integers = 6; // Match multiple integers
  960. RepeatedIntegers except_integers = 7; // Match any other value except those integers
  961. RepeatedStrings except_keywords = 8; // Match any other value except those keywords
  962. string phrase = 9; // Match phrase text
  963. }
  964. }
  965. message RepeatedStrings {
  966. repeated string strings = 1;
  967. }
  968. message RepeatedIntegers {
  969. repeated int64 integers = 1;
  970. }
  971. message Range {
  972. optional double lt = 1;
  973. optional double gt = 2;
  974. optional double gte = 3;
  975. optional double lte = 4;
  976. }
  977. message DatetimeRange {
  978. optional google.protobuf.Timestamp lt = 1;
  979. optional google.protobuf.Timestamp gt = 2;
  980. optional google.protobuf.Timestamp gte = 3;
  981. optional google.protobuf.Timestamp lte = 4;
  982. }
  983. message GeoBoundingBox {
  984. GeoPoint top_left = 1; // north-west corner
  985. GeoPoint bottom_right = 2; // south-east corner
  986. }
  987. message GeoRadius {
  988. GeoPoint center = 1; // Center of the circle
  989. float radius = 2; // In meters
  990. }
  991. message GeoLineString {
  992. repeated GeoPoint points = 1; // Ordered sequence of GeoPoints representing the line
  993. }
  994. // For a valid GeoPolygon, both the exterior and interior GeoLineStrings must consist of a minimum of 4 points.
  995. // Additionally, the first and last points of each GeoLineString must be the same.
  996. message GeoPolygon {
  997. GeoLineString exterior = 1; // The exterior line bounds the surface
  998. repeated GeoLineString interiors = 2; // Interior lines (if present) bound holes within the surface
  999. }
  1000. message ValuesCount {
  1001. optional uint64 lt = 1;
  1002. optional uint64 gt = 2;
  1003. optional uint64 gte = 3;
  1004. optional uint64 lte = 4;
  1005. }
  1006. // ---------------------------------------------
  1007. // -------------- Points Selector --------------
  1008. // ---------------------------------------------
  1009. message PointsSelector {
  1010. oneof points_selector_one_of {
  1011. PointsIdsList points = 1;
  1012. Filter filter = 2;
  1013. }
  1014. }
  1015. message PointsIdsList {
  1016. repeated PointId ids = 1;
  1017. }
  1018. // ---------------------------------------------
  1019. // ------------------- Point -------------------
  1020. // ---------------------------------------------
  1021. message PointStruct {
  1022. PointId id = 1;
  1023. reserved 2; // deprecated "vector" field
  1024. map<string, Value> payload = 3;
  1025. optional Vectors vectors = 4;
  1026. }
  1027. message GeoPoint {
  1028. double lon = 1;
  1029. double lat = 2;
  1030. }
  1031. // ---------------------------------------------
  1032. // ----------- Measurements collector ----------
  1033. // ---------------------------------------------
  1034. message Usage {
  1035. optional HardwareUsage hardware = 1;
  1036. optional InferenceUsage inference = 2;
  1037. }
  1038. // ---------------------------------------------
  1039. // ------------ Inference measurements ----------
  1040. // ---------------------------------------------
  1041. message InferenceUsage {
  1042. map<string, ModelUsage> models = 1;
  1043. }
  1044. message ModelUsage {
  1045. uint64 tokens = 1;
  1046. }
  1047. // ---------------------------------------------
  1048. // ------------ Hardware measurements ----------
  1049. // ---------------------------------------------
  1050. message HardwareUsage {
  1051. uint64 cpu = 1;
  1052. uint64 payload_io_read = 2;
  1053. uint64 payload_io_write = 3;
  1054. uint64 payload_index_io_read = 4;
  1055. uint64 payload_index_io_write = 5;
  1056. uint64 vector_io_read = 6;
  1057. uint64 vector_io_write = 7;
  1058. }