Open Source

I gave a coding agent a memory you can walk through

I wanted to close the chat, come back tomorrow and ask, “Where did I leave the remote?”

Thirteen seconds inside the agent’s memory. The panel on the right follows the selected remote as the clock moves. Full-size map and camera views.

I usually ask my coding agent to fix Python. This time I gave it a simulated robot’s camera feed and Loci, a Model Context Protocol (MCP) server for writing object sightings, estimated distances and notes into a spatiotemporal database. The video is a 3D view of what it wrote. Each sighting has a time and a camera position, so I can wind the remote back from the hall console to the coffee table.

If I wanted a robot to drive around my actual living room, I’d give it lidar, a depth camera and a voxel map. I have no particular desire to debug a chair-shaped dent in the drywall. What I wanted to try was giving a language model 60 fairly lousy pictures and somewhere permanent to put what it saw. GPT-6.1-Sol got the 640 × 480 images, timestamps and the robot’s reported pose. The simulator kept the depth data.

One remote, two tables

Two camera crops 81 seconds apart. At 09:33:08 a small grey remote rests beside a dinosaur on the coffee table. At 09:34:29 it sits in front of the books on the hall console. Yellow corners mark it in both images.
Two crops from the robot’s camera, 81 seconds apart. I marked the same remote in each. See the console before and after the drop-off.

On the coffee table, next to a toy dinosaur. That’s where Sol first put the remote, 1.15 metres ahead of the camera and 43 centimetres to its right. Then the robot reached for it. At 09:33:46 Sol recorded that the remote had disappeared from the table. A second later it wrote “carried by robot.” By 09:34:29 it had the kind of answer I’d actually want yelled back from the other room. “Left front of hall console, in front of stack of books.” The agent’s original observations

The blue line in the video is the path the robot says it took. The 17 shapes around it are things Sol remembered. Four position estimates belong to this one remote. In a fresh conversation I can ask where it ended up. I can also ask where it was before the robot picked it up. Overwriting the coffee-table sighting would have cost me that second answer. Inspect the remote in the explorer

What survives when I close the chat?

In my first version the model copied the robot’s pose into a tool call for every frame. It did a perfectly serviceable impression of an expensive data-entry clerk. The robot already has a clock and knows where it thinks its camera is. Now the loop saves those along with the picture. The model gets the interesting job of deciding what happened in it.

The robot loop saves the frame, time and pose. The model appends what it saw through remember. A recall query derives a belief from the claims in force at the requested time.
The original picture stays on disk. The 3D position is the model’s estimate, and a later observation can change the answer.

The pictures live on disk beside a SQLite database. Through MCP the agent calls remember to attach a claim to a sighting and recall to ask where something was at a particular time. With view it can reopen the picture that prompted the claim. If tomorrow’s model can tell that yesterday’s “remote” was a calculator, forget lets it withdraw the claim. The original picture and the history of the mistake survive. Storage design

My favorite button in the explorer puts the agent’s boxes back on top of the camera image. The person and chair looked perfectly plausible to me on the 3D map. Then I saw where Sol had put the person.

The model’s green person box sits down by the person's legs in a doorway and its purple chair box grazes the seat in front of the camera.
Frame 37. The green person box is down around the shins. The purple chair box barely catches the seat.

The cat was concrete

I tried giving the same job to an object detector. I ran YOLO26s over the same 60 frames, used Depth Anything V2 to estimate how far away each box was, and wrote those measurements into a second Loci database. Watch the hall console on the left of the video. On the right is the estimated depth.

The same 60 pictures in 16.5 seconds. Left, YOLO’s labels. Right, estimated depth, from purple nearby to yellow at six metres or more. Inspect the console.

YOLO found the grey remote in front of the books. It also found a cat, with 92% confidence. It’s a concrete figurine. By the end I had 18 cat detections in an apartment with zero live cats.

The remote shows where depth and tracking matter. The tracker joined nearby sightings of the same class, so the remote on the console got a different ID from the one on the coffee table. When I asked for its last position, the detector-and-depth estimate was 99 cm from the simulator’s placement. Sol’s was 4 cm away. That’s one object. The useful part is being able to open the frame and work out where the error came from. Detections and settings

Inspect the depth estimate and the detection benchmarks
The YOLO and simulator boxes nearly coincide around the remote. The simulator measures 0.72 m along the camera axis. The depth model estimates 1.58 m.
YOLO found the remote on the console. The depth model put it another 86 cm into the room. I compared the middle of the predicted box with the simulator’s median depth over visible remote pixels.

On this frame, the depth model put the middle of the remote’s box at 1.58 metres. The simulator’s visible remote pixels had a median depth of 0.72 metres along the camera axis. YOLO found the remote in four of the 14 frames with visible pixels at a box overlap of at least 50%. Detector weights · Indoor depth checkpoint

