Roadmap: Composable Deterministic Reranking

Gap statement: one fixed fusion step where competitors ship a configurable ranking pipeline

Wikantik's bundle assembly fuses BM25 and dense candidates with Reciprocal Rank Fusion and stops. There is no diversity stage, no metadata/business-rule boosting, and no principled result cutoff. The project has correctly measured and rejected LLM-based reranking — this brief is explicitly about deterministic stages, which are cheap, debuggable, and absent.

Market grounding: Vectara's chain reranker sets the composability bar

Current Wikantik state

Proposed direction

  1. Post-fusion rerank stage SPI in bundle assembly: an ordered list of deterministic RerankStage implementations, config-driven (wikantik.bundle.rerank.chain=mmr,metadata-boost,knee), each with per-stage cutoff/limit semantics.
  2. Stage 1 — MMR diversity: penalize near-duplicate sections (cosine similarity over already-computed chunk embeddings) so the top-12 covers more distinct ground. Directly addresses the sibling-page crowding failure mode seen in retrieval verification.
  3. Stage 2 — metadata boosts: bounded multiplicative boosts from frontmatter — verified/authoritative up, stale-cited down, optional recency. Fixed signal set first; a user-defined expression language only if a real tenant asks.
  4. Stage 3 — knee cutoff: replace the fixed top-12 with a score-elbow cut, letting thin queries return fewer, denser sections (also sharpens the coverage signal).

Phase 1 scope and acceptance criteria

First session scope: the RerankStage SPI (contract in wikantik-api, wiring at the BundleServiceWiring seam) + the MMR stage behind its flag + one harness run. Metadata-boost and knee stages are separate sessions, each gated the same way.

A stage is accepted only when all four hold:

  1. Flag-off is byte-identical: with the stage disabled, bundle output is unchanged (regression suite green) — the SPI itself must be a provable no-op.
  2. No recall regression: overall section recall@12 stays ≥ 0.74 on eval/bundle-corpus with the stage on.
  3. The stage's own metric moves: for MMR, a diversity measure (distinct-page count or intra-bundle redundancy in the top-12) improves; for metadata-boost, verified/authoritative sections rank above equally-scored stale ones on a constructed test set; for knee, thin queries return fewer sections without losing gold ones.
  4. Latency stays negligible: p95 bundle-assembly delta under ~20 ms at k=300 candidates.

A stage that fails gate 2 or 3 is rejected and recorded in the dead-levers list — the 0.74→0.68 enrichment regression is the standing proof that plausible changes hurt.

Verify before designing on these

Non-goals

Investigation starting points

See Also