Stay organized with collections
Save and categorize content based on your preferences.
As a PostgreSQL-compatible database, AlloyDB integrates
seamlessly with the tools and frameworks supported by PostgreSQL, in addition to
other services from the Google Cloud environment.
AlloyDB AI provides a suite of AI and ML features that enable you to build
generative AI applications. These features allow you to build
applications with capabilities like vector search for semantic similarity,
natural language queries, and integration with machine learning models by providers, such as Google, OpenAI, and Anthropic.
To simplify the process of building AI applications, AlloyDB provides the following extensions:
vector extension: The standard pgvector PostgreSQL
extension 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 HSNW index that are available with stock
pgvector.
You can use the alloydb_scann extension with PostgreSQL 14 and 15 compatible databases.
google_ml_integration extension: The google_ml_integration extension
provides the AI query engine feature, which includes 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.
The following are some use cases that these extensions enable:
Vector search: 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 query engine: 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: Register AI models as model endpoints and call the endpoints from within AlloyDB to generate embeddings, invoke predictions, or perform similarity searches.
Generate embeddings and invoke predictions: Use Vertex AI text embedding models or registered model endpoints to generate text or multimodal embeddings.
Generate SQL statements from natural language: Add natural language capabilities to your application, and interact with AlloyDB by asking questions in natural language. The natural language questions are then processed by AlloyDB AI to automatically generate an accurate SQL query that retrieve the answer.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[[["\u003cp\u003eAlloyDB AI provides machine learning capabilities to AlloyDB for PostgreSQL and AlloyDB Omni, allowing users to apply semantic and predictive power to their data.\u003c/p\u003e\n"],["\u003cp\u003eThe platform includes a customized \u003ccode\u003evector\u003c/code\u003e extension for storing and querying embeddings, as well as the \u003ccode\u003ealloydb_scann\u003c/code\u003e extension for efficient nearest-neighbor indexing, using algorithms like ScaNN.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB AI extends PostgreSQL with functions like \u003ccode\u003eInvoke predictions\u003c/code\u003e and \u003ccode\u003eGenerate embeddings\u003c/code\u003e, which allow for querying models using SQL and translating text prompts into numerical vectors, respectively.\u003c/p\u003e\n"],["\u003cp\u003eUsers can leverage the \u003ccode\u003eembedding()\u003c/code\u003e and \u003ccode\u003egoogle_ml.embedding()\u003c/code\u003e functions to query Vertex AI models, including the use of text embeddings, as well as custom hosted or third-party models.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB's integration with Vertex AI enables applications to invoke predictions using any model in the Vertex AI Model Garden and to generate embeddings using the \u003ccode\u003etext-embedding-005\u003c/code\u003e English models.\u003c/p\u003e\n"]]],[],null,["# Build generative AI applications using AlloyDB AI\n\nAs a PostgreSQL-compatible database, AlloyDB integrates\nseamlessly with the tools and frameworks supported by PostgreSQL, in addition to\nother services from the Google Cloud environment.\n\nAlloyDB AI provides a suite of AI and ML features that enable you to build\ngenerative AI applications. These features allow you to build\napplications with capabilities like vector search for semantic similarity,\nnatural language queries, and integration with machine learning models by providers, such as Google, OpenAI, and Anthropic.\n\nTo simplify the process of building AI applications, AlloyDB provides the following extensions:\n\n- **vector** extension: The standard [`pgvector` PostgreSQL\n extension](https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing) is customized for AlloyDB, and referred to as `vector`.\n It supports storing generated embeddings in a vector column. The extension also\n adds support for scalar quantization features to create `IVF` indexes. You can\n also create an `IVFFlat` index or `HSNW` index that are available with stock\n `pgvector`.\n\n- **alloydb_scann** extension: The [`alloydb_scann` extension](https://cloud.google.com/alloydb/docs/ai/store-index-query-vectors?resource=scann#create-index) implements a highly efficient\n nearest-neighbor index powered by the [ScaNN\n algorithm](https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md).\n\n You can use the `alloydb_scann` extension with PostgreSQL 14 and 15 compatible databases.\n- **google_ml_integration** extension: The `google_ml_integration` extension\n provides the AI query engine feature, which includes functions for generating embeddings,\n semantic ranking, and implementing AI-based filters, joins and text\n generation/summarization. This extension also provides functions to register\n metadata for AI models. The registered metadata is then used to invoke predictions from these\n models.\n\n- **alloydb_ai_nl** extension: The `alloydb_ai_nl` extension enables developers\n to build applications that accurately and securely answer end user natural\n language questions about data in the AlloyDB database. This makes the data\n accessible to users who might not be proficient in writing SQL.\n\nThe following are some use cases that these extensions enable:\n\n- [Vector search](/alloydb/docs/ai/run-vector-similarity-search): 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.\n\n- [Perform intelligent SQL queries using AlloyDB AI query engine](/alloydb/docs/ai/evaluate-semantic-queries-ai-operators): 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.\n\n- [Call models using model endpoints](/alloydb/docs/ai/model-endpoint-overview): Register AI models as model endpoints and call the endpoints from within AlloyDB to generate embeddings, invoke predictions, or perform similarity searches.\n\n- [Generate embeddings](/alloydb/docs/ai/work-with-embeddings) and [invoke predictions](/alloydb/docs/ai/invoke-predictions): Use Vertex AI text embedding models or registered model endpoints to generate text or multimodal embeddings.\n\n- [Generate SQL statements from natural language](/alloydb/docs/ai/natural-language-overview): Add natural language capabilities to your application, and interact with AlloyDB by asking questions in natural language. The natural language questions are then processed by AlloyDB AI to automatically generate an accurate SQL query that retrieve the answer.\n\nWhat's next\n-----------\n\n- [Perform vector search tutorial](/alloydb/docs/ai/perform-vector-search)\n\n- [Integrate AlloyDB with Vertex AI](/alloydb/docs/ai/configure-vertex-ai).\n\n- [Create indexes and query vectors](/alloydb/docs/ai/store-index-query-vectors)."]]