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
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
| Kind | Model | Auth | License | Reach for it when |
|---|---|---|---|---|
| voyage | rerank-2.5 · -lite | VOYAGE_API_KEY | Commercial API | The default when a Voyage key is present — tops the public reranking benchmarks at a competitive per-token price. |
| cohere | rerank-v3.5 | COHERE_API_KEY | Commercial API | A strong alternative — the auto fallback when only a Cohere key is set, or an explicit pick. |
| onnx-bge | bge-reranker-v2-m3 | self-hosted (no key) | Apache 2.0 | No data leaves the box — self-host path for air-gapped or cost-sensitive deployments. Requires @huggingface/transformers. |
| none | identity passthrough | — | — | Keep 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):
VOYAGE_API_KEYset → Voyagererank-2.5(override torerank-2.5-litewithELI_RERANK_MODEL).- else
COHERE_API_KEYset → Coherererank-v3.5. - 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.
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
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 search —
GET /api/v1/searchstays on the raw primitive for back-compat and cost; pass?rerank=trueto opt one call into a reranked list. See Search & ask. - MCP —
kb_searchtakes an optionalrerankargument (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(viaELI_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
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:
See the whole pipeline