Code Review Retrieval Explained: Simple Semantic and Keyword Search with Portable Reranking
Short answer: combine lexical and embedding candidates, fuse ranks rather than raw scores, rerank only a small merged set, and refuse to produce a code-review finding unless the final evidence still points to an accessible, current policy passage. This costs more latency than a single search, but it protects the exact identifiers that semantic retrieval tends to blur while keeping the retrieval…
The brief explains a retrieval system for code reviews that combines lexical and embedding-based search methods. It emphasizes the importance of preserving evidence, such as document identity, chunk identity, revision, access scope, rank, and short excerpts, to ensure the findings are actionable and verifiable. The retrieval process involves two independent candidate generators, which are merged using reciprocal rank fusion (RRF) to create a bounded pool of candidates, which is then reranked against the proposed code change and review question.
The system also stresses the need for tenant and repository authorization before any search takes place, and validates evidence at various stages to ensure accurate and reliable results.
Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.