Stratum: Repository Memory for Coding Agents Beyond the Context Window
Abstract
Context windows have grown a thousand-fold, yet coding agents still start every session with no memory of their past work. They re-read files, retry failed approaches, and forget root causes they established hours earlier. This is not a context-length problem but a memory-architecture problem. Our hypothesis: coding agents need persistent, experience-aware repository memory, so that knowledge survives from one session to the next. Three measurements on real repositories motivate the design. First, mid-size projects already exceed the largest production context windows, and storing knowledge inside the model's key-value (KV) cache costs to times more bytes than storing it as indexed text. Second, across 752 real bug-fix commits, the median fix edits two files, and these files plus their direct imports amount to less than 10% of the repository; the bottleneck is selection, not capacity. Third, even with transitive import reachability and test links, 47% of co-edited file pairs remain structurally disconnected; the knowledge needed for selection must be mined from history and experience. We sketch Stratum, a tiered memory that lives with the repository and serves it through page-safe tools: every response states what was returned, what remains, and what it cost. Retrieval over a store of one million nodes takes 1.7 ms at the median. In a multi-session experiment on eight real bugs, a fresh agent that inherited a prior session's memory, written by a different model, identified the root-cause file in 21 of 24 trials versus 6 of 24 for a retrieval-only baseline (Fisher ), at 4.5x lower median token cost. With the notes of all eight investigations pooled in one store, success remained 8/8.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI
- Comments
- 5 pages, 1 figure, 1 table. Replication package: https://doi.org/10.5281/zenodo.23615180
Related papers
Rivet: Utility-Preserving Context Control for Repository-Level Coding Agents
Shared title terminologycs.SERuwei Pan, Linhao Wu, Yakun Zhang et al.
Reliable Mining of Heterogeneous AI Coding-Agent Data: Context-Aware Prediction and Resource-Aware Ranking
Shared title terminologycs.SEHaoran Yu, Lifei Liu, Danping Zhang
Beyond Prompts: Runtime Contracts for Coding Agents
Shared title terminologycs.SEReda Heddad
Beyond Benchmarks: Evaluating Large Language Models and Agentic Patterns for Static Code Analysis Warning Classification
Shared title terminologycs.SELakmal Deshapriya, Sherlock A. Licorish, Brendon J. Woodford et al.
Launder-Bench: Can Repository-Level Agentic Code Laundering Be Detected?
Shared title terminologycs.SEYuntong Hu, Hongji Pu, Zimo Li et al.
CrossSWE: Benchmarking Cross-Repository Joint Development for Coding Agents
Shared title terminologycs.SESilin Chen, Yuling Shi, Heng Lian et al.