Most creative software still expects a human to sit between the idea and the finished file. You might describe a video edit to an AI, but the actual work of trimming clips, adjusting layers, and exporting frames usually falls back to you. That gap exists because media editing is not a single prompt-and-response task. It is a long chain of dependent decisions where step three only makes sense if step two actually changed the timeline. A recently shared project tackles this exact friction by wiring Claude Code into a stateful video editing pipeline powered by the Gemini Interactions API. The result is a working demonstration of how to get an AI agent to truly direct a creative workflow rather than simply suggest one.

A Director and an Editor

The architecture is intentionally split. Claude Code operates as the director, handling high-level planning, interpreting vague creative briefs, and deciding what needs to happen next. It breaks a request like “cut the dead air and add a title card” into discrete tasks, then monitors whether each task succeeds before moving on.

The Gemini Interactions API handles the specialized editing logic. Instead of forcing a generalist model to simulate a video editor, this setup uses Google’s API as the hands-on operator that executes cuts, evaluates timeline state, and reports back with concrete results. The system does not collapse both jobs into a single model. It keeps the reasoning layer separate from the tool-use layer, which means each part can focus on what it does best.

This division mirrors how actual post-production teams function. A director knows the story and makes the call. The editor knows the software and manipulates the pixels. When an agent tries to do both inside one context window, it often trips over syntax or forgets which clip is on which track. Splitting the load fixes that.

Why Memory Changes Everything

Video editing is inherently stateful. If you shorten a clip by four seconds, every subsequent transition, audio cue, and subtitle placement must shift to match. Most AI agents struggle here because they treat each step as an isolated query. They might recommend a cut in one response, then hallucinate a different timeline in the next, or suggest an effect for a segment that no longer exists.

The Gemini Interactions API is built to maintain state across these operations. It tracks the actual condition of the project as the agent works. That means the system knows whether an export failed, whether a clip has already been processed, or whether a color grade has been applied. When Claude issues the next instruction, it is working against the real current state of the timeline, not a guess.

For anyone who has watched an AI confidently suggest a “simple” five-step fix that completely ignores the previous four steps, the value of persistent state is obvious. Creative tasks degrade quickly without memory. A stateful backend turns a chatbot into a participant that can actually finish a job.

What the Workflow Looks Like

Picture a practical sequence. You feed the system several raw clips and ask for a finished social-media cut. Claude Code first evaluates the request. It might decide the footage needs stabilization, then a voice-over extraction, then subtitles, then a vertical crop. It structures these as a plan and begins calling the Gemini Interactions API to execute each item in order.

Gemini performs the media operations and returns structured feedback. Maybe the stabilization succeeded but the audio separation found overlapping dialogue that makes subtitles unreliable. Claude receives that update, revises the plan, and asks Gemini to try a different approach, such as identifying speaker segments before generating text overlays. Because the API holds the state, it can confirm that the subtitle track aligns with the newly stabilized video, not the original shaky footage.

This loop continues until the checklist is complete. The system creates a genuine workflow for complex video tasks instead of a one-off script generation. If a render fails because a codec setting is incompatible, the error feeds back up to Claude, which can adjust parameters and retry. The agent does not abandon the project after the first hurdle.

Using Different Models for Different Strengths

Проєкт також ілюструє ширший патерн проєктування в AI-інженерії: припиніть намагатися змусити одну модель робити все. Claude Code чудово справляється з міркуваннями на основі неоднозначних інструкцій, керуванням розгалуженою логікою та підтримкою контексту розмови протягом тривалої сесії. Gemini Interactions API, зокрема завдяки взаємодії з багатим медіаконтентом та використанню інструментів, забезпечує глибокі мультимодальні можливості та виконання зі збереженням стану. Поєднуючи їх, ви обходите обмеження кожного з них.

Модель міркування, яка ніколи не торкалася нелінійного відеоредактора, все одно може керувати чудовим монтажем, якщо вона має доступ до рівня виконання, який розуміє кодеки, ключові кадри та ієрархію доріжок. І навпаки, API, орієнтованому на медіа, не потрібно аналізувати абстрактні творчі нотатки, якщо модель-планувальник уже переклала їх у конкретні кроки. Сильні сторони однієї компенсують слабкості іншої.

Це не теорія. Ця конфігурація наочно демонструє, як різні моделі ШІ працюють разом, щоб виконувати категорію завдань — творчий відеомонтаж, — з якою агенти на основі однієї моделі часто не можуть впоратися. Для розробників, які створюють агентні системи, цей урок важко ігнорувати. Перестаньте вимагати від свого рівня оркестрації бути спеціалістом, і перестаньте вимагати від свого спеціаліста бути стратегом.

Що варто засвоїти розробникам

Вам не потрібно керувати відеостудією, щоб вважати цей патерн корисним. Будь-яка сфера, що потребує багатоетапної роботи в мінливому середовищі — робочі процеси CAD, звукорежисура, візуалізація даних або наукові обчислення — може запозичити таку ж структуру. Одна модель виступає як постійний менеджер проєкту. Спеціалізований API або інструмент виконує операції зі збереженням стану всередині програмного забезпечення конкретної галузі.

Робота розробника зміщується від написання гігантських промптів у надії, що модель усе запам'ятає, до проектування чіткої передачі завдань між міркуванням та виконанням. Управління станом стає критично важливим елементом. Якщо ваш агент не бачить, що змінилося після його останньої дії, він не зможе надійно діяти знову.

Ви можете прочитати повний розбір того, як працює інтеграція, включаючи конкретні взаємодії з API та структуру проєкту, у детальному дописі на dev.to.

Головний висновок

Вирішення складних творчих завдань за допомогою ШІ не потребує очікування появи єдиної ідеальної моделі, яка зможе планувати, пам'ятати та виконувати все одночасно. Воно потребує надання агенту пам'яті, що зберігається між кроками, та спеціаліста, якому він дійсно зможе делегувати завдання. Дайте мислителю мислити. Дайте монтажеру монтувати.