A Socratic TTS coding assistant that watches your Jupyter notebook and speaks guiding questions when you go off-track
Project description
๐ง Socratic Watchdog
A Socratic TTS coding assistant that watches your Jupyter notebook cells, analyzes them through the lens of the Socratic method, and speaks guiding questions when you go off-track. Stays silent when your code is correct.
"I cannot teach anybody anything, I can only make them think." โ Socrates
Features
- %%socratic cell magic โ analyser one cell at a time
- %socratic_watch on โ auto-watch every cell you run
- TTS audio delivery โ speaks questions via espeak-ng (default), edge-tts, or kokoro
- Socratic method โ never gives answers, only asks guiding questions
- Works everywhere โ JupyterLab, Notebook, Colab, VS Code
Quick start
%load_ext socratic_watchdog
%socratic_task Write a function that calculates Fibonacci numbers
%%socratic
def fib(n):
return fib(n-1) + fib(n-2) # missing base case!
Socrates will (verbally) ask something like:
"I see your function calls itself โ what condition would stop this recursion?"
Installation
# Minimal install (uses espeak-ng for TTS โ requires apt install espeak-ng)
pip install socratic-watchdog
# Or with a TTS backend of your choice:
pip install socratic-watchdog[edge-tts] # cloud neural TTS (free, no API key)
pip install socratic-watchdog[kokoro] # local neural TTS (82M model, needs torch)
Requires either:
- Hermes CLI (
hermes chat -q) โ available on the DIVE platform - OpenAI-compatible API โ set env vars:
SOCRATIC_LLM_BASE_URL,SOCRATIC_LLM_API_KEY
Note: The default TTS backend is
espeak-ng. Install it viaapt install espeak-ng(Linux) orbrew install espeak-ng(macOS). Switch backends withSOCRATIC_TTS_BACKEND=espeak|edge-tts|kokoro.
How it works
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโ
โ Cell runs โ โ โ Capture โ โ โ LLM with โ โ โ On track?โ
โ (source + โ โ source code โ โ Socrates โ โ โ SILENT โ
โ traceback) โ โ + error โ โ persona โ โ Off trackโ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ โ TTS Q โ
โโโโโโโโโโโโ
The Socrates persona instructs the LLM to:
- Never give direct answers or show corrected code
- Ask exactly one guiding question
- Reference something specific in the student's code
- Stay completely silent when correct
Commands
| Magic | What it does |
|---|---|
%%socratic |
Run a cell with Socratic analysis |
%socratic_task ... |
Describe your coding goal |
%socratic_watch on |
Watch every cell automatically |
%socratic_watch off |
Stop auto-watching |
%socratic_off |
Quick alias to stop |
%socratic_reset |
Clear the task description |
%socratic_help |
Show usage help |
Configuration
| Env var | Default | Description |
|---|---|---|
SOCRATIC_TTS_BACKEND |
espeak |
TTS engine: espeak (default, local), edge-tts (cloud neural), or kokoro (local neural) |
SOCRATIC_TTS_VOICE |
en-US-AndrewNeural |
Edge-TTS voice |
SOCRATIC_LLM_TIMEOUT |
30 |
Seconds to wait for LLM |
SOCRATIC_LLM_BASE_URL |
https://api.deepseek.com |
API base URL |
SOCRATIC_LLM_API_KEY |
โ | API key (or use Hermes CLI) |
SOCRATIC_LLM_MODEL |
deepseek-chat |
Model name |
Architecture
socratic_watchdog/
โโโ _core.py # Core engine (no IPython deps โ works anywhere)
โ โโโ SocraticWatchdog.analyze() # prompt โ LLM โ question/silence
โ โโโ SocraticWatchdog.speak() # text โ TTS (espeak/edge-tts/kokoro) โ Audio
โ โโโ _call_llm() # hermes CLI or direct API
โโโ magics.py # IPython magics + post-run hook
โ โโโ %%socratic, %socratic_task, etc.
โ โโโ _post_run_cell_hook # auto-watch mode
โโโ __init__.py # %load_ext entry point
License
MIT
Related
- jupyter-hermes-personalities โ the Socrates personality source
- edge-tts โ free TTS engine
- Hermes Agent โ the agent framework
Project details
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 socratic_watchdog-0.1.0.tar.gz.
File metadata
- Download URL: socratic_watchdog-0.1.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f30a72e96d318bd3fadbab48fa904d76bb1379d16aae505c4a011bba6477581
|
|
| MD5 |
b5bf8031ebae9392fa55650f0ea22282
|
|
| BLAKE2b-256 |
645c19f26f38e1986390fb1ebc4b461f7f8ab2cf4d4fc90620b15bf15c63a9e6
|
Provenance
The following attestation bundles were made for socratic_watchdog-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on xamzar/socratic-watchdog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
socratic_watchdog-0.1.0.tar.gz -
Subject digest:
9f30a72e96d318bd3fadbab48fa904d76bb1379d16aae505c4a011bba6477581 - Sigstore transparency entry: 1919589775
- Sigstore integration time:
-
Permalink:
xamzar/socratic-watchdog@89a634783efc130eb81c0ae85686079e21d0b791 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xamzar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@89a634783efc130eb81c0ae85686079e21d0b791 -
Trigger Event:
push
-
Statement type:
File details
Details for the file socratic_watchdog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: socratic_watchdog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0df0fe4aad474e2968eb175ed280e7e2c618d4b7ad1cb251bcb3e0ec55de360b
|
|
| MD5 |
516aa40da79161d446d9a8fd1582fa8b
|
|
| BLAKE2b-256 |
0e1d5dda7abcb12846d89992fc0793f3d8a79030abfd7c4ca9d10832fa000c07
|
Provenance
The following attestation bundles were made for socratic_watchdog-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on xamzar/socratic-watchdog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
socratic_watchdog-0.1.0-py3-none-any.whl -
Subject digest:
0df0fe4aad474e2968eb175ed280e7e2c618d4b7ad1cb251bcb3e0ec55de360b - Sigstore transparency entry: 1919589859
- Sigstore integration time:
-
Permalink:
xamzar/socratic-watchdog@89a634783efc130eb81c0ae85686079e21d0b791 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xamzar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@89a634783efc130eb81c0ae85686079e21d0b791 -
Trigger Event:
push
-
Statement type: