Skip to content

Ranking: cross-encoder reranker over the fused top-N (+ query expansion seam) #28

Description

@samkeen

The deferred fast-follow behind the post-fusion seam: rerank the RRF top-N with a cross-encoder (position-aware blend), caching scores in the already-reserved llm_cache table; query expansion stays off by default behind the same seam. Changes ordering only — never the store or the candidate set. It is store-agnostic (a model-side seam above the index) — no vector-store choice simplifies or blocks it (see planning/research/vector-store-alternatives.md §5).

Scope — reranks b2 search, not b2 similar. The seam is (query, candidate) → scores, so it needs query text and reorders query search results. b2 similar has no query — it is passage↔passage KNN, "near ∖ connected" — so this reranker does not apply to it. The discovery-side ranking levers are the chunker upgrade (#19) and distance-weighting (#20), not this.

Gate on the retrieval eval before building (planning/specs/eval-strategy.md) — never on intuition, and never overstate model quality. RRF is a strong baseline; the reranker buys top-k precision, whose value grows with vault size (semantic near-misses crowd the top past ~1k notes) and is highest when an agent consumes top-1/top-3 without a human eye (the serve adapter, #24). Vault size changes whether that precision is worth it, not the reranker cost (fixed at the top-N it rescores). Measure RRF precision@k / MRR on a representative set first; ship only on a measured gap.

Ref: planning/index-engine.md §5; planning/specs/completed/index-engine-build.md Flow ② + §1.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions