BLAgent: Agentic RAG for File-Level Bug Localization
On the map: Retrieval-augmented generation → RAG for code
also in 1 more
Abstract (arXiv)
Bug localization remains a key bottleneck for large language model (LLM)-based software maintenance, where accurately identifying faulty code is essential for debugging, root cause analysis, triage, and automated program repair (APR). File-level bug localization is especially critical in hierarchical localization and repair pipelines, where incorrect file selection can propagate to downstream stages such as function-level localization and patch generation. While Retrieval-Augmented Generation (RAG) offers a promising way to ground LLMs in repository context, existing RAG pipelines often rely on static retrieval and lack the reasoning needed to accurately identify faulty code. In this work, we present BLAgent, a novel agentic RAG framework for file-level bug localization that integrates three key ideas: (i) code structure-aware repository encoding with path-augmented AST-based chunking, (ii) dual-perspective query transformation that captures both structural and behavioral signals from bug reports, and (iii) two-phase agentic reranking that combines symbolic inspection with evidence-grounded reasoning. Unlike prior graph-based or multi-hop agentic approaches, BLAgent adopts a bounded reasoning strategy that limits LLM-based inspection and reranking to a compact, retrieval-filtered set of candidate files, avoiding open-ended repository traversal. This design balances localization accuracy with computational cost. On SWE-bench-Lite, BLAgent attains over 78% Top-1 accuracy with open-source models and over 86% with a closed-source model, while being over 18x cheaper than the strongest baseline using the same model. When integrated into an APR framework, BLAgent improves end-to-end repair success by up to 25%.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 43 of its 70 references that are in the map. First posted on arXiv 18 May 2026.
Builds on
43 of 70 references.
Closest ancestors · 4
Same direction, newest first
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct
- 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation2 Sep
- 2025cAST: Enhancing Code Retrieval-Augmented Generation with Structural Chunking via Abstract Syntax Tree18 Jun
- 2021Retrieval Augmented Code Generation and Summarization26 Aug
Other references · 39
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,509
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,601
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 1,002
- 2016Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphscited by 861
- 2024Large Language Model based Multi-Agents: A Survey of Progress and Challengescited by 769
- 2024A Survey on the Memory Mechanism of Large Language Model based Agentscited by 634
27 more
- 2024Understanding the planning of LLM agents: A surveycited by 421
- 2024AutoCodeRover: Autonomous Program Improvementcited by 278
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 232
- 2024RQ-RAG: Learning to Refine Queries for Retrieval Augmented Generationcited by 147
- 2025LocAgent: Graph-Guided LLM Agents for Code Localizationcited by 86
- 2022Coder Reviewer Reranking for Code Generationcited by 84
- 2024Blended RAG: Improving RAG (Retriever-Augmented Generation) Accuracy with Semantic Search and Hybrid Query-Based Retrieverscited by 84
- 2022Automated Repair of Programs from Large Language Modelscited by 71
- 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
- 2019TBar: Revisiting Template-based Automated Program Repaircited by 65
- 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Explorationcited by 58
- 2023A Quantitative and Qualitative Evaluation of LLM-Based Explainable Fault Localizationcited by 50
- 2024AgentFL: Scaling LLM-based Fault Localization to Project-Level Contextcited by 47
- 2024Is Semantic Chunking Worth the Computational Cost?cited by 43
- 2023Conversational Automated Program Repaircited by 41
- 2024A Systematic Literature Review on Large Language Models for Automated Program Repaircited by 37
- 2024LLMParser: An Exploratory Study on Using Large Language Models for Log Parsingcited by 32
- 2023Large Language Models in Fault Localisationcited by 28
- 2024DMQR-RAG: Diverse Multi-Query Rewriting for RAGcited by 27
- 2025A Survey of LLM-based Automated Program Repair: Taxonomies, Design Paradigms, and Applicationscited by 25
- 2023Decomposing Complex Queries for Tip-of-the-tongue Retrievalcited by 24
- 2024Hybrid Automated Program Repair by Combining Large Language Models and Program Analysiscited by 22
- 2025Bridging Bug Localization and Issue Fixing: A Hierarchical Localization Framework Leveraging Large Language Modelscited by 11
- 2025When Deep Learning Meets Information Retrieval-based Bug Localization: A Surveycited by 6
- 2025Improved IR-based Bug Localization with Intelligent Relevance Feedbackcited by 5
- 2025The Impact of Fine-tuning Large Language Models on Automated Program Repaircited by 3
- 2024Enhancing IR-based Fault Localization using Large Language Modelscited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Reformulate, Retrieve, Localize: Agents for Repository-Level Bug Localization
- 2026Retrieval-Oriented Code Representations in Agentic Bug Localization
- 2025Meta-RAG on Large Codebases Using Code Summarization
- 2026ARISE: A Repository-level Graph Representation and Toolset for Agentic Program Repair and Fault Localization
- 2026RGFL: Reasoning Guided Fault Localization for Automated Program Repair Using Large Language Models
- 2026Multi-Perspective Agentic Program Repair via Code Property Graphs and Temporal Execution Graphs
- 2024An Empirical Study on LLM-based Agents for Automated Bug Fixing
- 2026Multi-task LLMs for Bug Classification: Efficient Inference with Auxiliary Decoding Heads