Table of Contents

Search vectors

Searches in a PostgreSQL vector database.

img

Example img
This flow processes a user's chat question by first receiving it through a Chat completion trigger, then converting it into a vector using a text embedder, performing a Vector search in a postgreSQL database for relevant context, and finally passing the user input and retrieved context to an Azure AI Chat completion action, which generates a response that is returned to the client via the Return node.


Properties

Name Type Description
Title Optional The title or name of the action.
Connection Required The PostgreSQL database connection that will be used for the search.
Table Required The name of the table where the vector search will be performed.
Search text Required The input text string used to perform the vector search, can be provided by a trigger (see below).
Record definitions Required The definition of columns used in vector search. Note! The vector column is not part of the returned data.
Filter Optional A filter expression to narrow down the records (e.g., category == cats ).
Top Optional The maximum number of top results to return.
Skip Optional The number of top results to skip (default: 0).
Distance function Optional The method for calculating vector similarity, e.g., Cosine Distance (default).
Score limit Optional A threshold value that limits results to those with a distance score at or below this score (for e.g. CosineDistance).
Search result variable name Optional The name of the variable to store results.
Description Optional Any additional notes or information relevant to the search configuration.

img

Returns

The Vector Search action returns an object containing a ToPrompt() function that is used by the Chat completion Context property (in the example above). The resultObject also contains a set of records containing the key, content and vector columns that the user has specified as Record Definitions. img

img