Install AlloyDB AI in AlloyDB Omni

This page shows you how to install AlloyDB Omni and integrate AlloyDB AI in it.

AlloyDB AI is a suite of features included with AlloyDB Omni that let you build enterprise generative AI applications. For more information about the ML functionality of AlloyDB, see Build generative AI applications.

AlloyDB Omni with AlloyDB AI lets you query remote ML models to work with online predictions and text embeddings generated from ML models. AlloyDB Omni with AlloyDB AI can also process vector embeddings from other content such as an image, for example, if you use the google_ml.predict_row interface and do the translation yourself in the query.

Based on where you want to install AlloyDB Omni with AlloyDB AI, select one of the following options:

Verify AlloyDB Omni with AlloyDB AI installation

To verify your installation is successful and uses model prediction, enter the following:

   CREATE EXTENSION google_ml_integration CASCADE;

   SELECT array_dims(embedding( 'textembedding-gecko@003', 'AlloyDB AI')::real[]);

The output looks similar to the following:

      array_dims
      ------------
      [1:768]
      (1 row) 

In the previous query, the embedding() call generates embeddings for the input text AlloyDB AI. array_dims returns the dimensions of the array returned by embedding(). Since the pre-registered textembedding-gecko model returns an output with 768 dimensions, the output is [768].

What's next