AlloyDB for PostgreSQL lets you apply the semantic and predictive power of large language models (LLMs) and other machine learning (ML) models to your data. This page provides an overview of ML-powered AI functions available through AlloyDB.
Generate vector embeddings and text predictions
AlloyDB AI extends PostgreSQL syntax with two functions for querying models:
Invoke predictions to call a model using SQL within a transaction.
Generate embeddings to have an LLM translate text prompts into numerical vectors. You can then apply these vector embeddings as input to
pgvector
functions. This includes methods to compare and sort samples of text according to their relative semantic distance.
Store, index and query vector embeddings with pgvector
AlloyDB includes optimizations that let it work especially well
with the pgvector
extension. You can create indexes on vector-storing columns
that can significantly speed up certain queries. For more information, see Query and index
embeddings with pgvector
.
Use local or cloud-based models
AlloyDB integrates with Vertex AI for cloud-based model access. AlloyDB Omni also supports the use of locally stored models.
Use models in the cloud with Vertex AI
You can configure AlloyDB to work with Vertex AI.
This gives your applications the following benefits:
Your applications can invoke predictions using any model stored in the Vertex AI Model Garden that they have access to.
Your applications can generate embeddings using the
textembedding-gecko
LLM.
Use local models with AlloyDB Omni
AlloyDB Omni, the containerized edition of AlloyDB that you can run on your own Linux-based environment, has a Technology Preview edition that lets you run offline AI experiments with two downloadable models, both pre-trained by Google. For more information, see Install AlloyDB Omni with ML integration.