Architecture of the Parallel Sub-Agent System for Generating Multiple Animations in video-use

The parallel sub-agent system in video-use generates multiple animations simultaneously by isolating each animation in dedicated slot directories, providing self-contained briefs to independent LLM sub-agents, and executing them concurrently so that total wall-time equals only the duration of the slowest render.

The video-use repository by Browser Use implements a sophisticated multi-agent architecture that transforms sequential video production workflows into concurrent operations. Instead of rendering motion graphics and overlays one by one, the system deploys autonomous sub-agents that work in complete isolation, dramatically reducing production time for complex video projects while maintaining deterministic output through the edl.json composition layer.

The Three-Layer Architecture

The parallel sub-agent system consists of three distinct layers that enable safe concurrent execution: isolated slot directories, self-contained agent briefs, and parallel orchestration through the Agent tool.

Slot Directories: Isolated Workspaces

For every animation, the system creates a unique folder at edit/animations/slot_<id>/ that serves as the sub-agent's exclusive workspace. As defined in SKILL.md, each slot directory houses the source files, render script, and the final render.mp4 output that will be referenced by the main EDL (Edit Decision List). This isolation prevents file-name collisions and eliminates shared mutable state, ensuring that concurrent write operations cannot corrupt adjacent animations.

Self-Contained Sub-Agent Briefs

Each slot receives a comprehensive brief that contains everything the sub-agent needs to operate without parent-context coordination. According to the SKILL.md specification, the brief includes:

  • A one-sentence goal defining the animation objective
  • An absolute output path pointing to the slot directory
  • Precise technical specifications (resolution, fps, codec, CRF values)
  • Style palette and font selections
  • Frame-by-frame timeline instructions
  • An anti-list of disallowed features
  • A checklist of deliverables and a "don't ask" rule

This self-contained design eliminates any need for parent-agent context, allowing sub-agents to run completely independently.

Parallel Execution via the Agent Tool

The primary skill script iterates over all requested animations and immediately invokes the Agent tool for each brief. Because each sub-agent works exclusively within its own slot folder, the system can safely launch N agents simultaneously without coordination overhead. The overall wall-time equals the duration of the slowest animation render, not the sum of all renders.

Implementation: From Slot Creation to Final Render

The architecture manifests through concrete file operations and process spawning. Below are the implementation patterns used in the video-use codebase.

Creating Isolated Animation Slots

The following bash-style workflow demonstrates how the system prepares a slot and writes the brief before spawning the sub-agent:


# 1️⃣ Create a unique slot directory

slot_id=$(uuidgen)
mkdir -p "$EDIT_DIR/animations/slot_${slot_id}"

# 2️⃣ Write the brief for the animation

cat > "$EDIT_DIR/animations/slot_${slot_id}/brief.md" <<'EOF'
You are building ONE animation: a kinetic‑typography overlay that reveals the product name.
Output path: $EDIT_DIR/animations/slot_${slot_id}/render.mp4
Resolution: 1920x1080, fps: 30, codec: libx264, crf: 18
Palette: background #0a0a0a, accent #ff5a00
Font: /System/Library/Fonts/Menlo.ttc (index 1)
Timeline:
  0.0‑0.5 s: fade‑in background
  0.5‑2.5 s: typewriter reveal of "ProductX"
  2.5‑3.0 s: fade‑out
Anti‑list: no chrome, no extra titles
Deliverables: script, render, ffprobe duration report
Do not ask questions – pick the most obvious interpretation.
EOF

# 3️⃣ Spawn the sub-agent (the Agent tool is provided by the host platform)

Agent --brief "$EDIT_DIR/animations/slot_${slot_id}/brief.md"

Orchestrating Concurrent Agents

The main skill loop fires multiple agents without waiting for completion, as shown in this Python-style excerpt from the orchestration layer:

from pathlib import Path
import subprocess

def launch_animation(slot_id: str, brief_path: Path):
    # The `Agent` CLI is assumed to be available in the environment

    subprocess.Popen(["Agent", "--brief", str(brief_path)])

def run_parallel_animations(slot_ids):
    for sid in slot_ids:
        brief = Path(f"edit/animations/slot_{sid}/brief.md")
        launch_animation(sid, brief)

# Example usage – fire three animations at once

run_parallel_animations(["a1b2", "c3d4", "e5f6"])

Final Composition and EDL Integration

After all sub-agents finish writing their render.mp4 files to their respective slots, the main workflow collects these outputs and populates the overlays array in edl.json. The final composition occurs in helpers/render.py, which consumes the EDL and assembles the video:

render.py edl.json -o final.mp4

This step concatenates video segments, applies the overlay files with PTS shifting, and burns subtitles in a single pass, respecting hard rules about audio fades and subtitle ordering established in the source code.

Key Source Files and Their Roles

Understanding the parallel sub-agent architecture requires examining these specific files in the browser-use/video-use repository:

  • SKILL.md – Defines the parallel-sub-agent brief format, slot directory layout, and hard rules for animation generation
  • helpers/render.py – Consumes the overlays entries produced by sub-agents and assembles the final video output
  • helpers/pack_transcripts.py – Generates phrase-level transcripts that drive the timing requirements for animation sub-agents
  • skills/manim-video/SKILL.md – Provides a concrete implementation example using the Manim animation engine with slot-specific briefs
  • README.md – High-level overview mentioning that animations are "spawned in parallel sub-agents"

Summary

  • Slot directories isolate each animation in edit/animations/slot_<id>/, preventing file collisions and eliminating shared state between concurrent processes
  • Self-contained briefs provide sub-agents with complete specifications (goals, technical specs, anti-lists) so they require no parent context or coordination
  • The Agent tool spawns independent LLM processes that run simultaneously, making wall-time dependent only on the slowest render
  • EDL composition in helpers/render.py deterministically assembles parallel-generated overlays into the final video after all sub-agents complete

Frequently Asked Questions

How does the system prevent conflicts between parallel sub-agents?

The architecture uses slot directories to enforce complete filesystem isolation. Each sub-agent writes exclusively to its own edit/animations/slot_<id>/ folder, ensuring no two agents can access the same files simultaneously. This design eliminates race conditions and filename collisions without requiring complex locking mechanisms.

What information must be included in a sub-agent brief?

According to SKILL.md, a sub-agent brief must contain a one-sentence goal, an absolute output path, precise technical specifications (resolution, fps, codec, CRF), style palette and font selections, a frame-by-frame timeline, an anti-list of disallowed features, and a checklist of deliverables. The brief also includes a "don't ask" rule instructing the agent to proceed without clarification.

How does video-use handle final assembly of parallel-generated animations?

After all sub-agents write their render.mp4 files to their respective slots, the main workflow collects these paths and adds them to the overlays array in edl.json. The helpers/render.py script then consumes this EDL, concatenates video segments, applies overlays with PTS shifting, and burns subtitles in a single deterministic pass.

What determines the total execution time when generating multiple animations?

Because the system launches N agents simultaneously and each works in isolation, the total wall-time equals the duration of the slowest individual animation render, not the sum of all animations. This parallel execution model provides linear scalability for animation-heavy projects up to available compute resources.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →