Remove the Brain search reranker - #1768
Merged
Merged
Conversation
The reranker never actually ran: gbrain's init writes search.reranker.enabled=false for installs keyed the way ours are, and even when force-enabled, the configured openrouter:voyageai model is not on the OpenRouter recipe's rerank allowlist, so every call failed open to RRF order before issuing any request. A 72-query known-item A/B confirmed enabling it changes nothing (0/72 result lists differed; hit@1 68%, hit@5 90%, hit@20 97% on pure hybrid RRF). Make that the explicit contract: the entrypoint disables the reranker per-brain, the inference gateway drops /v1/rerank, the compose bundle stops loading a reranker model nothing calls, and the reranker env plumbing and docs go away. Autocut already no-ops without rerank scores by design.
Contributor
Coolify, the Railway template, and Render still exposed and forwarded R_BRAIN_RERANKER_MODEL, and their READMEs told operators to set a knob the entrypoint now ignores.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
While evaluating whether the reranker earns its keep, we found it has never actually run:
writeNewInstallRerankerDefault) writessearch.reranker.enabled=falseat Brain creation for installs keyed the way ours are (noVOYAGE_API_KEY). Our entrypoint set the reranker model after init but never flippedenabled— itsreranker:boot log line was cosmetic. Verified in the config table of our deployments.openrouter:voyageai/rerank-2.5-liteis not on the OpenRouter recipe's strict rerank model allowlist (Cohere v3.5/4-fast/4-pro + one NVIDIA model), so every call throws pre-HTTP and the fail-open contract silently returns RRF order. Failures land only in an in-container audit JSONL.A 72-query known-item A/B (gold page per query, reranker off vs force-enabled, config restored after) confirmed it: 0/72 result lists changed, and the pure hybrid-RRF baseline everyone has been using all along scores hit@1 68% / hit@5 90% / hit@20 97%, median gold rank 1.
So this PR makes reality the explicit contract instead of an accident. Search behavior is unchanged by construction; autocut already no-ops without rerank scores by design.
What
gbrain config set search.reranker.enabled false— converges pre-existing brains and is immune to upstream mode-bundle default flips (one is planned for September)./v1/rerankfrom the Brain's allowed paths, the rerank upstream branch, and the OpenRouter-only guard; tests updated (rerank path now 403s like any unlisted path).GBRAIN_RERANKER_MODEL/R_BRAIN_RERANKER_MODEL/R_BRAIN_RERANK_UPSTREAM_URL, and thelocal-inferenceInfinity service no longer loadsBAAI/bge-reranker-v2-m3(several GB of RAM for a model nothing calls).If we ever want a real reranker, the path is an allowlisted model (e.g.
openrouter:cohere/rerank-4-fast) or a local upstream — gated on an A/B showing it actually helps.Testing
@roomote/api: 1910 passed (brain-inference suite updated).@roomote/devgbrain-image test, compose security contract validator,bash -non the entrypoint: all pass.docker compose configis pre-existing and unchanged.