jupyter-ai-hermes-magics
%%hermes cell magic — talk to Hermes Agent directly inside Jupyter notebooks.
Features
- Two-phase button: Shift+Enter shows a ▶ button; click to send. No auto-send on run.
- Stop mid-stream: Click ⏹ to stop Hermes. No transcript cell created if stopped.
- Dynamic cell type: Code responses → code cell. Explanations → markdown cell.
- No ipywidgets: Uses IPython comms — no widget-state-saving issues.
- Notebook context: Hermes sees cells above the
%%hermescell (not below). - Session tree: Dot-notation labels (
main.debug.fix) for branching conversations. - Always new transcript: Each response creates a fresh cell below — no fragile update logic.
- Full agent: Hermes has tools, memory, skills, and can edit notebook cells via MCP.
Installation
pip install jupyter-ai-hermes-magics
Then load in a notebook:
%load_ext jupyter_ai_hermes_magics
Or add to ipython_config.py for auto-load:
c.InteractiveShellApp.extensions = ["jupyter_ai_hermes_magics"]
Usage
Basic chat
%%hermes
Explain what the code in the cell above does
→ A ▶ button appears. Click it to send to Hermes. Response goes to a new cell below.
Branching sessions
%%hermes --label main
Write a function to sort a list
%%hermes --label main.debug
Why does this throw an error?
%%hermes --label main.debug.fix
Fix the error and show the corrected code
Skip context
%%hermes --no-context
What is the capital of France?
Subcommands
%hermes list # Show session tree
%hermes reset # Clear all sessions
%hermes version # Show version
How it works
Two-phase flow
Phase 1 (Shift+Enter): The cell output displays a ▶ button and a tip.
No request is sent. The cell's execution_count is captured to identify
the magic cell later.
Phase 2 (Click ▶): Hermes starts via hermes chat -q "..." -Q.
The button toggles to ⏹ with a live timer. The user can:
- Wait for completion → response goes to a new transcript cell below.
- Click ⏹ → process killed, no transcript cell created.
Cell type detection
After Hermes completes, the response is analyzed:
- Single fenced code block (no prose) → code cell (fences stripped)
- Raw code (starts with
def/class/import) → code cell - Prose or mixed → markdown cell (code blocks render inline)
State consistency
- ▶ only when idle/done/stopped — never during streaming
- ⏹ only during streaming — never when idle
- Transcript always targets the cell below the magic cell (identified by
execution_count) - On kernel restart, button becomes a static snapshot (no comm target registered)
Requirements
- Hermes Agent installed and configured (
hermeson PATH) - IPython ≥ 8.0
- Jupyter MCP server (auto-started by jupyter-ai in JupyterLab)
License
MIT
Release files for jupyter-ai-hermes-magics 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jupyter_ai_hermes_magics-0.5.2.tar.gz | 107.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jupyter_ai_hermes_magics-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 140.0 kB
Release files / jupyter_ai_hermes_magics-0.5.2.tar.gz
| Download URL | jupyter_ai_hermes_magics-0.5.2.tar.gz |
|---|---|
| Size | 107.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
859e06b412112c6788815d45b5171f9c3a1fd005bb1c5e6a58051eccd57c966f
|
|
BLAKE2b-256 checksum How to use checksums |
cacb6daf87ef6040670f04440b36413439ac4acae3443ed00430831b4901b9f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / jupyter_ai_hermes_magics-0.5.2-py3-none-any.whl
| Download URL | jupyter_ai_hermes_magics-0.5.2-py3-none-any.whl |
|---|---|
| Size | 32.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
361af859dcde9369d2318b4273ffbf1da97daffa0161769314041c858ecfd12b
|
|
BLAKE2b-256 checksum How to use checksums |
e16a38d01e58dc31210fef10f2f55c3e7f0da66351fd3252cc7603d42b133b7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|