Long Live the Librarian! A Persistent Search Sub-Agent for Energy-Efficient Multi-Agent Software Engineering Systems

Seunghyuk Cho, Sunghyun Choi, Jaeseung Heo, Youngbin Choi, Saemi Moon, MoonJeong Park, Dongwoo Kim · 2026

Read Long Live the Librarian! A Persistent Search Sub-Agent for Energy-Efficient Multi-Agent Software Engineering Systems by Seunghyuk Cho, Sunghyun Choi, Jaeseung Heo, Youngbin Choi, Saemi Moon, MoonJeong Park, Dongwoo Kim (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-27787.txt.

Introduction

Cho and colleagues trace the energy cost of multi-agent coding teams to a surprising source: agents writing overlapping output again and again. Their persistent helper, Librarian, remembers which parts of a codebase have already been searched and hands back short pointers instead of long file excerpts. On two software-engineering benchmarks it cut energy use per task by roughly a tenth to a third without hurting results.

Catalog record

CREATORSeunghyuk Cho, Sunghyun Choi, Jaeseung Heo, Youngbin Choi, Saemi Moon, MoonJeong Park, Dongwoo Kim
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE75626
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.27787

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Long Live the Librarian! A Persistent Search Sub-Agent for Energy-Efficient Multi-Agent Software Engineering Systems Seunghyuk Cho, Sunghyun Choi, Jaeseung Heo, Youngbin Choi, Saemi Moon, MoonJeong Park, Dongwoo Kim Abstract Multi-agent systems (MAS) have substantially advanced autonomous software engineering (SWE), but their growing inference energy demands raise sustainability concerns. In this paper, we demonstrate that this cost is concentrated in an overlooked source: redundant output tokens generated across agents. Two empirical findings ground this claim. First, our per-token energy attribution for MAS reveals a sharp asymmetry: an output token consumes 30 to 1,000 times more energy than an input or cached token. Second, MAS inflate per-episode output because agents repeatedly re-explore overlapping repository regions. To address this inefficiency, we propose Librarian, a persistent search sub-agent that tracks repository-search history and suppresses redundant exploration actions across agents. By returning short references to file regions instead of full file excerpts, Librarian further reduces output-token volume. On SWE-Bench Verified, Librarian reduces per-episode GPU energy consumption of existing multi-agent SWE systems by up to 25% while preserving task performance. 1 Introduction The rapid deployment of large language models (LLMs) has driven a sharp rise in the electricity demand of large-scale computing and is projected to drive further growth in the coming years ( 3 ; 7 ; 4 ; 17 ) . This consumption translates into a substantial environmental footprint, ranging from carbon emissions ( 16 ) to freshwater drawn by host data centers ( 13 ) . These concerns have motivated recent work on measuring LLM inference energy ( 4 ; 18 ) and improving efficiency through system- and hardware-aware optimizations ( 22 ; 30 ) . However, most existing analyses focus on the per-call setting and offer limited insight into agentic deployments where a single task spans many LLM calls. This limitation is sharpest in multi-agent systems (MAS) for software engineering (SWE) ( 31 ; 6 ; 33 ; 24 ; 23 ; 35 ) , where bug fixing ( 10 ; 39 ) and feature implementation ( 6 ; 24 ) are split across specialized sub-agents. MAS are increasingly adopted in SWE for the performance gains of role specialization, yet no energy analysis exists for this setting. SWEnergy ( 32 ) takes a first step but is restricted to single-agent runs, leaving MAS deployments uncharacterized. In this work, we measure the GPU energy of multi-agent SWE systems and find a counterintuitive pattern: MAS consume more GPU energy than their single-agent counterparts even at lower aggregate token counts. To explain this gap, we conduct turn-level attribution that decomposes each episode’s GPU energy into the input, output, and cached tokens of every LLM call. The attribution traces the gap to two compounding effects: MAS produce more output tokens per episode, and each output token incurs much higher energy than its input or cached counterpart. Thus, aggregate token counts and API-pricing-based proxies can underestimate actual GPU energy and obscure the category-level effects that drive agentic energy consumption. We trace the excessive output to redundant file exploration across sub-agent invocations. In existing MAS designs, no sub-agent preserves an exploration history across invocations, so each lookup begins from scratch. As a result, when the orchestrator issues different queries, sub-agents repeatedly traverse overlapping files and regenerate long file excerpts, amplifying the most energy-intensive token category. To break this re-exploration cycle, we propose the Librarian, a MAS-agnostic code-lookup sub-agent that returns the relevant region for each orchestrator query. We instantiate it with three design choices. First, to eliminate redundant exploration, its session persists across all invocations within an episode, so prior searches are reused. Second, to keep the session consistent with the current repository state, each invocation is supplied with the files and line ranges edited since the previous call, prompting the Librarian to re-traverse those regions. Third, to minimize output tokens, each answer is returned as a short view command rather than the inlined file excerpt itself. To integrate Librarian into an existing MAS, we provide a guideline that replaces the MAS’s code-navigation sub-agent with Librarian and routes all exploration through it. We apply the Librarian on SWE-Bench Verified ( 10 ) to BOAD ( 35 ) and HyperAgent ( 23 ) with two open-weight LLMs from the Qwen3.6 family, 35B-A3B ( 26 ) and 27B ( 25 ) . Across both MAS and both backbones, the Librarian variants preserve or improve the underlying MAS’s pass rate while reducing the GPU energy consumed per episode by up to 25%. Ablations confirm that this energy reduction stems from Librarian invocations eliminating the duplicate output tokens diagnosed above. We summarize the contributions as follows: we confirm that output tokens dominate resource use in agentic settings (§ 3 ); we diagnose the energy overhead of existing MAS designs as a consequence of duplicate lookups across the debugging cycle that no existing sub-agent recognizes (§ 3.3 ); we propose the Librarian, a persistent search sub-agent that integrates into existing MAS designs to supply this missing role (§ 4 ); and we show on SWE-Bench Verified that it minimizes hardware energy at matched pass rate (§ 5 ). Token Count Method Uncached Cached Out Total Energy (M) (M) (K) (M) (kJ) [0pt][0pt] Qwen3.6-35B-A3B Vanilla 0.11 2.69 16.8 2.81 10.31 HyperAgent 0.26 2.16 48.5 2.47 25.64 BOAD 0.19 3.71 28.5 3.93 17.45 [0pt][0pt] Qwen3.6-27B Vanilla 0.10 2.59 15.4 2.71 57.45 HyperAgent 0.21 1.35 35.4 1.59 121.84 BOAD 0.21 3.07 24.3 3.30 88.96 Table 1: Token usage and energy consumption across SWE Agents. We report token usage by category, uncached input, cached input, and output, alongside per-episode mean energy consumption for a single-agent SWE system denoted as Vanilla and two multi-agent SWE systems, HyperAgent and BOAD. HyperAgent shows the smallest cached and total token counts yet the largest energy consumption. 2 Related Work 2.1 Energy footprint of LLM inference LLM inference energy is conventionally quantified at the GPU level, since GPU consumption dominates per-server serving power ( 21 ) . Within this scope, 16 benchmark per-inference energy across model and task configurations, and 4 further model per-query GPU duration and energy as a function of inference-optimization choices and workload geometry. At a finer granularity, 18 decompose per-request power into the prefill and decode stages, yielding per-token energy estimates per stage that inform energy-aware serving designs ( 22 ; 30 ) . While these works yield hardware-grounded per-call energy characterizations, all are defined per inference call, not over multi-turn agentic trajectories. SWEnergy ( 32 ) extends per-call energy measurement to SWE-agent frameworks, but its analysis is restricted to small LLMs with near-zero task resolution. Moreover, its per-category attribution uses univariate correlation, which gives each category’s per-token energy scaled by how much its count varies across turns, not the per-token energy itself. 2.2 Multi-agent software engineering systems Multi-agent SWE systems organize execution around specialized roles such as planner, navigator, coder, and reviewer that collaborate to resolve a single task. Two paradigms for stitching these roles recur. Pipeline-based MAS hardcode the role sequence at design time, so each role advances the task one predetermined phase and hands off to the next role ( 24 ; 6 ; 33 ) . In SWE, however, execution order is not fixed in advance and coordination evolves as the task unfolds (

Read the complete text