mlsanityData to 14 Oct 2026

Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches

arXiv 2510.04905 ↗First posted 6 Oct 2025cs.SE cs.CLcited by 23

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

Recent advances in large language models (LLMs) have significantly improved automated code generation. While existing approaches have achieved strong performance at the function and file levels, real-world software engineering requires reasoning over entire repositories, including cross-file dependencies, evolving execution environments, and global semantic consistency. This challenge has led to the emergence of Repository-Level Code Generation (RLCG), where models must retrieve, organize, and utilize repository-scale context to generate coherent and executable code changes. To address these challenges, Retrieval-Augmented Generation (RAG) has become an increasingly important paradigm for repository-level code intelligence. In this survey, we present a comprehensive review of Retrieval-Augmented Code Generation (RACG), with a particular focus on repository-level approaches. Rather than viewing RACG as a static ``retrieve-then-generate'' pipeline, we characterize it as a coupled and evolving process involving context construction, retrieval optimization, generation, and environment interaction. We organize existing methods through a unified analytical framework spanning retrieval substrate, control regime, and evaluation setting. Based on this framework, we systematically examine retrieval strategies, graph-based and non-graph-based retrieval paradigms, training-driven optimizations, and autonomous agent architectures. We further summarize widely used datasets, benchmarks, and system configurations, and discuss key challenges including scalability, reliability, efficiency, and the necessity boundary between RACG and long-context LLMs. Through this survey, we aim to provide a structured understanding of the rapidly evolving RACG landscape and highlight promising directions for future AI-powered software engineering research.

