Contextual Memory Virtualisation: DAG-Based State Management and Structurally Lossless Trimming for LLM Agents

Cosmo Santoni · 2026

Read Contextual Memory Virtualisation: DAG-Based State Management and Structurally Lossless Trimming for LLM Agents by Cosmo Santoni (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-2602-22402.txt.

Description

Long reasoning sessions in language models accumulate valuable state: design maps, trade-off decisions, codebase conventions. Cosmo Santoni notes that state vanishes when sessions hit context limits and undergo lossy compaction. He proposes Contextual Memory Virtualisation, treating that stored know-how as versioned state, borrowing virtual-memory ideas from OS design.

Session history becomes a directed acyclic graph with defined snapshot, branch, and trim operations for context reuse across parallel sessions. A three-pass trimming algorithm preserves every user and assistant message verbatim while cutting tokens by a fifth on average, and far more for bloated sessions, by stripping tool outputs, images, and metadata. A single-user case study evaluates the design.

Catalog record

CREATORCosmo Santoni
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE24 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2602-22402

Browse the full library · About the Tower of Babel