MemCompiler: Compile, Don’t Inject — State-Conditioned Memory for Embodied Agents

  • Xintao Ding ,
  • Xinrui Wang ,
  • ,
  • Hao Wu ,
  • Shiqi Jiang ,
  • ,
  • Liang Mi ,
  • Hanxin Zhu ,
  • Kunxi Li ,
  • Yunxin Liu ,
  • Zhibo Chen ,
  • Ting Cao

arXiv

Existing memory systems for embodied agents typically inject retrieved memory as static context at episode start, a paradigm we term Ahead-of-time Monolithic Memory Injection (AMMI). However, this static design quickly becomes misaligned with the agent’s evolving state and may degrade lightweight executors below the no-memory baseline. To address this, we propose MemCompiler, which reframes memory utilization as State-Conditioned Memory Compilation. A learned Memory Compiler reads a structured Brief State capturing the agent’s current execution state and dynamically selects and compiles only relevant memory into executable guidance. This guidance is delivered through a text channel and a latent Soft-Mem channel that preserves perceptual information not expressible in text. Across Alf World, EmbodiedBench, and ScienceWorld, MemCompiler consistently improves over no-memory across open-source backbones (up to +129%), matches or approaches frontier closed-source systems, and reduces per-step latency by 60%, demonstrating that state-aware memory compilation improves both effectiveness and efficiency.