> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

Select a documentation version: <button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">18.1.1</button>

- [Current (18.4.0)](https://docs.cloud.google.com/alloydb/omni/linux/current/docs/ai/vector-assist-overview.md.txt)
- [18.4.0](https://docs.cloud.google.com/alloydb/omni/linux/18.4.0/docs/ai/vector-assist-overview.md.txt)
- [18.3.0](https://docs.cloud.google.com/alloydb/omni/linux/18.3.0/docs/ai/vector-assist-overview.md.txt)
- [18.1.1](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/ai/vector-assist-overview.md.txt)
- [18.1.0](https://docs.cloud.google.com/alloydb/omni/linux/18.1.0/docs/ai/vector-assist-overview.md.txt)

<br />

Vector assist is a AlloyDB Omni extension that simplifies the deployment and management of your vector workloads. It provides a declarative SQL framework that helps you set up production-ready vector search capabilities, such as embedding generation, query optimization, and index creation. This framework reduces the complexity of vector workloads by:

<br />

- **Simplifying intent declaration**: requirements (such as table, text column, or target recall) are declared using SQL functions.
- **Automating best practices**: generates optimized SQL commands, also known as recommendations, to set up your vector workload using your defined vector specification and an optimized auto-tuning algorithm that computes optimal index configuration.
- **Providing transparency and control**: provides clear explanations for each recommendation when automating tasks that let you review, modify, and apply recommendations at your pace.
- **Enabling rapid prototyping**: lets you quickly deploy a well-tuned vector search setup, reducing the time from concept to production.
- **Focusing on ease-of-use**: simplifies the complexity of semantic search, bridging the gap between business and engineering requirements.

With vector assist, you can build end-to-end applications with semantic search
features with a simplified setup.

## How vector assist works

Vector assist requires you to define your vector specifications. The framework
uses these vector specifications, also known as the vector spec, to generate the
steps required to create a vector index. Vector assist outputs the steps
required to deploy your vector workload as recommendations. Each time you modify
your vector spec, vector assist regenerates the recommendations.

Once you generate the vector index using these recommended steps, you can use
vector assist to generate optimized search queries.

### Vector assist specification

Setting up your vector index specification, or *vector spec*, is the first step
in using vector assist. A vector spec is an object where you define the intent
and requirements for your vector workload. It includes all necessary
information, including the following:

- Tables and relevant columns (text or vector)
- Embedding model preferences (if using embedding generation)
- Preferred index type: [`HNSW`](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/ai/create-hnsw-index.md.txt) or [`IVFFlat`](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/ai/create-ivf-index.md.txt). [`ScaNN`](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/ai/create-scann-index.md.txt) isn't supported.
- Target recall for search queries
- Memory limitations

> [!NOTE]
> **Note:** If you define the `target_recall` specification in your vector spec and vector assist is unable to build an index on a given dataset and configuration to achieve the specified `target_recall`, it returns configurations that build a vector workload with the best possible `target_recall`. This might fall below the `target_recall` you defined.

You define the vector spec using the
[`vector_assist.define_spec`](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/reference/ai/vector-assist.md.txt#define-spec)
function, and you can modify it at any time. The system assigns each
specification a unique ID and stores it in a table called
`vector_assist.VECTOR_SPECS`.

Vector assist infers the specification inputs and an optimized auto-tuning
algorithm that computes optimal index configuration. Although vector assist uses
these values to simplify the development process, you can still customize them
to match your preferences.

### Vector assist recommendations

After you define the vector spec, vector assist processes your input and
generates recommendations. These recommendations are an ordered list of useful
steps, typically SQL commands, that you must execute to deploy your vector
workload per your specifications. Each recommendation includes the following:

- The SQL query to run.
- A detailed explanation of what the query does and why it's recommended.
- Information about potential trade-offs or costs, such as estimated index size or build time.

Vector assist stores recommendations in a table called
`vector_assist.RECOMMENDATIONS`, and you can review, modify, and apply them
individually, or as a whole.

Each time you modify the vector spec for your workload, vector assist
regenerates the recommendations to comply with the updated specifications.

## Limitations

When using vector assist with your AlloyDB Omni instances,
consider the following limitations:

- Vector assist only supports PostgreSQL versions 17 and later.
- Although vector assist supports all `pgvector` versions, we recommend using the most recent version for optimal performance and feature support. For more information, see the [`pgvector` changelog](https://github.com/pgvector/pgvector/blob/master/CHANGELOG.md#080-2024-10-30).
- If your instance uses the `google_ml_integration` extension to generate embeddings, then its restrictions also apply when you use vector assist. For more information, see [Register and call remote AI models in AlloyDB Omni overview](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/ai/model-endpoint-overview.md.txt).
- Vector assist only supports `HNSW` and `IVFFlat` index types. `ScaNN` index types aren't supported.
- Vector assist only supports text embedding models for auto-generating embeddings and uses the `text_column_name` as the input parameter. If your vector workload requires a multimodal embedding model, use the `google_ml_integration` extension, or another extension to manually generate these embeddings before using vector assist to enable semantic search on these embeddings.

## What's next

- [Use vector assist](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/ai/use-vector-assist.md.txt)
- [Vector assist reference](https://docs.cloud.google.com/alloydb/omni/linux/18.1.1/docs/reference/ai/vector-assist.md.txt)