A coding agent can revisit “cat” and add “ornament” to the record. A stock detector will give me another box. Open-vocabulary detectors also take text prompts, and dedicated models have a very good reason to live on robots. The YOLO-World authors reported 52 frames per second on a V100. YOLO-World paper · Ultralytics tracking

Selected Ultralytics models, mAP at 50% overlap and averaged over 50–95% overlap, on a 0–100 scale. Gemini 4 Carbon 58.4 and 37.9, GPT-6.2 Astra 54.3 and 34.6, Claude Fable 5.2 53.8 and 33.9, Claude Opus 5.5 52.6 and 32.5.
Four models from the December 1 detection leaderboard, including the leader, Gemini 4 Carbon. Green gives a correctly labeled box credit at 50% intersection-over-union. Rust averages the score across ten thresholds from 50% to 95%. A loose box has a harder time there. Full Ultralytics results and methodology.

On the December 1 Ultralytics detection leaderboard, Astra, Fable and Opus finished within two points at 50% box overlap. All three scores drop when a tighter fit counts. In a separate head-to-head, the grounding-trained Rex-Omni scored 64.3 against Grounding DINO’s 47.7 on zero-shot LVIS using F1 at 50% overlap. DepthLM also needed specific training to reach specialist-level accuracy on depth at a queried pixel. Rex-Omni, table 3 · DepthLM paper

SpatiotemporalBench interrupts the robot

Finding the remote felt like a win until I remembered that picking it up was the robot’s entire job. So while it was busy at the coffee table, SpatiotemporalBench asked about the Wi-Fi router it had passed 31 seconds earlier. The robot had turned. Where was the router relative to its camera *now*?

The benchmark shows the agent a simulated robot’s camera feed one frame at a time and interrupts it mid-job. Code grades the answers against the simulator’s hidden world. Guessing you can drive through furniture costs more than saying “I don’t know.” Benchmark code and tasks

Three questions from the apartment run. Sol estimated 1.70 m of driving room (actual 0.97 m), a closest pass of 5.60 m from a person (actual 5.21 m), and a router 0.85 m behind and 0.76 m right (actual 0.96 m behind and 0.75 m right).
Three consecutive questions on the way to the remote. Each photo shows what GPT-6.1-Sol could see at the numbered frame. The simulator kept the measurements.

Sol missed the router by 11 centimetres. Its answer about driving straight would have found the furniture. That’s why I’d build the benchmark first. When I changed how Loci recorded poses, I could replay the same trip and check both the answers and the token bill. I hillclimb on development cases and save unseen ones to find out whether a gain holds up. How I built SpatiotemporalBench

See the grader and the six apartment questions
Frame 14 shows a router with antennas under the TV. In frame 26 the robot faces the coffee table. It estimates the router 0.85 m behind and 0.76 m right. The grader gives 0.96 m behind and 0.75 m right.
At frame 14 the router is under the TV. At frame 26 the camera faces the coffee table. The agent has to answer in metres behind and to the right of its new position.
The actual SpatiotemporalBench run viewer showing model answers, gold answers, scores and evidence thumbnails. The first three scores are −0.50, +0.25 and +0.56.
The first three graded answers in the apartment smoke test, captured from stbench view. The benchmark computes the gold answers from the simulation. The agent only sees the evidence available to it at the time. Gold for this case.

I sent Luna, Sol and Astra around the apartment three times each at xhigh reasoning effort. On the first lap each agent could write claims and reopen stored images with Loci’s view. Astra fetched six old images, Sol five and Luna zero. On the second lap each got timestamped pictures and a notes file, which I call tape. On the third, the agent could query YOLO boxes and estimated depth at any pixel. Only those measurements reached the agent. All three setups received the robot’s poses, status and task updates.

Mean SpatiotemporalBench scores in the order RGB with Loci, RGB with tape, and a read-only YOLO/depth database. GPT-6 Luna +0.17, -0.11, -0.37. GPT-6.2 Sol +0.80, +0.83, +0.23. GPT-6.2 Astra +0.78, +0.62, +0.26.
One run per cell. The large number is the mean graded score over six questions. The small number is median seconds from question to submission. The sessions overlapped, so the times include whatever waiting the service did. All 54 answers, grades, timings and tool counts.

Astra with detector data estimated 1.02 metres of forward clearance against a true 0.97. Asked about the router and picture frame, it answered “unknown” both times. With RGB and Loci it earned +0.83 on the router. These were single runs over six questions. The detector comparison changes the evidence as well as the tools.

