Guide · Amazon Bedrock · Reranking
MCP Server Bedrock Reranking — Cohere Rerank v3 vs Amazon Rerank 1 model selection
Amazon Bedrock Reranking offers two foundation models: Cohere Rerank v3 Multilingual (cohere.rerank-v3-5:0) and Amazon Rerank 1 (amazon.rerank-v1:0). For most MCP server use cases on English-language corpora, Amazon Rerank 1 is the simpler starting point — no additional model-specific parameters required, good out-of-the-box quality for English technical documentation, and straightforward pricing. Cohere Rerank v3 Multilingual has two distinct advantages: native support for 100+ languages in a single model call, meaning a French query against Spanish documents scores correctly without any translation preprocessing; and a max_chunks_per_doc parameter in additionalModelRequestFields that controls how the model internally splits long documents before scoring — critical when your documents are multi-page and you cannot pre-chunk them. The key trade-off is that Cohere Rerank v3 adds complexity through the metadata configuration system and the additionalModelRequestFields map, while Amazon Rerank 1 works out of the box with no additional parameters. For the base RerankCommand structure see Bedrock Reranking overview; for inline document patterns see inline reranking.
TL;DR
Use amazon.rerank-v1:0 for English-only workloads — simpler, no extra parameters. Use cohere.rerank-v3-5:0 for multilingual corpora or when you need max_chunks_per_doc control for long documents. Both use the same RerankCommand structure; Cohere adds additionalModelRequestFields and optional metadataConfiguration. ARN format: arn:aws:bedrock:REGION::foundation-model/MODEL_ID (double colon before foundation-model).
Model IDs and ARN construction
Both models are accessed via full ARNs in the modelConfiguration.modelArn field. The ARN uses a double colon before foundation-model because there is no account ID in the resource path for public foundation models:
// Amazon Rerank 1 — English-optimized, simplest to use
const AMAZON_RERANK_1_USE1 =
"arn:aws:bedrock:us-east-1::foundation-model/amazon.rerank-v1:0";
const AMAZON_RERANK_1_USW2 =
"arn:aws:bedrock:us-west-2::foundation-model/amazon.rerank-v1:0";
// Cohere Rerank v3 Multilingual — 100+ languages, max_chunks_per_doc
const COHERE_RERANK_V3_USE1 =
"arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0";
const COHERE_RERANK_V3_USW2 =
"arn:aws:bedrock:us-west-2::foundation-model/cohere.rerank-v3-5:0";
// Environment-driven ARN selection
function selectRerankModel(
region: string,
useCohere: boolean = false
): string {
const modelId = useCohere
? "cohere.rerank-v3-5:0"
: "amazon.rerank-v1:0";
return `arn:aws:bedrock:${region}::foundation-model/${modelId}`;
}
const MODEL_ARN = selectRerankModel(
process.env.AWS_REGION ?? "us-east-1",
process.env.USE_COHERE_RERANK === "true"
);
The cohere.rerank-v3-5:0 model ID includes "v3-5" because it corresponds to Cohere's Rerank 3.5 (a refinement of Rerank v3). The :0 suffix is Bedrock's version qualifier, not Cohere's version number. Amazon Rerank 1's model ID is simply amazon.rerank-v1:0. Note that these model IDs are only valid in regions where the model is deployed — attempting to use a Cohere model in a region where Cohere hasn't been activated returns a ResourceNotFoundException.
Using Amazon Rerank 1
Amazon Rerank 1 requires no model-specific parameters beyond the ARN. The minimal configuration:
import {
BedrockAgentRuntimeClient,
RerankCommand,
} from "@aws-sdk/client-bedrock-agent-runtime";
const client = new BedrockAgentRuntimeClient({ region: "us-east-1" });
const AMAZON_RERANK_ARN =
"arn:aws:bedrock:us-east-1::foundation-model/amazon.rerank-v1:0";
async function rerankWithAmazonRerank(
query: string,
documents: Array<{ id: string; text: string }>,
topN: number = 5
) {
if (documents.length === 0) return [];
const response = await client.send(
new RerankCommand({
rerankingConfiguration: {
type: "BEDROCK_RERANKING_MODEL",
bedrockRerankingConfiguration: {
modelConfiguration: {
modelArn: AMAZON_RERANK_ARN,
// No additionalModelRequestFields needed for Amazon Rerank 1
},
numberOfResults: Math.min(topN, documents.length),
// metadataConfiguration is optional — omit unless filtering fields
},
},
sources: documents.map((doc) => ({
type: "INLINE",
inlineDocumentSource: {
type: "TEXT",
textDocument: { text: doc.text },
},
})),
query: {
type: "TEXT",
textQuery: { text: query },
},
})
);
return (response.rerankingResults ?? []).map((r) => ({
document: documents[r.index!],
score: r.relevanceScore ?? 0,
}));
}
Amazon Rerank 1 is a strong default for English corpora — technical documentation, code comments, support tickets, structured knowledge bases. It performs particularly well on domain-specific English text because it was trained on a broad English-language dataset. If your MCP server exclusively handles English queries against English documents, Amazon Rerank 1 covers most production scenarios without any additional configuration.
Using Cohere Rerank v3 Multilingual
Cohere Rerank v3 accepts the same base RerankCommand structure as Amazon Rerank 1, but adds two optional extensions: additionalModelRequestFields for model-specific parameters like max_chunks_per_doc, and metadataConfiguration for controlling which document fields are used during scoring. The basic setup:
const COHERE_RERANK_ARN =
"arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0";
async function rerankWithCohere(
query: string,
documents: Array<{ id: string; text: string }>,
topN: number = 5,
maxChunksPerDoc: number = 10
) {
if (documents.length === 0) return [];
const response = await client.send(
new RerankCommand({
rerankingConfiguration: {
type: "BEDROCK_RERANKING_MODEL",
bedrockRerankingConfiguration: {
modelConfiguration: {
modelArn: COHERE_RERANK_ARN,
additionalModelRequestFields: {
// Cohere-specific: how many chunks to split long documents into
// before scoring. Higher = more thorough but slower.
max_chunks_per_doc: maxChunksPerDoc,
},
},
numberOfResults: Math.min(topN, documents.length),
},
},
sources: documents.map((doc) => ({
type: "INLINE",
inlineDocumentSource: {
type: "TEXT",
textDocument: { text: doc.text },
},
})),
query: {
type: "TEXT",
textQuery: { text: query },
},
})
);
return (response.rerankingResults ?? []).map((r) => ({
document: documents[r.index!],
score: r.relevanceScore ?? 0,
}));
}
The max_chunks_per_doc value controls how many segments Cohere internally divides each document into. The default (when omitted) is model-dependent — typically around 10. Setting it to 1 treats the entire document as a single scoring unit, which is faster but misses relevant passages in long documents. Setting it higher (20–50) allows Cohere to find relevant passages deep in multi-page documents but increases scoring time proportionally. For pre-chunked documents of 500–1000 tokens, the default is fine. For full-page or multi-page documents, increase it to 20 or 30.
Multilingual queries and cross-lingual reranking
Cohere Rerank v3 Multilingual is specifically designed for queries and documents in different languages, or for corpora that mix multiple languages. The model understands semantic relevance across language boundaries without requiring translation:
// Cross-lingual reranking: French query against English and Spanish documents
const mixedLanguageDocs = [
{ id: "en-1", text: "The Eiffel Tower is located in Paris, France, built in 1889." },
{ id: "es-1", text: "La Torre Eiffel está situada en París y fue construida en 1889." },
{ id: "de-1", text: "Der Eiffelturm befindet sich in Paris und wurde 1889 erbaut." },
{ id: "en-2", text: "Big Ben is a clock tower in London, United Kingdom." },
{ id: "fr-1", text: "La Tour Eiffel est un monument iconique de Paris, inauguré en 1889." },
];
// French query — Cohere handles this natively without translation
const frenchQuery = "Quelle est l'année de construction de la Tour Eiffel?";
const results = await rerankWithCohere(frenchQuery, mixedLanguageDocs, 3);
// Expected: fr-1, en-1, es-1 at top — all about Eiffel Tower
// en-2 (Big Ben) should score lowest
console.log(results.map((r) => `${r.document.id}: ${r.score.toFixed(3)}`));
// fr-1: 0.923
// en-1: 0.891
// es-1: 0.867
For MCP servers that handle multilingual user queries — documentation assistants for global teams, customer support tools for multinational companies, research tools with multilingual literature — Cohere Rerank v3 eliminates a translation preprocessing step that would otherwise add latency and cost. The model's internal cross-lingual representation space handles semantic alignment between languages directly.
Amazon Rerank 1 handles non-English documents with declining quality as distance from English increases. For Spanish and French (high-resource European languages), it performs acceptably. For Japanese, Arabic, Korean, or low-resource languages, the quality drop is significant enough to warrant switching to Cohere Rerank v3.
Metadata configuration for structured JSON documents
When reranking JSON inline documents, the metadataConfiguration option controls which fields in the JSON structure the reranker considers during scoring. By default (selectionMode: "ALL"), all fields are used. With selectionMode: "SELECTIVE", you can include or exclude specific fields:
// Selective metadata: only use "title" and "body" fields for scoring
// Exclude "url", "author", "date" — these are metadata, not content
const response = await client.send(
new RerankCommand({
rerankingConfiguration: {
type: "BEDROCK_RERANKING_MODEL",
bedrockRerankingConfiguration: {
modelConfiguration: {
modelArn: COHERE_RERANK_ARN,
},
numberOfResults: 5,
metadataConfiguration: {
selectionMode: "SELECTIVE",
selectiveModeConfiguration: {
fieldsToInclude: [
{ fieldName: "title" },
{ fieldName: "body" },
],
// Alternatively, use fieldsToExclude for a denylist approach:
// fieldsToExclude: [
// { fieldName: "url" },
// { fieldName: "author" },
// ],
},
},
},
},
sources: documents.map((doc) => ({
type: "INLINE",
inlineDocumentSource: {
type: "JSON",
jsonDocument: {
data: {
title: doc.title,
body: doc.body,
url: doc.url, // present but excluded from scoring
author: doc.author, // present but excluded from scoring
date: doc.date, // present but excluded from scoring
},
},
},
})),
query: {
type: "TEXT",
textQuery: { text: query },
},
})
);
// The URL, author, and date fields travel with the document
// but do not influence the relevance score calculation
Metadata configuration is particularly useful when your documents contain fields that should be retrievable by the caller but should not influence scoring — URL, author name, timestamp, category tags. Including those fields in scoring can confuse the reranker when query terms happen to match metadata values (e.g., a query for "john" matching an author named "John Smith" and elevating irrelevant documents). The selective mode lets you carry metadata along without polluting the scoring signal.
The metadataConfiguration field applies to both Amazon Rerank 1 and Cohere Rerank v3, but it only has an effect when sources use the JSON type — it has no effect on TEXT sources where there are no named fields to select.
Latency and throughput comparison
Both models are hosted on Amazon infrastructure and subject to Bedrock's throughput quotas. Practical latency depends on the number of source documents and their length. For a 20-document set of ~500-token chunks, typical observed latencies in us-east-1:
// Latency benchmarking helper
async function benchmarkReranker(
query: string,
docs: Array<{ id: string; text: string }>,
modelArn: string,
iterations: number = 5
): Promise<{ p50Ms: number; p95Ms: number }> {
const latencies: number[] = [];
for (let i = 0; i < iterations; i++) {
const start = Date.now();
await client.send(
new RerankCommand({
rerankingConfiguration: {
type: "BEDROCK_RERANKING_MODEL",
bedrockRerankingConfiguration: {
modelConfiguration: { modelArn },
numberOfResults: 5,
},
},
sources: docs.map((d) => ({
type: "INLINE",
inlineDocumentSource: {
type: "TEXT",
textDocument: { text: d.text },
},
})),
query: { type: "TEXT", textQuery: { text: query } },
})
);
latencies.push(Date.now() - start);
}
latencies.sort((a, b) => a - b);
return {
p50Ms: latencies[Math.floor(latencies.length * 0.5)],
p95Ms: latencies[Math.floor(latencies.length * 0.95)],
};
}
// Typical results for 20 docs × 500 tokens in us-east-1:
// Amazon Rerank 1: p50=~250ms, p95=~600ms
// Cohere Rerank v3: p50=~300ms, p95=~700ms
// Both increase roughly linearly with doc count and length
Amazon Rerank 1 is marginally faster than Cohere Rerank v3 for most workloads — the difference is typically under 100ms for a 20-document batch. For latency-sensitive MCP tools, run your own benchmark on representative query and document sizes rather than relying on general estimates, since latency is sensitive to document length and regional factors.
Both models have lower throughput quotas than generation models. If your MCP server handles high concurrent traffic, request a quota increase from the Bedrock console under Service Quotas → Amazon Bedrock → Rerank requests per minute.
Switching models dynamically by query language
For MCP servers deployed to global audiences, a lightweight language detection step before reranking lets you route to the right model per query without paying Cohere Rerank v3 rates for English-only queries:
// Simple language detection based on unicode block coverage
// For production, use a proper library like franc or langdetect
function isLikelyEnglish(text: string): boolean {
// Rough heuristic: >95% ASCII characters suggests English
const asciiCount = [...text].filter((c) => c.charCodeAt(0) < 128).length;
return asciiCount / text.length > 0.95;
}
async function adaptiveRerank(
query: string,
documents: Array<{ id: string; text: string }>,
topN: number = 5
) {
const region = process.env.AWS_REGION ?? "us-east-1";
const modelId = isLikelyEnglish(query)
? "amazon.rerank-v1:0"
: "cohere.rerank-v3-5:0";
const modelArn = `arn:aws:bedrock:${region}::foundation-model/${modelId}`;
const response = await client.send(
new RerankCommand({
rerankingConfiguration: {
type: "BEDROCK_RERANKING_MODEL",
bedrockRerankingConfiguration: {
modelConfiguration: { modelArn },
numberOfResults: Math.min(topN, documents.length),
},
},
sources: documents.map((doc) => ({
type: "INLINE",
inlineDocumentSource: {
type: "TEXT",
textDocument: { text: doc.text },
},
})),
query: { type: "TEXT", textQuery: { text: query } },
})
);
return (response.rerankingResults ?? []).map((r) => ({
document: documents[r.index!],
score: r.relevanceScore ?? 0,
modelUsed: modelId,
}));
}
The heuristic above (ASCII character ratio) is a rough proxy for English detection — good enough for routing between models but not suitable for user-facing language labels. For production language detection, use a dedicated library or Bedrock's translation API to identify the language before routing. The result includes modelUsed so the caller can log which model handled each request, useful for debugging scoring discrepancies.
Model comparison summary
Choosing between the two reranking models in Bedrock comes down to corpus language and document structure:
// Decision matrix as code comments for easy reference
// Use AMAZON_RERANK_1 when:
// - corpus is English-only
// - documents are pre-chunked (500-1000 tokens)
// - no model-specific parameters needed
// - minimal configuration desired
// - slightly lower latency preferred
// Use COHERE_RERANK_V3 when:
// - queries or documents in multiple languages (100+ supported)
// - cross-lingual query matching needed (French query vs English docs)
// - long documents (multi-page) where max_chunks_per_doc helps
// - JSON documents where metadataConfiguration field filtering matters
// - Cohere's scoring behavior is already characterized in your domain
// In both cases:
// - Same RerankCommand structure
// - Same response format (index + relevanceScore)
// - Same IAM permission required (bedrock:Rerank)
// - Same regional availability constraints
// - Thresholds need separate calibration per model (scores not cross-compatible)
The fact that both models share the same API surface means you can switch between them by changing a single ARN string. The transition risk is primarily the threshold calibration — your 0.3 threshold for Amazon Rerank 1 may need adjustment when switching to Cohere Rerank v3, because the two models produce different score distributions for the same documents. Run a calibration pass on 50–100 representative query-document pairs to find the equivalent threshold before switching in production.
IAM permissions for both models
Both models require the same IAM action but different resource ARNs. If your MCP server uses both (via the adaptive routing pattern above), include both model ARNs in the IAM policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["bedrock:Rerank"],
"Resource": [
"arn:aws:bedrock:us-east-1::foundation-model/amazon.rerank-v1:0",
"arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0",
"arn:aws:bedrock:us-west-2::foundation-model/amazon.rerank-v1:0",
"arn:aws:bedrock:us-west-2::foundation-model/cohere.rerank-v3-5:0"
]
}
]
}
The bedrock:Rerank action is distinct from bedrock:InvokeModel — you cannot substitute one for the other. If the IAM policy only has bedrock:InvokeModel, calling RerankCommand returns an AccessDeniedException. Add both actions if your MCP server uses both generation and reranking in the same Lambda or ECS task role.
Production gotchas
Scores are not portable between models
A relevance score of 0.6 from Amazon Rerank 1 is not equivalent to a score of 0.6 from Cohere Rerank v3 Multilingual. The models use different internal calibrations. Never compare raw scores from two different models or apply the same threshold without recalibration. If you log scores, also log the model ARN so you can segment analysis by model.
additionalModelRequestFields is silently ignored by Amazon Rerank 1
Amazon Rerank 1 does not recognize additionalModelRequestFields. If you pass max_chunks_per_doc or other Cohere-specific fields when using Amazon Rerank 1, the API does not throw — it silently ignores the unrecognized fields. This can mislead developers who test with one model ARN and deploy with another; always validate that model-specific parameters are intentional for the model in use.
Cohere Rerank v3 model access requires a Cohere subscription check
Some Bedrock regions require you to explicitly subscribe to third-party model providers (Cohere, Anthropic, etc.) through the Bedrock Model Access console before using their models. If Cohere Rerank v3 returns an AccessDeniedException even with correct IAM policies, check the Bedrock console under "Model access" and request access to Cohere models in that region.
Both models share throughput quotas within the reranking API
Bedrock Reranking has a shared throughput quota across both models (not a separate quota per model). Throttling is managed at the API level, not the model level. If you use both models in the same account for high-traffic workloads, their combined load counts against one quota. Request a quota increase in Service Quotas if you anticipate concurrent reranking from multiple MCP server deployments in the same account.
Monitor your MCP server reranking tools with AliveMCP
AliveMCP monitors MCP server endpoints and surfaces model-level errors — including reranking API throttling and access exceptions — so you know which model in your RAG pipeline is causing latency or failures.
Start free monitoring