query: The user query that is embedded and searched against the dataset.
search_type: Can be semantic, fulltext, or hybrid.
Semantic: Uses cosine distance to determine the most relevant results.
Fulltext: Uses a SPLADE model to find the most relevant results.
Hybrid: Uses a reranker model that pulls one page of results from both fulltext and semantic searches to find the most relevant results.
page: The page of chunks to fetch. Pages are 1-indexed.
page_size: This lets you tune the number of results that are returned.
highlight_results: Enables subsentence highlighting of relevant portions of the text.
slim_chunks: Excludes chunk_html from the returned results to reduce network bandwidth. Useful for large chunks.
recency_bias: A value from 0-1 that tunes how much the recency of chunks (based on the timestamp field) affects the ranking.
sort_options: Options on how to sort.
filters: Apply filters to get exactly the results you want.
Semantic search uses an embeddnig model to generate a query vector. Defaults to using cosine similarity and jina-base-enTrieve uses only the embedding model to select and rerank the results.This search_type is semantic.
BM25 is the classical type of search index, it uses the BM25 ranking function to determine the results that are most similar to your given query.This search_type is bm25.
Hybrid search, does both a full text search, and semantic search. From those results it then uses a reranker model ( defaults to bge-reranker-large).This search_type is hybrid.
We offer three different search strategies for you to choose from:
Search over chunks: This strategy allows you to search all of your chunks independently. This is useful when your chunks are independent and do not need to be grouped together.
Search within groups: This strategy lets you constrain your results to within a selected group. This is useful for searching distinct groups within your dataset independently.
Search over groups: This strategy allows you to search over the groups of chunks within your dataset. This returns the groups and the top chunks within each group that matched your query, providing better search quality for datasets with highly related chunks within groups.
MultiQuery provides a way to give multiple query objects with a given weight bias.To use the multiquery, instead of a single string, the query parameter receives a list of tuples,
value 1 being the query and value 2 being a value on how important it is.As an example, search
Searching, but the search term of “iphone” and a color.
Trieve offers many ways to customize your embedding models and reranker models. Different embedding models and different reranker models are better suited for different tasks.
Trieve supports multiple embedding models that can be used to search over your data.
You can specify the embedding model to use in the server_configuration field when creating a dataset.
After creating a dataset, you cannot change the embedding model. If you need to change the embedding model, you must create a new dataset.
Trieve supports multiple reranker models that can be used to rerank the search results.Currently, Trieve supports the BAAI bge-reranker-large model, AIMon’s aimon-rerank model, and Cohere’s rerank-v3.5 model.
bge-reranker-large is a model by the Beijing Academy of Artificial Intelligence (BAAI) and is hosted by Trieve. This model does not require any additional configuration and will be used by default on all hybrid searches.To manually select the bge-reranker-large as your reranker model, make a request to the update dataset route with the following parameters:
curl --request POST \ --url https://api.trieve.ai/api/dataset \ --header 'Authorization: <api-key>' \ --header 'Content-Type: application/json' \ --header 'TR-Organization: <tr-organization>' \ --data '{ "dataset_name": "New Dataset", // Replace with a name for your dataset "organization_id": "********-****-****-****-************", // Update with the desired configurations for your dataset "server_configuration": { "RERANKER_MODEL_NAME":"bge-reranker-large" }}'
aimon-rerank is a model hosted by AIMon. To use this model, you must provide the aimon_api_key in the server_configuration field when creating a dataset.To switch your reranker model to AIMon’s aimon-rerank, make a request to the update dataset route with the following parameters:
curl --request POST \ --url https://api.trieve.ai/api/dataset \ --header 'Authorization: <api-key>' \ --header 'Content-Type: application/json' \ --header 'TR-Organization: <tr-organization>' \ --data '{ "dataset_name": "New Dataset", // Replace with a name for your dataset "organization_id": "********-****-****-****-************", // Update with the desired configurations for your dataset "server_configuration": { "RERANKER_BASE_URL":"https://pbe-api.aimon.ai/v1/rerank-icl", "RERANKER_MODEL_NAME":"aimon-rerank", "RERANKER_API_KEY":"<aimon_api_key>", "AIMON_RERANKER_TASK_DEFINITION": "<a_task_definition>" // A task definition can be used to specify the domain of the context documents for AIMon reranker. // example of a task definition: "Your task is to grade the relevance of context document(s) in the domain of music and arts." }}'
rerank-v3.5 is a model hosted by Cohere. To use this model, you must provide the cohere_api_key in the server_configuration field when creating a dataset.To switch your reranker model to Cohere’s rerank-v3.5, make a request to the update dataset route with the following parameters:
curl --request POST \ --url https://api.trieve.ai/api/dataset \ --header 'Authorization: <api-key>' \ --header 'Content-Type: application/json' \ --header 'TR-Organization: <tr-organization>' \ --data '{ "dataset_name": "New Dataset", // Replace with a name for your dataset "organization_id": "********-****-****-****-************", // Update with the desired configurations for your dataset "server_configuration": { "RERANKER_BASE_URL":"https://api.cohere.com/v2", "RERANKER_MODEL_NAME":"rerank-v3.5" "RERANKER_API_KEY":"<cohere_api_key>" }}'