Learn how to improve the relevance of your search and RAG systems with reranking.
query
and a number of documents
, and outputs a relevancy score and ordering index for each document. It can also filter its response to the n most relevant documents.
Together’s Rerank API is also compatible with Cohere Rerank, making it easy to try out our reranker models on your existing applications.
Key features of Together’s Rerank API include:
URL
, API key
and model
.
documents
from most to least relevant to the query What animals can I find near Peru?
.
Request
In this example, the documents being passed in are a list of strings:
rank_fields
, it will default to the text key.
The example below shows passing in some emails, with the query Which pricing did we get from Oracle?
.
Request
documents
parameter, we are passing in a list of objects which have the key values: ['from', 'to', 'date', 'subject', 'text']
. As part of the Rerank call, under rank_fields
we are specifying which keys to rank over, as well as the order in which the key value pairs should be considered. Finally, we’re also setting return_documents
to True since we want to see them in the response.
Response