Whence
Study notes and review questions from a YouTube video or an article, with each point checked against the source it cites.
- Status
- Live
- Stack
- Next.js, Hono, Cloudflare Workflows, D1, R2
- Models
- Claude Haiku 4.5, Jev SystemOne
- Demo at
- whence.smangrati.com
Overview
Whence turns a YouTube video or an article into study notes, a cheat sheet and review questions. Each point links to the second or the passage it came from, and the questions come back over the following weeks on a schedule set by how well you knew them.
I built it for people who learn from long tutorials and lectures. A week later you remember that the video covered something, but not what it said, so you watch the whole thing again. A language model can write notes like these, and it can also state things the source never said. A false line in study notes does more harm than a missing one, so most of the work in Whence goes into checking each line.
Whence is a complete MVP with sign-up with email verification and password reset, a Free plan and a $12 a month Pro plan with checkout and a billing portal, reminder emails, downloads, and a landing page.
The demo has no sign-up.
What was hard
-
01 Citations the model cannot make up
Whence first splits the source into numbered spans: one sentence of a video, or one paragraph, list item, heading, code block or table row of an article. The model answers in JSON and cites span numbers. Code maps each number to a stored span and writes the Markdown and the footnotes itself, so the model never types a timestamp. A claim that cites a span that does not exist fails before any verifier call.
-
02 Captions with no full stops
A caption line is a fragment of a sentence, and auto captions can come with no punctuation at all. Split that way, a citation opens mid-sentence and the verifier reads half a thought. When a transcript has fewer than one sentence end per 40 words, Haiku punctuates it in parts of 3,000 words. Haiku also changes words it thinks were misheard, so code keeps only its punctuation and capitals and puts them on the original caption words. If fewer than 95% of the words line up, Whence asks once more and then fails the job.
-
03 A second model checks the first
A model that grades its own output can agree with its own mistake. So a separate verifier, Jev SystemOne, checks each claim on its own against the spans it cites and a little text on each side. It returns a probability, and a claim passes at 0.75 or more.
A failed claim gets one rewrite from Haiku, and the verifier has to accept the rewrite too. I added the rewrite because deleting failures alone lost whole points over one wrong word. A claim that fails twice is removed, and one failed step removes its whole walkthrough, since a walkthrough with a gap teaches the wrong order. If no section or no question survives, the job fails with verification_failed and gives your slot back.
-
04 Retries that do not pay twice
Each job runs as one Cloudflare Workflow instance, with a step for each stage: validate, extract, cache check, concepts, concept check, generate, verify and commit. Workflows saves the result of every finished step, so when verify fails and retries, the model calls before it do not run again. With Queues, a retry runs the whole handler, unless I built a checkpoint table by hand.
A step result has a 1 MiB limit, so the steps hand each other R2 keys and keep the drafts in R2. The eval harness reads the same files later to show which claims the verifier rejected.
-
05 A quota two requests cannot oversell
D1 has no interactive transactions, so "count, then insert" lets two requests at the same moment both see 2 of 3 sources used. Each job reserves a numbered slot in the same batch that inserts the job, and a partial unique index on user, month and slot makes the database refuse the second one.
A failed job gives its slot back, but only as many times a month as the plan has sources. Without that cap, a link that always fails after the model calls could be pasted again and again at full cost. With it, one account can run at most twice its quota in paid jobs.
What it runs on
- Frontend
- Next.jsReactTypeScriptTailwindRadix UIRemotion
- Backend
- HonoCloudflare WorkflowsD1R2DrizzleBetter Auth
- Models
- Claude Haiku 4.5Jev SystemOne
- Integrations
- SupadataYouTube Data APIResendDodo PaymentsPostHog
- Infrastructure
- Cloudflare WorkersOpenNextTurnstileGitHub Actions
- Testing
- VitestworkerdEval harness