Question-by-question scores for all nine sessions. On the detector database Astra earned nearly full credit for forward clearance and answered unknown for the router and picture frame. Each cell’s exact score and submitted answer are in the accompanying data.
All six questions had answers in the simulator. U means the agent chose unknown and earned zero. Positive and negative numbers are partial credit and penalties under the benchmark’s scoring rules. An especially hazardous answer can cost more than one point.

Now point the camera at a wall

Sixty frames can fit in a conversation. I wanted to know what happens when the agent has been driving long enough for Codex to condense its earlier conversation into a summary. I sent it on four warehouse jobs, 344 frames in all. At the end of the last job, the robot was facing a wall. The benchmark asked how close a person had come during that job.

The entire four-job shift in 21.5 seconds. The colored lines follow the robot’s reported positions. Original warehouse case.

I ran three GPT models, Luna, Sol and Astra, on the same live camera feed. In live-only Loci, each could write sightings and read its claims. I checked the database and tool logs afterward. Zero stored images, no file reader, zero old pictures returned. With Loci + tape, each also had a timestamped frame archive and a notes file. Pictures still in the conversation could help either way. For this test I set Codex to compact at 25,000 tokens.

A warehouse worker appears at frame 313. At frame 343 the camera faces a wall. The minimum distance during task four was 2.056 metres. Live-only Loci and Loci plus tape answered, respectively: Luna 0.60 and 1.50 m, Sol 2.05 and 2.10 m, Astra 2.05 and 2.08 m.
The last evidence frame was 318. The question arrived at 343. The grader wants the closest approach across the whole fourth job. Submitted answers and compaction records.

All six Loci sessions had gone through one summary since the last frame showing the worker. The actual closest approach was 2.056 metres. Sol and Astra each answered 2.05 metres with live-only Loci. Luna said 0.60 metres with live-only Loci and 1.50 with tape available. A detail can survive in a written claim or in the summary.

Would a normal run ever fill the window? Sol drove the whole warehouse route at its default setting without compacting. On a longer vacuum job, Astra hit its first compaction at the default setting after 472 frames and 38 answers. I stopped the vacuum there. Apparently even vacuuming an apartment can be too much context.

Follow the drum, the compaction log and the vacuum run
The black drum at frame 5 and the empty shelves at frame 24. The nearest point on the drum is now 11.64 metres behind the robot and 1.01 metres to its left. Astra with live-only Loci answered 11.65 behind and 0.93 left.
The question asks for the nearest point on the drum relative to the camera at frame 24. The robot gets its pose with each image. Astra answered before its first compaction.

The six warehouse Loci runs compacted 8 to 11 times each. Of eight answerable memory questions, two had a compaction between the last evidence and the question in all six runs. The black drum came early enough to test geometry while both pictures could still be in context.

Recorded compaction boundaries in the warehouse. Luna with Loci alone 10, with Loci plus tape 10. Sol with Loci alone 10, with Loci plus tape 11. Astra with Loci alone 8, with Loci plus tape 8. Sol with Loci alone at its default setting compacted 0 times.
Each tick marks a context summary in the Codex log, aligned with the last delivered frame. A summary can carry details forward. A dot marks repeated compaction at the same frame.

Sol scored 0.811 on the warehouse at its default setting and 0.693 at 25k, with zero and ten compactions respectively. The vacuum route had 1,055 frames available. Its stopping rule was the first compaction or the end of the job, so it supplies a context-length measurement only.

Astra’s first and last camera views in the default-window vacuum test. 472 of 1,055 frames delivered.
Both images come from the vacuum’s camera. The bar shows the share of the available route delivered to the agent. Recorded settings and compaction event · Original vacuum case.

Could I have just kept the pictures?

This is the mildly embarrassing part of building a spatial database. A folder of timestamped pictures and a notes file makes a pretty good memory. A vision model can scan a tiled page for the TV cabinet and ask for the frame with the router. That’s the idea behind tape. In the scored runs it retrieved up to two full pictures per call. The same apartment as a tiled contact sheet

On those 15 warehouse questions I could give both agents tape and see what adding Loci bought. Or I could give both agents Loci and see what happened when one could reopen old pictures. Same model, same feed, same questions, one run per setup.

Warehouse change in mean benchmark score from adding Loci to tape: Luna −0.128, Sol +0.043, Astra −0.030. Adding tape to live-only Loci: Luna −0.286, Sol +0.069, Astra −0.064. All six contrasts use the same 15 questions.
Right of zero means a higher mean score with the extra tool. Each bar pairs the same model and the same 15 questions, at xhigh reasoning effort and a 25,000-token compaction threshold. Every paired difference.

