Skip to documentation

Lens

Reranking

Hybrid retrieval fuses full-text and vector results by rank position(RRF) — it never scores a chunk's text against the query. A cross-encoder reranker is the second stage that does: it reads each (query, chunk) pair jointly and returns a calibrated relevance score, and the retrieval pipeline re-sorts the candidate pool by it. This is the single highest-leverage precision upgrade in the pipeline, and it is a pluggable adapter — Voyage, Cohere, a self-hosted open model, or a no-op — resolved per workspace from settings and environment.

Reranking is optional and degrades cleanly

With no reranker key configured, the workspace default (auto) resolves to none — the identity passthrough that keeps the fused RRF order — and retrieval works exactly as it does today. A reranker is an upgrade, never a dependency; any adapter error also falls back to the fused order, so a provider outage can slow but never break an answer.

Providers

KindModelAuthLicenseReach for it when
voyagererank-2.5 · -liteVOYAGE_API_KEYCommercial APIThe default when a Voyage key is present — tops the public reranking benchmarks at a competitive per-token price.
coherererank-v3.5COHERE_API_KEYCommercial APIA strong alternative — the auto fallback when only a Cohere key is set, or an explicit pick.
onnx-bgebge-reranker-v2-m3self-hosted (no key)Apache 2.0No data leaves the box — self-host path for air-gapped or cost-sensitive deployments. Requires @huggingface/transformers.
noneidentity passthroughKeep the raw RRF order. The default when no key is configured, and the deterministic setting for reproducible eval runs.

Auto-resolution

The workspace reranker setting defaults to auto, resolved against the live environment at retrieval time (so adding a key takes effect without touching settings):

  1. VOYAGE_API_KEY set → Voyage rerank-2.5 (override to rerank-2.5-lite with ELI_RERANK_MODEL).
  2. else COHERE_API_KEY set → Cohere rerank-v3.5.
  3. else → none (the fused RRF order, no network call).

A workspace can also pin a specific kind — voyage, cohere, onnx-bge, or none — in Settings → Retrieval. If a pinned provider is unavailable (its key is missing, or the self-host dependency is absent), resolution logs one warning and degrades to none rather than failing — retrieval always has a working reranker.

.env — reranker keys (all optional)bash
# Workspace default "auto": Voyage if VOYAGE_API_KEY, else Cohere, else none.
VOYAGE_API_KEY=pa-...             # default reranker (rerank-2.5), commercial
COHERE_API_KEY=...                # fallback reranker (rerank-v3.5), commercial
ELI_RERANK_MODEL=rerank-2.5-lite  # override the Voyage model (vs rerank-2.5)

The self-host path

For deployments where retrieval text must not leave the machine, set the workspace reranker to onnx-bge and install @huggingface/transformers. The adapter lazily loads onnx-community/bge-reranker-v2-m3-ONNX (Apache 2.0) and runs a text-classification pass locally in batches — no API key, no egress. The dependency is not bundled: until it is installed, onnx-bge is unavailable and resolution degrades to none with a logged warning, so selecting it early is harmless.

License guard — no non-commercial weights

The supported reranker set deliberately excludes Jina reranker v3 and zerank-2. Both are CC-BY-NC (non-commercial) and cannot ship in a product distributed for enterprise consulting. The only self-host model wired is bge-reranker-v2-m3 (Apache 2.0). If you extend the adapter set, keep to permissive (MIT/Apache) or commercial-API licenses — the union is a guardrail, not an oversight.

Where reranking is applied

  • Grounded chat & structured query — the pipeline runs default-on, so answers are reranked whenever a real reranker resolves. Toggle it per send in the chat config panel, or per call via the workspace setting.
  • Raw searchGET /api/v1/search stays on the raw primitive for back-compat and cost; pass ?rerank=true to opt one call into a reranked list. See Search & ask.
  • MCPkb_search takes an optional rerank argument (default false), so an agent can opt into reranked chunks when precision matters.

Cost & latency

Reranking adds one network round-trip over the candidate pool (~40 chunks, each truncated to ~2,000 characters before it is sent). The commercial APIs are inexpensive relative to a generation call — Voyage prices per token, Cohere per search unit — but they are not free, which is why raw /search defaults to off and only the answer pipelines rerank by default. Rough guidance:

  • Voyage — the default; rerank-2.5-lite (via ELI_RERANK_MODEL) trades a little quality for lower latency and cost on high-volume workspaces.
  • Cohere — comparable order of magnitude; a good fallback where a Cohere contract already exists.
  • onnx-bge — no per-call fee at all; the cost is local compute (and cold-start model load on first use). Best when volume is high or egress is disallowed.

Confirm current pricing at the provider

Provider pricing changes; treat the above as relative guidance, not quotes. Check Voyage's and Cohere's current rerank pricing pages before sizing a high-volume workspace. Reproducibility caveat: remote rerankers are the only non-deterministic part of retrieval — pin the reranker to none for eval runs that must reproduce byte-for-byte.

Settings

The reranker choice lives in the retrieval bag of workspace settings alongside the other pipeline knobs; inner keys override and clear independently, exactly like policy and chatDefaults:

retrieval settings (defaults shown)json
{
  "retrieval": {
    "reranker": "auto",          // auto | voyage | cohere | onnx-bge | none
    "queryUnderstanding": true,  // 1 judge call: rewrite + sub-queries + filters
    "graphFusion": true,         // GraphRAG local-search expansion
    "tokenBudget": 6000,         // context assembler budget (chars/4 estimate)
    "candidatePool": 40          // width of the pool fed to rerank + assemble
  }
}

See the whole pipeline

Reranking is stage four of five. How it composes with query understanding, graph fusion, and the token-budget assembler — and the degrade paths that keep it optional — is in Retrieval pipeline. To enable and tune it end-to-end, follow Tune retrieval quality.