Skip to main content

vectorSearch

Performs similarity search across one or more datasets stored in the vector database. Fans out the query to the relevant data cluster(s) and returns a ranked list of text chunks with similarity scores.

Parameters

ParamTypeRequiredDefaultDescription
querystringYesSearch query text. Minimum length: 1
dataset_idsinteger[]YesList of dataset IDs to search. Minimum 1 element
kintegerNo5Number of results to return

Output

FieldTypeDescription
documentsSearchResult[]Ordered list of matching chunks
countintegerNumber of results returned
querystringThe original search query

Each SearchResult:

FieldTypeDescription
page_contentstringThe text content of the matched chunk
metadataobjectKey/value metadata attached to the chunk
scorefloatSimilarity score from the vector database

Example

{
"id": "vectorSearch",
"type": "vectorSearch",
"data": {
"label": "Vector Search",
"isExecuted": false,
"handles": ["inputs", "outputs"],
"schema": {},
"params": {
"query": { "value": "{{ $input.query }}", "isExpression": true, "isAttachedToInputNode": false },
"dataset_ids": { "value": [42, 87], "isExpression": false, "isAttachedToInputNode": false },
"k": { "value": 10, "isExpression": false, "isAttachedToInputNode": false }
},
"inputs": [], "outputs": [], "errors": []
},
"position": { "x": 0, "y": 0 },
"isSelected": false,
"isDragging": false
}