A new multi-agent framework takes a bottom-up approach to summarizing large, messy codebases that single language models routinely fumble.
Researchers introduced Agent4cs, a system that divides the work across three agents: one writes summaries, one extracts keywords from subfolders, and a third iteratively checks outputs for readability and completeness. The framework works upward through a repository's folder hierarchy rather than flattening everything into a single text dump. Tested against seven frontier models, it improved semantic consistency by an average of 8% over structured prompting baselines, and hit up to 38% gains on keyword coverage when run against real-world datasets.
The gap it targets is real. Most code summarization tools treat a repository like a long document, which means they miss the dependencies and structural relationships that actually explain how a codebase works — the stuff you need to onboard fast or audit unfamiliar code. By assigning roles, Agent4cs mirrors how a team of engineers might divide a codebase review, and the benchmark numbers suggest the approach isn't just tidier in theory.
Multi-agent architectures are increasingly the answer researchers reach for when single-model performance plateaus — though the coordination overhead and cost of running three agents per folder tree will need scrutiny before this moves beyond benchmarks.