Enhanced AI Functionality: Google Cloud Integrates Vector Search in Managed Databases

2023-07-10

Recently, Google Cloud has added support for pgvector to Cloud SQL for PostgreSQL and AlloyDB for PostgreSQL. This extension brings vector search operations to managed databases, allowing developers to store vector embeddings generated by large language models (LLMs) and perform similarity searches. Now, Cloud SQL and AlloyDB can be used in conjunction with the generative AI services on Vertex AI, helping to create AI applications with application and user state awareness. Google's Senior Product Manager Sandhya Ghai and Product Manager Bala Narasimhan explain: "Vector embeddings are a numerical representation commonly used to transform complex user-generated content, such as text, audio, and video, into a form that is easy to store, manipulate, and index. These representations are generated by embedding models, and if two contents are semantically similar, their embeddings will be close to each other in the embedding vector space. The 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 in text and image domains to generate embeddings, which can then be stored and indexed in databases, simplifying the process of searching for similar records. The pgvector extension can be installed in an existing database using the CREATE EXTENSION command. This new feature also helps developers leverage pre-trained large language models (LLMs), as explained by Ghai and Narasimhan: One thing to note about LLMs is that they do not have a concept of state. Embeddings allow you to store a large amount of context in the database, such as documents or long-term chat history, and filter them to find the most relevant information. You can then feed the most relevant chat history or documents to the model to simulate long-term memory and business-specific knowledge. Google Cloud has released a Colab notebook and a video demonstrating how to build AI-based applications using pgvector, the open-source framework LangChain, and LLMs. Saket Saurabh, Senior Software Engineer at Google, wrote about adding generative AI capabilities to a sample Python application: The pgvector extension also introduces new operators for performing similarity matching on vectors, allowing for finding semantically similar vectors. Two of these operators are: '<->', which returns the Euclidean distance between two vectors, and '<=>', which returns the cosine distance between two vectors. In the past few months, Google Cloud is not the only cloud provider targeting vector databases. Amazon RDS for PostgreSQL supports the pgvector extension, and Microsoft has showcased how Azure Data Explorer (ADX) can be used as a vector database and discussed several connectors to vector databases. Source: https://cloud.google.com/blog/products/databases/using-pgvector-llms-and-langchain-with-google-cloud-databases Source: https://www.infoq.com/news/2023/07/gcp-databases-vector-search/

RECENT AI NEWS

RECENT AI TOOLS