Most long-horizon agents I’ve operated don’t fail because the model can’t reason — they fail because the working context quietly grows until the signal drowns. We bolt on summarization and call it context management. ContextPilot argues that’s the shallow end: a real context manager needs planning, long-term memory, and adaptive compression as first-class tools, and it should learn when to use them, not fire them on a fixed schedule.
The part worth stealing is the credit assignment. In production, the failure I keep hitting is that a summarize-or-drop decision 30 turns ago is what tanked the run — but the reward only shows up at the end. ContextPilot uses context and entropy variation to spot the editing decisions that actually mattered, branches from those points, and estimates action-level advantages from the branches that pass through each edit. That’s a direct answer to the coarse trajectory-level reward problem every agentic RL setup fights. The result they report: stronger long-context QA and deep-search performance with a more compact context, which is the combination that matters when you’re paying for every token in the loop.
For anyone running retrieval-heavy agents, this reframes context as a policy you train, not a buffer you truncate. The overlap with RAG is obvious — deep search is iterative retrieval — but the operational lesson is broader: soft offloading and long-term memory are the tools, and knowing which to invoke is the learned behavior. Code’s on GitHub, so this is reproducible rather than a benchmark flex.
The open question I’m sitting with: does learned context editing survive contact with a real eval harness, where “compact context” and “answer quality” pull against each other and the reward is noisier than a QA benchmark? Skim the abstract and method on arXiv and the HF paper page — then ask whether your agent’s context strategy is a policy or just a while loop with a token cap.