• 01 June, 2026
  • GreenCode

New paper: Bridging Formal Syntax and LLM Semantics: Extracting Knowledge Graphs for Legacy Code Understanding

Established enterprises frequently rely on legacy systems that are increasingly difficult to maintain due to obsolete programming languages and archaic coding styles, such as non-descriptive identifiers. Yet replacing such systems is often impractical because their proven-in-use reliability must be preserved. While Large Language Models (LLMs) offer promising capabilities for system understanding, architecture recovery, and modernization, they require rigorous context management to be effective. Because programming languages are parsable formal languages, they enable retrieval approaches that exploit program structure rather than treating source code as unstructured text. We therefore propose a parsing-based methodology for constructing a structure-aware knowledge graph for GraphRAG in legacy software systems. Using an industrial case study, we show qualitatively that this approach improves retrieval precision and supports multi-hop architectural reasoning compared to textcentric RAG baselines.

Authors: Henrik Thillmann, Bernhard Rumpe, Andreas Biesdorf

Contributing partner: Trier University of Applied Sciences

Publication page and citation View at the publisher