Can we use llama-index re-ranking on the results of boto3's retrieve function?

0

I want to re-rank my RAG results from AWS Bedrock. But the only example I see as of yet is this : - https://github.com/aws-samples/amazon-bedrock-samples/blob/main/knowledge-bases/features-examples/03-advanced-concepts/reranking/02_kb-reranker.ipynb

this is using sagemaker's reranking model

Let me know if we can use llamaindex's free reranking rather than using sagemaker's re-ranking service.

1 Answer
0

Hello, You can use the following re-ranking models using Amazon Bedrock:

  • Amazon Rerank 1.0
  • Cohere Rerank 3.5

You can use these models directly through the Amazon Bedrock API or with Amazon Bedrock Knowledge Bases. You can find here some updated examples: https://github.com/aws-samples/amazon-bedrock-samples/blob/main/rag/knowledge-bases/features-examples/03-optimizing-accuracy-retrieved-results/re_ranking_using_kb.ipynb

However, you can use LLamaIndex in combination with Amazon Bedrock. Here are some examples on how to combine both tools (they do not cover re-ranking but other features of LlamaIndex) https://aws.amazon.com/blogs/machine-learning/build-powerful-rag-pipelines-with-llamaindex-and-amazon-bedrock/

Hopefully this helps

AWS
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions