Discover and explore top open-source AI tools and projects—updated daily.
langchain-aiPostgreSQL backend for LangChain AI applications
Top 95.1% on SourcePulse
Provides PostgreSQL-backed implementations for core LangChain abstractions, enabling developers to leverage a robust relational database for vector embeddings and chat message history. It offers a persistent and scalable backend for AI applications built with LangChain, simplifying data management and retrieval.
How It Works
This package integrates LangChain with PostgreSQL using asyncpg or psycopg3 drivers. It offers PGVectorStore for managing vector embeddings, supporting efficient similarity searches and hybrid search capabilities via configurations like reciprocal rank fusion. Additionally, PostgresChatMessageHistory allows for the persistence of chat session dialogues within PostgreSQL tables, keyed by session ID.
Quick Start & Requirements
pip install -U langchain-postgresasyncpg or psycopg3 drivers.PGVector is deprecated in v0.0.14+; migration to PGVectorStore is recommended for improved performance and manageability.Highlighted Details
PGVectorStore: Offers enhanced performance and manageability over the deprecated PGVector.PGVectorStore.PostgresChatMessageHistory for durable storage of conversational data.langchain-google-alloydb-pg, langchain-google-cloud-sql-pg) offer secure, simplified connections to Google Cloud's AlloyDB and Cloud SQL for PostgreSQL, featuring IAM authorization and instance name-based connection.Maintenance & Community
No specific details on contributors, sponsorships, or community channels were present in the provided README snippet.
Licensing & Compatibility
Released under the permissive MIT license, allowing for broad use, modification, and distribution, including within commercial applications.
Limitations & Caveats
The primary adoption blocker is the deprecation of the older PGVector implementation, necessitating migration to PGVectorStore for ongoing support and feature access. Users should consult the migration guide for a smooth transition.
1 week ago
Inactive