Skip to main content

Retrieval

AIMon offers a set of tools that help improve retrieval quality. These tools are intended to be used in conjunction with the AIMon evaluation tools to help you identify and fix issues with your retrieval pipeline. Currently, tools supported are as follows:

  • Domain adaptable re-ranking

Domain Adaptable Re-ranking

Open In Colab

Domain Adaptable Re-ranking is a technique that allows you to customize an AIMon selected re-ranker to your specific domain. This customization can be done by providing a description of the task that the re-ranker is being used for along with a set of examples of query-document pairs that would "teach" the re-ranker on how to rank documents for your specific task. All of this can be done through a simple AIMon API call.

Task Definition

The task definition allows users to specify the domain or objective of the re-ranker, ensuring that context is evaluated based on the intended use case. By providing a structured task definition, users can improve context relevance assessments, enabling more precise ranking of retrieved documents for applications such as summarization, question answering, and retrieval-augmented generation (RAG).

Code Example

from aimon import Client
import os

aimon_client = Client(auth_header="Bearer {}".format(os.getenv("AIMON_API_KEY")))

queries=["What is the capital of France?"],
context_docs=["Paris", "New York"]
scores = aimon_client.retrieval.rerank(
context_docs=context_docs,
queries=queries,
task_definition="Your task is to grade the relevance of context document against a specified user query.",
)
print(scores)
# [[35.25, 15.4375]]