GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
On the map: Retrieval-augmented generation → RAG for code
Abstract (arXiv)
The performance of repository-level code completion depends upon the effective leverage of both general and repository-specific knowledge. Despite the impressive capability of code LLMs in general code completion tasks, they often exhibit less satisfactory performance on repository-level completion due to the lack of repository-specific knowledge in these LLMs. To address this problem, we propose GraphCoder, a retrieval-augmented code completion framework that leverages LLMs' general code knowledge and the repository-specific knowledge via a graph-based retrieval-generation process. In particular, GraphCoder captures the context of completion target more accurately through code context graph (CCG) that consists of control-flow, data- and control-dependence between code statements, a more structured way to capture the completion target context than the sequence-based context used in existing retrieval-augmented approaches; based on CCG, GraphCoder further employs a coarse-to-fine retrieval process to locate context-similar code snippets with the completion target from the current repository. Experimental results demonstrate both the effectiveness and efficiency of GraphCoder: Compared to baseline retrieval-augmented methods, GraphCoder achieves higher exact match (EM) on average, with increases of +6.06 in code match and +6.23 in identifier match, while using less time and space.
Key facts. Cited by 40 papers in the map (data through 7 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 31 of its 63 references that are in the map. First posted on arXiv 11 Jun 2024.
Builds on
31 of 63 references.
Closest ancestors · 3
Same direction, newest first
- 2024FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion2 Apr
- 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar
- 2021Retrieval Augmented Code Generation and Summarization26 Aug
Other references · 28
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,185
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,026
- 2022GLM-130B: An Open Bilingual Pre-trained Modelcited by 837
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 820
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
16 more
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
- 2022Large Language Models Struggle to Learn Long-Tail Knowledgecited by 452
- 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Contextcited by 364
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2022Large Language Models Meet NL2Code: A Surveycited by 135
- 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 64
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2023RepoFusion: Training Code Models to Understand Your Repositorycited by 40
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
- 2023Structure-Aware Language Model Pretraining Improves Dense Retrieval on Structured Datacited by 23
- 2023Domain Adaptive Code Completion via Language Models and Decoupled Domain Databasescited by 19
Built on by
Citing papers per year: 2024: 5; 2025: 21; 2026: 14.
40 papers.
Sort:
By area:
- 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 165
- 2025A Survey of Graph Retrieval-Augmented Generation for Customized Large Language Modelscited by 85
- 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 62
- 2024SWE-bench-java: A GitHub Issue Resolving Benchmark for Javacited by 34
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Taskscited by 27
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
- 2025Graph-based Approaches and Functionalities in Retrieval-Augmented Generation: A Comprehensive Surveycited by 18
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generationcited by 17
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completioncited by 12
- 2025Blueprint First, Model Second: A Framework for Deterministic LLM Workflowcited by 11
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
28 more
- 2024CodeV: Issue Resolving with Visual Datacited by 9
- 2026SGAgent: Suggestion-Guided LLM-Based Multi-Agent Framework for Repository-Level Software Repaircited by 9
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systemscited by 7
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrievalcited by 7
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2025Knowledge Augmented Complex Problem Solving with Large Language Models: A Surveycited by 6
- 2025AutoGraph-R1: End-to-End Reinforcement Learning for Knowledge Graph Constructioncited by 6
- 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChatcited by 5
- 2025Impact-driven Context Filtering For Cross-file Code Completioncited by 5
- 2025Knowledge Graph Based Repository-Level Code Generationcited by 4
- 2025SelfRACG: Enabling LLMs to Self-Express and Retrieve for Code Generationcited by 2
- 2025TENET: One Step Toward Test-Driven Development for Repository-Level Code Generationcited by 2
- 2026CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generationcited by 2
- 2026Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Modelscited by 2
- 2024ENCO: Life-Cycle Management of Enterprise-Grade Copilotscited by 1
- 2025From Context to Intent: Reasoning-Guided Function-Level Code Completioncited by 1
- 2025Natural Language Summarization Enables Multi-Repository Bug Localization by LLMs in Microservice Architecturescited by 1
- 2026MHRC-Bench: A Multilingual Hardware Repository-Level Code Completion benchmarkcited by 1
- 2026Cross-Lingual Token Arbitrage: Optimizing Code Agent Context Windows via Local LLM Preprocessingcited by 1
- 2025Structure-Aware Corpus Construction and User-Perception-Aligned Metrics for Large-Language-Model Code Completioncited by 0
- 2025Is Implicit Knowledge Enough for LLMs? A RAG Approach for Tree-based Structurescited by 0
- 2026Hierarchical Embedding Fusion for Retrieval-Augmented Code Generationcited by 0
- 2026EvoRAG: Making Knowledge Graph-based RAG Automatically Evolve through Feedback-driven Backpropagationcited by 0
- 2026How Does Chunking Affect Retrieval-Augmented Code Completion? A Controlled Empirical Studycited by 0
- 2026XSearch: Explainable Code Search via Concept-to-Code Alignmentcited by 0
- 2026RCL: A Retrieval-Confidence Layer for Detecting Insufficient Context in Enterprise Retrieval-Augmented Code Generationcited by 0
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agentscited by 0
- 2026Chronos Enables Code Agents to Reason over Software Evolutioncited by 0
- 2026Chronos Enables Code Agents to Reason over Software Evolution8 Oct 2026
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agents28 Sep 2026
- 2026RCL: A Retrieval-Confidence Layer for Detecting Insufficient Context in Enterprise Retrieval-Augmented Code Generation10 Sep 2026
- 2026Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models14 Jul 2026
- 2026CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generation20 Jun 2026
- 2026Cross-Lingual Token Arbitrage: Optimizing Code Agent Context Windows via Local LLM Preprocessing2 Jun 2026
- 2026XSearch: Explainable Code Search via Concept-to-Code Alignment15 May 2026
- 2026How Does Chunking Affect Retrieval-Augmented Code Completion? A Controlled Empirical Study6 May 2026
- 2026EvoRAG: Making Knowledge Graph-based RAG Automatically Evolve through Feedback-driven Backpropagation17 Apr 2026
- 2026SGAgent: Suggestion-Guided LLM-Based Multi-Agent Framework for Repository-Level Software Repair27 Feb 2026
- 2026Hierarchical Embedding Fusion for Retrieval-Augmented Code Generation4 Feb 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
28 more
- 2026MHRC-Bench: A Multilingual Hardware Repository-Level Code Completion benchmark7 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025Natural Language Summarization Enables Multi-Repository Bug Localization by LLMs in Microservice Architectures5 Dec 2025
- 2025AutoGraph-R1: End-to-End Reinforcement Learning for Knowledge Graph Construction17 Oct 2025
- 2025Is Implicit Knowledge Enough for LLMs? A RAG Approach for Tree-based Structures12 Oct 2025
- 2025TENET: One Step Toward Test-Driven Development for Repository-Level Code Generation29 Sep 2025
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrieval27 Sep 2025
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completion19 Sep 2025
- 2025From Context to Intent: Reasoning-Guided Function-Level Code Completion13 Aug 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025Blueprint First, Model Second: A Framework for Deterministic LLM Workflow1 Aug 2025
- 2025SelfRACG: Enabling LLMs to Self-Express and Retrieve for Code Generation25 Jul 2025
- 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChat24 Jul 2025
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Tasks22 May 2025
- 2025Knowledge Graph Based Repository-Level Code Generation20 May 2025
- 2025Structure-Aware Corpus Construction and User-Perception-Aligned Metrics for Large-Language-Model Code Completion19 May 2025
- 2025Knowledge Augmented Complex Problem Solving with Large Language Models: A Survey6 May 2025
- 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generation14 Apr 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2025Graph-based Approaches and Functionalities in Retrieval-Augmented Generation: A Comprehensive Survey8 Apr 2025
- 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolving3 Apr 2025
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar 2025
- 2025A Survey of Graph Retrieval-Augmented Generation for Customized Large Language Models21 Jan 2025
- 2024CodeV: Issue Resolving with Visual Data23 Dec 2024
- 2024ENCO: Life-Cycle Management of Enterprise-Grade Copilots8 Dec 2024
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems29 Nov 2024
- 2024SWE-bench-java: A GitHub Issue Resolving Benchmark for Java26 Aug 2024
- 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databases7 Aug 2024
- 2025A Survey of Graph Retrieval-Augmented Generation for Customized Large Language Modelscited by 85
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
- 2025Graph-based Approaches and Functionalities in Retrieval-Augmented Generation: A Comprehensive Surveycited by 18
- 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generationcited by 17
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completioncited by 12
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systemscited by 7
- 2025AutoGraph-R1: End-to-End Reinforcement Learning for Knowledge Graph Constructioncited by 6
- 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChatcited by 5
- 2025Impact-driven Context Filtering For Cross-file Code Completioncited by 5
- 2025SelfRACG: Enabling LLMs to Self-Express and Retrieve for Code Generationcited by 2
- 2025Is Implicit Knowledge Enough for LLMs? A RAG Approach for Tree-based Structurescited by 0
- 2026Hierarchical Embedding Fusion for Retrieval-Augmented Code Generationcited by 0
12 most cited of 15 All 15 (JSON)
- 2026RCL: A Retrieval-Confidence Layer for Detecting Insufficient Context in Enterprise Retrieval-Augmented Code Generation10 Sep 2026
- 2026How Does Chunking Affect Retrieval-Augmented Code Completion? A Controlled Empirical Study6 May 2026
- 2026EvoRAG: Making Knowledge Graph-based RAG Automatically Evolve through Feedback-driven Backpropagation17 Apr 2026
- 2026Hierarchical Embedding Fusion for Retrieval-Augmented Code Generation4 Feb 2026
- 2025AutoGraph-R1: End-to-End Reinforcement Learning for Knowledge Graph Construction17 Oct 2025
- 2025Is Implicit Knowledge Enough for LLMs? A RAG Approach for Tree-based Structures12 Oct 2025
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completion19 Sep 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025SelfRACG: Enabling LLMs to Self-Express and Retrieve for Code Generation25 Jul 2025
- 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChat24 Jul 2025
- 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generation14 Apr 2025
- 2025Graph-based Approaches and Functionalities in Retrieval-Augmented Generation: A Comprehensive Survey8 Apr 2025
12 newest of 15 All 15 (JSON)
- 2026SGAgent: Suggestion-Guided LLM-Based Multi-Agent Framework for Repository-Level Software Repaircited by 9
- 2026CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generationcited by 2
- 2026Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Modelscited by 2
- 2026Cross-Lingual Token Arbitrage: Optimizing Code Agent Context Windows via Local LLM Preprocessingcited by 1
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agentscited by 0
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agents28 Sep 2026
- 2026Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models14 Jul 2026
- 2026CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generation20 Jun 2026
- 2026Cross-Lingual Token Arbitrage: Optimizing Code Agent Context Windows via Local LLM Preprocessing2 Jun 2026
- 2026SGAgent: Suggestion-Guided LLM-Based Multi-Agent Framework for Repository-Level Software Repair27 Feb 2026
- 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 165
- 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 62
- 2024SWE-bench-java: A GitHub Issue Resolving Benchmark for Javacited by 34
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Taskscited by 27
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025Blueprint First, Model Second: A Framework for Deterministic LLM Workflowcited by 11
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2024CodeV: Issue Resolving with Visual Datacited by 9
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrievalcited by 7
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2025Knowledge Graph Based Repository-Level Code Generationcited by 4
- 2025TENET: One Step Toward Test-Driven Development for Repository-Level Code Generationcited by 2
12 most cited of 18 All 18 (JSON)
- 2026Chronos Enables Code Agents to Reason over Software Evolution8 Oct 2026
- 2026XSearch: Explainable Code Search via Concept-to-Code Alignment15 May 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2026MHRC-Bench: A Multilingual Hardware Repository-Level Code Completion benchmark7 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025Natural Language Summarization Enables Multi-Repository Bug Localization by LLMs in Microservice Architectures5 Dec 2025
- 2025TENET: One Step Toward Test-Driven Development for Repository-Level Code Generation29 Sep 2025
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrieval27 Sep 2025
- 2025Blueprint First, Model Second: A Framework for Deterministic LLM Workflow1 Aug 2025
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Tasks22 May 2025
- 2025Knowledge Graph Based Repository-Level Code Generation20 May 2025
- 2025Structure-Aware Corpus Construction and User-Perception-Aligned Metrics for Large-Language-Model Code Completion19 May 2025
12 newest of 18 All 18 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2025GRACE: Graph-Guided Repository-Aware Code Completion through Hierarchical Code Fusion
- 2025SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion
- 2025Completion by Comprehension: Guiding Code Generation with Multi-Granularity Understanding
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion
- 2026Effective and Efficient Context Retrieval via Partial Dependency Graph for Repository-Level Code Generation
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches
- 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
- 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond