Skip to content

Commit 07b034d

Browse files
1 parent 3b33980 commit 07b034d

14 files changed

Lines changed: 887 additions & 220 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
All notable changes to `polygres-cli` are documented in this file.
44

5-
## 0.2.0 - 2026-08-06
5+
## Unreleased
6+
7+
### Changed
8+
9+
- `polygres vector configs create` now returns a migration error directing users to
10+
`polygres context collections create`.
11+
12+
## 0.2.0 - 2026-08-08
613

714
### Added
815

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,56 @@ polygres vector configs list
5555
polygres text configs list
5656
```
5757

58+
Creating new pgvector configurations is retired. Use
59+
`polygres context collections create` to create a pgContext collection and native
60+
`pgcontext.vector` column. Existing vector configuration list, retrieval, and lifecycle
61+
commands remain available for previously registered columns.
62+
63+
### Work with pgContext AI Search
64+
65+
pgContext uses named collections and is the supported path for new vector setup.
66+
67+
```bash
68+
polygres context capabilities
69+
polygres context sources discover
70+
polygres context collections create support_docs \
71+
--source new-table \
72+
--table support_docs \
73+
--dimensions 768
74+
polygres context search support_docs \
75+
--embedding-file query-embedding.json
76+
```
77+
78+
Commands that change a collection wait for the server operation to finish by default. Use `--no-wait` to return as soon as the operation is accepted.
79+
80+
Global options must come before the command namespace:
81+
82+
```bash
83+
polygres --project <project-id> --json context collections list
84+
```
85+
86+
## Use additional API routes
87+
88+
The `api` commands give automation access to supported project-management routes that do not yet have a dedicated high-level command.
89+
90+
```bash
91+
polygres api routes
92+
polygres --json api routes --method GET
93+
polygres --json --project <project-id> api request \
94+
/projects/{project_id} \
95+
--method GET \
96+
--dry-run
97+
```
98+
99+
The CLI validates the route, HTTP method, parameters, and JSON body against its bundled API specification before sending the request. Run with `--dry-run` to inspect a request without executing it.
100+
101+
## Notices and automation
102+
103+
Service and release notices are written to standard error, so standard output and `--json` remain safe for scripts. The CLI never sends command arguments or command output when checking for notices.
104+
58105
## Version and support
59106

60-
The current published CLI release is [`0.1.2`](https://github.com/Evokoa/polygres-cli/releases/tag/python-cli-v0.1.2).
107+
Package version: [`0.2.0`](https://github.com/Evokoa/polygres-cli/releases/tag/python-cli-v0.2.0).
61108

62109
Useful commands:
63110

@@ -76,4 +123,4 @@ Users of the former combined `polygres` package should install both packages sep
76123

77124
## Changelog
78125

79-
See the [CLI 0.1.2 release notes](https://github.com/Evokoa/polygres-cli/releases/tag/python-cli-v0.1.2) for published changes.
126+
See the [CLI 0.2.0 release notes](https://github.com/Evokoa/polygres-cli/releases/tag/python-cli-v0.2.0) for release changes.

src/polygres_cli/_vendor/polygres_lib/context/enums.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class ContextOperationKind(str, Enum):
8888
COLLECTION_UPDATE = "collection_update"
8989
COLLECTION_DELETE = "collection_delete"
9090
COLLECTION_REINDEX = "collection_reindex"
91+
VECTOR_ADD = "vector_add"
9192
FILTER_ADD_COLUMN = "filter_add_column"
9293
FILTER_ADD_JSONB_PATH = "filter_add_jsonb_path"
9394
POINTS_UPSERT = "points_upsert"
@@ -178,6 +179,18 @@ class ContextRecommendedAction(str, Enum):
178179
"failed",
179180
"cancelled",
180181
),
182+
ContextOperationKind.VECTOR_ADD: (
183+
"queued",
184+
"validating_vector",
185+
"creating_vector_column",
186+
"registering_vector",
187+
"building_index",
188+
"attaching_index",
189+
"verifying",
190+
"ready",
191+
"failed",
192+
"cancelled",
193+
),
181194
ContextOperationKind.COLLECTION_UPDATE: (
182195
"queued",
183196
"validating_config",

src/polygres_cli/_vendor/polygres_lib/context/models.py

Lines changed: 69 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,25 @@ def _mode_shape(self) -> ContextSourceRequest:
106106

107107

108108
class 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+
120128
class 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

273289
class 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

284308
class 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

304336
class RecallCheckRequest(DenseSearchRequest):
305337
minimum_recall: float = 0.95
@@ -313,6 +345,7 @@ def _recall(cls, value: float) -> float:
313345

314346
class 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

327367
class 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+
642701
class 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

685736
class 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

Comments
 (0)