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

> Discover the parallel sub-agent system architecture in video-use for generating multiple animations concurrently. Learn how isolated slots and independent LLM agents speed up rendering.

- Repository: [Browser Use/video-use](https://github.com/browser-use/video-use)
- Tags: architecture
- Published: 2026-07-04

---

**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`](https://github.com/browser-use/video-use/blob/main/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`](https://github.com/browser-use/video-use/blob/main/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`](https://github.com/browser-use/video-use/blob/main/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:

```bash

# 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:

```python
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`](https://github.com/browser-use/video-use/blob/main/edl.json). The final composition occurs in [`helpers/render.py`](https://github.com/browser-use/video-use/blob/main/helpers/render.py), which consumes the EDL and assembles the video:

```bash
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`](https://github.com/browser-use/video-use/blob/main/SKILL.md)** – Defines the parallel-sub-agent brief format, slot directory layout, and hard rules for animation generation
- **[`helpers/render.py`](https://github.com/browser-use/video-use/blob/main/helpers/render.py)** – Consumes the `overlays` entries produced by sub-agents and assembles the final video output
- **[`helpers/pack_transcripts.py`](https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py)** – Generates phrase-level transcripts that drive the timing requirements for animation sub-agents
- **[`skills/manim-video/SKILL.md`](https://github.com/browser-use/video-use/blob/main/skills/manim-video/SKILL.md)** – Provides a concrete implementation example using the Manim animation engine with slot-specific briefs
- **[`README.md`](https://github.com/browser-use/video-use/blob/main/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`](https://github.com/browser-use/video-use/blob/main/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`](https://github.com/browser-use/video-use/blob/main/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`](https://github.com/browser-use/video-use/blob/main/edl.json). The [`helpers/render.py`](https://github.com/browser-use/video-use/blob/main/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.