8000 GitHub - jack-temko/pset: A study app for textbook PDFs: ask the book questions with page citations, and get hints and walkthroughs for your homework. · GitHub
[go: up one dir, main page]

Skip to content
jack-temkoPublic

About

A study app for textbook PDFs: ask the book questions with page citations, and get hints and walkthroughs for your homework.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PSet

A study app for textbooks you own as PDFs. Put a book on the shelf and PSet reads it, page by page (OCR included, for scans). Then, beside the page scan:

  • Ask about the book. The tutor searches and reads the pages, looks at figures, checks its arithmetic, and answers with page citations you can click to jump the scan there. Theorems, worked derivations, plots and tables come back as cards, and math renders properly.
  • Work through homework. Add the problems your professor assigned ("3.B.4", or paste the text). PSet finds each one in the book, crops its figure, and writes a hint and a walkthrough, both hidden until you ask for them. Tick each problem off as you finish it, and print a clean worksheet to work on paper.
  • Keep track. Home shows what's due and how your week went: time spent on homework, reading and asking, by book.

It runs on your machine as one small server with the web app built in. Your books, notes and conversations stay in a local folder; the only things that leave it are the requests PSet makes to the chat and embeddings endpoints you configure, and, when you press Check for updates in Settings, a request to GitHub.

PSet is built for laptops and desktops: below a 1024px-wide window it asks you to come back on a bigger screen.

What you need

  • Go 1.26.8 or newer, and Node.js 24 with npm, to build it.
  • poppler-utils (pdfinfo, pdftotext, pdftoppm, pdftohtml), to read and render PDFs.
  • Tesseract, to read scanned books.
  • An OpenRouter key, from openrouter.ai/keys. It pays for the models, and PSet picks them: DeepSeek V4.1 Flash writes guides and answers, Perceptron Mk1.5 finds problems on the page, and GPT-6 Luna reads their words and figures.
  • Ollama on this machine, which searches your books with nomic-embed-text. Settings can download the model for you.

On Debian or Ubuntu:

sudo apt install poppler-utils tesseract-ocr

On macOS:

brew install poppler tesseract

For the default embeddings, install Ollama, then:

ollama pull nomic-embed-text

Install

On a Mac, Linux or WSL (Debian and Ubuntu), skip building. One command downloads the latest release for your machine, checks it against the release's checksums, installs poppler, tesseract and Ollama, pulls the embeddings model, puts pset in ~/.local/bin and starts it, opening your browser:

curl -fsSL https://github.com/jack-temko/pset/releases/latest/download/install.sh | sh

Run the same command again to update. Or download the tarball for your machine (pset-<version>-linux-amd64.tar.gz, -linux-arm64, or -macos for both Mac kinds) from the Releases page, open it and run sh setup.sh (bash setup.sh on a Mac). On a Mac the program is unsigned: setup.sh clears the flag macOS puts on downloads, or right-click it and choose Open once. make release VERSION=x.y.z builds all of them into dist/.

To build it yourself:

git clone https://github.com/jack-temko/pset.git
cd pset/web && npm ci && npm run build && cd ..
go build -o pset ./cmd/pset

The web app is embedded in the binary, so build the web first: a binary built without it serves a "not built" notice instead of the app. The result is one file, pset, which you can put anywhere on your PATH.

Run

./pset

Then open http://127.0.0.1:8420.

Flag Default
-addr 127.0.0.1:8420 Where to listen.
-data $PSET_DATA, else ~/Library/Application Support/pset on a Mac, else ~/.local/share/pset Where your library lives.
-open on Open your browser once PSet is serving (under WSL, your Windows browser). -open=false turns it off.
-verbose off Debug logging.
-version Print the version and exit.

Flags go straight after pset; there are no subcommands. Stop it with Ctrl+C: work in progress (a book being read, a walkthrough being written) picks up where it left off on the next start.

First run

  1. Open Settings (the gear, top right) and paste your OpenRouter key under Connections. Test tries it without saving it. Save tests first and only keeps a key that works. A book can't be prepared until one is saved: a model reads the book's contents.
  2. Check Health on the same page. It confirms the data folder, the database, poppler, tesseract and Ollama, and offers a fix where it can, Ollama's missing model included.
  3. Optionally, add your name under You. The greeting and the tutor use it.

Using it

Add a book. Press + on Home's shelf and pick a PDF. It shows on the shelf at once while PSet reads it; a scanned book takes longer, since every page is OCR'd. Open the book when it's ready.

The workspace. The book's contents are on the left (click to jump), the page scan in the middle, and the panel on the right. Pinch or Ctrl+scroll to zoom the scan; the floating bar at the bottom shows the page and zoom, and clicking the zoom resets to fit. Page numbers are the ones printed in the book; hover one to see the PDF page. If the printed numbers are off, fix them under Page numbers in Edit book, in the menu beside the book's title; a scan that lost a page gets a row for the jump. The same menu opens Memory and removes the book. Focus (top right of the panel) folds the contents away to widen the panel.

Ask. Type a question and press Enter. You'll see each step as the tutor takes it ("Searched…", "Read p. 137"), in place between the paragraphs of its answer. Click a page chip to jump there. Stop ends an answer early.

Homework. In the panel's Homework tab, add New homework, then Add questions, one per row. Untick In this book for a problem that isn't from this book; its guide is written from your text alone. Each question gets a hidden hint and a hidden walkthrough; click to reveal either. Ask about this takes a question over to Ask as context. The ⋯ menu prints a worksheet and marks the set turned in. PSet finds every question before it writes any guide, so the worksheet is ready to print early; until then, Print worksheet says how many are still being found. When PSet can't find a problem, it asks for the page, or lets you paste the problem instead.

Memory. The tutor keeps short notes per book: where results live, how the book is laid out, and how you like answers ("Use SI units"). Open Memory from the book's title bar to see, add or delete them. Every note says who saved it: you, the tutor, or PSet.

Your data

Everything is under the data folder (~/.local/share/pset by default, ~/Library/Application Support/pset on a Mac): pset.db (SQLite, including your settings and API key), books/ (your PDFs), cache/ (rendered pages), and logs/llm.jsonl, which records every request made to the models, with the model's reply. Back up or move the folder to take your library with you. Settings → Reset erases all of it, settings included; Clear history beside it forgets only the time Home counts.

Development

make dev

This runs the Go server (rebuilt on save) and the Vite dev server with hot reload, and regenerates the TypeScript wire types whenever a Go wire.go changes. It keeps its own data in .dev/data, apart from your real library.

make test

This runs go test ./... and the TypeScript type check. cd web && npm run test runs the frontend unit tests. No test calls a real model: model calls are tested against a fake server.

Layout

cmd/pset/        the server: wiring, flags, lifecycle
internal/        one package per feature (library, homework, ask, settings,
                 activity, memory) plus shared plumbing (db, jobs, events,
                 llm, agent, cards, pdf, ocr, mathx, httpx)
web/             the React app, embedded into the binary
design/          the specs: the design system and each screen, as decided
testdata/        generated sample books the tests read
tools/           the dev loop, the sample-book generator

Features never import each other; each package's README covers its contracts. Start with design/backend.md for the backend and design/design-system.md for the UI.

About

A study app for textbook PDFs: ask the book questions with page citations, and get hints and walkthroughs for your homework.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0