feat(gateway): stadio rerank con catena di fallback resiliente (frigate→brain)
- gateway/rerank.py: catena da RERANK_CHAIN (JSON, per-nodo key+timeout),
cooldown 60s sui nodi falliti, score sigmoide [0,1], degrada con grazia
all'ordine di fusione se tutti i nodi sono giù
- routes: /v1/memories:search applica il rerank post-fusione (fetch esteso a
RERANK_CANDIDATES), risposta con rerank{used,backend,took_ms}, flag
per-query rerank=false; /v1/version espone lo stato rerank
- store: search() accetta limit esteso; models: SearchIn.rerank
- metrics: qmem_rerank_calls_total + durata per backend
- test: 10 nuovi (fallback, cooldown, degradazione, integrazione) — 46 pass
This commit is contained in:
@@ -18,6 +18,7 @@ from qdrant_client.http import models as qm
|
||||
import cleanup
|
||||
import embed as embedding
|
||||
import metrics
|
||||
import rerank
|
||||
import state
|
||||
from config import (
|
||||
COLLECTION,
|
||||
@@ -80,6 +81,7 @@ async def _lifespan(_app: FastAPI):
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
await embedding.close_http()
|
||||
await rerank.close_http()
|
||||
|
||||
|
||||
app = FastAPI(title="Memory Gateway", version=GATEWAY_VERSION, lifespan=_lifespan)
|
||||
|
||||
Reference in New Issue
Block a user