Key facts. Cited by 23 papers in the map (data through 14 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 128 of its 220 references that are in the map. First posted on arXiv 6 Oct 2025.

Builds on

128 of 220 references.

Closest ancestors · 28

Same direction, newest first

  1. 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completion19 Sep
  2. 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation2 Sep
  3. 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug
  4. 2025SelfRACG: Enabling LLMs to Self-Express and Retrieve for Code Generation25 Jul
  5. 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization25 Jun
  6. 2025cAST: Enhancing Code Retrieval-Augmented Generation with Structural Chunking via Abstract Syntax Tree18 Jun
  7. 2025Across Programming Language Silos: A Study on Cross-Lingual Retrieval-augmented Code Generation4 Jun
  8. 2025RAG or Fine-tuning? A Comparative Study on LCMs-based Code Completion in Industry21 May
  9. 2025ARCS: Agentic Retrieval-Augmented Code Synthesis with Iterative Refinement29 Apr
  10. 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generation14 Apr
  11. 2025RTLRepoCoder: Repository-Level RTL Code Completion through the Combination of Fine-Tuning and Retrieval Augmentation11 Apr
  12. 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar
16 more
  1. 2025When LLMs Meet API Documentation: Can Retrieval Augmentation Aid Code Generation Just as It Helps Developers?19 Mar
  2. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan
  3. 2024PERC: Plan-As-Query Example Retrieval for Underrepresented Code Generation17 Dec
  4. 2024Building A Coding Assistant via the Retrieval-Augmented Language Model21 Oct
  5. 2024Preference-Guided Refactored Tuning for Retrieval Augmented Code Generation24 Sep
  6. 2024RepoGenReflex: Enhancing Repository-Level Code Completion with Verbal Reinforcement and Retrieval-Augmented Generation19 Sep
  7. 2024Retrieval-augmented code completion for local projects using large language models9 Aug
  8. 2024Retrieval-Augmented Code Generation for Situated Action Generation: A Case Study on Minecraft25 Jun
  9. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?20 Jun
  10. 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generation13 May
  11. 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation3 May
  12. 2024FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion2 Apr
  13. 2024Repoformer: Selective Retrieval for Repository-Level Code Completion15 Mar
  14. 2024EVOR: Evolving Retrieval for Code Generation19 Feb
  15. 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair12 Sep
  16. 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar

Other references · 100

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  2. 2021Program Synthesis with Large Language Modelscited by 3,637
  3. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  4. 2023Qwen Technical Reportcited by 3,344
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  6. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
  7. 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
  8. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
  9. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  10. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  11. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  12. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 1,002
38 more
  1. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  2. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  3. 2023StarCoder: may the source be with you!cited by 799
  4. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  5. 2024A Survey on Large Language Models for Code Generationcited by 658
  6. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  7. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  8. 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 452
  9. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  10. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  11. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
  12. 2025WebThinker: Empowering Large Reasoning Models with Deep Research Capabilitycited by 335
  13. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
  14. 2024AutoCodeRover: Autonomous Program Improvementcited by 278
  15. 2024SWE-bench Multimodal: Do AI Systems Generalize to Visual Software Domains?cited by 203
  16. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
  17. 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
  18. 2024LLM-Based Multi-Agent Systems for Software Engineering: Literature Review, Vision and the Road Aheadcited by 155
  19. 2023SMART-LLM: Smart Multi-Agent Robot Task Planning using Large Language Modelscited by 153
  20. 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 140
  21. 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 125
  22. 2023InferFix: End-to-End Program Repair with LLMscited by 114
  23. 2024Jasper and Stella: distillation of SOTA embedding modelscited by 112
  24. 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
  25. 2025A Survey on Code Generation with LLM-based Agentscited by 106
  26. 2023RTLFixer: Automatically Fixing RTL Syntax Errors with Large Language Modelscited by 100
  27. 2024RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graphcited by 91
  28. 2025SWE-Fixer: Training Open-Source LLMs for Effective and Efficient GitHub Issue Resolutioncited by 90
  29. 2025LocAgent: Graph-Guided LLM Agents for Code Localizationcited by 86
  30. 2024Automated Unit Test Improvement using Large Language Models at Metacited by 75
  31. 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 72
  32. 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 65
  33. 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 65
  34. 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
  35. 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Explorationcited by 58
  36. 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolutioncited by 53
  37. 2024Long Code Arena: a Set of Benchmarks for Long-Context Code Modelscited by 50
  38. 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 46

50 most cited of 100 All 100 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 21.

23 papers.

Sort:

By area:

  1. 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generationcited by 8
  2. 2026EET: Experience-Driven Early Termination for Cost-Efficient Software Engineering Agentscited by 7
  3. 2025Agentic Software Issue Resolution with Large Language Models: A Surveycited by 6
  4. 2026Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCPcited by 6
  5. 2026Codified Context: Infrastructure for AI Agents in a Complex Codebasecited by 5
  6. 2026Specification-Based Code-Text-Code Reengineering for LLM-Mediated Software Evolutioncited by 5
  7. 2026Reliable Graph-RAG for Codebases: AST-Derived Graphs vs LLM-Extracted Knowledge Graphscited by 4
  8. 2026Large Language Models for Multilingual Code Intelligence: A Surveycited by 2
  9. 2026Do Papers Tell the Whole Story? A Benchmark and Framework for Uncovering Hidden Implementation Gaps in Bioinformaticscited by 1
  10. 2026Beyond Functional Correctness: Design Issues in AI IDE-Generated Large-Scale Projectscited by 1
  11. 2026Automated Root-Cause Subclassification and No-Code Fix Generation for Invalid Bug Reportscited by 1
  12. 2026Effective and Efficient Context Retrieval via Partial Dependency Graph for Repository-Level Code Generationcited by 1
11 more
  1. 2026CodePoisonRAG: Knowledge Poisoning Attacks on Retrieval-Augmented Code Generationcited by 1
  2. 2026Context-Augmented Code Generation Using Programming Knowledge Graphscited by 0
  3. 2026How Does Chunking Affect Retrieval-Augmented Code Completion? A Controlled Empirical Studycited by 0
  4. 2026MAS-Algorithm: A Workflow for Solving Algorithmic Programming Problems with a Multi-Agent Systemcited by 0
  5. 2026BLAgent: Agentic RAG for File-Level Bug Localizationcited by 0
  6. 2026SSDAU: Structured Semantic Data Augmentation for Joint Entity and Relation Extractioncited by 0
  7. 2026Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomycited by 0
  8. 2026ACEM: A Cost Estimation Model for Agentic Software Engineeringcited by 0
  9. 2026Large Language Models at the Intersection of Software Engineering and Software Security:An Evidence-Centered Structured Survey and Research Agendacited by 0
  10. 2026Specification Portability Across LLM Development Agents: Cross-Agent Compatibility in Specification-Driven Software Migrationcited by 0
  11. 2026RCL: A Retrieval-Confidence Layer for Detecting Insufficient Context in Enterprise Retrieval-Augmented Code Generationcited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
  2. 2026Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation
  3. 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChat
  4. 2026TICoder: A Repository-Level Code Generation Framework with Test-Driven Planning and Implementation-Aware Reuse ↗
  5. 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
  6. 2026Not All RAGs Are Created Equal: A Component-Wise Empirical Study for Software Engineering Tasks
  7. 2024A Lightweight Framework for Adaptive Retrieval In Code Completion With Critique Model
  8. 2026MRCoder: An Efficient Context Selecting Approach for Repository-Level Code Generation ↗