Skip to content
Ankole

Jupyter data analysis

For AI Agents: the Markdown version of this page is at https://ankole.agentbull.com/en-US/docs/jupyter-data-analysis/index.md. The documentation index is at https://ankole.agentbull.com/en-US/llms.txt.

Data analysis is inherently iterative: you inspect a DataFrame, refine a query, plot the result, and repeat. Because a one-shot Python process loses its memory as soon as it exits, Ankole provides the jupyter-live-kernel Skill, which starts a live Jupyter kernel that the Agent drives across multiple cells.

Because the Jupyter kernel remains stateful across cells, variables, DataFrames, library imports, and plot state persist from one call to the next. That persistence lets the Agent explore and transform datasets step by step without reloading files or re-importing packages on every turn.

What you need

  • An enabled jupyter-live-kernel Skill. This Skill ships with default_enabled: true. See Skills.
  • The standard Worker image. The Agent Computer Worker image already includes Python, Jupyter, and the hamelnb kernel.
  • A bound primary model profile. The Agent writes the Python analysis code, and the Worker’s Jupyter kernel executes it.

When to use the kernel vs a one-shot script

Use the live Jupyter kernel when:

  • the analysis is iterative, requiring repeated inspection and adjustment;
  • in-memory state must persist, such as a large loaded DataFrame, a fitted model, or initialized libraries;
  • the Agent needs to explore the schema and distributions before writing its final aggregation or chart.

Use a one-shot Python script (via the command tool) when:

  • the script is stateless and produces its output in a single pass;
  • the task is a batch file transformation that needs no interactive inspection.

As the Skill’s SKILL.md notes: “Prefer a one-shot Python process for stateless scripts.”

How the kernel works

The jupyter-live-kernel Skill declares ankole-runtime: main, so the Agent can use it directly in a conversation. It starts a Jupyter server in the Session or Job workspace and sends cells through a local Unix socket. Cells share the same live kernel, so variables defined in cell 1 remain available in cell 5.

The Agent keeps the server in a tracked shell session for iterative work and stops it when the work ends. A batch script starts the server, runs the analysis, verifies the artifact, and cleans up in one call. Kernel memory is temporary process state; save results to files to preserve them.

A worked example

To set up an Agent that analyzes CSV files posted in a team channel:

  1. Confirm that the jupyter-live-kernel Skill is enabled (it is on by default).
  2. Create the Agent and write its AGENTS.md: “When a CSV appears in the channel, load it into a DataFrame, inspect the schema and summary statistics, identify anomalies, and report findings with a plot.”
  3. Attach a CSV directly in the chat channel, or upload it to the Agent’s drive in the Console and share its file path.
  4. The Agent starts the Jupyter kernel in its workspace, loads the CSV, explores the data across cells, renders a plot, and posts the summary back to the channel.

What this guide is not

This page is not a Python or pandas tutorial—the Agent writes the analysis code while the Skill manages the kernel process. Nor is it a guide to authoring saved .ipynb notebooks for humans, since the live kernel exists primarily for the Agent’s interactive loop (though the Agent can export a notebook if you ask for one). For exact tool commands and flags, check the Skill’s SKILL.md file directly.

Next steps