CoMem: Context Management with A Decoupled Long-Context Model
Abstract
Lay Summary
LLM agents that complete complex tasks, like fixing software bugs or navigating websites, often need to remember long histories of their past actions. However, as these histories grow, the agent slows down significantly because it must re-read everything before deciding what to do next. We propose CoMem, a framework that gives LLM agents a dedicated "memory assistant" — a smaller, faster model whose only job is to continuously summarize what has happened so far. Instead of making the main AI read the full history, we run the memory assistant in parallel, so the main AI receives a concise summary without waiting. We also developed a training method that teaches the memory assistant what information is actually important for decision-making. In experiments on software engineering and web tasks, CoMem reduces response time by 1.4x while maintaining task performance. These efficiency gains grow further as the system handles more requests simultaneously, making capable LLM agents more practical to deploy at scale.