Skip to content

Analyze data in your browser

The assistant on nemar.org, the website of NEMAR (Neuroelectromagnetic Data Archive and Tools Resource), can read and plot a recording for you instead of only describing how. It writes Python, you approve it, and the code runs inside your own browser tab. This page describes what is live today.

The assistant is operated by the Open Science Collective as part of its Open Science Assistant; its documentation is at docs.osc.earth/osa. By default the assistant uses a Claude model from Anthropic, currently one from the Haiku class. The chat’s Settings lets you choose another model the service offers, or use your own API key. This page does not name a model version, because the operator can change the default without notice.

The assistant’s Python runs in Pyodide, which is Python built for WebAssembly, the format browsers use to run compiled code safely. Pyodide runs in a Web Worker, a background thread of your browser tab, so a long calculation does not freeze the page. The code itself runs only in your browser.

By default every run the assistant proposes needs your approval. Before any code runs, the assistant shows it to you under “Run this Python in your browser?” with three choices:

  • Run runs that code once.
  • Don’t run declines it.
  • Run without asking until I reload approves every run until you reload the page.

Each run is recorded in the chat, with its code, its text output and its figures. Each recorded run also has an Edit and run button, which opens the code in an editor. Pressing Run there is your own approval, so it runs your edited code without asking again. It runs in the same Python session as the assistant’s runs, so variables from earlier runs are still there. The assistant is not told that you ran it and cannot read its output. Variables or files your edit leaves behind stay available to later runs, and what a later run prints reaches the assistant in the usual way.

The Python session comes with numpy, SciPy, matplotlib, zarr and eegprep-lean, which is the library that reads NEMAR recordings. MNE is not available. Nothing else can be installed. The only network host the code can reach is NEMAR’s Zarr host, so it cannot download from other sites. Zarr is a format that stores an array as many small chunks, so a page can fetch only the pieces it needs; see Zarr and edge access.

The assistant reads recordings through NEMAR’s Zarr copy, not through the original files. That copy is lossy: it is quantized, and it may be sampled at a lower rate than the original recording. The assistant is instructed to say so when it reports what it read, and to say when a window is downsampled. If you need the original samples, download the dataset instead; see Which surface should I use?.

After each run, the assistant receives this automatically:

  • The text the code printed, up to 16,384 characters.
  • The error text, up to 8,192 characters.
  • A summary of the facts about the run, such as variables created, their types and shapes, up to 8,192 characters.
  • Up to 3 figures, as Portable Network Graphics (PNG) images.
  • The names of any files the code explicitly saved.

Arrays and data are not sent unless the code prints them. The assistant can also ask the page for more of a run’s saved output, up to 262,144 characters per stream, and it will see what comes back. That fuller copy is kept only in the current tab and is gone when you reload. Because what is sent automatically is limited, the assistant is told to print a few summary lines instead of whole arrays. It does not read your Edit and run runs, as described above.

The assistant also receives the address, known as the Uniform Resource Locator (URL), and the title of the page you are on. This is controlled by the setting labelled “Share page URL to help answer questions” in the chat’s Settings, which is on by default. Turn it off and the page address and title are not sent.

Limit Value
Time for one run 120 seconds
Figures returned from one run 3
Runs in one assistant reply 20
One array view A view of 2 gibibytes (GiB) or more is refused

The last limit comes from 32-bit WebAssembly, the build of Pyodide the browser runs, which refuses one array view of 2 GiB or more with the error “array is too big”. This is a limit on one view, not a memory budget for the whole session. SciPy’s welch spectrum function builds one such view over all of its windows at once, so the assistant calls it one channel at a time.

If the runtime runs out of memory it restarts, and the run is reported as “Stopped: out of memory”. Asking for less data at a time, such as fewer channels or a shorter window, is the usual fix.

The first time you use the assistant in a browser, it downloads the Python runtime and its packages: 35.4 megabytes (MB) in one measurement, on 2026-09-24 in a cold Chrome profile. The download starts when you send your first message, so it overlaps with the assistant’s own first reply. A reader who only opens the chat and sends nothing does not pay for it.

Later visits normally reuse the downloaded files from your browser’s cache, unless the cache was cleared or the packages changed. In one measurement on NEMAR’s test site in a cold browser profile, the assistant’s first reply took about 8.1 seconds to reach the Run prompt. Your times depend on your connection and on how busy the model is.

Every run’s code, text output and figures are saved in your browser, in IndexedDB, the storage built into browsers. They are kept separately for each site and each assistant, up to 250 MB, and nothing in the workspace is sent to the server. The workspace keeps a fuller copy of each run’s output than the assistant is sent automatically; the server receives only the bounded result described under “What the assistant sees”, plus anything the assistant asks the page to read back. The workspace survives a reload.

The chat’s Settings panel shows the space used and has two buttons:

  • Download workspace (.zip) builds one ZIP file in your browser with each session’s code, outputs and a notebook.ipynb that you can open in Jupyter.
  • Delete workspace removes it, after a second click to confirm.

Because browser storage belongs to one site, a workspace saved on nemar.org is not available on another site that embeds the assistant.

Beside Chat, the assistant’s panel has a Notebook tab on a dataset page that has a Zarr copy. It opens a JupyterLite notebook, which is a Jupyter notebook that runs entirely in your browser, with a starter notebook filled in for that dataset.

The notebook has its own Python. It does not share variables or files with the chat’s Python, and no model is involved in it. It runs your code, not the assistant’s. Use it when you want to write the analysis yourself.

NEMAR’s privacy policy covers the assistant, and the Open Science Assistant’s privacy page gives the full detail. In brief:

  • Your chat history is stored in your browser’s local storage on that site. Clearing site data removes it.
  • Your messages and the run results described above are sent to the assistant’s server, which passes them to the provider of the model in use to produce a reply. By default that is a Claude model through the Claude Platform on Amazon Web Services. The other models the Settings panel offers are served through Amazon Bedrock. Both work under zero data retention agreements. If you enter your own API key in Settings, the request is sent with that key, to Anthropic or to OpenRouter depending on the key.
  • The server keeps a conversation in memory for 24 hours after its last message and does not write it to disk.
  • The server also keeps usage records, which hold no question or reply text, and stores any feedback you submit, with your comment and, if you share the page, its address.
  • The workspace stays in your browser, as described above.

“Python is not available on this page.” The Python runtime did not load on this page. You see this on the disabled Run button of an Edit and run panel. Reload the page once; if it persists, report a problem or write to support@nemar.org.

“Python is starting in your browser. Try again in a moment.” The runtime is still downloading or starting. Wait for the progress bar to finish and press Run again.

“The Python runtime did not finish starting within 120s.” The runtime failed to start after two minutes. The usual cause is the page’s Content Security Policy (CSP), the browser setting that restricts what a page may run. Python needs the policy to allow WebAssembly compilation through 'wasm-unsafe-eval' in script-src and to allow blob: in worker-src; without either, the runtime hangs and then reports this failure. The policy is set by the site hosting the assistant, so if you see this on nemar.org, report a problem or write to support@nemar.org.

“Stopped: out of memory.” The runtime ran out of memory and restarted. Ask the assistant to work on less data at a time.

“Stopped: took too long.” A run reached the 120 second limit. Ask for a shorter window, fewer channels, or a simpler computation.

“array is too big.” One array view reached 2 GiB. Ask the assistant to process one channel or one segment at a time.

The workspace is not saved in a private window. Private browsing can refuse browser storage. A run still completes, and a line in its output names each file that was not saved. Use a normal window if you want a workspace to download later.