How it works
When a recommendation request hits the console proxy (/api/recommendations), the proxy:
- Looks up the rerank configuration for the requested context.
- Resolves the final controls by checking global defaults, surface presets, and any request-level overrides.
- Injects the resolved
surface,rerank_mode, andrerank_depthparameters into the upstream API Gateway request. - Returns the upstream response annotated with
applied_controlsso you can see exactly what was applied.
Configure in the console
- Navigate to Console > Configuration > Rerank Controls.
- Click a context row to open the editor.
- Set the Global Default — the baseline mode and depth applied when no surface-specific preset matches.
- Optionally configure Surface Presets to override behaviour for
search,results, orrecommendationssurfaces independently. - Save your changes.
Global defaults
| Field | Description |
|---|---|
| Default Surface | The surface assumed when the caller does not specify one. |
| Rerank Mode | off (no reranking), balanced (moderate), or aggressive (strong personalisation, higher latency). |
| Rerank Depth | Number of candidates to rerank. Higher values improve quality at the cost of latency. |
Surface presets
Each surface (search, results, recommendations) can override the global mode and depth. Surfaces that match the global default show as “inheriting” in the UI.
Request-level overrides
Callers can passsurface, rerank_mode, and rerank_depth as query parameters. The proxy validates these against allowed values and clamps depth to the configured maximum.
Feature flags and kill switch
Rerank controls support staged rollouts via environment variables:| Variable | Description |
|---|---|
RERANK_CONTROLS_STAGE | off, internal, canary, or general. Controls who receives reranking. |
RERANK_KILL_SWITCH | Set to true to immediately disable all reranking. |
RERANK_MAX_DEPTH | Hard ceiling for rerank depth across all contexts. |
RERANK_INTERNAL_TEAM_IDS | Comma-separated team IDs allowed during the internal stage. |
off, the proxy returns rerank_mode: off and rerank_depth: 0 regardless of configuration.
Response annotations
Every proxied response includes metadata about the applied controls:source field tells you where the final values came from: global_default, surface_preset, request_override, or kill_switch.
