AlloyDB AI provides an integrated suite of AI and machine learning
(ML) capabilities in AlloyDB for PostgreSQL that lets you build generative AI
applications using your operational database data. You can run high-speed
vector similarity searches, translate natural language questions into SQL
queries, and invoke foundation models from
Gemini Enterprise Agent Platform, OpenAI, and Anthropic directly from
SQL.

To simplify the process of building AI applications, AlloyDB provides the following extensions:

- **vector** extension: the standard [`pgvector` PostgreSQL
  extension](https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing) is customized for AlloyDB, and referred to as `vector`.
  It supports storing generated embeddings in a vector column. The extension also
  adds support for scalar quantization features to create `IVF` indexes. You can
  also create an `IVFFlat` index or `HNSW` index that are available with stock
  `pgvector`.

- **alloydb_scann** extension: the [`alloydb_scann` extension](https://docs.cloud.google.com/alloydb/docs/ai/create-scann-index.md.txt) implements a highly efficient
  nearest-neighbor index powered by the [ScaNN
  algorithm](https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md).

  You can use the `alloydb_scann` extension with PostgreSQL 14, 15, 16, 17, and 18.
- **google_columnar_engine** extension: ScaNN index can be loaded into the columnar engine for further accelerating the vector search.

- **google_ml_integration** extension: the `google_ml_integration` extension
  provides AI functions for generating embeddings,
  semantic ranking, and implementing AI-based filters, joins and text
  generation/summarization. This extension also provides functions to register
  metadata for AI models. The registered metadata is then used to invoke predictions from these
  models.

- **alloydb_ai_nl** extension: the `alloydb_ai_nl` extension enables developers
  to build applications that accurately and securely answer end user natural
  language questions about data in the AlloyDB database. This makes the data
  accessible to users who might not be proficient in writing SQL. For
  next-generation text-to-SQL workflows and AI agent integration, we recommend
  using [QueryData](https://docs.cloud.google.com/gemini/data-agents/querydata/alloydb/data-agent-overview.md.txt).

The following are some use cases that AlloyDB AI and these extensions enable:

- [Vector search](https://docs.cloud.google.com/alloydb/docs/ai/run-vector-similarity-search.md.txt): use AlloyDB to store vector embeddings and perform highly efficient similarity searches. You can generate a highly efficient nearest-neighbor index powered by the ScaNN algorithm.

- [Perform intelligent SQL queries using AlloyDB AI functions](https://docs.cloud.google.com/alloydb/docs/ai/evaluate-semantic-queries-ai-operators.md.txt): use AI directly within your SQL queries. This allows you to re-rank search results for higher relevance, integrate natural language into your SQL queries, and generate multimodal embeddings for vector search.

- [Call models using model endpoints](https://docs.cloud.google.com/alloydb/docs/ai/model-endpoint-overview.md.txt): register AI models as model endpoints and call the endpoints from within AlloyDB to generate embeddings, invoke predictions, or perform similarity searches.

- [Generate embeddings](https://docs.cloud.google.com/alloydb/docs/ai/work-with-embeddings.md.txt) and [invoke predictions](https://docs.cloud.google.com/alloydb/docs/ai/invoke-predictions.md.txt): use Gemini Enterprise Agent Platform text embedding models or registered model endpoints to generate text or multimodal embeddings.

- [Query data in natural language with QueryData](https://docs.cloud.google.com/gemini/data-agents/querydata/alloydb/data-agent-overview.md.txt): translate natural language questions into SQL queries using context sets (templates, facets, and value search queries) and integrate single-turn natural-language-to-SQL generation into your [AI agents and applications](https://docs.cloud.google.com/alloydb/docs/ai/querydata.md.txt).

- [Build data agents with conversational analytics](https://docs.cloud.google.com/alloydb/docs/ai/conversational-analytics.md.txt): create and chat with stateful, multi-turn [data agents](https://docs.cloud.google.com/gemini/data-agents/conversational-analytics/alloydb.md.txt) in AlloyDB Studio to explore your AlloyDB data in natural language.

- [Generate SQL statements from natural language using the `alloydb_ai_nl` extension](https://docs.cloud.google.com/alloydb/docs/ai/natural-language-landing.md.txt): add in-database natural language capabilities to your application using the `alloydb_ai_nl` extension (for new text-to-SQL workflows, we recommend [QueryData](https://docs.cloud.google.com/gemini/data-agents/querydata/alloydb/data-agent-overview.md.txt)).

## What's next

- [Perform vector search tutorial](https://docs.cloud.google.com/alloydb/docs/ai/perform-vector-search.md.txt)

- [Integrate AlloyDB with Agent Platform](https://docs.cloud.google.com/alloydb/docs/ai/configure-vertex-ai.md.txt).

- [Create a ScaNN index](https://docs.cloud.google.com/alloydb/docs/ai/create-scann-index.md.txt).