Code2UML: Agentic LLMs with context engineering for scalable software visualization

📅 2026-05-23
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of generating comprehensive UML diagrams from large-scale codebases, which is hindered by the context-length limitations of large language models (LLMs). To overcome this, the authors propose a hierarchical multi-agent architecture combined with a deterministic importance-weighted intermediate representation (IR) compression method that reduces massive codebases into context-appropriate views within milliseconds—without requiring LLM inference. Built upon the Claude Agent SDK, five specialized agents collaboratively enable cross-language, scalable, and automated UML generation. Evaluation across 12 open-source projects spanning four programming languages and seven UML diagram types demonstrates strong performance: a syntactic correctness rate of 91.5%, a mean relationship precision of 0.858, and an average structural quality score of 81.7 out of 100, with no degradation in performance as codebase size increases.
📝 Abstract
Large Language Model (LLM)-based code analysis tools are adopted to automate software documentation tasks. However, the scalability of these approaches to real codebases, where Intermediate Representations (IR) exceed LLM context limits, remains underexplored. This paper introduces an agentic architecture with context engineering for automated UML diagram generation from source code repositories. It employs a hierarchy of five specialized agents: PlannerAgent, AnalyzerAgent, DiagramAgent, CorrectorAgent and DependencyAnalyzerAgent, built on the Claude Agent SDK, each addressing a distinct cognitive subtask. A deterministic, importance-weighted IR compaction layer transforms full project IRs into diagram-specific views guaranteed to fit within token constraints, requiring no LLM calls and completing in milliseconds. Thus, we evaluate the system across 12 open-source repositories in 4 programming languages (Java, JavaScript, PHP, Python) and 7 UML diagram types, producing 84 observations assessed on 5 automated metrics. Results demonstrate high syntactic validity (mean: 91.5%, with component and deployment diagrams reaching 100%), strong relationship precision (mean: 0.858) and consistent structural quality (mean: 81.7/100, with cross-language variance of 3.1 points). Entity recall averaged 0.313, reflecting deliberate architectural prioritization over exhaustive coverage. A sensitivity analysis (31 to 4,578 IR entities) confirms that quality scores remain stable regardless of scale.
Problem

Research questions and friction points this paper is trying to address.

scalability
Large Language Models
UML diagram generation
context limits
Intermediate Representations
Innovation

Methods, ideas, or system contributions that make the work stand out.

Agentic LLMs
Context Engineering
UML Diagram Generation
Intermediate Representation Compaction
Scalable Code Visualization
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
A
Alin-Gabriel Văduva
Bucharest University of Economic Studies, Department of Economic Informatics and Cybernetics, no. 6 Piaţa Romană, Bucharest, Romania
A
Anca-Ioana Andreescu
Bucharest University of Economic Studies, Department of Economic Informatics and Cybernetics, no. 6 Piaţa Romană, Bucharest, Romania
S
Simona-Vasilica Oprea
Bucharest University of Economic Studies, Department of Economic Informatics and Cybernetics, no. 6 Piaţa Romană, Bucharest, Romania
A
Adela Bâra
Bucharest University of Economic Studies, Department of Economic Informatics and Cybernetics, no. 6 Piaţa Romană, Bucharest, Romania