arXiv:2610.22736cs.ROOct 2026

Manuscript Offprint

arXiv:2610.22736

Spatial Memory by Agents, for Agents

Qianwei Wang, Ce Zhang, Zhanpeng Luo, Pengpeng Su, Shuo Yang, Hao Xu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Qianwei Wang 2^{2}, Ce Zhang 3^{3}, Zhanpeng Luo 4^{4}, Pengpeng Su 5^{5}, Shuo Yang 5^{5}, and Hao Xu 1,∗^{1,*}

Abstract—Spatial memory enables robots to reuse past observations for localization, navigation, and question answering. Designing such memory involves jointly deciding what to retain and how to retrieve it for diverse semantic, metric, and temporal needs. We investigate whether coding agents can automate this design process through iterative implementation and evaluation. Under a fixed development budget, a Designer Agent writes and revises code for memory construction and retrieval using feedback from a fixed Query Agent. The resulting implementations are frozen before building memories from held-out observation histories, without access to downstream questions, and evaluated across five complementary task tracks using the same Query Agent. Across three independent design searches, Codex / GPT-6 Astra averages 44.23 on the equally weighted five-track score, versus 29.32 for ReMEmbR, the strongest evaluated baseline supporting all five tracks, a 50.9% relative improvement. Qualitative analysis relates performance differences to evidence retention and retrieval, while identifying grounding and evidence-use failures. These results demonstrate the potential of coding agents to automate spatial memory design, while revealing task-dependent trade-offs in performance and computational cost. Project page: https://ba-fa-3344.github.io/.

I. INTRODUCTION

Spatial memory enables robots to use past observations to answer questions unknown during exploration. After traversing an office, a robot may be asked where a chair is, which cabinet is beside the desk, what the room looks like, or when it last saw an object.

These questions require complementary spatial, semantic, and temporal evidence. Deciding what to retain and how to organize it is difficult: a memory supporting one query type may omit information essential to another.

Existing systems organize observations differently. Re-MEmbR [1] stores captions with poses and timestamps, ConceptGraphs [2] builds object-centric graphs, DAAAM [3] maintains temporal object/place histories, and FARM [4] retrieves evidence through spatial relations. Perception models, association strategies, embeddings, and retrieval tools create a large, coupled design space: useful retrieval requires both retaining evidence and making it accessible to downstream agents. Repeated implementation, evaluation, and revision make manual development costly.

Figure

Public feedback

Fig. 1. Spatial memory by agents, for agents. A shared component pool supports different implementations (puzzles) for the same question requirements (board). Coding agents revise their designs using public feedback. The human–agent contrast is conceptual.

Coding agents offer a way to explore this space by implementing candidates, running experiments, and revising code in response to failures. Recent work demonstrates these capabilities in agent architectures and ML pipelines [5], [6], and in robotics through trace-guided program repair and real-world policy improvement [7], [8]. This motivates our question (Fig. 1): given reusable components, development feedback, and a fixed budget, how well can a coding agent design spatial memory for another agent across diverse tasks?

Our workflow separates design, build, and query, with distinct Designer and Query Agent roles. The Designer iteratively develops memory construction and retrieval using public-task feedback. The selected implementation is frozen before building memories from held-out histories without downstream questions. A fixed Query Agent then answers through each system's retrieval tools, enabling comparison under a common downstream agent. Figure 2 illustrates how a design revision changes the semantic evidence stored in memory.

Building on NaVQA and OC-NaVQA [1], [3], our evaluation covers category-level and referring-expression localization, spatial and temporal QA, and navigation-history QA. Across three independent searches, our strongest Designer, Codex / GPT-6 Astra, averages 44.23 Unified on held-out histories versus 29.32 for ReMEmbR [1], the strongest evaluated full-track baseline. We analyze implementations,

∗^{*}Corresponding author: Hao Xu.

1^{1}Hao Xu is with Nanjing University (e-mail: xuhao3e8@nju.edu.cn).

2^{2}Qianwei Wang is with Princeton University (e-mail: qw3601@princeton.edu).

3^{3}Ce Zhang is with Carnegie Mellon University (e-mail: cezhang@cs.cmu.edu).

4^{4}Zhanpeng Luo is with Johns Hopkins University (e-mail: zluo45@jh.edu).

5^{5}Pengpeng Su and Shuo Yang are with Mondo Robotics (e-mail: pengpeng.su@mondorobotics.com; shuo.yang@mondorobotics.com).

Which cabinet is near the foot of the bed?

What is hanging from the bedroom ceiling?

What is depicted in the painting above the bed?

Figure

What color are the bedroom walls?

Where is the full-body mirror?

How long ago did you first enter the bedroom?

Public evaluation

Scores + logs

From geometric objects to semantic evidence

Before

Refine naming

Coding Agent

Retained revision

elevator door

aircraft model

umbrella

Crop-based semantics

mirror

ceiling fan

stained glass lamp

Fig. 2. An agent-discovered revision on a public HM3D scene. Shared observations and public questions guide a crop-based naming revision: aircraft model becomes ceiling fan, while object geometry stays unchanged. Bottom panels show actual memory artifacts, not answer predictions; puzzle assemblies denote implementations.

development traces, and resource costs to relate design choices to performance and computational trade-offs.

Our contributions are:

• A coding-agent workflow that jointly designs spatial memory construction and retrieval through budgeted, iterative implementation and evaluation.

• A five-track spatial memory evaluation suite with separate development and test histories and a fixed Query Agent for controlled cross-task comparisons.

• An empirical demonstration of improved average cross-task performance over evaluated full-track baselines, with analyses of evidence retention, retrieval interfaces, and performance–resource trade-offs.

References (34)