Overview
TheSEOOptimizerAgent optimizes video metadata for maximum YouTube discoverability. It generates optimized titles, descriptions, tags, hashtags, chapters, and calculates comprehensive SEO scores.
Constructor
Database
required
Database instance for keyword history and SEO data
Credentials
required
Credentials manager for external services
Properties
Map
Historical keyword performance data
Logger
Logger instance for tracking optimization
Methods
initialize()
Initializes the agent and loads keyword history.Promise<boolean>
Returns true when initialization is complete
optimize(script, strategy)
Generates complete SEO optimization for a video.Object
required
Video script object
Object
required
Content strategy object
Promise<Object>
Complete SEO data object
string
Optimized title (60-100 characters)
string
Comprehensive description (up to 5000 characters, first 125 optimized)
Array<string>
Prioritized tags (max 500 characters total)
Array<string>
15 relevant hashtags
Array<Object>
Video chapters with timestamps
Object
End screen strategy
number
Overall SEO score (0-100)
Object
Additional metadata (keywords, category, language)
optimizeTitle(originalTitle, strategy)
Optimizes video title for searchability and CTR.string
required
Original title from script
Object
required
Content strategy
Promise<string>
Optimized title (max 100 characters)
generateDescription(script, strategy)
Generates comprehensive, SEO-optimized video description.Object
required
Video script object
Object
required
Content strategy
Promise<string>
Full description (up to 5000 characters)
generateTags(script, strategy)
Generates and prioritizes video tags.Object
required
Video script
Object
required
Content strategy
Promise<Array<string>>
Prioritized tags (max 500 characters total)
generateHashtags(strategy)
Generates relevant hashtags for video.Object
required
Content strategy
Promise<Array<string>>
15 relevant hashtags
generateChapters(script)
Generates video chapters with timestamps.Object
required
Video script with sections
Promise<Array<Object>>
Chapter objects with time, title, and seconds
generateEndScreenStrategy()
Generates end screen element configuration.Promise<Object>
End screen strategy with elements and timing
calculateSEOScore(title, description, tags)
Calculates comprehensive SEO score.string
required
Video title
string
required
Video description
Array<string>
required
Video tags
Promise<number>
SEO score (0-100)
identifyNiche(strategy)
Identifies content niche from strategy.Object
required
Content strategy
string
Niche category: technology, gaming, education, business, lifestyle, health, entertainment, or general
selectCategory(strategy)
Selects YouTube category ID.Object
required
Content strategy
number
YouTube category ID
calculateOptimalLength(contentType)
Calculates optimal video length for content type.string
required
Content type (Tutorial, Explainer, Review, List, Story)
string
Recommended duration range
Usage Example
Tag Categories
The agent generates tags from multiple sources:Primary Keywords
Primary Keywords
Direct keywords from content strategy (highest priority)
Topic Variations
Topic Variations
Topic with spaces, without spaces, with underscores
Long-Tail Keywords
Long-Tail Keywords
Multi-word phrases (e.g., “how to javascript”, “javascript for beginners”)
Best Practices
Optimize First 125 Characters
Optimize First 125 Characters
The first 125 characters of the description appear in search results. Include primary keywords and a compelling hook.
Use All 500 Tag Characters
Use All 500 Tag Characters
The agent prioritizes tags to use the full 500-character limit. Mix broad and long-tail keywords.
Add Timestamps
Add Timestamps
Chapters improve user experience and SEO. The agent automatically generates them from script sections.
Target 80+ SEO Score
Target 80+ SEO Score
Scores above 80 indicate well-optimized content. Below 60 needs improvement in title, description, or tags.
Update Keywords Database
Update Keywords Database
Store performance data for keywords to improve future optimization recommendations.
Environment Variables
string
Your website URL for description links
string
Social media links for description
string
Business inquiry email for description
string
Channel name for branding tags