AI Engineer Summit 2025
This video was edited with AI agent. But how?
Read the talk
Editing video with an agent that writes code
A browser-based video editor gives an agent a programmable workspace: generate editing code, retrieve documentation, inspect sampled frames, and render after visual approval.
From a talk by Muhtesem
Before you start: Basic familiarity with language-model tool calling and JavaScript or TypeScript will help; no video-codec expertise is required.
From learning clips to programmable compositions
The recording opens with two kinds of educational video: a conversational introduction to Attention Is All You Need, presented as a landmark NLP paper, and a brisk description of OCaml as functional, imperative, and object-oriented. The latter ends with the jab that OCaml is “what Haskell wishes it could be.” These snippets set the scene for the practical problem that follows: automating the editing of learning videos.
Muhtesem introduces the Video Composer Agent, describing it as the world’s first open-source video-editing agent—a priority claim the presentation does not substantiate. The project began with a need to automate video editing for Reskill, a personalized-learning platform. Working with FFmpeg exposed limitations that pushed the team toward a more intuitive, flexible composition interface.
The library choice turned on where rendering happened and how editing operations were expressed:
| Option | Experience described in the talk |
|---|---|
| FFmpeg | Command-based editing became limiting |
| Remotion | Appealing, but required server-side rendering in the evaluated setup |
| Diffusion Studio Core | Suitable API without a separate rendering backend |
That Remotion comparison reflects the team’s historical selection experience; current Remotion documentation supports browser rendering without server infrastructure, stable from version 4.0.491. After trying Core, the team met its author and decided to build the agent together.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Make editing actions executable
Diffusion Studio Core exposes complex compositions through JavaScript and TypeScript. That gives the language model a direct way to act: generate code against the composition library, then execute that code. The editing program becomes the agent’s action. Instead of merely describing a desired edit, the model can express the operations that produce it through the same interface a programmer would use.
Muhtesem argues that code is the most expressive way to specify computer actions and points to unnamed research favoring code-based tool calls over JSON. The architectural consequence is clear even without a universal performance claim: the agent needs a programmable editing environment in which its generated actions can run. The talk supplies no video-editing benchmark comparing those action formats.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Give the agent a browser workspace
The agent starts a browser session with Playwright and connects to the operator UI, a video-editing web application designed specifically for agents. This is the environment where generated editing code operates on the composition. The application renders video directly in the browser using the WebCodecs API, avoiding the separate rendering backend that motivated the library search.
The browser is also connected to the agent’s Python environment. Helper functions transfer files from Python into the browser and back through the Chromium DevTools Protocol. This separates the agent’s orchestration environment from its editing runtime while providing a path for media to cross between them.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Generate, inspect, then render
The editing workflow uses three tools, beginning with the user’s request:
- Generate and execute:
VideoEditingToolturns the prompt into editing code and runs it in the browser. - Retrieve context when needed:
DocsSearchTooluses retrieval-augmented generation to supply relevant documentation. - Inspect the composition: after each execution step, sampled frames go to
VisualFeedbackTool.
Muhtesem reports that the composition is sampled at one frame per second for visual review. This is the review cadence, not the output frame rate or rendering speed.
A small TypeScript helper expresses that sampling schedule. For a four-second composition, it requests review frames at seconds 0, 1, 2, and 3; extracting those frames remains the composition runtime’s job.
typescript
function reviewSampleTimes(durationSeconds: number): number[] {
if (!Number.isFinite(durationSeconds) || durationSeconds < 0) {
throw new RangeError("Duration must be finite and nonnegative");
}
const times: number[] = [];
for (let second = 0; second < durationSeconds; second += 1) {
times.push(second);
}
return times;
}
const sampleTimes = reviewSampleTimes(4);
// [0, 1, 2, 3]
Sampling gives the reviewer a sequence of visible composition states. It also leaves gaps between observations: an artifact that appears and disappears between samples may escape this check.
Muhtesem compares the visual-feedback arrangement to the generator and discriminator in a GAN: one part produces an edit, while another judges the result. Here that is a feedback analogy, rather than a description of adversarial training. Visual approval gates the final render. Once VisualFeedbackTool gives the green light, the agent proceeds to render the composition; the workflow slide presents the alternative as further refinement.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Supply documentation and prompt templates
The team also shipped an llms.txt file and specific prompt templates to help agents use the editing environment. The on-screen example shows a documentation welcome section and terminology definitions. Those materials complement documentation search by giving the agent a prepared starting point for understanding the library.
Muhtesem calls llms.txt the equivalent of robots.txt for agents. The useful distinction is their purpose: llms.txt supplies curated context and documentation links, while robots.txt communicates guidance about automated access. For this editor, the relevant combination is library context plus task-specific prompting.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Separate the agent from the browser it controls
The browser runtime allows two deployment arrangements:
- Bring your own browser: run the agent against a browser session you provide.
- Connect remotely: attach through a WebSocket connection, with a separate GPU-accelerated browser session for each agent.
Muhtesem describes a load balancer behind the remote arrangement. This is a proposed deployment path rather than a demonstrated production service; the accompanying project description marks the remote WebSocket endpoint as work in progress.
The first agent implementation is in Python, with a TypeScript implementation underway at the time of the presentation. Muhtesem closes with a TypeScript variation on the familiar programming-language joke: any application that can be written in TypeScript eventually will be. That roadmap would bring the agent implementation into the same language ecosystem as the composition interface. The project is a collaboration between Diffusion Studio and Reskill.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
Python video-editing agent repository with setup instructions and documentation-search examples.
TypeScript browser video engine with composition, transitions, animation and rendering examples.
Image-sample review tool that checks editing goals and produces structured feedback and a render decision.
The original Transformer paper introduced in the opening video snippet.
Further reading
CodeAct research comparing executable Python actions with text and JSON action formats on tool-use tasks.
Updates since the talk
Current browser-rendering APIs, examples and limitations for Remotion's web renderer.
The revised proposal for publishing concise website guidance and documentation links for agents.
Read the complete timestamped transcript
- 0:00
[on-hold music]
- 0:30
Today, we're tackling a paper that's basically legendary, at least in the world of natural language processing. NLP, for those in the know.
- 0:38
Right. Attention is all you need. It's not just a catchy title.
- 0:41
Definitely not.
- 0:51
OCaml, a general-purpose functional programming language that is also an imperative language and also an object-oriented language. It is what Haskell wishes it could be.
- 1:04
Hey everyone. My name is Muhtesem, and I'm excited to talk about the world's first open source video editing agent.
- 1:13
Backstory is that we needed some automatic tool to edit videos for Reskill.io, a platform for personalized learning. While doing so, we quickly realized limitations of FFmpeg and started looking for more intuitive and flexible alternatives.
- 1:28
Remotion was nice, but it did unreliable server-side rendering. After trying out Core, we really liked the API as it did not require the separate rendering backend. We met with the author of the library and decided to collaborate and build this agent together.
- 1:47
The Core library from Diffusion Studio can do complex compositions via JavaScript, TypeScript-based programmatic interface, meaning we can use LLM to generate code to run this. And if we take a step further and let our LLM write its own action in code, it's a perfect match, simply because code is the best possible way to express actions performed by
- 2:12
a computer. Lastly, multiple research papers have shown that having LLM tool calling in code is much better than in JSON.
- 2:25
Now, let's take a look at current architecture. Agent starts a browser session using Playwright
- 2:33
and connects to operator UI. This web app is video editing UI designed specifically for AI agents. It renders video directly in browser using WebCodecs API.
- 2:47
It also has helper functions for transferring files from Python to browser and back via Chromium DevTool protocol.
- 3:00
This is a typical flow of agent. We have three main tools, VideoEditingTool, DocsSearchTool, and VisualFeedbackTool. First, a VideoEditingTool generates code based on user prompt and runs it in browser.
- 3:15
If additional context is needed, DocsSearchTool uses RAG to pull the relevant information. After each execution step, a composit- the compositions are sampled currently at one frame per second, and they are, they are fed to VisualFeedbackTool.
- 3:34
VisualFeedbackTool can be thought as a generator and discriminator, like in famous GAN architecture.
- 3:43
After the VisualFeedbackTool gives green light, the agent proceeds to render the composition.
- 3:53
We also shipped llms.txt, which is essentially robots.txt, but for agents. You can see sample in the screen. Llms.txt, in addition with specific template prompts, will take you far in your video editing journey.
- 4:12
While, while you can bring your own browser and run the agent, the current setup is also flexible enough to let the agent connect to a remote browser session via WebSocket, and each agent can get a separate browser session, which is GPU accelerated.
- 4:31
And of course, there's a load balance, load balancer behind this.
- 4:38
Of course, the first version of the agent is in Python, but TypeScript implementation is underway. As the fame, famous saying goes, "Any applications that can be written in TypeScript will be written in TypeScript."
- 4:54
Thank you very much. This was collaboration between Diffusion Studio and Reskill.