Serverless AI Data Documents Search
AI powered semantic search service that finds the most relevant chunks from a vector collection based on a query. Returns only the chunks that have a similarity score of 0.5 or higher.
Endpoint
Search through vector embeddings in a collection using AI-powered semantic search
POSThttps://api.xtartapp.com/data/loader/search
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
collection | string | Yes | - | The name of the collection to search in. Must be a collection previously created with data-loader-upload. |
query | string | Yes | 250 | The search query to find relevant chunks in the collection. |
topK | number | Yes | 25 | The maximum number of results to return. Default is 5, maximum is 25. |
scoreThreshold | number | No | 1 | The minimum score threshold for results to be returned. Default is 0.7, minimum is 0, maximum is 1. |
Response
Name | Type | Description |
---|---|---|
data | object | The data of the search operation |
data.results | array | Array of content chunks matching the search query, ordered by relevance |
data.collectionName | string | The name of the collection that was searched |
metadata | object | Metadata about the data loader search process |
metadata.cost | number | The cost of the data loader search request (fixed at $0.000001 per request) |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when the payload is invalid. |
400 | INVALID_REQUEST | Ex.: The request is invalid. |
400 | DATA_LOADER_SEARCH_ERROR | Ex: could not search collection | collection not found |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
401 | UNAUTHORIZED | Ex.: The token is invalid. |
429 | TOO_MANY_REQUESTS | Ex.: The request limit has been reached. |