Skip to content

ibenian/algebench

Repository files navigation

AlgeBench

See and touch the math. Think with an AI.

AI for human understanding — not for outsourcing thought.

Interactive 3D lessons with a live AI narrator. Spin up a scene, listen to it explain itself, then interrupt and ask what, how and the why — the narrator answers in real time and the visualization responds.

Step-by-step proofs walk through derivations alongside the 3D scene — each step shows the math, the justification, and highlighted regions you can click to see what changed. A semantic graph parses the current expression into an interactive flowchart of variables, operators, and relationships, so you can see the structure of an equation, not just its symbols. Proofs and the graph stay in sync: advance a proof step and the graph and 3D view update together.

Made for: self-taught learners, students, and educators who think math makes more sense when you can see it move.

AlgeBench screenshot

algebench eigenvalues.json

Built on MathBox / Three.js, powered by Gemini, expressions via math.js.


See it in action

YouTube Channel: youtube.com/@AlgeBench

Scene Video
Measurement Reads Latitude — Bloch Sphere Intuition Watch
From Hilbert Space to the Bloch Sphere — Interactive Quantum Visualization Watch
Orbital Flight Simulation Watch
Pi and e — The Mathematical Duo Watch
Rotating Space Habitat Simulation Watch

Vision

My ultimate goal is to create an agentic system that can genuinely engage in the tangible learning process — fostering that explorative, experimental mindset, willing and courageous enough to ask daring questions freely, supported by an infinitely patient tutor that can meet you exactly where you are and take you wherever you want to go.

The motto guides every design choice:

AI for human understanding — not for outsourcing thought.

The AI's job is to set the table — pick what's worth showing, build the apparatus, prepare the ground — so the learner can do the seeing, the playing, and the understanding for themselves. Computation, plotting, axis-picking, and sensible defaults are scut work the AI is happy to do. Understanding is non-transferable; only the learner can do it, and they do it by interacting with the apparatus.

Active design proposals (in docs/proposals/):


Quick Start

Prerequisites: Python 3.10+, a Gemini API key

git clone https://github.com/ibenian/algebench
cd algebench
pip install -r requirements.txt
export GEMINI_API_KEY=your_key_here
./algebench

Open http://localhost:8785 in your browser.

To launch directly into a scene:

./algebench scenes/eigenvalues.json

To update to the latest version of [gemini-live-tools](https://github.com/ibenian/gemini-live-tools) (which includes new voice characters and the voice picker UI):

./algebench --update

This reinstalls gemini-live-tools from GitHub and copies the updated voice-character-selector.js into the app. Not ideal, but simple enough for now.

For all available CLI options including TTS settings:

./algebench --help

TTS Modes

AlgeBench supports three TTS configurations, each with different trade-offs:

Flags API Quality Latency Cost Best for
(default) Gemini Live streaming Good Low (~200ms) Single API call Interactive use, narration
--tts-buffered Gemini Live, falls back to Gemini TTS Mixed Varying (2–5s+) Multiple parallel calls Long-form, saving to file
--tts-buffered --no-tts-live Gemini TTS High Higher (3–10s+) One call per sentence Highest quality output

Examples:

./algebench                                    # realtime streaming (default)
./algebench --tts-buffered                     # buffered with Live API + TTS fallback
./algebench --tts-buffered --no-tts-live       # buffered with standard Gemini TTS only

Buffered mode options (only apply with --tts-buffered):

Flag Default Description
--tts-parallelism 3 Max concurrent sentence synthesis (1–4)
--tts-min-buffer 30.0 Seconds of audio to buffer before playback
--tts-min-sentence-chars 100 Merge short sentences up to this char count
--tts-output-file out.wav Save audio to WAV file (auto-enables buffered mode)

Common options (all modes):

Flag Description
--tts-style "..." Additional style guidance (e.g. "speak slowly")

--no-tts-live and --tts-output-file automatically enable buffered mode when used without --tts-buffered.


Contributing

See CONTRIBUTING.md for how to add scenes, voice characters, and more.

Roadmap

See docs/feature-ideas.md for technical directions and creative ideas under consideration, and docs/lesson-ideas.md for lesson concepts and content proposals.

Documentation


Project Structure

algebench/
├── algebench          Launcher (run this)
├── server.py          Python server
├── scenes/            Lesson JSON files (contribute here!)
│   └── ...
└── static/
    ├── main.js        Entry point — wires all modules, exposes globals
    ├── state.js       Shared mutable state
    ├── scene-loader.js  Scene/lesson loading, step navigation & undo
    ├── chat.js        AI chat panel, TTS, voice picker
    ├── proof.js       Step-by-step proof panel with LaTeX rendering
    ├── graph-view.js  Semantic graph tab (D3 expression flowcharts)
    ├── graph-panel/   Graph renderers, themes, and layout engines
    ├── objects/       Element renderers
    │   ├── point.js, vector.js, polygon.js, sphere.js, …
    ├── domains/       Domain library plugins
    │   ├── astrodynamics/
    │   └── ...
    ├── index.html
    └── ...

License

MIT

Disclaimer

This software is provided for educational and informational purposes only. The authors and contributors make no representations or warranties regarding the accuracy, completeness, or suitability of this software for any particular purpose. Use is entirely at your own risk. The authors shall not be held liable for any direct, indirect, incidental, special, or consequential damages arising from the use of or inability to use this software. Lesson scenes, mathematical visualizations, and AI-generated explanations are all works in progress — they may contain errors or approximations and should not be relied upon as authoritative references.

About

Interactive 3D math visualizer with an agentic AI tutor. Explore concepts through live simulations, adjustable parameters, and narrated step-by-step lessons

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors