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
Base Parameters (from BaseVectorDBConfig)
| Parameter | Type | Description | Default | Required |
|---|---|---|---|---|
collection_name | str | Name of the collection | "default_collection" | No |
vector_size | int | Dimension of vectors | - | Yes |
distance_metric | DistanceMetric | Similarity metric (COSINE, EUCLIDEAN, DOT_PRODUCT) | COSINE | No |
recreate_if_exists | bool | Recreate collection if it exists | False | No |
default_top_k | int | Default number of results | 10 | No |
default_similarity_threshold | Optional[float] | Minimum similarity score (0.0-1.0) | None | No |
dense_search_enabled | bool | Enable dense vector search | True | No |
full_text_search_enabled | bool | Enable full-text search | True | No |
hybrid_search_enabled | bool | Enable hybrid search | True | No |
default_hybrid_alpha | float | Default alpha for hybrid search (0.0-1.0) | 0.5 | No |
default_fusion_method | Literal['rrf', 'weighted'] | Default fusion method for hybrid search | 'weighted' | No |
provider_name | Optional[str] | Provider name | None | No |
provider_description | Optional[str] | Provider description | None | No |
provider_id | Optional[str] | Provider ID | None | No |
default_metadata | Optional[Dict[str, Any]] | Default metadata for all records | None | No |
auto_generate_content_id | bool | Auto-generate content IDs | True | No |
indexed_fields | Optional[List[Union[str, Dict[str, Any]]]] | Fields to index for filtering | None | No |
PGVector-Specific Parameters
| Parameter | Type | Description | Default | Required |
|---|---|---|---|---|
connection_string | SecretStr | PostgreSQL connection string | - | Yes |
schema_name | str | PostgreSQL schema name | "public" | No |
table_name | Optional[str] | Table name (uses collection_name if not specified) | None | No |
index | Union[HNSWIndexConfig, IVFIndexConfig] | Index type configuration (FLAT not supported) | HNSWIndexConfig() | No |
content_language | str | Language for full-text search (e.g., ‘english’, ‘spanish’) | "english" | No |
prefix_match | bool | Enable prefix matching for full-text search (appends * to words) | False | No |
schema_version | int | Schema version for migrations | 1 | No |
auto_upgrade_schema | bool | Automatically upgrade schema on version mismatch | False | No |
batch_size | int | Batch size for upsert operations | 100 | No |
pool_size | int | Connection pool size | 5 | No |
max_overflow | int | Maximum pool overflow | 10 | No |
pool_timeout | float | Pool timeout in seconds | 30.0 | No |
pool_recycle | int | Pool recycle time in seconds | 3600 | No |

