- Newest
- Most votes
- Most comments
Hey,
Hope you're keeping well.
The error indicates that rerankingConfiguration is not a supported field within vectorSearchConfiguration for the retrieveAndGenerateConfiguration API in Amazon Bedrock Knowledge Bases. In the current Bedrock API contract, reranking is only available through the standalone Retrieve API when you set retrievalConfiguration.rerankingConfiguration at the top level of the request, not nested inside vectorSearchConfiguration.
Thanks and regards,
Taz
answered a year ago
The issue you're encountering is related to how reranking is configured in Amazon Bedrock Knowledge Bases.
For the RetrieveAndGenerate API, reranking is not configured within the vectorSearchConfiguration parameter as you've attempted. Instead, reranking should be enabled through a setting available in the RetrieveAndGenerate API directly.
For your two-step approach using the Retrieve operation, the structure of your reranking configuration appears incorrect. When using a reranker model with Amazon Bedrock Knowledge Bases, you need to ensure:
-
Your service role has the proper permissions for reranking, specifically the
bedrock:Rerankandbedrock:InvokeModelactions. -
The reranker model you're trying to use (Cohere Rerank 3.5) is available in your region. This model is available in US West (Oregon), Canada (Central), Europe (Frankfurt), and Asia Pacific (Tokyo). If you're in US East (N. Virginia), you should check if this specific model is available there.
-
The correct syntax is used for the API call. The error message suggests that "rerankingConfiguration" is not a valid parameter within vectorSearchConfiguration.
To use reranking with Amazon Bedrock Knowledge Bases, make sure you're using the latest SDK version and check the documentation for the exact parameter structure required for enabling reranking in the Retrieve or RetrieveAndGenerate operations.
Remember that reranking models help prioritize the most relevant content from your retrieved documents, ensuring that the most useful information is sent to the foundation model for response generation.
Sources
Improve the relevance of query responses with a reranker model in Amazon Bedrock - Amazon Bedrock
Amazon Bedrock now supports Rerank API to improve accuracy of RAG applications - AWS
Permissions for reranking in Amazon Bedrock - Amazon Bedrock
answered a year ago
Relevant content
asked 2 years ago
asked 3 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago

Hi Taz, Thanks for your quick response! We followed your recommendation and used retrievalConfiguration.rerankingConfiguration at the top level of the request as below. But, it still doesn't work.
Version 1 - Request: request_payload = { "input": { "text": prompt }, "retrieveAndGenerateConfiguration": { "type": "KNOWLEDGE_BASE", "knowledgeBaseConfiguration": { "knowledgeBaseId": kb_id, "modelArn": "arn:aws:bedrock:us-east-1:029309145300:inference-profile/us.anthropic.claude-sonnet-4-5-20250929-v1:0", "retrievalConfiguration": { "vectorSearchConfiguration": { "numberOfResults": 10, "overrideSearchType": "HYBRID" }, "rerankingConfiguration": { "type": "BEDROCK_RERANKING_MODEL", "bedrockRerankingConfiguration": { "modelConfiguration": { "modelArn": "arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0" }, "numberOfRerankedResults": 5 } } } } } }
Error: Error calling RDS Knowledge Base: Parameter validation failed: Unknown parameter in retrieveAndGenerateConfiguration.knowledgeBaseConfiguration.retrievalConfiguration: "rerankingConfiguration", must be one of: vectorSearchConfiguration
Version 2 - Request (using bedrock_agent_client.retrieve):
retrieve_response = bedrock_agent_client.retrieve( knowledgeBaseId=kb_id, retrievalQuery={ "text": prompt }, retrievalConfiguration={ "vectorSearchConfiguration": { "numberOfResults": 20 }, "rerankingConfiguration": { "type": "BEDROCK_RERANKING_MODEL", "bedrockRerankingConfiguration": { "numberOfResults": 5, "modelConfiguration": { "modelArn": "arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0" } } } } )
Error: Error calling RDS Knowledge Base: Parameter validation failed: Unknown parameter in retrievalConfiguration: "rerankingConfiguration", must be one of: vectorSearchConfiguration
Version 3 (reranking outside of retrieveAndGenerateConfiguration): request_payload = { "retrieveAndGenerateConfiguration": { "type": "KNOWLEDGE_BASE", "knowledgeBaseConfiguration": { "knowledgeBaseId": kb_id, "modelArn": "arn:aws:bedrock:us-east-1:029309145300:inference-profile/us.anthropic.claude-sonnet-4-5-20250929-v1:0", "retrievalConfiguration": { "vectorSearchConfiguration": { "numberOfResults": 10 } } } }, "rerankingConfiguration": { "type": "BEDROCK", "bedrockRerankingConfiguration": { "modelConfiguration": { "modelArn": "arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0" }, "numberOfResults": 3 } } }
Error: Error calling RDS Knowledge Base: Parameter validation failed: Missing required parameter in input: "input" Unknown parameter in input: "rerankingConfiguration", must be one of: input, retrieveAndGenerateConfiguration, sessionConfiguration, sessionId
Hope you will be able to help!
Thanks in advance!