PgVectorStorage
- vector_dim (int): The dimension of the vectors to be stored.
- conn_info (Dict[str, Any]): Connection information for psycopg2.connect.
- table_name (str, optional): Name of the table to store vectors. (default: :obj:
None
) - distance (VectorDistance, optional): Distance metric for vector comparison. (default: :obj:
VectorDistance.COSINE
)
init
- vector_dim (int): The dimension of the vectors.
- conn_info (Dict[str, Any]): Connection info for psycopg2.connect.
- table_name (str, optional): Table name. (default: :obj:
None
) - distance (VectorDistance, optional): Distance metric. (default: :obj:
VectorDistance.COSINE
)
_ensure_table
_ensure_index
add
- records (List[VectorRecord]): List of vector records to add or update.
delete
- ids (List[str]): List of record IDs to delete.
query
- query (VectorDBQuery): Query object containing the query vector and top_k. **kwargs (Any): Additional keyword arguments for the query.