jupyter_ai_tutor
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
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupyter_ai_tutor-0.2.0.tar.gz.
File metadata
- Download URL: jupyter_ai_tutor-0.2.0.tar.gz
- Upload date:
- Size: 372.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d73872ced79251f2a568f2726225a4a29044594388c81d5e7ead270aac9f3778
|
|
| MD5 |
df88426e72abf53c2d2f7f9f7a768b8d
|
|
| BLAKE2b-256 |
56976edf34b9b9ff9344dff455b3077e4af7aed10208e6e2ad89fc479b4737e1
|
File details
Details for the file jupyter_ai_tutor-0.2.0-py3-none-any.whl.
File metadata
- Download URL: jupyter_ai_tutor-0.2.0-py3-none-any.whl
- Upload date:
- Size: 170.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f113011a7580a5c2e04d90c677c280f9bbea0cb73c6e701cc350c4708f9faa5e
|
|
| MD5 |
025a73a4045192dc19591ce732c73a69
|
|
| BLAKE2b-256 |
123507c96f497d61a64be5ce202a7606a1e8a4787059390dae190da62fc038d0
|