# yuwenhan07/vivid architecture

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

- Interactive diagram: https://gitdiagram.com/yuwenhan07/vivid
- Repository: https://github.com/yuwenhan07/vivid

## Overview

VIVID equips coding agents to edit video through an iterative workflow: an agent receives task instructions, inspects media and retrieves evidence, edits with its native tools, then reviews and verifies deliverables. The graph preserves the documented inspection, persistent-memory, and revision capabilities. Source excerpts support the main orchestration and tool relationships; some subsystem internals were not sampled, so uncertain links are omitted.

Main entry points: [`src/vivid/controller.py`](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/controller.py) (Run controller), [`src/vivid/harness.py`](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/harness.py) (Tool harness), [`src/vivid/media.py`](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/media.py) (Media inspection), [`src/vivid/memory.py`](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/memory.py) (Evidence memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Agent entry"]
  node_cli["CLI<br/>[cli.py]"]
  node_controller["Run controller<br/>[controller.py]"]
  node_mcp["MCP server<br/>[server.py]"]
end

subgraph group_agent["Agent backends"]
  node_backend_base["Backend runtime<br/>[base.py]"]
  node_agent_adapters["Agent adapters"]
  node_app_server["App server transport<br/>[app_server.py]"]
  node_provider["OpenRouter config<br/>[provider.py]"]
end

subgraph group_tools["Editing and inspection"]
  node_harness["Tool harness<br/>[harness.py]"]
  node_interaction["Tool interaction<br/>[interaction.py]"]
  node_media["Media inspection<br/>[media.py]"]
  node_editing["Native editing<br/>[editing.py]"]
  node_native_jobs["Native jobs<br/>[native_jobs.py]"]
  node_transcription["Transcription<br/>[transcription.py]"]
  node_temporal["Time mapping<br/>[temporal.py]"]
end

subgraph group_evidence["Evidence and state"]
  node_memory[("Evidence memory<br/>[memory.py]")]
  node_notes[("Run notes<br/>[notes.py]")]
  node_transcript_cache[("Transcript cache")]
  node_workspace[("Workspace state<br/>[workspace.py]")]
end

subgraph group_review["Review and controls"]
  node_review_helpers["Review helpers<br/>[review.py]"]
  node_verification["Output verification<br/>[verification.py]"]
  node_runtime["Runtime budgets<br/>[runtime.py]"]
end

node_user(("Task author"))
node_mcp_client(("MCP client"))
node_model_service(("Model service"))

node_user -->|"starts run"| node_cli
node_cli -->|"starts worker"| node_controller
node_cli -->|"serves tools"| node_mcp
node_controller -->|"runs agent"| node_backend_base
node_agent_adapters -->|"implements"| node_backend_base
node_app_server -->|"uses runtime"| node_backend_base
node_app_server -->|"configures provider"| node_provider
node_controller -->|"runs tools"| node_harness
node_mcp_client -->|"calls tools"| node_mcp
node_mcp -->|"dispatches calls"| node_harness
node_harness -->|"routes inspection"| node_media
node_harness -->|"catalogs evidence"| node_memory
node_harness -->|"routes actions"| node_interaction
node_interaction -->|"dispatches edits"| node_editing
node_interaction -->|"dispatches review"| node_review_helpers
node_interaction -->|"dispatches inspection"| node_media
node_media -->|"registers evidence"| node_memory
node_media -->|"requests transcripts"| node_transcription
node_transcription -->|"reads and writes"| node_transcript_cache
node_media -->|"uses cache"| node_transcript_cache
node_controller -->|"loads evidence"| node_memory
node_controller -->|"manages notes"| node_notes
node_controller -->|"checks outputs"| node_verification
node_controller -->|"sets budget"| node_runtime
node_harness -->|"provides review"| node_review_helpers
node_review_helpers -->|"inspects media"| node_media
node_review_helpers -->|"maps timestamps"| node_temporal
node_editing -->|"starts jobs"| node_native_jobs
node_editing -->|"uses time mapping"| node_temporal
node_native_jobs -->|"records evidence"| node_memory
node_native_jobs -->|"checks results"| node_verification
node_verification -->|"binds file evidence"| node_memory
node_controller -->|"uses workspace"| node_workspace
node_harness -->|"opens workspace"| node_workspace
node_backend_base -.->|"requests model"| node_model_service

click node_cli "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/cli.py"
click node_controller "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/controller.py"
click node_mcp "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/server.py"
click node_backend_base "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/backends/base.py"
click node_agent_adapters "https://github.com/yuwenhan07/vivid/tree/main/src/vivid/backends"
click node_app_server "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/backends/app_server.py"
click node_provider "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/backends/provider.py"
click node_harness "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/harness.py"
click node_interaction "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/interaction.py"
click node_media "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/media.py"
click node_editing "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/editing.py"
click node_native_jobs "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/native_jobs.py"
click node_review_helpers "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/review.py"
click node_verification "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/verification.py"
click node_memory "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/memory.py"
click node_notes "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/notes.py"
click node_transcription "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/transcription.py"
click node_transcript_cache "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/transcript_cache.py"
click node_workspace "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/workspace.py"
click node_runtime "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/runtime.py"
click node_temporal "https://github.com/yuwenhan07/vivid/blob/main/src/vivid/temporal.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_cli,node_controller,node_mcp,node_mcp_client toneBlue
class node_backend_base,node_agent_adapters,node_app_server,node_provider toneAmber
class node_harness,node_interaction,node_media,node_editing,node_native_jobs,node_transcription,node_temporal toneMint
class node_memory,node_notes,node_transcript_cache,node_workspace,node_user toneRose
class node_review_helpers,node_verification,node_runtime,node_model_service toneIndigo
```

## Components

### Agent entry

- [CLI](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/cli.py): `src/vivid/cli.py`
- [Run controller](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/controller.py): `src/vivid/controller.py`
- [MCP server](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/server.py): `src/vivid/server.py`

### Agent backends

- [Backend runtime](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/backends/base.py): `src/vivid/backends/base.py`
- [Agent adapters](https://github.com/yuwenhan07/vivid/tree/main/src/vivid/backends): `src/vivid/backends`
- [App server transport](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/backends/app_server.py): `src/vivid/backends/app_server.py`
- [OpenRouter config](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/backends/provider.py): `src/vivid/backends/provider.py`

### Editing and inspection

- [Tool harness](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/harness.py): `src/vivid/harness.py`
- [Tool interaction](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/interaction.py): `src/vivid/interaction.py`
- [Media inspection](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/media.py): `src/vivid/media.py`
- [Native editing](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/editing.py): `src/vivid/editing.py`
- [Native jobs](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/native_jobs.py): `src/vivid/native_jobs.py`
- [Transcription](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/transcription.py): `src/vivid/transcription.py`
- [Time mapping](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/temporal.py): `src/vivid/temporal.py`

### Evidence and state

- [Evidence memory](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/memory.py): `src/vivid/memory.py`
- [Run notes](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/notes.py): `src/vivid/notes.py`
- [Transcript cache](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/transcript_cache.py): `src/vivid/transcript_cache.py`
- [Workspace state](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/workspace.py): `src/vivid/workspace.py`

### Review and controls

- [Review helpers](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/review.py): `src/vivid/review.py`
- [Output verification](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/verification.py): `src/vivid/verification.py`
- [Runtime budgets](https://github.com/yuwenhan07/vivid/blob/main/src/vivid/runtime.py): `src/vivid/runtime.py`

### Other components

- **Task author**
- **MCP client**
- **Model service**

## Connections

- Task author → CLI: starts run (evidence: `README.md`)
- CLI → Run controller: starts worker (evidence: `src/vivid/cli.py`)
- CLI → MCP server: serves tools (evidence: `src/vivid/cli.py`)
- Run controller → Backend runtime: runs agent (evidence: `src/vivid/controller.py`)
- Agent adapters → Backend runtime: implements (evidence: `src/vivid/backends/__init__.py`)
- App server transport → Backend runtime: uses runtime (evidence: `src/vivid/backends/app_server.py`)
- App server transport → OpenRouter config: configures provider (evidence: `src/vivid/backends/app_server.py`)
- Run controller → Tool harness: runs tools (evidence: `src/vivid/controller.py`)
- MCP client → MCP server: calls tools (evidence: `README.md`)
- MCP server → Tool harness: dispatches calls (evidence: `src/vivid/server.py`)
- Tool harness → Media inspection: routes inspection (evidence: `src/vivid/harness.py`)
- Tool harness → Evidence memory: catalogs evidence (evidence: `src/vivid/harness.py`)
- Tool harness → Tool interaction: routes actions (evidence: `src/vivid/harness.py`)
- Tool interaction → Native editing: dispatches edits (evidence: `src/vivid/interaction.py`)
- Tool interaction → Review helpers: dispatches review (evidence: `src/vivid/interaction.py`)
- Tool interaction → Media inspection: dispatches inspection (evidence: `src/vivid/interaction.py`)
- Media inspection → Evidence memory: registers evidence (evidence: `src/vivid/media.py`)
- Media inspection → Transcription: requests transcripts (evidence: `src/vivid/media.py`)
- Transcription → Transcript cache: reads and writes (evidence: `src/vivid/transcription.py`)
- Media inspection → Transcript cache: uses cache (evidence: `src/vivid/media.py`)
- Run controller → Evidence memory: loads evidence (evidence: `src/vivid/controller.py`)
- Run controller → Run notes: manages notes (evidence: `src/vivid/controller.py`)
- Run controller → Output verification: checks outputs (evidence: `src/vivid/controller.py`)
- Run controller → Runtime budgets: sets budget (evidence: `src/vivid/controller.py`)
- Tool harness → Review helpers: provides review (evidence: `src/vivid/harness.py`)
- Review helpers → Media inspection: inspects media (evidence: `src/vivid/review.py`)
- Review helpers → Time mapping: maps timestamps (evidence: `src/vivid/review.py`)
- Native editing → Native jobs: starts jobs (evidence: `src/vivid/editing.py`)
- Native editing → Time mapping: uses time mapping (evidence: `src/vivid/editing.py`)
- Native jobs → Evidence memory: records evidence (evidence: `src/vivid/native_jobs.py`)
- Native jobs → Output verification: checks results (evidence: `src/vivid/native_jobs.py`)
- Output verification → Evidence memory: binds file evidence (evidence: `src/vivid/verification.py`)
- Run controller → Workspace state: uses workspace (evidence: `src/vivid/controller.py`)
- Tool harness → Workspace state: opens workspace (evidence: `src/vivid/harness.py`)
- Backend runtime → Model service: requests model (evidence: `README.md`)
