← Catalog

@nteract/pi

Persistent notebook-backed Python REPL for Pi coding agents. Stateful execution, hot dependency sync, zero cold starts.

Package

Install

Install with PiG

pig install npm:@nteract/pi

Install with Pi

pi install npm:@nteract/pi
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions/repl.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.7.1 (README.md). PiG does not review it.

@nteract/pi

Persistent notebook-backed Python REPL for Pi coding agents. Stateful execution, hot dependency sync, zero cold starts.

Run Python in a real IPython runtime. State (variables, imports, matplotlib figures) persists between agent turns. Perfect for data analysis, plotting, and multi-step workflows.

What you get

  • python_repl — Execute Python in your persistent REPL. Backed by a real IPython runtime. Variables, imports, and state stick around between calls. The last expression is the result; use print() or display() for intermediate output. Images (matplotlib, PIL, widgets) are returned inline.

  • python_add_dependencies — Install packages mid-session without restarting the kernel. Or pass dependencies on the first python_repl call to pre-install before kernel start.

  • python_save_notebook — Save your session as an .ipynb file you can open in Jupyter or nteract.

  • /python-reset — Start fresh: new kernel, clean slate.

Install

pi install npm:@nteract/pi

How it works

This extension uses @runtimed/node, the Node.js bindings for the nteract daemon (the same runtime that powers the nteract desktop app). If you have nteract installed, you already have everything you need. The daemon manages isolated Jupyter kernels and environments per working directory, handles dependency installation via uv, and keeps your Python state hot between agent calls.

Building your own

This extension is a starting point. Want more control? Build your own Pi extensions using @runtimed/node.

See packages/runtimed-node/README.md for the full API. The source for this extension (extensions/repl.ts) shows how to wire it up to Pi's tool registration.

Inspecting and managing sessions

The daemon is controlled by the nteract CLI (installed with nteract). Use it to inspect active sessions, open notebooks in the desktop app, or troubleshoot:

# List open notebooks and their kernel status
nteract notebooks

# Open a notebook in nteract Desktop
nteract open <path>

# Check daemon status
nteract daemon status

Local development

From this repo:

pi --extension ./plugins/nteract/pi/extensions/repl.ts