The starting point for Memento is a problem anyone who has tried to run an LLM agent on a full book knows well: you cannot keep everything in context. The research doesn't try to widen the window; it teaches the model to compact. The team builds the agent on Qwen3-8B, an eight-billion-parameter model, and trains it to manage context through self-generated notes. Across four book question-answering benchmarks, with volumes up to 2.5 million tokens, Memento lifts accuracy from 36.9% to 67.8% while never holding more than 20,000 tokens in context.

Training happens in two phases. First, the researchers prepare synthetic trajectories annotated with notes generated in hindsight, a bootstrapping step that starts fine-tuning without waiting for the model to learn from scratch. Then they apply reinforcement learning with a reward that combines answer correctness, note-quality heuristics, and confidence calibration. The key point is that RL alone, on off-the-shelf agentic models like GPT-5.5 or GLM-5.3, rarely discovers useful note-taking behavior: explicit signals and a guided learning path are needed.

The results are surprising especially when compared with much larger models. Memento outperforms a GPT-5.5 agent in the same harness (13.1%) and the full book context condition (56.7%) at less than 1/50 the cost. It nearly matches an approximately 100x larger GLM-5.3 agent (69.3%) at 1/9 the cost, and comes within 6.4 points of GLM-5.3 full context while spending 1/26 as much. The most relevant technical detail is that the model never keeps more than 20,000 tokens: the rest of the book goes through a compaction policy that decides what to retain.

This story has structural implications for anyone evaluating local deployment. A 20,000-token context window reduces the pressure on VRAM and compute compared with contexts of hundreds of thousands or millions of tokens: attention scales quadratically with sequence length, and keeping additional activations in memory has a direct cost. If an eight-billion-parameter model can compete on long documents through a learned compaction policy, self-hosted inference on more modest hardware becomes a realistic path. This is not theoretical: the cost numbers show that the spending difference can be one or two orders of magnitude.

There is also a data sovereignty advantage. Compacting context on-device avoids sending the entire document to an external API: the agent's intermediate notes and memory stay within the local perimeter. For those handling sensitive documents, this shifts the conversation from savings alone to compliance. Memento signals that progress in long-context agents does not come only from widening the window or using a larger model, but from engineering a context management pipeline: a training investment that pays off in inference and TCO. The lesson is clear: the next efficiency leap may come from smaller models that learn to forget better.