Engineering · AI · Video
How Cereby's Lesson Videos Moved to 3D Scenes in One Week
A new kind of lesson, checks that can say no before anything is drawn, and a render bill we had to read line by line.
Between November 18 and 22, our marketing agent sent 232 lessons to be drawn. Eighty of them never were. A check looked at each one first, found something a viewer would have seen was wrong, and sent it back with the second and the fix. The agent fixed its own scene and asked again, and nobody had to watch a bad video to find out.
This post follows How Our AI Agent Grades Its Own Lesson Videos Before They Post, which described how that agent grades the drawn lessons it made. A week later, none of those drawn lessons are being made. This is what replaced them, why the checks moved in front of the draw, and how we brought the cost of drawing a lesson down to about four and a half cents.
What a lesson is now
A Cereby lesson is a 30 to 45 second video that answers one sharp question, and it is the main thing Cereby posts. Until November 17 it was a cartoon, assembled shot by shot from a shared library of drawings, templates and scenes. That library had grown with every improvement the agent asked for, and most of what the agent read before making a lesson was about it. We decided a lesson should instead be written for itself.
So a lesson is now three things the agent writes for that lesson alone:
- The narration. A calm narrator says each line as its own recording, at his own pace. Nobody is on screen to teach it.
- The scene. A short program that builds a 3D scene and poses all of it from the time alone. Because no frame depends on the one before it, several renderers can draw one take at once.
- The sound. A recipe, not a track: a music bed, a few layers of ambience, and effects tied to words of the narration, so a new recording keeps each effect where it belongs.
The first lessons made this way were correct and plain, so we wrote down what made the best of them work and built it into the kit: the subject drawn as a character, a lit stage, a cutaway to show what is inside, readouts drawn as instruments, and one big moment. A scene that lacks one is told so. Those are suggestions, never refusals, because not every topic has an inside to show.
We retired the old makers rather than delete them. Their code, their tests and every video they made are still there, behind one switch.
What the old checks read
The drawn lessons had checks before the draw, but most of them read the lesson as written: what was on screen and what it did, as data. Anything a viewer could see that the data did not describe was found by the critic in the finished video, after the draw had been paid for:
A held video is a correct outcome and a wasted one. The draw is the expensive part of a lesson, and every held video had paid for it in full.
A scene lesson changes what there is to check. The scene is a program that can pose any moment on demand, so the checks no longer read a description of the picture. They pose the scene itself, the same code that will draw the take, at every moment something appears, moves or is named, and measure what is actually on screen.
Red and yellow
Every finding has one of two levels. The code calls them block and warn. We think of them as red and yellow, and the line between them is the viewer.
A red finding stops the take. These are the things someone watching would see are wrong: the camera inside an object, two things passing through each other, words cut off by the edge of the frame, something the narration points at that is out of shot. A vision model also looks at two frames of each line beside its words, and is told to report only what a viewer would plainly see is wrong, and nothing when it is unsure.
A yellow finding is reported, and the take goes on. These are worth fixing and not worth a refusal: a camera that moves a little fast, one object crowding the frame for a moment.
The refusal is the useful part. It names the moment, the thing and what to change, so the agent fixes the scene and asks again. Because a lesson costs cents, we decided nothing in that loop should wait for a person. The first time anyone on the team sees a lesson, it has already passed.
The picture check is a model, and it is sometimes stricter than a viewer would be. So the agent may pass a line the picture check refused, once it has looked at the frames itself. A red finding from measuring the scene has no such pass: the scene has to change.
Here is where five days of requests to draw went:
Two more failed for unrelated reasons. The agent also ran 418 dry runs in those days, which check a lesson without drawing it.
What the critic still holds
The critique did not go away. After a take is drawn, the agent watches the finished file, frames and audio, and scores it, as the first post describes. A blocking issue or a score of 1 still holds the video from posting.
Since scene lessons became the default, the critic has written 147 critiques and held 19 videos. That is a higher share than the drawn lessons' 11 of 196, and we think it is the right direction: the critic now judges a picture the checks already passed, so what it finds is subtler.
Its issues still split two ways. Most are the lesson's own, and the agent rewrites the scene. The rest are about the kit, the checks or the sound engine, and each becomes one improvement request for a coding agent, deduplicated across every lesson that hit it.
From a complaint to a fix on main
What changed this week is how short that second path became:
On November 20, two batches of kit fixes went from complaint to main on the same day, covering eleven requests between them. Where a fix made something measurable, it also became a check, so the same flaw is now a red finding before the draw instead of a complaint after it.
The numbers are small. The critic has filed 25 requests since November 17. Seven have merged, six were closed as no longer applying, and twelve are open. None is verified yet: a request is verified only when a lesson that had the problem is made again and critiqued clean.
The bill
Our hosting bill was growing, and we wanted it down without fewer videos or worse ones. Almost all of it was the sandbox, the short-lived machine where a lesson is checked and drawn. From November 15 to 21, sandboxes were $52.39 of the $62.43 Vercel charged us, and memory was the largest line. Memory is billed for every second a machine is alive, busy or not.
When we read the sessions, they were mostly idle: large machines kept alive for minutes while using a fraction of their processors. Almost none of the cost was the drawing. It was waiting.
We made four changes, none of which touched the picture. The machines are half the size, because the renderers drew no faster on bigger ones. Each one starts from a snapshot with everything installed, instead of installing it every time. Each one reports back the moment a step ends, instead of idling until a scheduled job notices. And each one is stopped before the last step, joining the video together, which never needed it.
The change went out on the afternoon of November 20. Vercel's bill for the first full day after it, against a day of similar work before:
| Nov 18, before | Nov 21, after | |
|---|---|---|
| Sandboxes started | 125 | 98 |
| Memory billed | 126.0 GB-hours | 20.5 GB-hours |
| Processor time billed | 20.2 hours | 6.2 hours |
| Sandbox charges | $5.46 | $1.33 |
| Per sandbox | 4.4 cents | 1.4 cents |
Memory per sandbox fell to about a fifth. Processor time fell too, because the setup no longer runs every time. Every job now records what it used, and a daily budget refuses new work past it. By those records, a finished lesson costs about four and a half cents and a dry run a fifth of a cent. The draw itself is now most of what we pay for.
Before and after
| Drawn lessons, Nov 10 | Scene lessons, Nov 22 | |
|---|---|---|
| What a lesson is | Shots from a shared library | A scene written for that lesson |
| What the checks measure | The lesson as data | The scene itself, at every moment |
| What stops a take | A check on the data | Any red finding |
| Critiques that held a video | 11 of 196 | 19 of 147 |
| Sandbox cost of a finished lesson | not recorded | about 4.5 cents |
What this taught us
A check is worth most where it is cheapest to obey. Moved in front of the draw, a refusal costs a fifth of a cent instead of a whole video.
Two levels are enough, if the line between them is the viewer. Red is what someone watching would see, and everything else is yellow. That kept the checks from becoming a wall the agent learns to argue with.
A bill is a log of waiting. The drawing was a small share of what we paid. Most of it was a machine kept alive between steps.
What's next
The merged fixes need their second critique before they count as verified. The most repeated open complaint is the loudness of the final mix. And the agent often remakes a lesson only to change its sound or caption, which draws an identical picture twice; reusing the drawn take when nothing in the picture changed is the next saving.