Retrieval-stack release. Everything is gated and defaults to current behavior — with no new env vars set, search results are byte-identical to 4.4.0.
Highlights
- Cross-encoder reranker (
RERANK_ENABLED) — re-scores the fused candidate pool by reading query and document together. Speaks TEI and Cohere-compatible (Infinity / vLLM / Jina / Cohere / llama.cpp)/rerankshapes, probes at startup, degrades gracefully to fused order on outage. On our private bilingual production corpus it roughly doubled MRR (0.375 → 0.771) and lifted recall@5 to 1.0 — measure yours with the eval harness. - Entity-graph retrieval (
GRAPH_RETRIEVAL_ENABLED) — the entity graph the write path has always maintained finally feeds search: query entities expand one hop over co-occurrence edges and join RRF fusion as a weighted third list. - Weighted RRF (
RRF_VECTOR_WEIGHT/RRF_KEYWORD_WEIGHT) — bias fusion toward semantic or exact matches. - Self-hosted models —
OPENAI_BASE_URLfor local encoders and LLMs (vLLM / Infinity / TEI / llama.cpp),EMBED_QUERY_PREFIX/EMBED_DOC_PREFIXfor instruction-aware encoders, in-place re-embed tooling for encoder swaps,<think>-block stripping +LLM_CHAT_TEMPLATE_KWARGSfor reasoning models. - Opt-in multilingual full-text (
BM25_TSCONFIG=zengram_multi) — accent-folding text-search config for mixed-language corpora, self-healing reindex. - Resilience — an embedding-backend outage degrades search to surviving paths (with honest
degradedmetadata) instead of failing; MCP tool responses are capped with a truncation envelope (BRAIN_MCP_MAX_RESPONSE_CHARS); startup rejects placeholder API keys.
343 tests (was 287). Full details in CHANGELOG.md.