Vector assist is a Cloud SQL for PostgreSQL extension that simplifies the deployment and management of your Cloud SQL 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:
- 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 simplified setup.
How vector assist works
Using 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 tables and relevant columns (text or vector)
- Embedding model preferences (if using embedding generation)
- Preferred index type, such as
HNSWorIVFFlat. - Target recall for search queries
- Memory limitations or other performance constraints
You define the vector spec using the
vector_assist.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 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.recommendation, 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 Cloud SQL for PostgreSQL instances, consider the following limitations:
- Vector assist only supports PostgreSQL versions 12 and later.
- Although vector assist supports all
pgvectorversions, we recommend using the most recent version for optimal performance and feature support. For more information, see thepgvectorchangelog. - If your instance uses the
google_ml_integrationextension to generate embeddings, then its restrictions also apply when you use vector assist. For more information, see Model endpoint management overview. - Vector assist only supports
HNSWandIVFFlatindex types. - Vector assist only supports text embedding models for auto-generating
embeddings and uses the
text_column_nameas the input parameter. If your vector workload requires a multimodal embedding model, use thegoogle_ml_integrationextension, or another extension to manually generate these embeddings before using vector assist to enable semantic search on these embeddings.