Inspiration
This app was a natural progression to my project Samsar, the 1-shot T2V agent. The technical implementation was the main impetus, after the implementation was done the only challenge remaining was: What is the use of this technology, This could be either continue accelerate the way things are going and fill the internet with more effective visual brain-rot or be something different - A tool to discover and to learn and to satisfy curiosities.
What it does
It creates interactive grounded videos upto 3 minutes duration, upto 3 levels of branching depth from a single text prompt. Creators and educators can choose the model settings (including inference, video and image models for their content)
How we built it
I built it using intuition developed over three years and experience building text to video agents. I was building the intial framework for a while, approaching the very same outcome. Codex with GPT 5.6 Sol, allowed me to speed up the process and timeline and reach the intended goal faster and more efficiently. The app is built with NextJS and uses SamsarJS stack for render and auxiliary functions.
Challenges we ran into
Building was easy, running into production I ran into several operational issues-
- Slow inference for branching narrative.
When doing linear render slower inference with high thinking doesn't seem to be much of an issue, but when branching the narrative over deeper levels, slow inference increases the render time and high thinking budget can eat up token spend. After observing over several experiements, I concluded that GPT 5.6 with xHigh settings was too slow for branched render, so I reduced the thinking level to high. Also when attempting branch render with other inference models, I found that only Gemini-3.1 was able to successfully complete branched narratives without going into retry loops, while Qwen 3.7 could complete this when called via native adapters and went into long retry loops when called via external adapters.
- Deleting nodes upon repeat failure or low judge score.
When running single stage I2V pipeline deleting nodes on repeat failure is straight-forward, Hust remove the node, link the next node to the previous one and reflow the timeline, however in branched render it gets a bit more complicated , deleting a node means deleting all the child nodes too. We had to handle the image scoring threshold failure for branched renders since on delete layer the timelines need to be reflowed differently.
- No existing web standards for rendering or handling interactive video media.
After building the framework and POC, I set out to find existing standards around web players to handle interactive movies only to find out there are none. (I supposed the creators of the HTML spec had not imagined that 1-shot interactive video pipelines would be a thing anytime soon) So me and GPT 5.6 set out to create our own standards for handling interactive video resources as well as a standard for interactive video player.
- Ok we have the tech, now what?
Building the tech has now become the easier part, the harder part is handling edge-cases in production and calibrating the agent around productive use-cases. After building the initial version, I set out to refine the grounded T2V branched render pipeline around educational and technical content and use-cases as well as testing the interactive video pipeline to verify which models could handle grounded technical content effectively.
Accomplishments that we're proud of
Built the world's first interactive film creator and viewer.
Built upon the Samsar JS stack, Full Featured Text to Video (and now to Interactive-Video) engine. Also built entirely using Codex (and previously ChatGPT web)
Both client and render engine are fully open-source tech under MIT license.
What we learned
Beyond implementing the tech, refining it to handle the various constituent models so that it behaves consistently across settings becomes paramount as the complexity of the pipeline increases, for instance some image model adapters during certain periods of time will consistently return unrelated or incorrect images, which can be handled in the linear pipeline but repeat low-quality image results breaks the branched pipeline, so we had to enforce a more constrained set of rules and model settings for the branched pipeline.
What's next for TMochiLearn
The project and the underlying engine is completely open-source for academic and industry collaboration. My plan is to work with enterprises and educators, to implement interactive technical content, training material etc. customized to their internal knowledge-base and to their specific needs. Consumers can further use the open-source project to run their own inference and create personal technical content libraries using models and adapters of their choice.
Built With
- codex
- gpt
- nextjs
- samsar
- typescript
Log in or sign up for Devpost to join the conversation.