AlloyDB Vector Search

Overview

You can use this Snap to perform advanced vector-based queries using the SELECT statement.



Prerequisites

A valid account with the required permissions.

Snap views

View Description Examples of upstream and downstream Snaps
Input
  • Requires an input vector with the same dimension as the selected vector column.

  • Requires a vector input with an array of float/int data types.

Output For each input document, all results are grouped in a single output document.
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: AlloyDB Vector Search

Example: AlloyDB Vector Search
Schema name String/Expression/ Suggestion

Specify the schema name when searching for a vector.

Default value: N/A

Example: VECTOR_DEMO

Table name String/Expression/ Suggestion Specify the table name when searching for a vector.
Warning: The values can be passed using the pipeline parameters but not the upstream parameter.

Default value: N/A

Example: VECTOR_DEMO.BOOKS

Vector Column String/Expression/ Suggestion Required. Specify the vector column name to search.

Default value: N/A

Example: INT_VEC

Where Clause String/Expression/ Suggestion Specify the where clause to use in the vector search query statement.
Note: Because of the limitation of the SQL standard, you cannot use the _SL_DISTANCE column in the where clause.

Default value: N/A

Example: ID > '001i0000007FVjpAAG'

Limit Rows Integer/Expression Required. Specify the number of results to return for each query.

Default value: 4

Example: 3

Minimum value: 1

Distance Function Dropdown list Required. Choose the similarity function to compare vectors. The available options are:
  • L2: (Euclidean Distance) Measures the straight-line distance between two points. It’s useful when you want to calculate the as-the-crow-flies distance.

  • L1: (Manhattan Distance) Measures the distance between two points along the axes at right angles. It’s useful in grid-based systems, such as, city streets.

  • COSINE: Measures the cosine of the angle between two vectors. It’s commonly used in high-dimensional positive spaces to assess similarity regardless of magnitude.

  • Inner Product: (Dot Product) Measures the similarity between two vectors. It’s useful in various applications, such as calculating the angle between vectors or finding projections.

Learn more about the Vector Similarity Functions.

Default value: L2

Example: COSINE

Include vector values Checkbox/Expression Select this checkbox to include vector values in the response.
Note: This field does not support input schema from the upstream Snaps.

Default status: Deselected

Include scores Checkbox/Expression Select this checkbox to include similarity scores in the response.
Note:
  • This field does not support input schema from the upstream Snaps.

  • When you select this checkbox, the output preview displays _SL_DISTANCE, which is the distance between the input vector and vectors in the database.

Default status: Selected

Ignore empty result Checkbox Select this checkbox if you want the Snap to produce no output when no matching vector is found. Otherwise, the Snap outputs a blank document when no vectors match.

Default status: Deselected

Number of retries Integer/Expression Specify the maximum number of attempts to make to receive a response.

Default value: 0

Example: 3

Retry interval (seconds) Integer/Expression Specify the minimum number of seconds the Snap must wait before each retry attempt.

Default value: 0

Example: 3

Snap execution Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Execute only

Example: Validate & Execute