With tape already available, adding Loci moved Sol from 0.720 to 0.762. Luna and Astra went the other way. All three used the archive in their combined runs. I also tried a fairer version of tape across 19 development cases, where reopening an image returned the camera pose it came with. Over 73 answerable memory questions, the average change with Loci was +0.007 for Luna and +0.187 for Sonnet, giving each case equal weight. Both 95% intervals included zero. I couldn’t pick a winner from those runs.

Explore the four setups and the 19-case uncertainty intervals
Mean score in the order Loci with one-time RGB, Loci plus tape, tape alone, detector database only. Apartment: Luna +0.33, −0.16, −0.11, −0.37. Sol +0.71, +0.84, +0.83, +0.23. Astra +0.71, +0.80, +0.62, +0.26. Warehouse: Luna +0.46, +0.17, +0.30, −0.08. Sol +0.69, +0.76, +0.72, +0.50. Astra +0.74, +0.68, +0.71, +0.59.
One run per model and setup in each place. The warehouse changes the layout, job, questions and context setting, so compare setups within each panel. The apartment’s tape and detector controls carry over from the first experiment. Per-question grades, tool usage, compaction frames and control run.

The apartment used six questions at default context settings. The warehouse used 15 and the 25k threshold. Compare setups within a place. In the warehouse Loci + tape runs, Luna reopened 48 pictures, Sol 51 and Astra 27, including repeat views. The live-only agents reopened zero. Luna’s tape-only session needed a reminder to continue to the second question on the final frame. Its notes and earlier answers stayed in the session. Per-question results and access audit

Paired Loci-minus-tape scores with 95% intervals. Luna on all memory questions +0.007 [−0.163, +0.176], reference-compaction subset −0.031 [−0.228, +0.166]. Sonnet on all memory questions +0.187 [−0.020, +0.393], subset +0.349 [−0.072, +0.770].
Each case gets one vote. The dot is the mean of the within-case score differences and the line is its 95% paired t interval. The second row for each model uses questions whose evidence crossed a compaction in a separate run without external memory. That gives Luna 42 questions in 19 cases and Sonnet 51 in 18. Per-case differences and intervals.

In the earlier 19-case Sol comparison, Loci averaged 0.589 and tape 0.594. Tape used about half the input tokens. That version of tape returned the picture, label and time, while Loci could also return the old pose. The chart above uses the later, header-matched runs. Original Sol scorecard · Paired differences

There’s a speed tradeoff, too. On 41 paired memory questions, GPT-6.1-Sol took a median 16.3 seconds with Loci and 12.5 with tape to answer. During the apartment run Sol took 3.44 seconds to turn a frame into a Loci observation. YOLO and depth produced their measurements in 102 milliseconds per frame. Loci itself took 9.3 milliseconds to file the picture and pose. Most of the wait was the agent deciding what it saw.

See the answer times and frame-processing timings
Median answer times for GPT-6.1-Sol on 41 paired memory questions: 16.3 seconds with Loci and 12.5 with tape. On 49 apartment frames: 3.44 seconds to a Sol observation in Loci, 102 milliseconds for YOLO plus depth, and 9.3 milliseconds for an image-and-pose write alone.
Top: the same 41 memory questions, each asked on its own, across 13 development cases. Bottom: 49 frames where Sol saved an observation in the original apartment run. For the local timings I replayed those images three times with the models loaded. YOLO ran on four CPU threads and metric depth ran on an RTX 5090 Laptop GPU. Individual timings and method.

Take the apartment for a walk

For a robot that just needs to answer questions, I’d try timestamped pictures and notes first. What I’d miss is being able to click a chair on the map and see the sliver of seat that convinced the agent it was there. I’m keeping those 98 seconds of lousy camera footage. When the next model comes out I can give it the same apartment and see where it puts the chair.

With Git, Python 3.11+ and uv installed, these commands open the apartment from the video. The replay runs locally without a GPU, an account or a dataset download.

git clone https://github.com/DanMcInerney/loci.git
cd loci
uv run --no-dev python examples/apartment/replay.py places/apartment
uv run --no-dev loci explore places/apartment

Search for grey remote, select it and drag the clock to 09:33:08. There it is, back on the coffee table. The sample includes the 60 poses and the agent’s observations. The camera photos in this post come from the full benchmark recording. Apartment replay

Connect your own coding agent

Register a fresh place with Codex using the command below. For Claude Code, substitute claude for codex. To ask about the remote you just inspected, replace ~/.loci/home with the absolute path to the replay’s places/apartment.

codex mcp add loci -- uvx --from "loci[mcp] @ git+https://github.com/DanMcInerney/loci" loci serve ~/.loci/home

Camera imagery comes from SpatiotemporalBench v0.11.0. The crops, highlights, detector overlays and videos were made for this post. Dataset and scene credits · CC BY 4.0