feat: Add cross-encoder re-ranking after hybrid search (CF-1317)

Add rerank() function calling LiteLLM /v1/rerank endpoint (Cohere-compatible).
Plugged into all 3 search functions (sessions, session-docs, archives) after
RRF merge. Disabled by default via RERANK_ENABLED env var. Graceful fallback
to RRF-only ranking on API failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-02-19 16:36:24 +02:00
parent 0150575713
commit ef74d7912e
5 changed files with 124 additions and 10 deletions

View File

@@ -8,6 +8,10 @@ POSTGRES_PORT=6432
LLM_API_URL=https://api.agiliton.cloud/llm
LLM_API_KEY=your_llm_api_key_here
# Cross-encoder re-ranking (CF-1317)
RERANK_ENABLED=false
RERANK_MODEL=rerank-v3.5
# Jira Cloud (session tracking)
JIRA_URL=https://agiliton.atlassian.net
JIRA_USERNAME=your_email@agiliton.eu