Whybook

[?] Open source, for JupyterLab and Notebook 7

Question your data. See the choices behind each answer.

Whybook is a view of a Jupyter notebook with no chat box. Point at a column, a plot or a value, and pick one of the questions it offers, or type or say your own. Whybook writes and runs the cell, and shows each choice it finds behind the result.

Watch a 4-minute demo, or a whole analysis

Drag IL6 onto the model cell. Or click IL6, then the button that appears on the cell.

[5]

Mixed model: does arm change the trajectory?

Model check
reml True left joinAI re_formula ~monthAI missing dropAI
pain_score ~ treatment_arm * month + age
[5b]

Ordinal model

Model check branch
bins [-1, 3, 6, 10]AI distr logitAI
pain_level ~ 0 + arm_b * month + age
A replay of the prototype on its demo data, a synthetic clinical cohort. The questions, where each one goes and the code change are the ones the prototype produced.
  • Any .ipynb opens in Whybook and stays an ordinary notebook.
  • The first questions come at once from templates, with no model call.
  • Branches of a cell run in parallel, in kernel subshells.
  • One setting keeps the data on the analyst's machine.

The problem

AI can now run a whole analysis. Someone still has to understand it.

Language models run complete statistical analyses that experts judge sound in most cases. Developers who hand their coding to an AI assistant understand the code less, and data analysis is going through the same change now. Tim Hanewich calls the result the understanding gap. In data analysis it opens in four ways.

An answer without a question

A chat that is asked to "analyse this data" returns an analysis. The analyst no longer decides what to ask next.

Assumptions inside generated code

Generated code carries modelling choices that the analyst never sees. In the demo cohort, a constant in prep.py leaves out 27 of 318 patients.

Code that moved into files

Analysis code moves from notebooks into modules. A default set in a module does not show in the notebook that uses it.

Hidden reasoning

Models reason before they answer, and the analyst does not read that reasoning. A trace that is shown does not always report what the model used.

There is no point in analysing data if no one asked the question.

Why Whybook: the understanding gap, with its sources

How it works

A notebook view built around questions

Whybook opens any .ipynb as a second view, in JupyterLab or Jupyter Notebook 7. The analyst asks the questions, AI writes the code, and every choice stays in sight. The file stays an ordinary notebook, with the questions in its metadata.

A chat assistant and Whybook, compared
AspectA chat assistant Whybook
How the analyst asksTypes a promptDrags a column onto a cell, or clicks the column and then the cell, and picks a question or types one
What comes backText to readThe cells the question needs, run in the notebook, and an answer that links them
Where the assumptions areInside the generated codeChips on the cell, coloured by where each value comes from: the notebook's code, the AI in Whybook, or a default
How to try an alternativeStart another conversationBranch the cell; the branch runs in parallel, in a kernel subshell of its own
What is keptA chat logAn ordinary .ipynb, with the questions in its metadata

Drag or click

Ask by pointing at the data

Drag a column, a variable, a file or a table onto a cell, or click one and then the other. Whybook offers up to 12 ranked questions, and those from templates show at once.

Decision chips

Every choice in plain sight

After a cell runs, each value that its result depends on shows as a chip. The colour tells where the value comes from: the notebook's code, the AI, or a default that nobody set.

Plot selection

Question the result

Drag across a plot to select its rows. Whybook shows how many rows the selection holds, what differs there, and questions about it.

Markdown cells

Question the writeup

Whybook lists each number that a markdown cell states, with the outputs that show it. A number that no output shows stands out.

Shift+drop, Alt+drop

Branch in parallel, keep one line of cells

Shift+drop turns a question into a branch, and Alt+drop starts several. Each branch runs in a kernel subshell of its own, on the same data in memory.

Answers by an agent

One question, as many cells as it needs

For a question that needs AI, an agent adds and runs the cells that it needs. It ends with a short answer that links those cells, and with follow-up questions.

Code, Bench and Map

See the whole analysis, then the lines that matter

One notebook in three views: the map shows the whole analysis, the bench each step, and the Code view each line.

Exploration panel

Make it feel like a game

The Exploration panel counts the questions by type and the columns that the analysis has used, and suggests what to ask next.

Take the tour, with a live demo of each idea

Watch it work

See it on real data, with a live AI model

Each video is one recorded session in JupyterLab, on public data. Start with the 4-minute demo: a validator checks a notebook that someone else wrote. Or watch a whole analysis, from the raw file to the answer.

The chapters of each video, and screenshots

AI and your data

You choose what leaves the machine

Most of the model work in Whybook is small: order the questions, label a table, title a cell. A small open model on the analyst's machine can do it. When the first notebook opens, Whybook asks which of three ways to use models.

