personal
Notes Generator
Turns a physics chapter into notes you can actually revise from, with diagrams a vision model has checked.

Summarising a chapter is easy and produces something useless: a shorter version of the textbook you already could not face reading. The target here was different, a page a student can revise from the night before an exam.
That target drove almost every decision. Content is written as typed blocks rather than continuous prose: definitions, comparison tables, worked examples, warnings, connections to things the student already knows. No more than two paragraphs may run consecutively. Key terms are emphasised so the page can be skimmed. Equations are set large and on their own. A page of unbroken text has failed, however accurate it is.

The diagram loop
Roughly a third of sections carry a diagram, and diagrams are where generated material usually falls apart. Labels overlap. Arrows point at nothing. The figure restates the caption instead of adding to it.
So generated figure code is statically checked, rendered, and then shown to a vision model that judges it against the section it belongs to. If it is rejected, the feedback goes back into a regeneration, up to three times.

The more interesting outcome is the other one. After three attempts the document ships without that figure rather than with a bad one, and in the physics chapter that is exactly what happened to section one: four sections planned a diagram, three got one, and the opening section gave up.

Half price, and safe to resume
Generating thirty chapters one at a time is slow and costs full price. The Gemini Batch API is half price, so chapters are processed in waves, outline, then sections, then classification, then code generation and gating, which turns thirty end-to-end pipelines into four or five provider round trips.
Batching introduces a nastier failure mode than it removes. Batch creation is not idempotent, and a batch is billable the moment it is created, so a retry after a timeout can quietly bill twice. The fix is that every job gets a deterministic name and an intent row written before creation, duplicates are cancelled on discovery, and a budget cap is enforced before submission rather than after.
Anything the batch does not return falls back to synchronous full-price generation, so no document ships with holes in it.
- $0.03
- per chapter$0.06 with diagrams, measured from traces
- 27
- diagram attempts across five runs23 of them rendered
- 2
- chapters carried end to endphysics and history
Why Typst
Markdown to PDF gives you a web page printed on A4. Typst is a real typesetting system, so the output has proper measure, hanging punctuation, and equations set at a size you can read across a desk. Content is stored as a structured document with stable section and block identifiers, which means a review pass can address one field of one block, and re-rendering costs nothing because the generation is already paid for.