Skip to content

Latest commit

 

History

362 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stemLM

Learn STEM. Step by step.

A free, open-source browser extension that turns answers from ChatGPT, Claude, Gemini, and Grok
into numbered steps, formulas, diagrams and quick checks, right beside your chat.

Website · Chrome Web Store · Privacy · Terms · Contact

CI MIT licence Chrome 116+ and Edge Manifest V3

The stemLM study panel: a numbered step with a typeset formula, the working, and a free-body diagram of a block on a 30 degree incline.

What stemLM does

Chat assistants explain STEM problems well, but the explanation arrives as one long reply. stemLM puts the study work beside the chat:

  1. Ask. Type a question or attach a photo or PDF in your AI chat. Press the orange stemLM + beside the chat box, then send.
  2. Study. Read numbered steps with working, formulas and diagrams beside your chat. Open Solution to see them all at once.
  3. Check. Try a quick check, then reveal the answer. Ask in chat adds the step's context to your follow-up question.
  4. Save. Save a solution with one click. Search Saved questions by subject or date to reopen it.
  5. Export. Download the full solution as a PDF, with formulas and diagrams, or merge saved questions into one revision file.

It covers physics, chemistry, maths, biology, computer science, and electrical, mechanical, civil and chemical engineering. The AI works out the subject from your question.

Important

The steps come from your AI model, and models make mistakes. stemLM makes reasoning easier to follow, but it does not verify it. Check important results, and check diagrams against the problem.

Works with

Chat service Address
ChatGPT chatgpt.com
Claude claude.ai
Gemini gemini.google.com
Grok grok.com

stemLM runs in desktop Google Chrome 116 or newer and Microsoft Edge. It does not run on phones or tablets. You use your own account with the chat service, so that service's plan, usage limits and terms still apply.

Install

From GitHub (v2.0.0). Download stemlm-2.0.0-chrome.zip from the latest release, extract it, and load the folder containing manifest.json with Load unpacked at chrome://extensions or edge://extensions (enable Developer mode first). See INSTALL.md for installation, updating without losing saved work, and checksum verification. Read what's new in v2.0.0.

From the Chrome Web Store. Open the Chrome Web Store, choose Add to Chrome, and pin stemLM from the puzzle-piece menu so its toolbar button is always handy. Open a supported chat and the orange + appears beside the chat box. Refresh any chat tab that was already open.

From source. See Development to build the extension and load it unpacked.

Privacy at a glance

  • No stemLM account. No login, subscription or payment details.
  • Your study library stays in your browser. stemLM reads the question and answer on the chat page to build the study view on your computer. It has no server that receives your questions, answers or saved solutions.
  • No extension telemetry in v2.0.0. This build disables analytics and ships no telemetry endpoint or credential. It has no analytics toggle. The published privacy policy also describes behavior in other releases.
  • You press Send. The + prepares instructions in your chat; stemLM never sends a message for you. Your chat provider receives what you send, under its own policies.
  • Open source. Every line of the extension is in this repository under the MIT licence.

The full Privacy Policy and Terms and Conditions are Markdown copies of the versions published at stemlm.app/privacy and stemlm.app/terms. The website versions apply if the two ever differ.

How it works

Pressing the + attaches a plain-text instruction file to your message. It teaches the model one answer format: a single fenced stemlm capsule holding the steps, formulas, quick checks and takeaways. Figures inside the capsule are not pictures. They are short, typed key: value specs in a small language, for example:

@diagram id=f1 type=plot
fn: x^2 - 4
domain: -3 3
xlabel: x
ylabel: y
eq: y=x^2-4
@enddiagram

The extension parses the capsule and compiles every figure spec to SVG in your browser. There is no language model in the render path: layout, validation, sanitization and drawing all happen locally and deterministically.

flowchart LR
  A["Chat page<br/>(ChatGPT, Claude, Gemini, Grok)"] -->|answer text| B["Content script<br/>platform adapter"]
  B --> C["Capsule parser<br/>src/protocol"]
  C --> D["Study panel<br/>React in a shadow root"]
  C -->|figure specs| E["Figure compiler<br/>src/lib/figure"]
  E -->|sanitized SVG| D
  D --> F["Saved questions<br/>extension storage"]
  D --> G["PDF export"]
Loading

The figure compiler goes catalog → engine → Scene IR → layout kernel → SVG. Five core engines (plots, scenes, graphs, tables and circuits) sit beside about 60 template families. Examples:

