How bj0703/viraldna works
ViralDNA is an AI-assisted short-video editing platform: creators provide a reference video, their own footage, and an editing request; the system analyzes reusable structure, matches footage to structural slots, resolves gaps, plans a timeline, and can render a video demo. The graph preserves that principal workflow, the editing and knowledge-base capabilities, and the separate sample-analysis API. Several agent implementations are listed but not excerpted, so documented or configured relationships are shown only where supported; unsampled internals are not inferred.
Main entry points: orchestration.py Orchestration API · orchestrator.py Workflow orchestrator · shared_memory.py Shared job memory · gap_resolver.py Gap resolution
Components 24
Creation workflow
- Intent planner
backend/app/services/intent_planner.py - Reference analysis
backend/app/agents/reference_analyzer.py - Asset indexing
backend/app/agents/asset_indexer.py - Slot matching
backend/app/agents/slot_matcher.py - Gap resolution
backend/app/agents/gap_resolver.py - Sample analysis
backend/app/services/sample_analysis.py - Analysis provider
backend/app/providers/heuristic_video_analysis.py
Orchestration and state
- Orchestration API
backend/app/api/routes/orchestration.py - Workflow orchestrator
backend/app/agents/orchestrator.py - Shared job memory
backend/app/core/shared_memory.py - Redis memory
backend/app/core/shared_memory_redis.py - Sample analysis API
backend/app/api/routes/sample_analysis.py - Analysis repository
backend/app/repositories/in_memory_sample_analysis.py
Editing capabilities
- Timeline planning
backend/app/agents/edit_planner.py - Video rendering
backend/app/agents/final_video_renderer.py - FFmpeg timeline
backend/app/renderers/ffmpeg_timeline.py - Timeline editing
backend/app/services/timeline_editor.py - Editing knowledge base
backend/app/services/knowledge_base_service.py - CapCut draft export
backend/app/services/capcut_draft_generator.py
Creator workbench
- Web workbench
frontend/src/App.tsx - Video inputs
frontend/src/layouts/LeftSidebarContent.tsx - Progress and results
frontend/src/components/AgentConversationPanel.tsx - Event stream client
frontend/src/hooks/useSSEEventSource.ts
Other components
- Creator
Connections 31
- Creator → Web workbench: provides inputs
README.md - Web workbench → Video inputs: shows inputs
frontend/src/App.tsx - Video inputs → Orchestration API: uploads videos
frontend/src/layouts/LeftSidebarContent.tsx - Web workbench → Orchestration API: submits job
- Orchestration API → Intent planner: plans intent
backend/app/api/routes/orchestration.py - Orchestration API → Workflow orchestrator: starts workflow
backend/app/api/routes/orchestration.py - Workflow orchestrator → Shared job memory: reads and writes
backend/app/agents/orchestrator.py - Workflow orchestrator → Reference analysis: dispatches
backend/app/dependencies.py - Workflow orchestrator → Asset indexing: dispatches
backend/app/dependencies.py - Workflow orchestrator → Slot matching: dispatches
backend/app/dependencies.py - Workflow orchestrator → Gap resolution: dispatches
backend/app/dependencies.py - Workflow orchestrator → Timeline planning: dispatches
backend/app/dependencies.py - Workflow orchestrator → Video rendering: dispatches
backend/app/dependencies.py - Reference analysis → Shared job memory: writes analysis
backend/app/dependencies.py - Asset indexing → Shared job memory: writes index
backend/app/dependencies.py - Slot matching → Shared job memory: writes matches
backend/app/dependencies.py - Gap resolution → Shared job memory: writes resolutions
backend/app/dependencies.py - Timeline planning → Shared job memory: writes timeline
backend/app/dependencies.py - Video rendering → Shared job memory: writes render metadata
backend/app/dependencies.py - Video rendering → FFmpeg timeline: renders timeline
README.md - Orchestration API → Timeline editing: edits segments
backend/app/api/routes/orchestration.py - Gap resolution → Editing knowledge base: retrieves guidance
README.md - Orchestration API → CapCut draft export: exports draft
backend/app/api/routes/orchestration.py - Orchestration API → Redis memory: loads job state
backend/app/api/routes/orchestration.py - Redis memory → Shared job memory: backs memory
backend/app/core/shared_memory_redis.py - Event stream client → Orchestration API: subscribes and polls
frontend/src/hooks/useSSEEventSource.ts - Progress and results → Event stream client: displays events
frontend/src/components/AgentConversationPanel.tsx - Orchestration API → Sample analysis API: serves analysis routes
backend/app/main.py - Sample analysis API → Sample analysis: requests analysis
backend/app/api/routes/sample_analysis.py - Sample analysis → Analysis provider: analyzes sample
backend/app/services/sample_analysis.py - Sample analysis → Analysis repository: stores results
backend/app/services/sample_analysis.py