MemCodex: Self-Programming Hierarchical Memory for Language Agents

📅 2026-09-30
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the challenges of heterogeneous memory access in agents and the inability of predefined workflows to adapt to multi-hop queries by proposing a self-evolving hierarchical memory system. This approach transcends predefined design space limitations by organizing experiences into executable programs, dynamically reconstructing layer-wise construction, indexing, and routing mechanisms through open-ended evolution to enable adaptive memory retrieval and composition. Furthermore, it introduces a unified runtime interface, MemArena, alongside a coarse-to-fine traversal strategy to support efficient execution. Experimental results demonstrate that the proposed system improves task success rates by 10.1%, reduces context token consumption by 3.4×, and accelerates inference speed by 2.1×.
📝 Abstract
Agent memory faces heterogeneous access needs: a single-hop question may require one piece of evidence, whereas a multi-hop question must combine evidence from multiple sources. Predefined memory workflows cannot adapt to these varying needs. Recent adaptive methods search or learn over memory components and their compositions, but the design space itself remains predefined. We introduce MemCodex, a self-evolving hierarchical memory system that organizes experience into executable memory programs for summaries, relational knowledge, reusable skills, and latent memory. Open-ended program evolution searches the open design space of layer programs by rewriting how each layer is constructed, indexed, retrieved, and routed, thereby adapting both within-layer implementations and cross-layer composition. At query time, reads traverse the hierarchy from coarse to fine and stop once sufficient evidence is found, descending to the original history when needed. We further develop MemArena, a unified runtime that places heterogeneous data and memory systems behind a common interface. MemCodex improves average task success by 10.1% relative to the strongest adaptive-memory baseline, while using 3.4x fewer context tokens and achieving 2.1x faster inference.
Problem

Research questions and friction points this paper is trying to address.

language agents
agent memory
heterogeneous access needs
memory systems
adaptive memory
Innovation

Methods, ideas, or system contributions that make the work stand out.

Self-Programming Memory
Hierarchical Memory
Program Evolution
Language Agents
Memory Arena
🔎 Similar Papers
No similar papers found.