Reproduce “Memory as Code: Declarative Retrieval over Codified Long-Term Memory” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Aoting Zeng, Yuxin Du, Jianwei Wang, Yizhang He, Shan Jiang, Xuemin Lin, Kai Wang

MaC (Memory as Code) represents conversational memories as reusable computations and compiles each question into a query-specific retrieval program. The program selects and combines facts, including changing states, before execution, without further planning on successful runs. On LOCOMO with Qwen3.6-27B, MaC reached 86.84% judge accuracy versus Mem0’s 74.92%; it used fewer tokens than MRAgent on LongMemEval but ran slower.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.