Announcing LangChain Postgres open-source Improvements
Open-source LangChain PostgreSQL upgrades
Google Cloud contributed heavily to the library and updated LangChain Postgres at Google Cloud Next ’25. These upgrades enable all application developers to design database-backed agentic gen AI solutions utilising open source technologies.
LangChain, an open-source framework, simplifies agentic gen AI systems that use massive language models. It connects large language models (LLMs) to other data sources for more powerful and context-aware AI applications. LangChain regularly interacts with databases to efficiently manage and extract structured data. The langchain-postgres package integrates PostgreSQL databases to load documents, store chat history, and store vectors for embeddings. Connectivity is needed for LLM-powered apps to use relational data, perform semantic searches, and generate memory chatbots.
Google Cloud enhancements include enterprise-level connection pooling, faster SQL filtering with relational metadata columns, and optimised performance with asynchronous PostgreSQL drivers. It also included:
Developers can use LangChain to create vector databases with vector indexes.
Flexible database schemas for more robust and manageable applications
For better security, the LangChain vector store APIs follow the least privilege principle and clearly distinguish database setup and usage.
Some new enhancements
Improved security and connectivity
Developing secure and dependable generative AI systems requires careful consideration of how your application interacts with the data architecture. Its LangChain Postgres contributions have prioritised security and connection through several key changes.
Following the least privilege concept has been our focus. The revised API distinguishes between database schema creation and application use rights. This separation lets you restrict the application layer's database schema changes. Separating these tasks can boost AI application security and reduce the attack surface.
Maintaining a pool of database connections reduces the overhead of making new connections for each query. This stabilises your application by efficiently limiting resource utilisation and preventing thousands of idle PostgreSQL connections. It also improves speed, especially in high-throughput scenarios.
Designing schema better
The langchain-postgres package historically only allowed schemas with fixed table names and a single json metadata column to resemble vector databases. PostgreSQL's sophisticated querying features allow you to filter non-vector columns to improve vector search quality. Our LangChain postgres package modifications let you define metadata columns to combine vector search queries with SQL filters when querying your vector storage.
Use the new LangChain PostgreSQL package to turn your PostgreSQL database structure into an AI workload with a few lines of code. This eliminates data schema migration.
Features ready for production
Google Cloud introduced vector index management and first-class asynchronous driver integrations in LangChain to enable production-scale applications. Asynchronous drivers enable non-blocking I/O operations, improving performance. This helps your application grow efficiently, reduce resource consumption, and increase responsiveness to handle more concurrent requests.
LangChain may now directly create and maintain vector indexes. This lets you utilise LangChain to describe and build your entire application stack, from database schema to vector index creation, using an infrastructure-as-code technique for vector search. This end-to-end connection simplifies development and makes LangChain AI-powered apps easy to set up and manage by using asynchronous operations and vector search.
LangChain packages for Google Cloud databases were upgraded by Google Cloud. It upstreamed those changes from its packages into LangChain PostgreSQL so developers on any platform could use them. Generative AI applications increasingly rely on databases, therefore software libraries must offer high-quality database connectors to exploit your data. These databases root LLMs, provide RAG application knowledge, and fuel high-quality vector search.
Get started
A quickstart application and langchain-postgres package are available now! Use this guide to switch from the old langchain-postgres package to Google's. Use AlloyDB's LangChain package and Cloud SQL for PostgreSQL to use GCP-specific capabilities like AlloyDB AI's ScaNN index. Create agentic apps with MCP Toolbox.