Any laptop, even a Chromebook

Frontier models for everything

A hosted frontier model reads what each task needs and writes the code.

Sent out
Tables, pictures and variables, as each task needs
For
Students and small labs

A 16 GB laptop or a Mac mini

Data stays on this machine

Local models read the tables and describe them. A frontier model writes the code from those descriptions.

Sent out
Descriptions, code and questions, never the rows of a table
For
Companies, hospitals and government

An AI PC or a small server

All local in progress

Local models read the data and write the code. The work goes on with no internet.

Sent out
Nothing
For
Large companies and government, where nothing may leave the building
  • A review guard reads every prompt before it leaves the machine, and every cell that a model wrote before it runs.

  • Marked as written by AI: each cell, label and question that a model writes records which model wrote it, and when.

  • The analyst's own keys stay on the Jupyter server and never reach the browser.

Every use of AI in Whybook, the local models and the guard

Evidence

Built on what studies found, and tested on real notebooks

Several choices in Whybook follow from user studies of analysts who work with AI. For each small job that Whybook gives to AI, we tested rules, small models on the analyst's machine and remote models, on what analysts asked in real notebooks. Whybook's default is the simplest method that did the job.

Assumptions on the cell

Stated assumptions help analysts find errors

Analysts who checked analyses that an AI wrote often noticed errors faster when the AI clearly stated its assumptions about the data.

Gu et al., CHI 2024: 22 analysts

Questions at each step

Guidance does better than full automation for exploration

A copilot that guided each step did better than a fully automated one in user control, software utility and learnability, especially for exploratory and creative tasks.

Khurana et al., CHI 2025: 20 users

Branches beside the answer

Seeing other paths helps analysts judge a result

People who also saw other analyses that the agent could have run relied less on its result, and their conclusions ended closer to the middle of all the analyses.

Grunde-McLaughlin et al., 2026: 48 people

What we tested

Four jobs, each with the method that Whybook uses by default and the models that an analyst can pick:

All the studiesEvery result, and the models to pick

Built on Jupyter

Jupyter already has the parts. Whybook is made to last.

Many AI tools for notebooks have stopped: forks fell behind, and extensions stopped when their company changed course. Whybook builds on the parts that Jupyter already has, and keeps the work in an ordinary notebook.

An ordinary notebook

Each answer is code and outputs in the .ipynb, and the questions and assumptions are in its metadata. Any Jupyter frontend opens it, with no model and without the extension.

Branches in kernel subshells

Kernel subshells, in ipykernel 7, run several branches of an analysis at the same time, on the same data in memory.

A kernel in a sandbox

The notebook reaches its kernel only through messages, so the kernel can run in a sandbox with access to one folder of files. Whybook runs it under bubblewrap on Linux and Seatbelt on macOS.

An extension, not a fork

Whybook is an extension for JupyterLab 4.4 and later, on the extension API that has been stable since JupyterLab 4.0. Users update JupyterLab as usual.

No single vendor

Templates need no model. Open models run in the Jupyter server, and the remote model and decision models of several makers are choices in the settings.

Made by people who maintain Jupyter

Whybook comes from long-time maintainers of JupyterLab and its extensions, who can make the changes that it needs in JupyterLab itself.

Why JupyterDesigned to last

Try it

Run the demo in your browser, or install it

The demo is a synthetic clinical cohort: a daily pain diary, patient characteristics, a protein panel and a database of clinic visits.

In your browser

Opens the demo in JupyterLab on mybinder.org, free and with no sign-in, in about a minute. A Full HD screen is recommended.

On your machine

Whybook is on PyPI. Install it into the environment of your JupyterLab:

Shell
pip install "whybook[kernel,demo,models]"
python -m whybook.demo pain_diary
jupyter lab pain_diary/pain_diary_cohort.ipynb

In JupyterLab, choose "Open Notebook in Whybook" in the command palette, then press Run all. Install notes

What comes next: the roadmap to v1

Build it with us

Whybook is a research prototype, open source under the Apache-2.0 licence. Taking it to v1, along the roadmap, needs people as much as code: research with analysts, reviews of its statistics and its security, and maintainers. We are looking for partners:

  • Organisations whose analysts would try the beta on their own notebooks.
  • Funders and sponsors who would carry it to v1.
  • Developers who would contribute to the extension and to Jupyter.

Work together

Talk to OpenTeams about a trial with a team, funding or sponsorship, or contribute on GitHub.

Ask in public

Ask a question or share an idea where others can join in. Mike, who created Whybook, replies on GitHub and on the Jupyter forum. No GitHub account? Use the forum.

Talk in private

Send Mike an informal message on LinkedIn or in Jupyter's Zulip chat. On LinkedIn, add your question to the connection request.