Where Did This Come From, and Why? Giving Agents the Computation and Intent Behind Every Output with marimo-lens: what it means for business leaders

marimo-lens gives a coding agent the cells that produced a chart or number an analyst points at, plus the earlier requests that shaped them, so it asks before silently undoing a colleague's decision.

1. What the method is

marimo-lens is an open-source extension for marimo, a reactive Python notebook, that implements a design the authors call Lens. Lens maintains a provenance graph in three layers: the view (rendered charts, tables, numbers), the computation (the cells that produce them) and the intent (recorded requests, with who asked, why, and which cells changed in response). When an analyst selects part of an output, Lens extracts a graph cut: the output, its producing cell, every upstream cell, and the earlier requests that changed any of those cells. Each earlier change carries a status derived from the code (present, reverted or unknown), and each request carries a standing only a person can state (confirmed, withdrawn or unset). The agent receives this as a brief with tools to fetch more, and points back by marking the output, showing the cells it used and leaving a receipt.

2. Why the method was developed

Analysts increasingly ask agents for changes by pointing at an output, and current tools hand the agent only that output, often as a screenshot. The agent must then reconstruct the computation, which usually sits upstream, and 35% of the 1,085 tool-calling models the authors counted cannot read images at all. Code also records what was done, not why: a filter excluding 2012 does not say a colleague asked for it. The authors cite prior work in which 40% to 73% of evolving coding tasks lose behaviour established in an earlier turn. Their own study of 7,293 public Observable notebook histories found that 86% of charts depend on other cells, 28% of histories contain an undone edit (65% of long ones), and no prose is edited in 68% of code-changing sessions. Of 29 prior systems they rated, none fully covers view, computation and intent together.

3. Who should care

Analytics and data science leads whose teams share notebooks and delegate edits to coding agents are the direct audience, because the failure this targets is one analyst's request quietly reversing another's. Platform engineers who run notebook infrastructure should note that it ships with marimo's recommended installation and that one public-sector data engineering team already bundles it with its notebook server. Whoever owns our model spend should look at the token figures for text-only, open-weight models, since that is where the savings appear. Anyone accountable for published reports has an interest in a number on a page tracing back to the cell and the decision behind it. Our own product teams building agent features should read it as a pattern rather than a notebook feature: record requests against the code they changed, and make the agent ask before reversing one.

4. How the method works

marimo already tracks which cells read which variables and gives every cell output a stable identifier, so the view and computation layers are rebuilt from the running kernel rather than stored. A browser widget carries the analyst's selection to the kernel; outputs in reports and slides are resolved through four HTML attributes naming their producing cells. Only the intent layer is persisted, as a JSON Lines file beside the notebook holding each request, its asker, timestamps and the code of every changed cell. It also follows the editor's edit stream to capture direct edits and interleaves relevant git commits. Status is derived by comparing a recorded change with current code: present if added statements remain and removed ones stay gone. An accompanying Agent Skill carries a rule for acting: where a present change came from a confirmed request, or an unset one by another person, the agent names it and asks first.

5. How it was evaluated

The authors ran 3,288 agent runs across three experiments, three runs per output and input, on four models inside Claude Code: Claude Sonnet 5.5 and Haiku 5.5, which read images, and the open-weight Beam 1.0 and GLM-5.3, run text-only. Materials were public Observable team notebooks reimplemented in marimo, with 22 real requests taken from comment threads in three notebooks plus 50 further outputs. Experiment 1 asked agents to name the producing cell given the question alone, a marked screenshot, or marimo-lens. Experiment 2 asked them to report earlier requests on 27 outputs, 13 of which had one. Experiment 3 let agents edit on 10 outputs backed by 7 earlier requests, using a conflicting request and a control. Separate checks tested status derivation and whether selections survive reruns. Because the notebooks predate the tool, a script reconstructed the intent record from comments and history.

6. How it performed

With marimo-lens, agents named the producing cell in 99% of runs against 39% from the question alone; text-only agents rose from 40% to 98% while median input tokens fell from 524k to 293k and from 622k to 205k. Image-reading agents did as well with a marked screenshot, at lower token cost. Agents reported earlier requests in 95% of runs, against 69% with comment threads. On conflicting requests they undid the earlier change in 15% of runs, against 96% given only the cell's name, but also stopped unnecessarily on 15% of control requests, and one model, Beam 1.0, undid the change in 16 of 30 runs. Status detection can miss an inverted comparison. The evidence rests on three notebooks from two teams, a reconstructed record, one agent harness and single-turn tasks. Our call: pilot it with one team that already works in marimo, and watch how often the agent's questions are wanted. (Source: arXiv 2612.05904, 2026)

← Back to dossier index