Memex(RL): 인덱싱된 경험 메모리를 통한 장기적 LLM 에이전트 확장
Memex(RL): Scaling Long-Horizon LLM Agents via Indexed Experience Memory
March 4, 2026
저자: Zhenting Wang, Huancheng Chen, Jiayun Wang, Wei Wei
cs.AI
초록
대규모 언어 모델(LLM) 에이전트는 장기적 과제 수행 시 유한한 컨텍스트 윈도우에 의해 근본적으로 병목 현상이 발생합니다. 작업 궤적이 길어질수록 도구 출력 및 중간 추론 과정을 컨텍스트 내에 보유하는 것은 빠르게 불가능해집니다: 작업 컨텍스트가 지나치게 길어지고, 결국 컨텍스트 예산을 초과하며, 멀리 떨어진 증거가 여전히 존재하더라도 이를 활용하기가 더 어려워집니다. 기존 솔루션은 일반적으로 잘라내기나 실행 요약을 통해 컨텍스트를 단축하지만, 이러한 방법들은 과거 증거 자체를 압축하거나 폐기하기 때문에 근본적으로 정보 손실이 발생합니다. 본 연구에서는 증거를 폐기하지 않고 컨텍스트를 압축하는 색인화된 경험 메모리 메커니즘인 Memex를 소개합니다. Memex는 간결한 구조화된 요약과 안정적인 색인으로 구성된 컴팩트한 작업 컮텍스트를 유지하는 동시에, 완전한 충실도의 기반 상호작용을 해당 색인 아래 외부 경험 데이터베이스에 저장합니다. 그러면 에이전트는 색인을 역참조하여 현재 하위 목표에 필요한 정확한 과거 증거를 복원할 시점을 결정할 수 있습니다. 우리는 MemexRL이라는 강화 학습 프레임워크를 통해 쓰기 및 읽기 동작을 최적화하며, 컨텍스트 예산 하에서 색인화된 메모리 사용에 맞춰 조정된 보상 형성을 사용하여 에이전트가 무엇을 요약하고, 무엇을 보관하며, 어떻게 색인을 생성하고, 언제 검색할지 학습하도록 합니다. 이는 요약만 사용하는 접근법보다 훨씬 적은 정보 손실 형태의 장기적 메모리를 제공합니다. 또한 우리는 Memex 루프가 역사가 증가함에 따라 효과적인 컨텍스트 내 계산을 유지하면서 제한된 역참조로 의사 결정 품질을 보존할 수 있는 잠재력을 이론적으로 분석합니다. 실험적으로, 도전적인 장기적 과제에서 MemexRL로 훈련된 Memex 에이전트는 상당히 작은 작업 컨텍스트를 사용하면서도 과제 성공률을 향상시켰습니다.
English
Large language model (LLM) agents are fundamentally bottlenecked by finite context windows on long-horizon tasks. As trajectories grow, retaining tool outputs and intermediate reasoning in-context quickly becomes infeasible: the working context becomes prohibitively long, eventually exceeds the context budget, and makes distant evidence harder to use even when it is still present. Existing solutions typically shorten context through truncation or running summaries, but these methods are fundamentally lossy because they compress or discard past evidence itself. We introduce Memex, an indexed experience memory mechanism that instead compresses context without discarding evidence. Memex maintains a compact working context consisting of concise structured summaries and stable indices, while storing full-fidelity underlying interactions in an external experience database under those indices. The agent can then decide when to dereference an index and recover the exact past evidence needed for the current subgoal. We optimize both write and read behaviors with our reinforcement learning framework MemexRL, using reward shaping tailored to indexed memory usage under a context budget, so the agent learns what to summarize, what to archive, how to index it, and when to retrieve it. This yields a substantially less lossy form of long-horizon memory than summary-only approaches. We further provide a theoretical analysis showing the potential of the Memex loop to preserve decision quality with bounded dereferencing while keeping effective in-context computation bounded as history grows. Empirically, on challenging long-horizon tasks, Memex agent trained with MemexRL improves task success while using a significantly smaller working context.