-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathzeppelin-api.yaml
More file actions
696 lines (653 loc) · 19 KB
/
zeppelin-api.yaml
File metadata and controls
696 lines (653 loc) · 19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
openapi: 3.1.0
info:
title: Zeppelin Vector Search API
description: S3-native vector search engine with BM25 full-text search support.
version: 0.2.0
license:
name: Apache-2.0
servers:
- url: http://localhost:8080
description: Local development server
paths:
/healthz:
get:
operationId: healthCheck
summary: Health check
description: Returns server health status. Always returns 200 if the process is running.
tags: [Health]
responses:
"200":
description: Server is healthy
content:
application/json:
schema:
type: object
required: [status]
properties:
status:
type: string
example: ok
/readyz:
get:
operationId: readinessCheck
summary: Readiness check
description: Verifies S3 connectivity. Returns 503 if the storage backend is unreachable.
tags: [Health]
responses:
"200":
description: Server is ready
content:
application/json:
schema:
type: object
required: [status, s3_connected]
properties:
status:
type: string
example: ready
s3_connected:
type: boolean
example: true
"503":
description: Server is not ready
content:
application/json:
schema:
type: object
required: [status, s3_connected]
properties:
status:
type: string
example: not_ready
s3_connected:
type: boolean
example: false
error:
type: string
/metrics:
get:
operationId: getMetrics
summary: Prometheus metrics
description: Returns Prometheus-formatted metrics.
tags: [Health]
responses:
"200":
description: Prometheus metrics
content:
text/plain:
schema:
type: string
/v1/namespaces:
post:
operationId: createNamespace
summary: Create a namespace
description: |
Creates a new namespace with the specified dimensions and distance metric.
The server generates a UUID v4 name for the namespace. Save the returned name — it cannot be recovered if lost.
tags: [Namespaces]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateNamespaceRequest"
responses:
"201":
description: Namespace created
content:
application/json:
schema:
$ref: "#/components/schemas/CreateNamespaceResponse"
"400":
$ref: "#/components/responses/ValidationError"
/v1/namespaces/{ns}:
parameters:
- $ref: "#/components/parameters/NamespacePath"
get:
operationId: getNamespace
summary: Get namespace
description: Returns metadata for a single namespace.
tags: [Namespaces]
responses:
"200":
description: Namespace metadata
content:
application/json:
schema:
$ref: "#/components/schemas/NamespaceResponse"
"404":
$ref: "#/components/responses/NotFoundError"
delete:
operationId: deleteNamespace
summary: Delete namespace
description: Deletes a namespace and all its data.
tags: [Namespaces]
responses:
"204":
description: Namespace deleted
"404":
$ref: "#/components/responses/NotFoundError"
/v1/namespaces/{ns}/vectors:
parameters:
- $ref: "#/components/parameters/NamespacePath"
post:
operationId: upsertVectors
summary: Upsert vectors
description: Insert or update vectors in a namespace. Vectors with existing IDs are overwritten.
tags: [Vectors]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpsertVectorsRequest"
responses:
"200":
description: Vectors upserted
content:
application/json:
schema:
type: object
required: [upserted]
properties:
upserted:
type: integer
example: 100
"400":
$ref: "#/components/responses/ValidationError"
"404":
$ref: "#/components/responses/NotFoundError"
delete:
operationId: deleteVectors
summary: Delete vectors
description: Delete vectors by ID from a namespace.
tags: [Vectors]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/DeleteVectorsRequest"
responses:
"200":
description: Vectors deleted
content:
application/json:
schema:
type: object
required: [deleted]
properties:
deleted:
type: integer
example: 5
"404":
$ref: "#/components/responses/NotFoundError"
/v1/namespaces/{ns}/query:
parameters:
- $ref: "#/components/parameters/NamespacePath"
post:
operationId: queryNamespace
summary: Query vectors
description: |
Run a vector similarity search or BM25 full-text search.
Exactly one of `vector` or `rank_by` must be provided.
tags: [Query]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/QueryRequest"
responses:
"200":
description: Query results
content:
application/json:
schema:
$ref: "#/components/schemas/QueryResponse"
"400":
$ref: "#/components/responses/ValidationError"
"404":
$ref: "#/components/responses/NotFoundError"
components:
parameters:
NamespacePath:
name: ns
in: path
required: true
schema:
type: string
description: Namespace name
responses:
ValidationError:
description: Validation error (400)
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
NotFoundError:
description: Resource not found (404)
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
schemas:
ErrorResponse:
type: object
required: [error, status]
properties:
error:
type: string
description: Human-readable error message
status:
type: integer
description: HTTP status code
example:
error: "namespace 'test' not found"
status: 404
DistanceMetric:
type: string
enum: [cosine, euclidean, dot_product]
default: cosine
ConsistencyLevel:
type: string
enum: [strong, eventual]
default: strong
FtsLanguage:
type: string
enum: [english]
default: english
AttributeValue:
description: |
A scalar or array attribute value. One of:
- string
- integer (int64)
- number (float64)
- boolean
- array of strings
- array of integers
- array of numbers
oneOf:
- type: string
- type: integer
format: int64
- type: number
format: double
- type: boolean
- type: array
items:
type: string
- type: array
items:
type: integer
format: int64
- type: array
items:
type: number
format: double
FtsFieldConfig:
type: object
description: Per-field configuration for full-text search.
properties:
language:
$ref: "#/components/schemas/FtsLanguage"
stemming:
type: boolean
default: true
description: Whether to apply stemming (e.g., "running" -> "run").
remove_stopwords:
type: boolean
default: true
description: Whether to remove common stopwords.
case_sensitive:
type: boolean
default: false
description: Whether matching is case-sensitive.
k1:
type: number
format: float
default: 1.2
description: "BM25 k1 parameter: term frequency saturation."
b:
type: number
format: float
default: 0.75
description: "BM25 b parameter: length normalization."
max_token_length:
type: integer
default: 40
description: Maximum token length; tokens exceeding this are discarded.
Filter:
type: object
required: [op]
description: |
Filter condition discriminated by the `op` field. Supported operators:
- `eq`: Exact match on a field
- `not_eq`: Not equal
- `range`: Numeric range (gte, lte, gt, lt)
- `in`: Field value is one of the given values
- `not_in`: Field value is not one of the given values
- `contains`: Array field contains the given value
- `contains_all_tokens`: All tokens must be present (order-independent)
- `contains_token_sequence`: Tokens must appear as exact phrase
- `and`: All sub-filters must match
- `or`: Any sub-filter must match
- `not`: Negate a sub-filter
discriminator:
propertyName: op
mapping:
eq: "#/components/schemas/FilterEq"
not_eq: "#/components/schemas/FilterNotEq"
range: "#/components/schemas/FilterRange"
in: "#/components/schemas/FilterIn"
not_in: "#/components/schemas/FilterNotIn"
contains: "#/components/schemas/FilterContains"
contains_all_tokens: "#/components/schemas/FilterContainsAllTokens"
contains_token_sequence: "#/components/schemas/FilterContainsTokenSequence"
and: "#/components/schemas/FilterAnd"
or: "#/components/schemas/FilterOr"
not: "#/components/schemas/FilterNot"
oneOf:
- $ref: "#/components/schemas/FilterEq"
- $ref: "#/components/schemas/FilterNotEq"
- $ref: "#/components/schemas/FilterRange"
- $ref: "#/components/schemas/FilterIn"
- $ref: "#/components/schemas/FilterNotIn"
- $ref: "#/components/schemas/FilterContains"
- $ref: "#/components/schemas/FilterContainsAllTokens"
- $ref: "#/components/schemas/FilterContainsTokenSequence"
- $ref: "#/components/schemas/FilterAnd"
- $ref: "#/components/schemas/FilterOr"
- $ref: "#/components/schemas/FilterNot"
FilterEq:
type: object
required: [op, field, value]
properties:
op:
type: string
const: eq
field:
type: string
value:
$ref: "#/components/schemas/AttributeValue"
FilterNotEq:
type: object
required: [op, field, value]
properties:
op:
type: string
const: not_eq
field:
type: string
value:
$ref: "#/components/schemas/AttributeValue"
FilterRange:
type: object
required: [op, field]
properties:
op:
type: string
const: range
field:
type: string
gte:
type: number
lte:
type: number
gt:
type: number
lt:
type: number
FilterIn:
type: object
required: [op, field, values]
properties:
op:
type: string
const: in
field:
type: string
values:
type: array
items:
$ref: "#/components/schemas/AttributeValue"
FilterNotIn:
type: object
required: [op, field, values]
properties:
op:
type: string
const: not_in
field:
type: string
values:
type: array
items:
$ref: "#/components/schemas/AttributeValue"
FilterContains:
type: object
required: [op, field, value]
properties:
op:
type: string
const: contains
field:
type: string
value:
$ref: "#/components/schemas/AttributeValue"
FilterContainsAllTokens:
type: object
required: [op, field, tokens]
properties:
op:
type: string
const: contains_all_tokens
field:
type: string
tokens:
type: array
items:
type: string
FilterContainsTokenSequence:
type: object
required: [op, field, tokens]
properties:
op:
type: string
const: contains_token_sequence
field:
type: string
tokens:
type: array
items:
type: string
FilterAnd:
type: object
required: [op, filters]
properties:
op:
type: string
const: and
filters:
type: array
items:
$ref: "#/components/schemas/Filter"
FilterOr:
type: object
required: [op, filters]
properties:
op:
type: string
const: or
filters:
type: array
items:
$ref: "#/components/schemas/Filter"
FilterNot:
type: object
required: [op, filter]
properties:
op:
type: string
const: not
filter:
$ref: "#/components/schemas/Filter"
RankByExpression:
description: |
BM25 ranking expression as an S-expression JSON array. Examples:
- Single field: `["content", "BM25", "search query"]`
- Multi-field sum: `["Sum", [["title", "BM25", "q"], ["content", "BM25", "q"]]]`
- Weighted: `["Product", 2.0, ["title", "BM25", "q"]]`
- Max: `["Max", [["title", "BM25", "q"], ["body", "BM25", "q"]]]`
type: array
items: {}
examples:
- ["content", "BM25", "search query"]
- ["Sum", [["title", "BM25", "q"], ["content", "BM25", "q"]]]
- ["Product", 2.0, ["title", "BM25", "q"]]
VectorEntry:
type: object
required: [id, values]
properties:
id:
type: string
description: Unique vector identifier
values:
type: array
items:
type: number
format: float
description: Vector embedding values
attributes:
type: object
additionalProperties:
$ref: "#/components/schemas/AttributeValue"
description: Optional key-value metadata for filtering
SearchResult:
type: object
required: [id, score]
properties:
id:
type: string
description: Vector identifier
score:
type: number
format: float
description: Distance (vector search, lower is better) or BM25 relevance score (higher is better)
attributes:
type: object
additionalProperties:
$ref: "#/components/schemas/AttributeValue"
CreateNamespaceRequest:
type: object
required: [dimensions]
properties:
dimensions:
type: integer
minimum: 1
description: Vector dimensionality
distance_metric:
$ref: "#/components/schemas/DistanceMetric"
full_text_search:
type: object
additionalProperties:
$ref: "#/components/schemas/FtsFieldConfig"
description: Per-field FTS configuration. Keys are attribute field names.
CreateNamespaceResponse:
description: Response from namespace creation, includes a warning to save the UUID name.
allOf:
- $ref: "#/components/schemas/NamespaceResponse"
- type: object
required: [warning]
properties:
warning:
type: string
description: Warning to save the namespace UUID — it cannot be recovered if lost.
example: "Save this namespace name. It cannot be recovered if lost."
NamespaceResponse:
type: object
required: [name, dimensions, distance_metric, vector_count, created_at, updated_at]
properties:
name:
type: string
dimensions:
type: integer
distance_metric:
$ref: "#/components/schemas/DistanceMetric"
vector_count:
type: integer
format: int64
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
full_text_search:
type: object
additionalProperties:
$ref: "#/components/schemas/FtsFieldConfig"
description: Present only when FTS fields are configured.
UpsertVectorsRequest:
type: object
required: [vectors]
properties:
vectors:
type: array
items:
$ref: "#/components/schemas/VectorEntry"
minItems: 1
DeleteVectorsRequest:
type: object
required: [ids]
properties:
ids:
type: array
items:
type: string
QueryRequest:
type: object
description: |
Exactly one of `vector` or `rank_by` must be provided.
- `vector`: Run ANN vector similarity search
- `rank_by`: Run BM25 full-text search
properties:
vector:
type: array
items:
type: number
format: float
description: Query vector for ANN search
rank_by:
$ref: "#/components/schemas/RankByExpression"
last_as_prefix:
type: boolean
default: false
description: Treat the last token of each BM25 query as a prefix (for autocomplete).
top_k:
type: integer
default: 10
minimum: 1
description: Number of results to return
filter:
$ref: "#/components/schemas/Filter"
consistency:
$ref: "#/components/schemas/ConsistencyLevel"
nprobe:
type: integer
minimum: 1
description: Number of IVF clusters to probe (vector search only)
QueryResponse:
type: object
required: [results, scanned_fragments, scanned_segments]
properties:
results:
type: array
items:
$ref: "#/components/schemas/SearchResult"
scanned_fragments:
type: integer
description: Number of WAL fragments scanned
scanned_segments:
type: integer
description: Number of index segments scanned