# langchain_postgres

> Python package

📖 [View in docs](https://reference.langchain.com/python/langchain-postgres)

## Classes

- [`PostgresChatMessageHistory`](https://reference.langchain.com/python/langchain-postgres/chat_message_histories/PostgresChatMessageHistory)
- [`PGVectorTranslator`](https://reference.langchain.com/python/langchain-postgres/translator/PGVectorTranslator)
- [`DistanceStrategy`](https://reference.langchain.com/python/langchain-postgres/vectorstores/DistanceStrategy)
- [`PGVector`](https://reference.langchain.com/python/langchain-postgres/vectorstores/PGVector)
- [`HybridSearchConfig`](https://reference.langchain.com/python/langchain-postgres/v2/hybrid_search_config/HybridSearchConfig)
- [`AsyncPGVectorStore`](https://reference.langchain.com/python/langchain-postgres/v2/async_vectorstore/AsyncPGVectorStore)
- [`ColumnDict`](https://reference.langchain.com/python/langchain-postgres/v2/engine/ColumnDict)
- [`Column`](https://reference.langchain.com/python/langchain-postgres/v2/engine/Column)
- [`PGEngine`](https://reference.langchain.com/python/langchain-postgres/v2/engine/PGEngine)
- [`StrategyMixin`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/StrategyMixin)
- [`DistanceStrategy`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/DistanceStrategy)
- [`BaseIndex`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/BaseIndex)
- [`ExactNearestNeighbor`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/ExactNearestNeighbor)
- [`QueryOptions`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/QueryOptions)
- [`HNSWIndex`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/HNSWIndex)
- [`HNSWQueryOptions`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/HNSWQueryOptions)
- [`IVFFlatIndex`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/IVFFlatIndex)
- [`IVFFlatQueryOptions`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/IVFFlatQueryOptions)
- [`PGVectorStore`](https://reference.langchain.com/python/langchain-postgres/v2/vectorstores/PGVectorStore)

## Functions

- [`cosine_similarity()`](https://reference.langchain.com/python/langchain-postgres/_utils/cosine_similarity)
- [`maximal_marginal_relevance()`](https://reference.langchain.com/python/langchain-postgres/_utils/maximal_marginal_relevance)
- [`weighted_sum_ranking()`](https://reference.langchain.com/python/langchain-postgres/v2/hybrid_search_config/weighted_sum_ranking)
- [`reciprocal_rank_fusion()`](https://reference.langchain.com/python/langchain-postgres/v2/hybrid_search_config/reciprocal_rank_fusion)
- [`validate_identifier()`](https://reference.langchain.com/python/langchain-postgres/v2/indexes/validate_identifier)

## Types

- [`Matrix`](https://reference.langchain.com/python/langchain-postgres/_utils/Matrix)
- [`DBConnection`](https://reference.langchain.com/python/langchain-postgres/vectorstores/DBConnection)
