Papers
arxiv:2612.01681

Self-Context: Graph-Based Context Self-Management for Long-Horizon Agents

Published on Dec 1
· Submitted by
Renxu Bao
on Dec 2
Authors:
,
,
,
,
,
,
,
,
,

Abstract

Self-Context is a graph-based framework that enables an LLM to manage its own context through editable working graphs and fold/unfold history summaries, improving long-horizon agent performance and interaction efficiency.

Effective context management is essential for long-horizon agents because context is a finite resource, and context windows of any size remain subject to context pollution and information relevance concerns. However, existing approaches assume that keeping critical findings in the interaction history is sufficient for later decisions and struggle with accumulating context noise and irreversible context compaction. To address these challenges, we propose Self-Context, a graph-based plug-and-play framework between the LLM and its native harness. It allows the LLM to take over context management through two components: graph management for structured exploration and history management for preserving critical interaction details. Graph management records exploration attempts and their findings in an editable working graph. History management uses fold and unfold to replace interaction history with summary notes and restore the original history when needed. Extensive experiments on three agent tasks show that Self-Context improves both task performance and interaction efficiency by keeping critical findings available for later decisions and maintaining exploration coherence.

Community

👋 Hi everyone! Sharing the official bilingual (English / 简体中文) resources and 15s benchmark performance showcase for Self-Context:

Self-Context 15s Benchmark Performance Overview


核心亮点 / Key Highlights

  • Plug-and-Play Inference Gateway ($c_t = F_t \oplus G_t$) — Combines reversible whole-turn history fold / unfold ($\mathcal{T}$) with an editable working graph ($\mathcal{G}$) between a frozen LLM and its unchanged native harness.
  • 即插即用推理期网关 — 无需重训模型权重、无需改动原生工具框架,由行动模型通过 <graph> 自主执行整轮可逆折叠/展开与工作图增删改连(255,208 次操作中删增比达 0.88×)。
  • #1 Across All 9 Methods (6/6 Wins) — On Qwen3.8-27B, reaches 69.8% macro average (+5.7 pp over Vanilla Harness, −23.7% turns) and 82.0% on Terminal-Bench 2.1 (+7.8 pp, −31.8% turns, matching 100-turn Vanilla by Turn 61).
@misc{wang2026self-context,
  title         = {Self-Context: Graph-Based Context Self-Management for Long-Horizon Agents},
  author        = {Ziheng Wang and Chengyi Yang and Renxu Bao and Zhishang Xiang and Chengsong Huang and Wenhao Li and Junnan Zhu and Delai Qiu and Yining Wang and Shengping Liu and Jinsong Su},
  year          = {2026},
  eprint        = {2612.01681},
  archivePrefix = {arXiv},
  primaryClass  = {cs.AI},
  url           = {https://arxiv.org/abs/2612.01681}
}
Paper author Paper submitter

c2a6845dd7b014d3305770a6c9e24bc8

59c7f73dea0b0d2b1594e657d9ec8f5a

🤩 If you find this work helpful, we would appreciate an upvote and a star, and we look forward to exchanging new ideas on context management for long-horizon agents with the community!

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2612.01681 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2612.01681 in a dataset README.md to link it from this page.

Spaces citing this paper 1

Collections including this paper 1