Let your notebook agent see what you see.
Point to a notebook result and say what should change. Lens gives your agent the producing cell, related notebook context, and an annotated image to ground its work in the result you marked.
While the agent works, Lens can show which cell it is changing or checking, bring the result into view for review, and keep completed requests in History for another pass.
Read the user guide for the notebook-agent workflow.
Quick start
Open a local marimo notebook with Lens available:
uvx --with marimo-lens marimo edit --no-token notebook.py
Mount Lens in one notebook cell:
from marimo_lens import Lens
lens = Lens()
lens
Keep the cell mounted. Press Select, then click a point or drag a region inside a rendered output. Add a note with what you want the agent to inspect or change.
--no-token lets marimo Pair discover this local
notebook. Getting started
covers existing projects and includes a live selection example.
Connect an agent
Connect a notebook agent that can call the Lens Python API to the same running notebook. marimo Pair provides a ready-made integration.
After selecting an output and adding a note, ask the agent:
Resolve my Lens request.
The marimo Pair guide covers the ready-made workflow. Overview shows how another agent can read the request, show its activity, return a result, and keep completed feedback available for another pass.
Python API
The package exports Lens, LensContext, LensError, and SelectionImage.
Agent integrations use four methods:
| Method | Behavior |
|---|---|
lens.context() |
Returns detached selection context with lazy notebook text |
lens.activity(cell_id, *, label=None, message=None) |
Marks the agent's current work until its result is ready |
lens.reveal(cell_id, *, message=None) |
Brings one verified or explanatory cell into view |
lens.resolve(selection_ids, *, expected_revision, summary=None) |
Moves one or more selections to History in one guarded operation |
The Python API reference documents return values, errors, limits, and lifecycle behavior.
Project
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file marimo_lens-0.0.4.tar.gz.
File metadata
- Download URL: marimo_lens-0.0.4.tar.gz
- Upload date:
- Size: 160.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9481ce4a17aa1ff24fd9d365eb919f7d6376a3de6cbc968648a8a73e5253d48
|
|
| MD5 |
adc31eec08813e9b9d0e43fe208b4fe3
|
|
| BLAKE2b-256 |
13b306532e7a1437b6256b8cd91e4285c41b9accbb105f7ce8b9566e892737fc
|
File details
Details for the file marimo_lens-0.0.4-py3-none-any.whl.
File metadata
- Download URL: marimo_lens-0.0.4-py3-none-any.whl
- Upload date:
- Size: 169.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df1c9037602323ce6f60392f1b1cfb333dd37428ad90a3fbb43ed904bf928061
|
|
| MD5 |
0d96d4965a47f4a7a8af34da929d79a4
|
|
| BLAKE2b-256 |
3049e7131f0ee354874003c6174fca82fb6b6a9634ec5204dc4df2627a342ccc
|