banner
News center
Constantly enhancing our techniques and quality to stay up-to-date with industry trends.

Enhancing AI Capabilities: Google Cloud Integrates Vector Search in Managed Databases

Jul 11, 2023

InfoQ Homepage News Enhancing AI Capabilities: Google Cloud Integrates Vector Search in Managed Databases

Jul 09, 2023 2 min read

by

Renato Losio

Google Cloud recently added support for the pgvector on Cloud SQL for PostgreSQL and AlloyDB for PostgreSQL. The extension brings vector search operations to the managed databases, allowing developers to store vector embeddings generated by large language models (LLMs) and perform similarity searches.

Cloud SQL and AlloyDB can now be paired with generative AI services on Vertex AI, helping create AI-enabled applications that are aware of the application and user state. Sandhya Ghai, senior product manager at Google, and Bala Narasimhan, product manager at Google, explain:

Vector embeddings are numerical representations typically used to transform complex user-generated content like text, audio, and video into a form that can be easily stored, manipulated, and indexed. These representations are generated by embeddings models such that, if two pieces of content are semantically similar, their respective embeddings are located near each other in the embedding vector space. Vector embeddings are then indexed and used to efficiently filter data based on similarity.

For example, developers can use Vertex AI’s pre-trained models across text and images to generate embeddings and store and index them in a database, simplifying the search for similar records.

The pgvector extension can now be installed within an existing database using the CREATE EXTENSION command:

Source: https://cloud.google.com/blog/products/databases/using-pgvector-llms-and-langchain-with-google-cloud-databases

The new feature can also help developers leverage pre-trained LLMs, as Ghai and Narasimhan explain:

One thing to note about LLMs is that they have no concept of state. (...) Embeddings allow you to store large contexts such as documentation or long-term chat histories in your database and filter them to find the most relevant information. You can then feed the most relevant pieces of chat history or documentation to the model to simulate long-term memory and business-specific knowledge.

Google Cloud released a Colab notebook and a video to build AI-powered apps using pgvector, the open-source framework LangChain, and LLMs. Showing how to add generative AI features to a sample Python application, Saket Saurabh, senior software engineer at Google, writes:

The pgvector extension also introduces new operators for performing similarity matches on vectors, allowing you to find vectors that are semantically similar. Two such operators are:‘<->’: returns the Euclidean distance between the two vectors. (...)‘<=>’: returns the cosine distance between the two vectors.

Google Cloud is not the only cloud provider targeting vector databases in the last few months, with Amazon RDS for PostgreSQL supporting the pgvector extension and Microsoft showing how Azure Data Explorer (ADX) can be used as a vector database and discussing several connectors to vector databases.

Code, deploy, and scale Java your way.Microsoft Azure supports your workload with abundant choices, whether you're working on a Java app, app server, or framework. Learn more.

Writing for InfoQ has opened many doors and increased career opportunities for me. I was able to deeply engage with experts and thought leaders to learn more about the topics I covered. And I can also disseminate my learnings to the wider tech community and understand how the technologies are used in the real world.

I discovered InfoQ’s contributor program earlier this year and have enjoyed it since then! In addition to providing me with a platform to share learning with a global community of software developers, InfoQ’s peer-to-peer review system has significantly improved my writing. If you’re searching for a place to share your software expertise, start contributing to InfoQ.

I started writing news for the InfoQ .NET queue as a way of keeping up to date with technology, but I got so much more out of it. I met knowledgeable people, got global visibility, and improved my writing skills.

Becoming an editor for InfoQ was one of the best decisions of my career. It has challenged me and helped me grow in so many ways. We'd love to have more people join our team.

InfoQ seeks a full-time Editor-in-Chief to join C4Media's international, always remote team. Join us to cover the most innovative technologies of our time, collaborate with the world's brightest software practitioners, and help more than 1.6 million dev teams adopt new technologies and practices that push the boundaries of what software and teams can deliver!

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

You need to Register an InfoQ account or Login or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Join a community of experts. Renato Losiohas opened many doors and increased career opportunitiesVivian HuInfoQ’s peer-to-peer review system has significantly improved my writingOghenevwede Emeni got global visibility, and improved my writing skillsEdin Kapićbest decisions of my careerhelped me grow in so many waysjoin our teamThomas Bettsfull-time Editor-in-ChiefThe InfoQGet the most out of the InfoQ experience.