Class ScaNNIndex (0.17.0)

ScaNNIndex(name: typing.Optional[str] = None, index_type: str = 'ScaNN', distance_strategy: langchain_postgres.v2.indexes.DistanceStrategy = <factory>, partial_indexes: typing.Optional[list[str]] = None, extension_name: str = 'alloydb_scann', num_leaves: int = 5, *, mode: typing.Optional[str] = None)

ScaNN index configuration for AlloyDB.

Parameters

Name Description
num_leaves int

Number of partitions. Used when mode is None or "MANUAL"; ignored when mode="AUTO". Defaults to 5.

mode Optional[str]

Keyword-only. "AUTO" creates an automatically tuned index (the server chooses the number of leaves; the table must contain at least 10,000 rows); "MANUAL" creates a manually tuned index using num_leaves. Defaults to None, which emits the same options as previous releases.

Methods

index_options

index_options() -> str

Set index query options for vector store initialization.

ScaNNIndex

ScaNNIndex(name: typing.Optional[str] = None, index_type: str = 'ScaNN', distance_strategy: langchain_postgres.v2.indexes.DistanceStrategy = <factory>, partial_indexes: typing.Optional[list[str]] = None, extension_name: str = 'alloydb_scann', num_leaves: int = 5, *, mode: typing.Optional[str] = None)

ScaNN index configuration for AlloyDB.

Parameters
Name Description
num_leaves int

Number of partitions. Used when mode is None or "MANUAL"; ignored when mode="AUTO". Defaults to 5.

mode Optional[str]

Keyword-only. "AUTO" creates an automatically tuned index (the server chooses the number of leaves; the table must contain at least 10,000 rows); "MANUAL" creates a manually tuned index using num_leaves. Defaults to None, which emits the same options as previous releases.