@@ -106,17 +106,25 @@ def _mode_shape(self) -> ContextSourceRequest:
106106
107107
108108class ContextVectorRequest (ContextRequest ):
109+ name : str | None = None
109110 column_name : str = "embedding"
110111 dimensions : int = Field (ge = 1 , le = 16_000 )
111112 metric : ContextMetric = ContextMetric .COSINE
112113
113- @field_validator ("column_name" )
114+ @field_validator ("name" , " column_name" )
114115 @classmethod
115- def _column (cls , value : str ) -> str :
116- require_valid (validate_identifier (value , field = "column_name" ))
116+ def _column (cls , value : str | None , info ) -> str | None :
117+ if value is not None :
118+ require_valid (validate_identifier (value , field = info .field_name ))
117119 return value
118120
119121
122+ class ContextVectorCreateRequest (ContextVectorRequest ):
123+ mode : Literal ["existing" , "add_column" ] = "existing"
124+ index_kind : ContextIndexKind = ContextIndexKind .HNSW
125+ set_default : bool = False
126+
127+
120128class JsonbFilterPathRequest (ContextRequest ):
121129 key : str
122130 column : str
@@ -185,6 +193,7 @@ class CollectionUpdateRequest(ContextRequest):
185193 text_column : str | None = None
186194 result_columns : list [str ] | None = Field (default = None , max_length = 32 )
187195 max_search_limit : int | None = Field (default = None , ge = 1 , le = 1_000 )
196+ default_vector_name : str | None = None
188197
189198 @field_validator ("text_column" )
190199 @classmethod
@@ -193,6 +202,13 @@ def _text_column(cls, value: str | None) -> str | None:
193202 require_valid (validate_identifier (value , field = "text_column" ))
194203 return value
195204
205+ @field_validator ("default_vector_name" )
206+ @classmethod
207+ def _default_vector_name (cls , value : str | None ) -> str | None :
208+ if value is not None :
209+ require_valid (validate_identifier (value , field = "default_vector_name" ))
210+ return value
211+
196212 @field_validator ("result_columns" )
197213 @classmethod
198214 def _result_columns (cls , value : list [str ] | None ) -> list [str ] | None :
@@ -271,6 +287,7 @@ def _field(cls, value: str) -> str:
271287
272288
273289class DenseSearchRequest (CountRequest ):
290+ vector_name : str | None = None
274291 embedding : list [float ]
275292 limit : int = Field (default = 10 , ge = 1 , le = MAX_RANKED_LIMIT )
276293
@@ -280,9 +297,17 @@ def _embedding(cls, value: list[float]) -> list[float]:
280297 require_valid (validate_embedding (value ))
281298 return value
282299
300+ @field_validator ("vector_name" )
301+ @classmethod
302+ def _vector_name (cls , value : str | None ) -> str | None :
303+ if value is not None :
304+ require_valid (validate_identifier (value , field = "vector_name" ))
305+ return value
306+
283307
284308class GroupedSearchRequest (ContextRequest ):
285309 collection : str
310+ vector_name : str | None = None
286311 embedding : list [float ]
287312 group_by : str
288313 group_limit : int = Field (default = 1 , ge = 1 , le = MAX_RANKED_LIMIT )
@@ -300,6 +325,13 @@ def _group(cls, value: str) -> str:
300325 require_valid (validate_identifier (value , field = "group_by" ))
301326 return value
302327
328+ @field_validator ("vector_name" )
329+ @classmethod
330+ def _vector_name (cls , value : str | None ) -> str | None :
331+ if value is not None :
332+ require_valid (validate_identifier (value , field = "vector_name" ))
333+ return value
334+
303335
304336class RecallCheckRequest (DenseSearchRequest ):
305337 minimum_recall : float = 0.95
@@ -313,6 +345,7 @@ def _recall(cls, value: float) -> float:
313345
314346class TextHybridSearchRequest (ContextRequest ):
315347 collection : str
348+ vector_name : str | None = None
316349 embedding : list [float ]
317350 query : str = Field (min_length = 1 )
318351 limit : int = Field (default = 10 , ge = 1 , le = MAX_RANKED_LIMIT )
@@ -323,6 +356,13 @@ def _embedding(cls, value: list[float]) -> list[float]:
323356 require_valid (validate_embedding (value ))
324357 return value
325358
359+ @field_validator ("vector_name" )
360+ @classmethod
361+ def _vector_name (cls , value : str | None ) -> str | None :
362+ if value is not None :
363+ require_valid (validate_identifier (value , field = "vector_name" ))
364+ return value
365+
326366
327367class GraphStart (ContextRequest ):
328368 schema_name : str = Field (alias = "schema" )
@@ -639,6 +679,25 @@ class PreflightResponse(ContextResponse):
639679 ownership : PreflightOwnership
640680
641681
682+ class ContextCollectionVector (ContextResponse ):
683+ id : UUID
684+ name : str
685+ column_name : str
686+ is_default : bool
687+ owns_vector_column : bool
688+ vector_type_owner : Literal ["pgcontext" , "pgvector" ] = "pgcontext"
689+ dimensions : int
690+ metric : ContextMetric
691+ index_kind : ContextIndexKind
692+ index_name : str | None
693+ owns_index : bool
694+ index_status : ContextIndexStatus | str
695+ last_error_code : str | None
696+ last_error_stage : str | None
697+ created_at : datetime
698+ updated_at : datetime
699+
700+
642701class ContextCollection (ContextResponse ):
643702 id : UUID
644703 project_id : str
@@ -651,21 +710,13 @@ class ContextCollection(ContextResponse):
651710 source_key_type : str
652711 source_mode : ContextSourceMode
653712 owns_source_table : bool
654- owns_vector_column : bool
655- vector_name : str
656- vector_column : str
657- vector_type_owner : Literal ["pgcontext" , "pgvector" ] = "pgcontext"
658- dimensions : int
659- metric : ContextMetric
713+ default_vector_name : str
714+ vectors : list [ContextCollectionVector ]
660715 max_search_limit : int
661716 text_column : str | None
662717 result_columns : list [str ]
663718 filter_columns : list [str ]
664719 jsonb_filter_paths : list [dict [str , Any ]]
665- index_kind : ContextIndexKind
666- index_name : str | None
667- owns_index : bool
668- index_status : ContextIndexStatus | str
669720 point_reconciliation_status : ContextPointReconciliationStatus | str
670721 mapped_point_count : int | None
671722 last_reconciled_at : datetime | None
@@ -684,9 +735,9 @@ class CollectionListResponse(ContextResponse):
684735
685736class DeletionPlan (ContextResponse ):
686737 pgcontext_collection : str
687- drop_owned_index : str | None
738+ drop_owned_indexes : list [ str ]
688739 preserve_source_table : str
689- preserve_source_column : str
740+ preserve_source_columns : list [ str ]
690741 preserve_indexes : list [str ]
691742
692743
@@ -738,7 +789,7 @@ class CollectionStatusResponse(ContextResponse):
738789 collection_name : str
739790 status : ContextCollectionStatus | str
740791 serving_status : ContextServingStatus | str
741- index_status : ContextIndexStatus | str
792+ vectors : list [ ContextCollectionVector ]
742793 point_reconciliation_status : ContextPointReconciliationStatus | str
743794 mapped_point_count : int | None
744795 last_reconciled_at : datetime | None
@@ -1089,6 +1140,7 @@ class RecallCheckResponse(ContextResponse):
10891140 DiscoveryRequest ,
10901141 ContextSourceRequest ,
10911142 ContextVectorRequest ,
1143+ ContextVectorCreateRequest ,
10921144 JsonbFilterPathRequest ,
10931145 CollectionCreateRequest ,
10941146 CollectionSetDefaultRequest ,
@@ -1155,6 +1207,7 @@ class RecallCheckResponse(ContextResponse):
11551207 PreflightCheck ,
11561208 PreflightBlocker ,
11571209 PreflightOwnership ,
1210+ ContextCollectionVector ,
11581211 DeletionPlan ,
11591212 ContextOperationFailure ,
11601213 VerificationCheck ,
0 commit comments