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

Official Resources / 官方开源资源 (English & 简体中文)

Overview: Self-Context sits transparently between a frozen LLM and its native agent harness (c_t = F_t ⊕ G_t), combining reversible whole-turn history management (fold / unfold) and structured graph management (add / edit / link / remove). Across BrowseComp-Plus, Terminal-Bench 2.1, and QwenClawBench v1.1, it reaches 69.8% macro average (+5.7 pp over Vanilla Harness) with 23.7% fewer turns on Qwen3.8-27B.

中文简介: Self-Context 是位于冻结大模型与其原生智能体框架之间的即插即用上下文自管理网关(c_t = F_t ⊕ G_t),结合可逆整轮历史管理(fold / unfold)与可编辑工作图管理(add / edit / link / remove)。在三大长程评测基准上,基于 Qwen3.8-27B 取得 69.8% 宏平均分(较原生基线 +5.7 pp),并减少 23.7% 交互轮次。

@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