Librarian Agents: LLMs Pre-Organize Long Documents
Long-document reasoning is still hard for large language models. Standard retrieval is passive and becomes a bottleneck when a question needs complex reasoning across documents. Precomputed structures such as knowledge graphs depend on rigid heuristics. This paper introduces Librarian Agents. Before inference, a builder agent turns raw documents into a hierarchical file system with synthesized files and citation links, and a downstream answering agent uses it as its workspace. The authors model workspace construction as a Markov decision process and use reinforcement learning to optimize downstream answer accuracy directly. On BrowseComp-Plus, the method beats the strongest retrieval and precomputation baselines by 33 points. The upfront build cost can be amortized over repeated queries. On BRIGHT, it generalizes zero-shot to unseen domains and raises average accuracy by 31 points.
Background and Context
Long-document reasoning is still hard for large language models. The common fix is retrieval-augmented generation: wait for a question, then pull relevant passages from the corpus. This approach is passive by design. When a question needs clues from several documents joined together, the retrieval step becomes the bottleneck for the whole agent.
The other route is to precompute structure ahead of time, for example a knowledge graph. That route depends on rigid, hand-designed heuristics, and those heuristics often fit poorly with the many different questions that arrive later. The paper behind Librarian Agents asks a different question: can an agent organize a corpus before inference starts, with direction, so that it is ready for future queries? The authors call this anticipatory directed curation.
The starting point is an asymmetry in modern agent environments such as Claude Code. LLM agents navigate existing file systems well when they finish a task in front of them. Almost nobody trains them to build a reusable workspace for future use. Librarian Agents targets that gap, and the source article is an arXiv paper.
Deep Analysis
The framework has two roles. A builder agent reads the raw documents before inference and turns them into a hierarchical file system. That file system holds synthesized files and citation links between them. A downstream answering agent then uses this workspace to look up information and answer questions. The builder does more than chunk text or build an index. Like a librarian, it decides how to categorize material, which summary files to write, and which links should connect related content. The synthesized files and citation links are the concrete outputs of those decisions. What does it mean to train a builder with reinforcement learning on workspace construction? The authors model workspace construction as a Markov decision process. Each operation the builder performs is an action. The full build forms a trajectory. The final reward comes directly from the answering agent's accuracy on the finished workspace. The builder policy is optimized with reinforcement learning to maximize that downstream accuracy, not an intermediate proxy metric. The downstream result, not a human-written rule, decides which organization is useful.
The evaluation uses two benchmarks. BrowseComp-Plus contains tasks that need complex reasoning across documents. On it, Librarian Agents beats the strongest retrieval baseline and the strongest precomputation baseline by 33 percentage points. That is a large gap. The second benchmark, BRIGHT, tests generalization. The builder is trained once, then applied zero-shot to unseen domains. It still raises average accuracy by 31 points. This suggests the builder has not learned a trick tied to one corpus. It appears to have learned a fairly general skill of organizing documents. Cost matters too. Building a workspace requires an upfront investment, and whether it pays off depends on how many queries share that cost. The paper reports that the upfront build cost can be amortized over repeated queries. The more often one corpus is queried, the better the build-first approach looks. The abstract gives no finer ablation data, so this article makes no claim about how much each design choice contributes.
Industry Impact
This work points to a neglected step in agent systems. Organizing knowledge and using knowledge can be separated, and the organizing step can itself be learned. That reframes a problem usually handled by fixed pipelines. For industrial use, many organizations hold fairly stable document sets that people query again and again, such as technical documentation, case libraries, and research material. In these settings, paying once for a builder to produce a hierarchical workspace, then letting an answering agent reuse it, can be more attractive than retrieving on the fly for every question. The reported amortization of build cost supports that reasoning.
For the research community, the paper offers a clear framing: treat workspace construction as a reinforcement learning problem and use downstream accuracy as the reward. This gives direct leads for work on agent memory, long-context management, and automatic knowledge-base maintenance. Possible extensions include updating a workspace incrementally as new documents arrive, or adapting the builder to different query distributions. There is a limit to what the evidence shows. The reported results cover two benchmarks. Real business corpora may differ in scale, update frequency, and noise. Whether the upfront cost pays off in a given deployment still needs practical testing.
Outlook
The most useful next questions are about maintenance and scope. A workspace built once is a snapshot. If the underlying documents change often, the build cost recurs, and the amortization argument weakens. Incremental updating of the file system would test how robust the idea is in live settings.
A second open point is how far the zero-shot result on BRIGHT extends. A 31-point average gain on unseen domains is encouraging. Corpora with very different structure, size, or noise levels would show whether the builder's organizing skill holds up beyond these two benchmarks. A third point is the build-versus-query tradeoff. The paper states that repeated queries amortize the upfront cost, but the abstract gives no break-even figure. Teams considering this method would need to measure their own query volume against build effort before committing. Even with those caveats, the direction is worth watching. Teaching an agent to prepare material for its future self, and for other agents, turns document handling from a retrieval problem into a learned preparation step.
Sources
FAQ
What are Librarian Agents?
Librarian Agents is a framework in which a builder agent, before inference, turns raw documents into a hierarchical file system with synthesized files and citation links. A downstream answering agent then uses this file system as its workspace to look up information and answer questions.
Why do Librarian Agents matter for long-document reasoning?
Librarian Agents address the weaknesses of passive retrieval and rigid precomputed structures such as knowledge graphs. The paper reports that the method beats the strongest retrieval and precomputation baselines by 33 points on BrowseComp-Plus, and raises average accuracy by 31 points zero-shot on BRIGHT.
What should teams watch before adopting Librarian Agents?
Teams adopting Librarian Agents should watch the upfront build cost. The paper says this cost can be amortized over repeated queries. The reported results cover only two benchmarks, BrowseComp-Plus and BRIGHT, so real corpora need their own validation. The article gives no finer ablation data.