Where Did This Come From, and Why? Giving Agents the Computation and Intent Behind Every Output with marimo-lens

Péter Ferenc Gyarmati, Trevor Manz, Dominik Moritz, Mennatallah El-AssadyarXiv 2026

TL;DR

When you point at a chart and ask an AI coding agent to "fix this," the agent usually only sees a screenshot—it has no idea how the chart was computed or why earlier decisions were made. This paper introduces Lens, a provenance graph that links visual outputs, underlying code, and human intent, and implements it in marimo-lens for reactive Python notebooks. With this context, AI agents locate the right code 99% of the time and stop silently undoing your teammates' earlier work.

What Problem Does This Paper Address?

Data analysts increasingly delegate coding to AI agents by pointing at an output—a bar in a chart, a cell in a table, or a number in a report—and asking to change "this." Current tools typically pass the agent just that output, often as a screenshot. That creates two major blind spots:

  1. Missing computation: The code that loads, filters, or transforms data often lives several steps upstream of the chart. Text-only models (which make up 35% of tool-calling models on models.dev) cannot read screenshots at all, and even multimodal models struggle to trace long-range code dependencies from an image alone.
  2. Missing intent: Code shows what was done (e.g., year != 2012), not why. If Ben asked three days ago to exclude 2012 as an outlier, and Ana points at 2012 today asking to "fit all years," an agent without intent history will happily delete Ben's filter—silently undoing his decision.
Ana points at the 2012 outlier, and Lens traces it through the computation to Ben's earlier request

Methods

To ground their design in real-world practice, the authors first analyzed 7,293 public Observable notebook histories and 17,328 cell comments. From this, they derived three design requirements: anchor requests to output parts, trace upstream computation, and record intent alongside whether a change is still present.

They then designed the Lens graph, an extended provenance graph spanning three layers:

  • View: Rendered outputs (charts, tables, numbers) with stable identifiers.
  • Computation: The blocks of code or queries that produce and feed those outputs.
  • Intent: Recorded requests, comments, or git commits, capturing who asked for a change and why.

When an analyst selects an output, Lens extracts a graph cut—the output, its producing and upstream code blocks, and any earlier requests tied to them. Crucially, Lens separates status (derived from code: present, reverted, or unknown) from standing (stated by a human: confirmed, withdrawn, or unset).

Figure 2: The Lens graph is an extended provenance graph in three layers (view, computation, and intent), paired with six positions for pointing in and back. In the view layer, outputs assembled from one graph of computation span several documents, such as a notebook, a report, and slides. Each output links to the computation blocks that produce and feed it, and those blocks link to requests in the intent layer that record reasons for changes. On the left (blue), the analyst points in to select a part, trace the computation, and record intent. On the right (purple), the agent points back to mark a part, show the computation, and report status. Highlighted in blue,

The authors implemented this in marimo-lens, an open-source widget and Agent Skill for the reactive Python notebook marimo. It lets analysts point at outputs (even in external reports or slides via HTML attributes) and gives agents tools to inspect the graph cut, mark outputs, show their computation trail, and ask before overriding an earlier request.

Datasets

  • Observable Corpus: 7,293 public notebook histories (2,431 with 25+ revisions) and 17,328 cell comments across 5,381 notebooks, used to study how analysts iterate and undo work.
  • Agent Evaluation Benchmarks: Three openly licensed team notebooks from Observable (CO2 over Time, Language of Accidents, and Language of Mechanisation) reimplemented in marimo, providing 22 real output-focused comment threads plus 50 additional outputs for testing.

Key Insights and Ideas

  • Readers point at outputs; code lives upstream: In Observable notebooks, 60% of chart comments are about what the chart shows, and non-creator readers refer to outputs far more than creators (45% vs. 26%). Yet 86% of charts depend on other cells, with 59% reaching two or more steps upstream.
  • Undos happen quietly: 65% of long notebook histories contain an undone edit, 52% of output-feeding undos happen upstream, and 68% of code-changing sessions edit no explanatory prose.
  • Status ≠ Standing: Just because a filter is still in the code (present) doesn't mean the team still wants it (confirmed), and vice versa. Separating the two prevents agents from making bad assumptions.
  • Pointing goes both ways: Analysts point in (select, trace, record), and agents should point back (mark the chart, show the code trail, report status) so both share common ground.

Key Results

The authors evaluated four coding agents (Claude Sonnet 5.5, Claude Haiku 5.5, Beam 1.0, and GLM-5.3) across 3,288 runs:

  • Finding the right code (Experiment 1): Agents located the producing cell in 99% of runs with marimo-lens, up from 39% from the question alone. For text-only agents, accuracy jumped from 40% to 98% while median input tokens dropped sharply (524k to 293k for Beam 1.0; 622k to 205k for GLM-5.3).
  • Reporting earlier intent (Experiment 2): Agents reported earlier requests in 95% of runs with marimo-lens, compared to 0% from a marked screenshot with git history alone.
  • Avoiding silent undos (Experiment 3): When given a conflicting request, agents without marimo-lens undid the earlier change in 96% of runs (from the cell's name) or 92% (from a marked screenshot). With marimo-lens, undos dropped to 15% (and 3% when the rule for acting and record were placed directly in the prompt).

Limitations and Future Work

  • Single-turn & reconstructed history: The real-world requests were reconstructed from notebooks predating marimo-lens, and Experiment 3 only tested a single turn—leaving open how teams resolve conflicts over multiple turns in practice.
  • Implementation edge cases: Because marimo-lens derives status from code statements, it can miss inverted comparisons (e.g., != flipped to ==) and misread reworded prose as reverted. It also groups requests by cell, meaning two charts rendered by one cell share their request history.
  • Agent compliance: Providing the graph cut and Agent Skill doesn't guarantee obedience—agents still undid earlier changes in 15% of runs, and an agent that misreads context could record a standing nobody stated.

Summary updated

BibTeX
@misc{gyarmati2026where,
  author = {Péter Ferenc Gyarmati and Trevor Manz and Dominik Moritz and Mennatallah El-Assady},
  title = {{Where Did This Come From, and Why? Giving Agents the Computation and Intent Behind Every Output with marimo-lens}},
  year = {2026},
  eprint = {2612.05904},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.05904},
}
Figure