Folio: Recoverable Multi-Resolution Context Folding for Long-Horizon Language Agents

Yubo Ruan, Tao Peng, Jiao Zhang, Chuanguo Ma, Lei Xu +9 more
11/12/2026
cs.AI

No confident code implementation found for this paper.

Abstract

Long-horizon language agents accumulate tool results and replies until the history no longer fits the context window. Current agents shrink this history by having a model summarize it, so each compaction rereads and rewrites the history it replaces, and cache-aware triggers decide when to compact while taking the size of the result as given.

Show full abstract

We present Folio, a context manager that records, folds, and recovers history through one set of handles. While the agent runs, Folio records three linked levels: a short turn note the model writes as part of its ordinary reply (L1), an event manifest of every call written by the runtime (L2), and the captured source records (L3). Because these views already exist, the runtime folds the context programmatically, selecting coarser views for older turns. The fold prints the handles that index L2 and L3, so recovery tools that read bounded pages, compute over full text in files, and keep findings in a persistent dossier reach the evidence the agent needs with little added input. The fold trigger prices an explicit landing point that includes the retained budget. On 75 LOCA-bench tasks with DeepSeek-V4-Pro behind every system, Folio solves 66 tasks against 54 for the same runtime with model-written compaction and 49-59 for Claude Code, Codex, and SoL-Pi, in about half their working time, at 2.4 times lower cost than that runtime; each fold takes a median of 0.6 seconds.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ruan2026folio,
  title  = {Folio: Recoverable Multi-Resolution Context Folding for Long-Horizon Language Agents},
  author = {Yubo Ruan and Tao Peng and Jiao Zhang and Chuanguo Ma and Lei Xu and Han Zhou and Wenwu Wang and Xiafei Lv and Xingjie Zhou and Guiju Fan and Hao Wang and Fenghui Zhang and Mao Miao and Shuo Li},
  year   = {2026},
  eprint = {2611.16627},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.16627v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.16627.svg)](https://codeofpaper.com/paper/2611.16627)

Discussion