vector-assist-generate-query

The “vector-assist-generate-query” tool produces optimized SQL queries for vector search, leveraging metadata and specifications to enable semantic and similarity searches.

About

The vector-assist-generate-query tool generates optimized SQL queries for vector search by leveraging the metadata and vector specifications defined in a specific spec_id. It serves as the primary actionable tool for generating the executable SQL required to retrieve relevant results based on vector similarity.

The tool contextually understands requirements such as distance functions, quantization, and filtering to ensure the resulting query is compatible with the corresponding vector index. Additionally, it can automatically handle iterative index scans for filtered queries and calculate the necessary search parameters (like ef_search) to meet a target recall.

Compatible Sources

This tool can be used with the following database sources:

Source Name
Cloud SQL for PostgreSQL Source

Requirements

Tip

Ensure that your target PostgreSQL database has the required vector_assist extension installed, in order for this tool to execute successfully.

Parameters

The tool takes the following input parameters:

ParameterTypeDescriptionRequired
spec_idstringUnique ID of the vector spec for query generation.No
table_namestringTarget table name for generating the vector query.No
schema_namestringSchema name for the query’s target table.No
column_namestringText or vector column name identifying the specific spec.No
search_textstringText string to search for; embeddings are auto-generated.No
search_vectorstringVector to search for; use instead of search_text.No
output_column_namesarrayList of columns to retrieve in the search results.No
top_kintegerNumber of nearest neighbors to return (defaults to 10).No
filter_expressionsarrayList of filter expressions applied to the vector query.No
target_recallfloatTarget recall rate, overriding the spec-level default.No
iterative_index_searchbooleanEnables iterative search for filtered queries to guarantee results.No

Note Parameters are marked as required or optional based on the vector assist function definitions. The function may perform further validation on optional parameters to ensure all necessary data is available before returning a response.

Example

kind: tool
name: generate_query
type: vector-assist-generate-query
source: my-database-source
description: "This tool generates optimized SQL queries for vector search by leveraging the metadata and vector specifications defined in a specific spec_id. It may return a single query or a sequence of multiple SQL queries that can be executed sequentially. Use this tool when a user wants to perform semantic or similarity searches on their data. It serves as the primary actionable tool to invoke for generating the executable SQL required to retrieve relevant results based on vector similarity."

Reference

fieldtyperequireddescription
typestringtrueMust be “vector-assist-generate-query”.
sourcestringtrueName of the source the SQL should execute on.
descriptionstringfalseDescription of the tool that is passed to the agent.



Last modified April 13, 2026: chore(main): release 1.1.0 (#3024) (da6f5f8)