Skip to main content

Overview

The ProductionManagementAgent orchestrates the complete video production pipeline, from script processing to final video assembly. It manages assets, generates AI video content, creates audio narration, generates captions, and assembles the final video.

Constructor

Database
required
Database instance for production data
Credentials
required
Credentials manager with API access

Properties

Array
Production pipeline with all content in various stages
Map
Asset management map for tracking production files
AIVideoGenerator
AI video generation service
Logger
Logger instance for tracking production

Methods

initialize()

Initializes the agent, creates directories, and loads pipeline.
Promise<boolean>
Returns true when initialization is complete

processContent(contentData)

Processes complete content through production pipeline.
Object
required
Content package with strategy, script, thumbnail, and SEO data
Object
required
Content strategy from ContentStrategyAgent
Object
required
Video script from ScriptWriterAgent
Object
required
Thumbnail from ThumbnailDesignerAgent
Object
required
SEO data from SEOOptimizerAgent
Promise<Object>
Production data with all generated assets
string
Unique production ID
string
Production status: processing or ready
Object
All generated assets (script, thumbnail, audio, video, captions, finalVideo)
Object
Timestamps for each production milestone
string
Calculated publish time
number
Production priority (0-100)

generateVideoContent(productionData)

Generates AI video content using visual prompts from script.
Object
required
Production data object
Promise<Array>
Array of generated visual assets

generateAudioNarration(productionData)

Generates AI audio narration from script.
Object
required
Production data with script assets
Promise<string>
Path to generated audio file

generateCaptions(productionData)

Generates SRT captions with timestamps.
Object
required
Production data with script
Promise<string>
Path to SRT caption file

assembleVideo(productionData)

Assembles final video from all assets.
Object
required
Production data with all assets
Promise<string>
Path to final video file

processScript(script)

Processes and formats script for production.
Object
required
Script from ScriptWriterAgent
Promise<Object>
Processed script assets with paths

formatScriptForTTS(script)

Formats script into TTS-friendly text.
Object
required
Complete script object
string
Plain text formatted for text-to-speech

processThumbnail(thumbnail)

Processes thumbnail for production and generates AI variant.
Object
required
Thumbnail from ThumbnailDesignerAgent
Promise<Object>
Processed thumbnail asset

createSRTCaptions(productionData)

Creates properly formatted SRT caption file.
Object
required
Production data with script
Promise<string>
SRT formatted caption string

calculatePublishTime(strategy)

Calculates optimal publish time from strategy.
Object
required
Content strategy
string
ISO timestamp for publishing

calculatePriority(strategy)

Calculates production priority.
Object
required
Content strategy
number
Priority score (0-100)

getPipelineStatus()

Gets status of all items in production pipeline.
Promise<Array<Object>>
Array of pipeline item summaries

calculateProgress(productionData)

Calculates production completion percentage.
Object
required
Production data with timeline
number
Progress percentage (0-100)

getNextReadyContent()

Gets highest priority content ready for publishing.
Promise<Object|null>
Next production item or null

Production Pipeline Stages

Usage Example

Asset Management

The agent manages assets in organized directories:
Production metadata and state files
Processed thumbnails and visual assets
Final rendered video files
Generated audio narration files
Original scripts and TTS-formatted versions
Temporary files during processing

Best Practices

Check pipeline status to identify bottlenecks and ensure smooth production flow.
Content with higher estimated views and closer publish times gets higher priority automatically.
While AI generation is automatic, review visual assets and audio narration for quality.
Archive or clean up old production files periodically to manage disk space.
The agent includes fallback methods for AI service failures. Monitor logs for simulation vs. actual generation.