Overview
PGVector is a PostgreSQL extension that enables vector similarity search. It supports HNSW and IVFFlat indexes and integrates seamlessly with existing PostgreSQL infrastructure. Provider Class:PgvectorProviderConfig Class:
PgVectorConfig
Dependencies
Examples
Parameters
| Parameter | Type | Description | Default | Source |
|---|---|---|---|---|
collection_name | str | Name of the collection | "default_collection" | Base |
vector_size | int | Dimension of vectors | Required | Base |
distance_metric | DistanceMetric | Similarity metric (COSINE, EUCLIDEAN, DOT_PRODUCT) | COSINE | Base |
recreate_if_exists | bool | Recreate collection if it exists | False | Base |
default_top_k | int | Default number of results | 10 | Base |
default_similarity_threshold | Optional[float] | Minimum similarity score | None | Base |
connection_string | SecretStr | PostgreSQL connection string | Required | Specific |
schema_name | str | PostgreSQL schema name | "public" | Specific |
table_name | Optional[str] | Table name | Uses collection_name | Specific |
index | Union[HNSWIndexConfig, IVFIndexConfig] | Index type configuration | HNSWIndexConfig() | Specific |
content_language | str | Language for full-text search | "english" | Specific |
prefix_match | bool | Enable prefix matching for full-text search | False | Specific |
schema_version | int | Schema version for migrations | 1 | Specific |
batch_size | int | Batch size for upsert operations | 100 | Specific |
pool_size | int | Connection pool size | 5 | Specific |
max_overflow | int | Maximum pool overflow | 10 | Specific |
pool_timeout | float | Pool timeout in seconds | 30.0 | Specific |
pool_recycle | int | Pool recycle time in seconds | 3600 | Specific |

