mlsanityData to 7 Oct 2026

Reliable Graph-RAG for Codebases: AST-Derived Graphs vs LLM-Extracted Knowledge Graphs

arXiv 2601.08773 ↗First posted 13 Jan 2026cs.SE cs.AIcited by 4

On the map: Retrieval-augmented generation → Knowledge-graph and structured-knowledge RAG

Abstract (arXiv)

Retrieval-Augmented Generation for software engineering often relies on vector similarity search, which captures topical similarity but can fail on multi-hop architectural reasoning such as controller to service to repository chains, interface-driven wiring, and inheritance. This paper benchmarks three retrieval pipelines on Java codebases (Shopizer, with additional runs on ThingsBoard and OpenMRS Core): (A) vector-only No-Graph RAG, (B) an LLM-generated knowledge graph RAG (LLM-KB), and (C) a deterministic AST-derived knowledge graph RAG (DKB) built with Tree-sitter and bidirectional traversal. Using 15 architecture and code-tracing queries per repository, we measure indexing time, query latency, corpus coverage, cost, and answer correctness. DKB builds its graph in seconds, while LLM-KB requires much longer graph generation. LLM-KB also shows indexing incompleteness: on Shopizer, 377 files are skipped or missed, reducing embedded chunk coverage and graph size compared to DKB. End-to-end cost is modest for DKB relative to the vector-only baseline but much higher for LLM-KB, especially as repository scale increases. Query latency is similar for No-Graph and DKB, while LLM-KB is slower and more variable. On the Shopizer question suite, DKB achieves the highest correctness, LLM-KB is close behind, and the vector-only baseline performs worst on upstream architectural queries and has the highest hallucination risk. Overall, deterministic AST-derived graphs provide more reliable coverage and multi-hop grounding than LLM-extracted graphs at substantially lower indexing cost.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in Knowledge-graph and structured-knowledge RAG, one of 15 directions in Retrieval-augmented generation. Builds on 21 of its 30 references that are in the map. First posted on arXiv 13 Jan 2026.

Builds on

21 of 30 references.

Closest ancestors · 3

Same direction, newest first

  1. 2025A Survey of Graph Retrieval-Augmented Generation for Customized Large Language Models21 Jan
  2. 2024LightRAG: Simple and Fast Retrieval-Augmented Generation8 Oct
  3. 2024From Local to Global: A Graph RAG Approach to Query-Focused Summarization24 Apr

Other references · 18

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  5. 2021Program Synthesis with Large Language Modelscited by 3,509
  6. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  7. 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,185
  8. 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 940
  9. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  10. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
  11. 2025Agentic Retrieval-Augmented Generation: A Survey on Agentic RAGcited by 242
  12. 2024Measuring memorization in language models via probabilistic extractioncited by 40
6 more
  1. 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Taskscited by 27
  2. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
  3. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunitiescited by 17
  4. 2025cAST: Enhancing Code Retrieval-Augmented Generation with Structural Chunking via Abstract Syntax Treecited by 17
  5. 2025Think Inside the JSON: Reinforcement Strategy for Strict LLM Schema Adherencecited by 16
  6. 2025Large Language Models Versus Static Code Analysis Tools: A Systematic Benchmark for Vulnerability Detectioncited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 4.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Context-Augmented Code Generation Using Programming Knowledge Graphs
  2. 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrieval
  3. 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
  4. 2026Effective and Efficient Context Retrieval via Partial Dependency Graph for Repository-Level Code Generation
  5. 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databases
  6. 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
  7. 2025GRACE: Graph-Guided Repository-Aware Code Completion through Hierarchical Code Fusion
  8. 2025Towards Practical GraphRAG: Efficient Knowledge Graph Construction and Hybrid Retrieval at Scale