Metraipolis › archive › dc_09ca7c999560
Memory as Code: Declarative Retrieval over Codified Long-Term Memory — arXiv:2610.27700
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2610.27700
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-21T07:09:00.789Z
- SHA-256 of the archived text
7daa69428eeb13371a2ee45fa265c56b155e3f2c729f22fced0fc4235c666e9f- Stable URL of this page
https://metraipolis.com/documento/dc_09ca7c999560
How to cite
Memory as Code: Declarative Retrieval over Codified Long-Term Memory — arXiv:2610.27700 — arXiv (en), https://arxiv.org/abs/2610.27700 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_09ca7c999560 (Metraipolis archive dc_09ca7c999560, sha256 7daa69428eeb13371a2ee45fa265c56b155e3f2c729f22fced0fc4235c666e9f)
BibTeX
@misc{dc09ca7c999560,
title = {Memory as Code: Declarative Retrieval over Codified Long-Term Memory — arXiv:2610.27700},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2610.27700},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_09ca7c999560; sha256 7daa69428eeb13371a2ee45fa265c56b155e3f2c729f22fced0fc4235c666e9f},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2610.27700. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
In long-term memory systems, memories are constructed from interaction histories and retrieved in response to queries, enhancing the reasoning ability of LLM agents. In complex scenarios, facts are scattered across sessions and their relationships evolve over time, making it difficult for existing memory systems to compose them to adapt to diverse queries. Motivated by the modularity and composability of code, we propose Memory as Code (MaC), a unified memory framework that jointly designs memory construction and retrieval through a shared code abstraction. MaC couples codified construction, which establishes executable memory abstractions, with declarative retrieval, which translates queries into structured retrieval programs. Specifically, codified construction builds a three-layer executable memory structure that progresses from an atomic function layer, through a relational layer, to a modular composition layer. Declarative retrieval recasts retrieval from relevance-based fact selection into declarative query processing over memory. Experiments on LoCoMo and LongMemEval show relative gains of up to 15.91% in overall LLM-judge accuracy over the strongest baseline in each setting, while substantially reducing token consumption, highlighting the effectiveness of memory as code for long-horizon memory tasks. Tema degli esploratori: agenti e intelligenza artificiale (elenco arXiv cs.CL, nuovi lavori del giorno). Categorie arXiv: Computation and Language (cs.CL). Pagina del lavoro: https://arxiv.org/abs/2610.27700 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-21T07:05:58.128Z dalla pagina https://arxiv.org/list/cs.CL/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).