What should an agent remember before it knows the question?

In MC Gallery, the only instruction is to reach the gold wall. The agent passes 16 similar paintings along the way. At the exit, it sees one from a new angle. Can it use what it saved to recall the door and the side?

On the walk

Two turquoise paintings flank door 1.
Door 1
A different pair of turquoise patterns beside door 4.
Door 4
Door 7 with two similar green and blue paintings. The exit query matches the one on the left.
Door 7

At the exit

The exit query shows a re-photographed blue-green painting against a gray background.
Re-photographed painting

Where did this painting hang?

Door 7, left

If the painting never appeared on the walk, the answer is “not seen.”

Six environments

Try a decision from a real episode

Why Do Existing Memory Designs Fall Short with Deferred Queries?

Accuracy on deferred queries (%) with Claude Haiku 5.5
Memory designMC GalleryPoster MazeDMV-Hard
Basic image tools15.018.813.8
Hand-designed visual memory Archive only20.016.322.1
Evolved text memory23.816.342.1
Hand-designed visual memory Archive + matcher18.816.380.8
One-shot program13.820.028.8
A crop of the blue-green, navy and rust pattern from the vase page.
Query crop

AutoMem’s notes

Vase with the matching swatch in the lower left.
Vase · sourcerust-orange, cream and navy blurred blobs
Side table with a different swatch in similar colors.
Table · chosenrust-orange and dark navy blob accents

Evolved text memory

Its descriptions of one pattern often fit several others, so the stored notes cannot distinguish the queried item.

100 / 134photo-detail queries answered correctly
1 / 106pattern queries answered correctly

My notes led me to the side table. The swatch came from the vase.

Hand-designed visual memory

The program lacks operations that associate the match with a location and determine whether the queried picture was seen at all.

56 / 60seen paintings in the top match
0 / 60seen paintings located correctly

I found the painting in the frame. Which door was it beside, and on which side?

One-shot program

One gallery program records the order of the doors passed, whereas the later questions ask where each painting hung.

0 / 60seen paintings located correctly
11 / 20unseen paintings correctly rejected

I wrote down the doors in order. In ten walks, I saved just one frame.

The EvoViM framework

The agent starts with basic image tools and runs two development episodes. The same frozen model inspects the episodes, edits its program, and updates the playbook, notes and scripts it uses for later revisions.

Main results

Across the three models, EvoViM outscored AutoMem by 31.3 to 47.6 percentage points on the six-task held-out average.

Scores across generations

By generation 2, 13 of the 18 EvoViM programs had made at least 90% of their final gain over the starting program.

Revision support ablation

We removed enhanced feedback and inherited revision experience together in the Claude Haiku 5.5 runs.

MC Gallery

Development runs at ≥75% by generation 2
Full EvoViM
3 of 3
Without revision support
0 of 3

MC Gallery

Mean held-out score across three runs
Full EvoViM
88.3%
Without revision support
60.0%

DMV-Hard

Final held-out score, one run per setting
Full EvoViM
77.1%
Without revision support
82.9%

Evolved visual tools

Mechanisms added by evolution

EvoViM most often added frame parsing and image memory. AutoMem most often added text notes. A final program can add several mechanisms in one group.

EvoViMAutoMem
  1. Image memory
    EvoViM 39 AutoMem 0
  2. Frame parsing
    EvoViM 42 AutoMem 17
  3. Text notes
    EvoViM 6 AutoMem 22
  4. Workflow
    EvoViM 19 AutoMem 16

Mechanisms added across 18 final programs per method

Programs that gained each function

Each function is counted once per program, across 18 EvoViM and 18 AutoMem programs.

Image memory

  1. Pixel matching
    EvoViM 14 AutoMem 0
  2. Visual store
    EvoViM 12 AutoMem 0
  3. Visual recall
    EvoViM 11 AutoMem 0

Frame parsing

  1. Frame parsing
    EvoViM 13 AutoMem 1
  2. Spatial index
    EvoViM 8 AutoMem 6
  3. Decision support
    EvoViM 12 AutoMem 7

Text notes

  1. Text ledger
    EvoViM 6 AutoMem 13

Workflow

  1. Workflow control
    EvoViM 16 AutoMem 13

A tool from each task

Visual matching
Card Matching compares exposed card faces. DMV-Hard searches saved pages for the corner pattern in a product photo.
Spatial recall
MC Gallery locates a painting beside a numbered door. Poster Maze links a poster to a cell and wall.

With its evolved wall map, Qwen3.8-27B saw 4.3 posters clearly per episode, up from 1.5 with the starting program (10 held-out episodes).

Sequential decision-making
Tetris reads the board and plans a drop. Pac-Man updates its pellet map and finds the first move on a route.

Try EvoViM.

Run Card Matching offline with Python 3.10+ on macOS or Linux.

Terminal
git clone https://github.com/Lewis-Xinyu/EvoViM.git
cd EvoViM
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .
evovim demo --cards