Area Figures
Physics and mechanics free-body diagrams, ray optics, fields around point charges, gas-state and thermodynamic diagrams, trusses, shear and moment diagrams, Mohr's circle, cams
Electrical and computing circuits with BJT, MOSFET and op-amp stages, hybrid-π models, two-ports, transmission lines, transformers, motors, phasors, Smith charts, PWM and timing diagrams, K-maps, datapaths and pipelines
Chemistry skeletal structures from SMILES, VSEPR shapes, Newman, Fischer and Haworth projections, MO, crystal-field and Jablonski diagrams, NMR splitting trees, electrochemical cells
Chemical and civil engineering McCabe–Thiele diagrams, reactors, heat exchangers, process flow diagrams, soil phase diagrams, retaining walls, frames
Biology membranes, gel electrophoresis, operons, PCR, neurons, cell division, Ramachandran plots, phylogenetic trees
Computer science flowcharts, state machines and automata, arrays, linked lists, stacks, hash tables, Gantt charts
Tables matrices, dynamic-programming tables, ICE tables, Punnett squares

Figures fail closed. When a spec is incomplete, unsupported, or fails validation, the entire figure section is hidden while the explanation stays readable. The panel does not display raw specs or a figure-repair button. Validation checks supported drawing structure; it cannot guarantee that the model understood the question correctly.

Development

Prerequisites

  • Node.js 20.19 or newer (22 LTS or later recommended)
  • pnpm 11
  • Google Chrome 116+ or Microsoft Edge

Build and load

git clone https://github.com/chayprabs/stemlm-app.git
cd stemlm-app
pnpm install
pnpm build            # production build in .output/chrome-mv3

Open chrome://extensions (or edge://extensions), turn on Developer mode, choose Load unpacked, and select .output/chrome-mv3. A "How to use stemLM" page opens after the first install.

For day-to-day work, pnpm dev starts a development build with hot reload in a separate browser profile.

After rebuilding an unpacked install, press the extension's Reload control. Open chat tabs pick up the new version automatically; refresh any tab that does not show the +. Reloading closes an open study panel; choose Load conversation in the panel to bring the answer back. Keep the extension installed between builds to keep its saved questions.

Commands

Command What it does
pnpm dev Development build with hot reload (Chrome)
pnpm build Production build in .output/chrome-mv3
pnpm compile Type-check with tsc --noEmit
pnpm test Run the full Vitest suite (happy-dom)
pnpm test:watch Run Vitest in watch mode
pnpm verify Type-check, test and build: run this before opening a pull request
pnpm zip Package the build for the Chrome Web Store
pnpm release:chrome Type-check, test, build and create the release ZIP
npx vitest run src/lib/figure Run only the figure-compiler tests

pnpm dev:firefox and pnpm build:firefox exist, but Firefox is not tested or supported.

See RELEASING.md for the release process and CHANGELOG.md for version history.

Project layout

entrypoints/          MV3 entry points: background worker, content script, study panel,
                      toolbar popup, settings, saved-questions library, PDF export, welcome page
src/platforms/        one adapter per chat site: find the composer, attach, read answers
src/content/          the controller that runs in the chat tab and drives the panel
src/protocol/         the instruction file, capsule parser, subject playbooks, quality checks
src/lib/figure/       figure catalog, engines, Scene IR, layout kernel, SVG compiler
src/lib/              storage, settings, PDF export, math rendering, tab and session plumbing
src/components/       study panel UI: steps, solution view, figures, quick checks, reports
src/state/            the panel's state store
assets/               design tokens, shipped styles, bundled IBM Plex fonts
public/               extension icons and welcome-page images
scripts/              icon generation and the study-panel bundle split
temp-icon/            source artwork for the logo and toolbar icons

The content script stays small on chat pages. The study panel, with Markdown, KaTeX and the figure engines, is a separate bundle that loads the first time you open the panel. Fonts ship inside the extension; nothing is fetched from a font CDN.

Contributing

Bug reports, wrong figures, chat-site breakages and pull requests are all welcome. Read CONTRIBUTING.md before you start: it covers setup, the project's rules for figures and protocol changes, and how to test. Everyone taking part follows the Code of Conduct.

Found a security issue? Please don't open a public issue; follow SECURITY.md.

Licence and credits

stemLM's code and original assets are released under the MIT licence.

  • IBM Plex Sans and IBM Plex Mono are bundled under the SIL Open Font License 1.1 (assets/fonts/ibm-plex/OFL.txt).
  • KaTeX and its fonts are MIT-licensed. Every runtime dependency uses a permissive licence (MIT, ISC, BSD, Apache-2.0, Zlib or 0BSD; DOMPurify is dual-licensed MPL-2.0 or Apache-2.0). Run pnpm licenses list --prod to check.
  • No textbook figure or corpus image is included in this repository.

ChatGPT, Claude, Gemini and Grok are trademarks of OpenAI, Anthropic, Google and xAI, respectively. Their marks are used only to show compatibility. stemLM is an independent project and is not affiliated with or endorsed by them.

Team

stemLM is built by Chaitanya Prabuddha, Rohit Gupta and Abhishek Dogra. Feedback, a bug, or a subject we handle badly? Email founders@stemlm.app. We read everything.

About

open-sourced codebase of stemLM extension.

Resources

Code of conduct

Contributing

Security policy

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages