Skip to content

Evaluating Semantic and Quality-Aware Retrieval for Source Code Repositories

Jul 2026 · arXiv.org · Vol abs/2607.09161 · 1 citation · 21 references
Computer Science

TL;DR

Within the reported query set, semantic retrieval was the strongest overall mode, while explicit quality metadata was most useful for explicitly quality-oriented queries.

Abstract

Keyword-based retrieval is limited for source-code repositories when queries are expressed in natural language or concern implementation intent and code quality rather than exact tokens. This study evaluates a prototype retrieval system that combines function-level fragmentation, text-and-code embeddings, ChromaDB vector storage, LLM-derived quality metadata, and four retrieval modes: semantic, quality-filtered, hybrid, and automatic routing. The concrete evaluation uses an educational C-code corpus. The full corpus contains 563 anonymized programmer identifiers and 8,951 C files; a reproducible 10% indexed sample contains 56 programmer identifiers, 847 files, and 3,839 fragments. Across 15 manually judged queries, semantic retrieval achieved nDCG@5 of 0.820, Success@5 of 0.800, and MRR of 0.644. The automatic router selected the expected mode for all 15 queries. In a small manual audit, LLM-derived quality scores were within one point of the manual assessment for 9 of 12 fragments. Within the reported query set, semantic retrieval was the strongest overall mode, while explicit quality metadata was most useful for explicitly quality-oriented queries.

View source

Similar papers

Jul 2026

Retrieval-Oriented Code Representations in Agentic Bug Localization

This work finds that the choice of code representation affects both localization effectiveness and cost, and suggests that code representation should be treated as a first-class design choice in agentic localization pipelines, guided by pipeline stage and cost-accuracy requirements.

Genevieve Caumartin, Tse-Hsun Chen, Diego Elias Costa · 0 citations
Jul 2026

OwlPath: Lossless Knowledge Compression for LLM Bug Repair

OwlPath is presented, an OWL2 reasoning layer atop CodeGraph, a widely used code intelligence platform with 500K+ GitHub stars, offering a unified CLI for structural code retrieval, with lossless knowledge compression.

Bo Zhang, Renke Pan, Huan Chen et al. · 0 citations
Book Open access Jul 2026

CODENS: Transforming Code Changes into Living, Accessible, and Queryable Documentation

Results show that CODENS produces highly relevant and well-grounded answers, while qualitative feedback highlights a remaining challenge in concise, documentation-oriented synthesis.

Abdelhak Kelious, Chyrine Tahri, E. Bardet · 0 citations
Jul 2026

ProjAgent: Procedural Similarity Retrieval for Repository-Level Code Generation

ProjAgent is a repository-level code generation system that introduces procedural similarity as an explicit retrieval signal and decomposes the target function into intermediate reasoning steps and employs an agentic workflow to retrieve repository functions that exhibit similar procedural behavior at each step.

Qi-Hong Chen, Aaron Imani, Iftekhar Ahmed · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.