Skip to main content

jupyter_ai_tutor

Github Actions Status Binder

A JupyterLab extension to add an AI-powered tutor assistant to Notebooks.

a screencast showing an example with jupyter-ai-tutor

It currently relies on jupyter-ai-jupyternaut for the agent, it needs to be installed (pip install jupyter_ai_tutor[server]).

Once Jupyterlab started, the model must be configured via the menu Settings>Jupyternaut settings (model and API key).

See Jupyternaut documentation for details about setting up the agent.

How it works

Each code cell in a notebook gets an Explain Code button in its toolbar info icon
Clicking it opens a chat panel on the right side and sends the following context to the AI:

  • The cell source code and its kernel language
  • Any error output produced by the cell (traceback included)
  • Preceding code cells and markdown cell (up to the previous markdown cell), used as the exercise description
  • An optional reference_solution (multiline string) and evaluation_criteria (multiline string) stored in the cell metadata

The AI replies using a configurable system prompt (TUTOR.md) that shapes its pedagogical behavior. By default the extension looks for a TUTOR.md file walking up from the notebook's directory to the server root, so different courses or folders can each have their own tutor persona.

Configuration

TUTOR

The extension can be configured via jupyter_server_config.py (or any traitlets CLI config):

c.JupyterAITutorApp.discover_tutor_md = True   # default
c.JupyterAITutorApp.tutor_md = ""              # default (uses built-in TUTOR.md)
c.JupyterAITutorApp.debug = False              # default
Parameter Type Default Description
discover_tutor_md bool True When enabled, the extension searches for a TUTOR.md file starting from the active notebook's directory and walking up to the server root. The first file found takes precedence over the configured system prompt.
tutor_md str "" Path to a Markdown file used as the system prompt. When empty, falls back to the built-in TUTOR.md shipped with the extension.
debug bool False When enabled, prompts and model replies are logged to jupyter-ai-tutor temp directory for debugging purposes.

Jupyternaut

The default model and API key used with Jupyternaut agent can be setup via jupyter_server_config.py (or any traitlets CLI config):

c.AiExtension.initial_language_model=mistral/devstral-latest
c.AiExtension.default_api_keys={'MISTRAL_API_KEY': '***'}

Requirements

  • JupyterLab >= 4.0.0
  • jupyter-ai-jupyternaut (currently the only agent compatible)

Install

To install the extension, execute:

pip install jupyter_ai_tutor[server]

Uninstall

To remove the extension, execute:

pip uninstall jupyter_ai_tutor

Contributing

If you would like to contribute to this extension, please refer to the Contributing Guide.

AI Coding Assistant Support

This project includes an AGENTS.md file with coding standards and best practices for JupyterLab extension development. The file follows the AGENTS.md standard for cross-tool compatibility.

Compatible AI Tools

AGENTS.md works with AI coding assistants that support the standard, including Cursor, GitHub Copilot, Windsurf, Aider, and others. For a current list of compatible tools, see the AGENTS.md standard. This project also includes symlinks for tool-specific compatibility:

  • CLAUDE.md → AGENTS.md (for Claude Code)

  • GEMINI.md → AGENTS.md (for Gemini Code Assist)

Other conventions you might encounter:

  • .cursorrules - Cursor's YAML/JSON format (Cursor also supports AGENTS.md natively)
  • CONVENTIONS.md / CONTRIBUTING.md - For CodeConventions.ai and GitHub bots
  • Project-specific rules in JetBrains AI Assistant settings

All tool-specific files should be symlinks to AGENTS.md as the single source of truth.

What's Included

The AGENTS.md file provides guidance on:

  • Code quality rules and file-scoped validation commands
  • Naming conventions for packages, plugins, and files
  • Coding standards (TypeScript)
  • Development workflow and debugging
  • Common pitfalls and how to avoid them

Customization

You can edit AGENTS.md to add project-specific conventions or adjust guidelines to match your team's practices. The file uses plain Markdown with Do/Don't patterns and references to actual project files.

Note: AGENTS.md is living documentation. Update it when you change conventions, add dependencies, or discover new patterns. Include AGENTS.md updates in commits that modify workflows or coding standards.

Release files for jupyter-ai-tutor 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyter-ai-tutor 0.3.0
File Size Uploaded
jupyter_ai_tutor-0.3.0.tar.gz 373.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-ai-tutor 0.3.0
File Interpreter ABI Platform
jupyter_ai_tutor-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 544.8 kB

Release files / jupyter_ai_tutor-0.3.0.tar.gz

Download URL jupyter_ai_tutor-0.3.0.tar.gz
Size 373.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e77acf06c299dfd31c3c7c95483ec325d733d2bd4a2206c5066fa81f13d587ea
BLAKE2b-256 checksum
How to use checksums
c473650ceee754c3cd9af21669bd03b2cf15127f4efb49a27e6ae107ac800d54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / jupyter_ai_tutor-0.3.0-py3-none-any.whl

Download URL jupyter_ai_tutor-0.3.0-py3-none-any.whl
Size 170.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c721b913ca9690e59ccf615b347616607f7757de0d9716dc812a1fbb3dba79e
BLAKE2b-256 checksum
How to use checksums
2ee220534828cc60d422ef6947a45352b3010ce59ae5313bc8ab375e5a155265
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page