Generation of Documentation Based on Graph Representation of Code and Large Language Models
Abstract
Generation of Documentation Based on Graph Representation of Code and Large Language Models
Incoming article date: 10.12.2025The article discusses the problems of generating and updating software documentation using large language models. An overview of existing approaches is presented, including code summarization, systems using augmented generation approaches, assistants embedded in the development environment, and their limitations in terms of loss of architectural context and the occurrence of structural hallucinations. The concept of a graphically augmented documentation system is proposed, where the "source of truth" is a directed graph of knowledge about the code, built by static code analysis and analysis of library dependencies. An algorithm for constructing a graph is described, including node extraction, library bytecode analysis, and semantic link classification. The effectiveness of the approach was confirmed by experimental implementation on an industrial microservice, where the system demonstrated the ability to correctly restore the context and generate meaningful documentation without distorting the facts.
Keywords: automatic documentation, large language models, knowledge graph, augmented text generation, static analysis, semantic search, vector representation, microservice architecture, program structure interface, bytecode, technical documentation