Skip to content

fix(reranker): default RERANKING_STRATEGY to adaptive (was slice)

Jérôme Revillard requested to merge fix/reranker-default-adaptive into main

fix(reranker): default RERANKING_STRATEGY to adaptive (was slice)

Inconsistency

The reranker strategy default differed across services:

  • chatqna orchestrator: adaptive (genieai_chatqna.py:146)
  • reranker microservice + reranking wrapper + retriever passthrough: slice

Impact (live trace 366658ab, el-salvador)

el-salvador deployed the reranker microservice with RERANKING_STRATEGY unset, so it fell back to its slice + RERANKER_TOP_N=1 default and sliced 4 retrieved chunks down to 1, starving the LLM context. adaptive (dynamic top-N from score distribution) is the env-template recommendation + the chatqna default.

Fix

Changed the 3 slice defaults to adaptive:

  • genie-ai-overlay/reranker/genieai_tei_reranker.py:45
  • genie-ai-overlay/reranker/genieai_reranking_microservice.py:80
  • genie-ai-overlay/retriever/genieai_retriever_arangodb.py (reranking_strategy passthrough)

Now an unset env → adaptive everywhere (consistent). slice remains opt-in via env.

Tests

Updated test_reranking_strategy_default to expect adaptive; 281 reranker + chatqna + retriever tests pass; ruff clean.

Context

Found by the 3-specialist trace investigation. Sibling: the rag.chunk_count=0 metric bug (!207 (merged), merged) — needed to verify this reranker change's effect in production.

Merge request reports

Loading