By measuring memory value prospectively on the next task and assigning credit only to steps that actually use memory, agents can build efficient, cost-aware memory systems that improve coding task performance without bloating context.
CoReMem is a framework that helps coding agents decide what information to remember between tasks. It measures how valuable different memory pieces will be for future unknown tasks, balancing the cost of storing and retrieving memory against its usefulness. The system improves a 27B model's ability to solve coding tasks from 21% to 25.7% while using fewer steps and tokens.