From f9416fd4556d4d7500cfaf5bced6c0c63b47535a Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Fri, 25 Oct 2024 11:41:38 -0700 Subject: [PATCH 1/2] docs: update the readme to note Google provided integrations --- README.md | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 06c0a0f6..05a5602a 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ The `langchain-postgres` package implementations of core LangChain abstractions using `Postgres`. -The package is released under the MIT license. +The package is released under the MIT license. Feel free to use the abstraction as provided or else modify them / extend them as appropriate for your own application. ## Requirements -The package currently only supports the [psycogp3](https://www.psycopg.org/psycopg3/) driver. +The package currently only supports the [psycopg3](https://www.psycopg.org/psycopg3/) driver. ## Installation @@ -25,7 +25,7 @@ pip install -U langchain-postgres ## Change Log -0.0.6: +0.0.6: - Remove langgraph as a dependency as it was causing dependency conflicts. - Base interface for checkpointer changed in langgraph, so existing implementation would've broken regardless. @@ -33,12 +33,12 @@ pip install -U langchain-postgres ### ChatMessageHistory -The chat message history abstraction helps to persist chat message history +The chat message history abstraction helps to persist chat message history in a postgres table. -PostgresChatMessageHistory is parameterized using a `table_name` and a `session_id`. +`PostgresChatMessageHistory` is parameterized using a `table_name` and a `session_id`. -The `table_name` is the name of the table in the database where +The `table_name` is the name of the table in the database where the chat messages will be stored. The `session_id` is a unique identifier for the chat session. It can be assigned @@ -80,6 +80,31 @@ print(chat_history.messages) ``` -### Vectorstore +### Vector Store + +Learn how to use the [`PGVector` vectorstore](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/vectorstore.ipynb). + +## Google Cloud Integrations + +[Google Cloud](https://python.langchain.com/docs/integrations/providers/google/) provides Vector Store, Chat Message History, and Data Loader integrations for [AlloyDB](https://cloud.google.com/alloydb) and [Cloud SQL](https://cloud.google.com/sql) for PostgreSQL databases via the following PyPi packages: + +* [`langchain-google-alloydb-pg`](https://github.com/googleapis/langchain-google-alloydb-pg-python) + +* [`langchain-google-cloud-sql-pg`](https://github.com/googleapis/langchain-google-cloud-sql-pg-python) + +Using the Google Cloud provided integrations provides the following benefits: + +- **Enhanced security**: Easily and securely connect to Google Cloud databases utilizing IAM for authorization and database authentication without needing to manage SSL certificates, configure firewall rules, or enable authorized networks. +- **Simplified and Secure Connections:** Connect to Google Cloud databases effortlessly using the instance name instead of complex connection strings. The integrations creates a secure connection pool that can be easily shared across your application using the `engine` object. + +Learn how to [migrate a `PGVector` vector store to `AlloyDBVectorStore`](https://github.com/googleapis/langchain-google-alloydb-pg-python/blob/main/samples/migrations/migrate_pgvector_to_alloydb.md) to gain the following benefits: + +- **Simplified management**: a single table contains data corresponding to a single collection, making it easier to query, update, and maintain. +- **Schema flexibility**: allow users to add tables into any database schema. +- **Improved performance**: using a single-table schema can lead to faster query execution, especially for large collections. +- **Improved metadata handling**: store metadata in columns instead of JSON, resulting in significant performance improvements. +- **Clear separation**: clearly separate table and extension creation, allowing for distinct permissions and streamlined workflows. +- **Better integration with AlloyDB**: take advantage of AlloyDB's advanced indexing and scalability capabilities. + + -See example for the [PGVector vectorstore here](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/vectorstore.ipynb) From dffb0183f6e40247a74bc8f47d4a856f7be302df Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Mon, 28 Oct 2024 10:53:10 -0700 Subject: [PATCH 2/2] add note about filters --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 05a5602a..381adfed 100644 --- a/README.md +++ b/README.md @@ -106,5 +106,4 @@ Learn how to [migrate a `PGVector` vector store to `AlloyDBVectorStore`](https:/ - **Clear separation**: clearly separate table and extension creation, allowing for distinct permissions and streamlined workflows. - **Better integration with AlloyDB**: take advantage of AlloyDB's advanced indexing and scalability capabilities. - - +Note: The vector store currently supports metadata filtering using Postgres syntax instead of [database agnostic filter syntax](https://python.langchain.com/docs/how_to/query_constructing_filters/).