# joaoms98/openmontage architecture

> Architecture diagram of the GitHub repository joaoms98/openmontage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joaoms98/openmontage
- Repository: https://github.com/joaoms98/openmontage

## Overview

OpenMontage is an agentic video-production system: a user describes a video or supplies a reference, an agent develops a plan, acquires or generates media, and composes a finished video. The graph preserves reference analysis, stock-footage retrieval, media-generation tools, audio, and Remotion composition, plus Backlot’s project board and the shared tool contract. Several capabilities are documented or indexed but their runtime wiring was not excerpted, so uncertain links are omitted or marked dashed.

Main entry points: [`remotion-composer/src/Root.tsx`](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/Root.tsx) (Composition Catalog), [`tools/base_tool.py`](https://github.com/joaoms98/openmontage/blob/main/tools/base_tool.py) (Tool Contract), [`backlot/state.py`](https://github.com/joaoms98/openmontage/blob/main/backlot/state.py) (Project State), [`tools/analysis/video_analyzer.py`](https://github.com/joaoms98/openmontage/blob/main/tools/analysis/video_analyzer.py) (Reference Analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning and Review"]
  node_pipeline["Pipeline Manifests<br/>[pipeline_loader.py]"]
  node_reference_analysis["Reference Analysis<br/>[video_analyzer.py]"]
  node_media_review["Source Media Review"]
end

subgraph group_tools["Production Tools"]
  node_tool_registry["Tool Registry<br/>[tool_registry.py]"]
  node_tool_contract["Tool Contract<br/>[base_tool.py]"]
  node_stock_search["Stock Clip Search"]
  node_video_generation["Video Generation<br/>[_wan_engine.py]"]
  node_image_generation["Image Generation"]
  node_audio_production["Audio Production"]
  node_subtitles["Subtitle Generation<br/>[subtitle_gen.py]"]
  node_export["Export Bundle<br/>[export_bundle.py]"]
end

subgraph group_composition["Video Composition"]
  node_composer_root["Composition Catalog<br/>[Root.tsx]"]
  node_explainer["Explainer Renderer<br/>[Explainer.tsx]"]
  node_cinematic["Cinematic Renderer"]
  node_collage["Collage Renderer<br/>[CollageBurst.tsx]"]
  node_caption_overlay["Caption Overlay<br/>[CaptionOverlay.tsx]"]
  node_hero_title["Hero Title<br/>[HeroTitle.tsx]"]
  node_particle_overlay["Particle Overlay"]
  node_asset_resolver["Asset Resolver<br/>[resolveAsset.ts]"]
end

subgraph group_workspace["Project Workspace"]
  node_backlot_server["Backlot Server<br/>[server.py]"]
  node_backlot_state[("Project State<br/>[state.py]")]
  node_events["Tool Events<br/>[events.py]"]
  node_asset_cache[("Asset Cache<br/>[asset_cache.py]")]
  node_project_paths["Project Paths<br/>[paths.py]"]
end

node_user(("Creative User"))
node_agent(("AI Agent"))

node_user -->|"describes project"| node_agent
node_agent -->|"analyzes reference"| node_reference_analysis
node_agent -->|"plans production"| node_pipeline
node_agent -->|"reviews supplied media"| node_media_review
node_agent -.->|"selects tools"| node_tool_registry
node_reference_analysis -->|"uses tool contract"| node_tool_contract
node_media_review -->|"invokes analysis tools"| node_tool_registry
node_stock_search -->|"uses tool contract"| node_tool_contract
node_video_generation -->|"returns tool result"| node_tool_contract
node_agent -->|"retrieves footage"| node_stock_search
node_agent -->|"generates motion"| node_video_generation
node_agent -->|"generates artwork"| node_image_generation
node_agent -->|"creates soundtrack"| node_audio_production
node_agent -.->|"creates captions"| node_subtitles
node_agent -->|"composes video"| node_composer_root
node_composer_root -->|"registers renderer"| node_explainer
node_composer_root -->|"registers renderer"| node_cinematic
node_composer_root -->|"registers renderer"| node_collage
node_composer_root -->|"registers overlay"| node_caption_overlay
node_composer_root -->|"registers component"| node_hero_title
node_composer_root -->|"registers component"| node_particle_overlay
node_explainer -->|"resolves assets"| node_asset_resolver
node_agent -.->|"exports deliverable"| node_export
node_backlot_server -->|"serves project state"| node_backlot_state
node_backlot_state -->|"uses event feed"| node_events
node_backlot_state -->|"uses project paths"| node_project_paths
node_tool_contract -->|"emits tool events"| node_events
node_tool_contract -->|"wraps execution cache"| node_asset_cache

click node_pipeline "https://github.com/joaoms98/openmontage/blob/main/lib/pipeline_loader.py"
click node_reference_analysis "https://github.com/joaoms98/openmontage/blob/main/tools/analysis/video_analyzer.py"
click node_media_review "https://github.com/joaoms98/openmontage/blob/main/lib/source_media_review.py"
click node_tool_registry "https://github.com/joaoms98/openmontage/blob/main/tools/tool_registry.py"
click node_tool_contract "https://github.com/joaoms98/openmontage/blob/main/tools/base_tool.py"
click node_stock_search "https://github.com/joaoms98/openmontage/blob/main/tools/video/direct_clip_search.py"
click node_video_generation "https://github.com/joaoms98/openmontage/blob/main/tools/video/_wan_engine.py"
click node_image_generation "https://github.com/joaoms98/openmontage/tree/main/tools/graphics"
click node_audio_production "https://github.com/joaoms98/openmontage/tree/main/tools/audio"
click node_subtitles "https://github.com/joaoms98/openmontage/blob/main/tools/subtitle/subtitle_gen.py"
click node_export "https://github.com/joaoms98/openmontage/blob/main/tools/publishers/export_bundle.py"
click node_composer_root "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/Root.tsx"
click node_explainer "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/Explainer.tsx"
click node_cinematic "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/CinematicRenderer.tsx"
click node_collage "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/CollageBurst.tsx"
click node_caption_overlay "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/components/CaptionOverlay.tsx"
click node_hero_title "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/components/HeroTitle.tsx"
click node_particle_overlay "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/components/ParticleOverlay.tsx"
click node_asset_resolver "https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/lib/resolveAsset.ts"
click node_backlot_server "https://github.com/joaoms98/openmontage/blob/main/backlot/server.py"
click node_backlot_state "https://github.com/joaoms98/openmontage/blob/main/backlot/state.py"
click node_events "https://github.com/joaoms98/openmontage/blob/main/lib/events.py"
click node_asset_cache "https://github.com/joaoms98/openmontage/blob/main/lib/asset_cache.py"
click node_project_paths "https://github.com/joaoms98/openmontage/blob/main/lib/paths.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pipeline,node_reference_analysis,node_media_review,node_user toneBlue
class node_tool_registry,node_tool_contract,node_stock_search,node_video_generation,node_image_generation,node_audio_production,node_subtitles,node_export toneAmber
class node_composer_root,node_explainer,node_cinematic,node_collage,node_caption_overlay,node_hero_title,node_particle_overlay,node_asset_resolver toneMint
class node_backlot_server,node_backlot_state,node_events,node_asset_cache,node_project_paths toneRose
class node_agent toneIndigo
```

## Components

### Planning and Review

- [Pipeline Manifests](https://github.com/joaoms98/openmontage/blob/main/lib/pipeline_loader.py): `lib/pipeline_loader.py`
- [Reference Analysis](https://github.com/joaoms98/openmontage/blob/main/tools/analysis/video_analyzer.py): `tools/analysis/video_analyzer.py`
- [Source Media Review](https://github.com/joaoms98/openmontage/blob/main/lib/source_media_review.py): `lib/source_media_review.py`

### Production Tools

- [Tool Registry](https://github.com/joaoms98/openmontage/blob/main/tools/tool_registry.py): `tools/tool_registry.py`
- [Tool Contract](https://github.com/joaoms98/openmontage/blob/main/tools/base_tool.py): `tools/base_tool.py`
- [Stock Clip Search](https://github.com/joaoms98/openmontage/blob/main/tools/video/direct_clip_search.py): `tools/video/direct_clip_search.py`
- [Video Generation](https://github.com/joaoms98/openmontage/blob/main/tools/video/_wan_engine.py): `tools/video/_wan_engine.py`
- [Image Generation](https://github.com/joaoms98/openmontage/tree/main/tools/graphics): `tools/graphics`
- [Audio Production](https://github.com/joaoms98/openmontage/tree/main/tools/audio): `tools/audio`
- [Subtitle Generation](https://github.com/joaoms98/openmontage/blob/main/tools/subtitle/subtitle_gen.py): `tools/subtitle/subtitle_gen.py`
- [Export Bundle](https://github.com/joaoms98/openmontage/blob/main/tools/publishers/export_bundle.py): `tools/publishers/export_bundle.py`

### Video Composition

- [Composition Catalog](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/Root.tsx): `remotion-composer/src/Root.tsx`
- [Explainer Renderer](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/Explainer.tsx): `remotion-composer/src/Explainer.tsx`
- [Cinematic Renderer](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/CinematicRenderer.tsx): `remotion-composer/src/CinematicRenderer.tsx`
- [Collage Renderer](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/CollageBurst.tsx): `remotion-composer/src/CollageBurst.tsx`
- [Caption Overlay](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/components/CaptionOverlay.tsx): `remotion-composer/src/components/CaptionOverlay.tsx`
- [Hero Title](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/components/HeroTitle.tsx): `remotion-composer/src/components/HeroTitle.tsx`
- [Particle Overlay](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/components/ParticleOverlay.tsx): `remotion-composer/src/components/ParticleOverlay.tsx`
- [Asset Resolver](https://github.com/joaoms98/openmontage/blob/main/remotion-composer/src/lib/resolveAsset.ts): `remotion-composer/src/lib/resolveAsset.ts`

### Project Workspace

- [Backlot Server](https://github.com/joaoms98/openmontage/blob/main/backlot/server.py): `backlot/server.py`
- [Project State](https://github.com/joaoms98/openmontage/blob/main/backlot/state.py): `backlot/state.py`
- [Tool Events](https://github.com/joaoms98/openmontage/blob/main/lib/events.py): `lib/events.py`
- [Asset Cache](https://github.com/joaoms98/openmontage/blob/main/lib/asset_cache.py): `lib/asset_cache.py`
- [Project Paths](https://github.com/joaoms98/openmontage/blob/main/lib/paths.py): `lib/paths.py`

### Other components

- **Creative User**
- **AI Agent**

## Connections

- Creative User → AI Agent: describes project (evidence: `README.md`)
- AI Agent → Reference Analysis: analyzes reference (evidence: `README.md`)
- AI Agent → Pipeline Manifests: plans production (evidence: `README.md`)
- AI Agent → Source Media Review: reviews supplied media (evidence: `README.md`)
- AI Agent → Tool Registry: selects tools
- Reference Analysis → Tool Contract: uses tool contract (evidence: `tools/analysis/video_analyzer.py`)
- Source Media Review → Tool Registry: invokes analysis tools (evidence: `lib/source_media_review.py`)
- Stock Clip Search → Tool Contract: uses tool contract (evidence: `tools/video/direct_clip_search.py`)
- Video Generation → Tool Contract: returns tool result (evidence: `tools/video/_wan_engine.py`)
- AI Agent → Stock Clip Search: retrieves footage (evidence: `README.md`)
- AI Agent → Video Generation: generates motion (evidence: `README.md`)
- AI Agent → Image Generation: generates artwork (evidence: `README.md`)
- AI Agent → Audio Production: creates soundtrack (evidence: `README.md`)
- AI Agent → Subtitle Generation: creates captions
- AI Agent → Composition Catalog: composes video (evidence: `README.md`)
- Composition Catalog → Explainer Renderer: registers renderer (evidence: `remotion-composer/src/Root.tsx`)
- Composition Catalog → Cinematic Renderer: registers renderer (evidence: `remotion-composer/src/Root.tsx`)
- Composition Catalog → Collage Renderer: registers renderer (evidence: `remotion-composer/src/Root.tsx`)
- Composition Catalog → Caption Overlay: registers overlay (evidence: `remotion-composer/src/Root.tsx`)
- Composition Catalog → Hero Title: registers component (evidence: `remotion-composer/src/Root.tsx`)
- Composition Catalog → Particle Overlay: registers component (evidence: `remotion-composer/src/Root.tsx`)
- Explainer Renderer → Asset Resolver: resolves assets (evidence: `remotion-composer/src/Explainer.tsx`)
- AI Agent → Export Bundle: exports deliverable
- Backlot Server → Project State: serves project state (evidence: `backlot/server.py`)
- Project State → Tool Events: uses event feed (evidence: `backlot/state.py`)
- Project State → Project Paths: uses project paths (evidence: `backlot/state.py`)
- Tool Contract → Tool Events: emits tool events (evidence: `tools/base_tool.py`)
- Tool Contract → Asset Cache: wraps execution cache (evidence: `tools/base_tool.py`)
