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
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Search query text. Minimum length: 1 |
dataset_ids | integer[] | Yes | — | List of dataset IDs to search. Minimum 1 element |
k | integer | No | 5 | Number of results to return |
Output
| Field | Type | Description |
|---|---|---|
documents | SearchResult[] | Ordered list of matching chunks |
count | integer | Number of results returned |
query | string | The original search query |
Each SearchResult:
| Field | Type | Description |
|---|---|---|
page_content | string | The text content of the matched chunk |
metadata | object | Key/value metadata attached to the chunk |
score | float | Similarity 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
}