Command Palette
Search for a command to run...
슈퍼 라이브러리 에이전트: 단일 코드베이스를 넘어선 다중 애플리케이션의 통합 생성 및 유지보수
슈퍼 라이브러리 에이전트: 단일 코드베이스를 넘어선 다중 애플리케이션의 통합 생성 및 유지보수
Daegyu Sung Yukyeong Lee Geon Park Yumin Choi Sung Ju Hwang
초록
조직은 상당한 도메인 로직, 인터페이스 패턴 또는 운영 규칙을 공유하는 독립적으로 배포 가능한 코드베이스들로 구성된 관련 애플리케이션 포트폴리오를 개발하고 유지보수하는 경우가 많다. 대규모 언어 모델(LLM) 기반 코딩 에이전트가 이러한 소프트웨어를 생성하고 유지보수하는 데 점점 더 많이 사용됨에 따라, 단순히 애플리케이션별로 작업하는 워크플로우는 공유 로직을 코드베이스 전반에 중복시키고, 장기간의 에이전트 기반 유지보수 과정에서 장황함, 죽은 코드, 구조적 침식이 누적되도록 허용한다. 본 논문에서는 에이전트가 재사용 가능한 교차 애플리케이션 구성 요소로 이루어진 공유 슈퍼 라이브러리를 유지보수하면서 N개의 관련 애플리케이션 포트폴리오를 순차적으로 생성하는 슈퍼 라이브러리 에이전트 문제를 소개한다. 최소한의 순차적 스캐폴드는 원칙적으로 공유 코드를 추출하고 애플리케이션을 진화하는 라이브러리로 마이그레이션할 수 있지만, 실제로는 낮은 추출 재현율과 취약한 의존성 마이그레이션 문제를 겪는다. 우리는 코드 청크 요약에 대한 후보 기반 추출, 추출 전 코드베이스 통합, 추출 추적 및 호출 그래프 정보를 활용한 컨텍스트 인식 마이그레이션을 통해 이러한 실패를 해결한다. WebGen-Bench와 PaperBench 전반에 걸쳐, 우리의 방법은 제로샷 방식 대비 애플리케이션 기능을 보존하면서 중복성과 토큰 사용량(장황함, 토큰 길이)을 크게 줄이고, 단순한 라이브러리 구축으로 인해 발생하는 구조적 침식을 방지하며, 코드 라인 수(LOC)와 최소 기술 길이(MDL)를 추가적으로 감소시킨다.
One-sentence Summary
Researchers from KAIST and DeepAuto.ai introduce the Super Library Agent problem, which involves sequentially generating a portfolio of N related applications while maintaining a shared Super Library, and address extraction failures with candidate-guided extraction over code chunk summaries, pre-extraction consolidation, and context-aware migration, preserving functionality while reducing redundancy and token footprint on WebGen-Bench and PaperBench.
Key Contributions
- The Super Library Agent problem is formulated as an online setting where a coding agent sequentially builds a portfolio of related applications while maintaining a shared Super Library of reusable cross-application components.
- To overcome low extraction recall and fragile dependency migration, candidate-guided extraction uses summarized code chunk indexes and LLM-based candidate selection, and context-aware migration supplies extraction traces and call-graph information to a dependency-migration agent.
- Evaluations on WebGen-Bench and PaperB ench show that the method preserves application functionality, reduces redundancy and token footprint, and improves maintainability metrics, library utilization, and abstraction quality over zero-shot and naive library baselines.
Introduction
The authors address the challenge of using LLM coding agents to build and maintain portfolios of related applications, where independent generation duplicates shared logic and violates DRY principles. This duplication is amplified by LLM-induced code slop, making maintenance across many applications increasingly brittle. Prior library learning techniques treat abstraction as a post-hoc step over existing codebases or assume a single project, leaving the multi-repo, online setting unexplored. The key contribution is the Super Library Agent problem formulation and a scaffold that tackles two core obstacles: low extraction recall when identifying reusable components across divergent implementations, and fragile dependency migration when those components are moved into a shared library. The authors introduce candidate-guided extraction using summarized code indexes and an LLM‑based selector, paired with context-aware migration that leverages extraction traces and call‑graph information to safely update imports and call sites.
Method
The authors formalize the Super Library Agent problem as a sequential multi-application construction task. Given a stream of application requests x1,…,xN, an agent must build each codebase while progressively maintaining a shared Super Library Lt. At step t, with previous codebases C<t and the library Lt−1, the agent produces the new codebase ct, an updated library Lt, and patched previous codebases C<t′:
(ct,C<t′,Lt)=A(xt,C<t,Lt−1).The ideal library Lt⋆ contains every component used by at least two applications, while application-specific code stays local. The agent is optimized for a Pareto trade-off between functionality (request satisfaction) and maintainability (proper extraction, deduplication, reuse, and consistency across the joint codebase).
The minimal agentic scaffold, used as a naive baseline, tackles this mapping with two coarse phases per step. A coding agent generates an initial codebase ct0 from the request xt, reusing existing library components when possible. Then a single library agent jointly extracts shared components into the Super Library and migrates all previous codebases to use the updated library, producing Lt, ct, and C<t′. This undifferentiated hand-off suffers from low recall in identifying reusable blocks and the risk of breaking existing applications during migration.
To overcome these limitations, the augmented scaffold decomposes the single library phase into two specialized agents: a library-extraction agent and a dependency-migration agent. The extraction agent is responsible for updating Lt; the migration agent patches previous codebases. They are supported by two complementary strategies.
First, index-based candidate extraction shifts from surface-form matching to semantic-level reasoning. Code blocks from every codebase and the library are identified via AST boundaries (functions, classes, modules) and summarized in natural language by an LLM, producing a compact code-summary index. A dedicated LLM-based candidate selector then compares these summaries for two tasks: extraction candidates (blocks used across multiple applications) and migration candidates (library symbols paired with local blocks they can replace). Before cross-application extraction, a one-time consolidation refactors duplicated local code within each new application, further refining the index.
Second, context-aware dependency migration bridges the extraction and migration agents and aligns local edits. The extraction agent produces a structured extraction trace for each new or updated library symbol, recording its origin, the generalized pattern, and a replacement guide. This trace is forwarded to the migration agent, obviating the need to rediscover correspondences. Additionally, a call-graph conditioning step attaches an “also-refactor” list to every migration candidate, including relevant import declarations and caller/callee relationships. This prompts the agent to update dependencies, remove dead code, and eliminate obsolete local implementations, reducing broken references and duplication. Together, these strategies enable the system to iteratively refactor the codebase portfolio into a maintainable, library-driven structure.
Experiment
The evaluation uses sequential coding task suites from WebGen-Bench and PaperBench to compare a Super Library Agent that incrementally builds a shared library against zero-shot generation and post-hoc library construction. SLA-Full consistently achieves the best maintainability metrics—lower code size, structural erosion, and verbosity—while preserving application functionality, and it markedly reduces patch size during shared policy updates by centralizing changes in the library. Ablation studies show that summary-guided candidate selection, pre-extraction consolidation, and call-graph-conditioned migration each improve library quality, enabling the library to capture diverse behavioral and domain-level abstractions beyond simple UI primitives. Additionally, a mature Super Library can act as a reuse prior to improve future application generation accuracy and compactness.
All methods achieve comparable functionality on WebGen-Bench, indicating library use does not harm task performance. SLA-FULL obtains the best maintainability scores (LOC, token length, erosion, verbosity) with statistically significant reductions versus zero-shot, while LIBRARIAN's best-of-K selection lowers MDL but increases erosion. On PaperBench, SLA-FULL achieves the lowest values on all five maintainability metrics while retaining comparable code-dev scores, and naive unguided extraction variants reduce some size metrics but concentrate complexity into shared components. Zero-shot, LIBRARIAN, and naive variants all reach similar accuracy (75–77) and appearance (≈3.9) on WebGen-Bench. SLA-FULL achieves the best maintainability results, significantly reducing LOC, token length, and verbosity relative to zero-shot. LIBRARIAN (K=8) attains the lowest MDL but increases erosion above zero-shot, rather than reducing it. Naive-Implicit and Naive-Ward reduce LOC and tokens but suffer higher erosion, suggesting unguided library extraction concentrates complexity. On PaperBench, SLA-FULL scores lowest on all five maintainability metrics while keeping code-dev scores comparable to other methods. LIBRARIAN's post-hoc MDL selection on PaperBench yields no MDL or functionality improvement over zero-shot.
SLA-FULL requires the smallest total patch size by centralizing shared updates in the Super Library, substantially reducing application-level edits. The other methods apply larger patches directly to applications, while post-patch pass rates and appearance quality remain comparable across all approaches. This shows that library-centric maintenance can streamline changes without compromising functionality. SLA-FULL yields the smallest overall patch size, with most changes applied to the shared library rather than individual applications. Original and requested behavior pass rates are similar across methods, indicating that the smaller patches do not degrade functionality.
Natural-language summary-based candidate selection gives the best maintainability scores among naive strategies, and SLA-FULL further improves accuracy by adding call-graph conditioning and pre-extraction codebase consolidation. The resulting Super Library is larger, more broadly reused, and captures richer abstraction layers beyond primitive UI widgets, yielding less redundancy and better downstream application generation. The natural-language summary approach identifies the largest number of shared components and achieves top scores on four of five maintainability metrics. Dropping pre-extraction consolidation increases verbosity, structural erosion, and total lines of code, showing it helps the library agent abstract components within a single codebase. Removing call-graph conditioning hurts migration accuracy, leaves dead code, and raises verbosity and erosion, indicating structural caller-callee context is essential for clean dependency replacement. SLA-FULL exports more library components that are reused by many applications and extracts behavioral hooks and page-level patterns, while naive methods stay limited to shallow UI widgets and thin utilities. Over sequential rounds, SLA-FULL steadily reduces each application's local code, whereas a naive shared library shows a flatter trajectory without reliable candidate discovery and migration.
SLA-FULL produces a substantially larger Super Library than naive variants, with roughly 60% more exported components on average. It also achieves broader reuse, with many more components shared across 3–5 and 6–8 applications. This expansion reflects extraction of higher-level abstractions beyond primitive UI elements, which later helps generate more accurate applications with less total code. SLA-FULL exports about 13 components on average, compared to 7–8 for the naive methods. Exports reused by 6–8 apps more than double, rising from approximately 2–3 in naive variants to nearly 5 in SLA-FULL.
When a vanilla coding agent uses a mature Super Library to generate content-presentation applications, UI accuracy rises substantially and application-local code shrinks. Even after accounting for the added library code, total lines of code decrease by approximately 11%, with only a marginal change in maintainability. UI accuracy improved from 80.95% to 84.35% with library access. Total lines of code (application plus library) fell by roughly 11%, despite the library's own contribution.
Experiments on WebGen-Bench and PaperBench evaluate the Super Library approach for multi‑application code generation and maintenance. SLA‑FULL consistently achieves the best maintainability scores with significantly lower code size, token length, erosion, and verbosity compared to zero‑shot baselines, while all methods attain comparable functional accuracy and appearance, confirming that library‑oriented structuring does not harm task performance. Ablations show that call‑graph conditioning and pre‑extraction consolidation are essential for extracting richer, more reusable abstractions beyond shallow UI widgets, resulting in a substantially larger Super Library that is shared by more applications and drives steady application‑local code reduction across rounds. Maintenance evaluations further demonstrate that centralizing edits in the library yields the smallest total patch sizes without degrading pass rates, and a downstream coding agent equipped with this mature library obtains higher UI accuracy and an overall 11% reduction in total lines of code.