NX-EDITOR8 AI AGENTS FLOW
Date: October 4, 2025
Status: โ
LANGCHAIN ENABLED WITH AI AGENTS PIPELINE
๐ค AI AGENTS ARCHITECTURE
nx-editor8 uses LangChain and LiteLLM to implement a sophisticated multi-agent AI processing pipeline for content transformation.
๐ AI AGENTS FLOW DIAGRAM
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ KAFKA CONTENT SOURCES โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ youtube_content โ tiktok_content โ facebook_content โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MESSAGE PROCESSOR โ
โ (src/core/message_processor.py) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ค AI AGENT 1: REQUIREMENTS VALIDATOR โ
โ (src/validation/requirements_validator.py) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Word/Character Count Validation โ
โ โข Content Format Detection โ
โ โข Language Validation โ
โ โข Quality Assessment โ
โ โ
โ ๐ ENHANCEMENT LOOP (if requirements not met): โ
โ โโโ LLM-Powered Content Enhancement โ
โ โโโ Retry Logic (max 3 attempts) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ (requirements met)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ค AI AGENT 2: CONTENT ANALYZER โ
โ (_analyze_content method) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Prompt: src/ai/prompts/content_analysis.md โ
โ โ
โ AI Tasks: โ
โ โข Sentiment Analysis (positive/negative/neutral) โ
โ โข Topic Extraction โ
โ โข Key Points Identification โ
โ โข Title Generation โ
โ โข Description Creation โ
โ โข SEO Keywords Generation โ
โ โข Content Type Classification โ
โ โข Quality Score Assessment โ
โ โ
โ Output: ContentAnalysis model โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ค AI AGENT 3: SCENE GENERATOR โ
โ (_generate_scenes method) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Prompt: src/ai/prompts/scene_generation.md โ
โ โ
โ AI Tasks: โ
โ โข Video Script Structure Creation โ
โ โข Scene Type Assignment (title/text/image/outro) โ
โ โข TTS-Optimized Text Generation โ
โ โข Visual Design (colors, duration) โ
โ โข Scene Flow Optimization โ
โ โข Engagement Optimization โ
โ โ
โ Scene Types: โ
โ โโ title_scene: Opening with title/intro โ
โ โโ text_scene: Main content presentation โ
โ โโ image_scene: Visual content with text โ
โ โโ outro_scene: Closing with CTA โ
โ โ
โ Output: List[Scene] models โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OUTPUT FORMATTER โ
โ (_create_nx_maker8_input method) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข NXMaker8Input Model Creation โ
โ โข Video Settings Configuration โ
โ โข Storage and TTS Provider Setup โ
โ โข Metadata Enrichment โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ KAFKA PUBLISHER โ
โ (src/integrations/kafka_client.py) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข nx-maker8 Topic Publishing โ
โ โข Video Request Formatting โ
โ โข Success/Error Handling โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ NX-MAKER8 ECOSYSTEM โ
โ (Video Generation Pipeline) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง AI AGENTS DETAILED CAPABILITIES
๐ค Agent 1: Requirements Validator
File: src/validation/requirements_validator.py
LangChain Integration: Content Enhancement via LLM
Core Functions:
verify_requirements()- Multi-criteria content validationenhance_content_for_requirements()- LLM-powered content expansion_validate_content_format()- Format compliance checking_detect_language()- Language identification
AI Enhancement Logic:
# When content fails requirements:
enhanced_content = await self.llm_client.generate(
prompt=enhancement_prompt,
system_message="You are nx-editor8's content enhancement specialist..."
)
๐ค Agent 2: Content Analyzer
File: src/core/message_processor.py (_analyze_content method)
Prompt Template: src/ai/prompts/content_analysis.md
AI Capabilities:
- Sentiment Analysis: positive/negative/neutral classification
- Topic Extraction: Multi-topic identification and categorization
- Key Points: Hierarchical content structure analysis
- SEO Optimization: Title, description, and keyword generation
- Quality Assessment: Content scoring for video suitability
JSON Output Structure:
{
"sentiment": "positive|negative|neutral",
"topics": ["topic1", "topic2"],
"key_points": ["point1", "point2"],
"suggested_title": "AI-generated engaging title",
"suggested_description": "Compelling description",
"suggested_keywords": ["kw1", "kw2"],
"content_type": "educational|entertainment|news|tutorial",
"quality_score": 0.85,
"engagement_potential": "high|medium|low"
}
๐ค Agent 3: Scene Generator
File: src/core/message_processor.py (_generate_scenes method)
Prompt Template: src/ai/prompts/scene_generation.md
AI Capabilities:
- Video Structure: Intelligent scene breakdown and flow
- TTS Optimization: Text length and pronunciation optimization
- Visual Design: Color schemes and timing coordination
- Engagement Flow: Hook, content, and call-to-action structure
Scene Types Generated:
- title_scene: Opening hook with title and introduction
- text_scene: Main content delivery with optimized pacing
- image_scene: Visual content integration (when available)
- outro_scene: Conclusion with engagement prompts
๐ง LiteLLM CLIENT ARCHITECTURE
File: src/integrations/llm_client.py
Design Pattern: Singleton with async/await
Key Features:
- EngineX Compatibility: Follows established xProjects patterns
- Multi-Fallback Configuration: Environment variable hierarchy
- Retry Logic: Exponential backoff with 3 attempts
- JSON Parsing: Automatic structured response handling
- Error Recovery: Graceful fallback mechanisms
Client Methods:
# Text generation
response = await llm_client.generate(prompt, system_message)
# Structured JSON generation
data = await llm_client.generate_json(prompt, system_message)
๐ AI PROCESSING PIPELINE FLOW
Step-by-Step Execution:
- Message Ingestion: Kafka consumer receives content message
- Requirements Check: AI validates content against criteria
- Enhancement Loop: If needed, AI expands/improves content
- Content Analysis: AI extracts insights and metadata
- Scene Generation: AI creates structured video scenes
- Output Formatting: Data transformed to nx-maker8 format
- Publication: Structured video request published to Kafka
Retry and Error Handling:
- Requirements Validation: Up to 3 enhancement attempts
- LLM Requests: Exponential backoff retry logic
- Fallback Mechanisms: Basic scene generation if AI fails
- Error Publishing: Structured error reporting to Kafka topics
๐ฏ LangChain Integration Points
Current LangChain Usage:
- Dependencies:
langchain>=0.1.0,<0.2.0andlangchain-core>=0.1.7,<0.2.0 - LangGraph:
langgraph==0.0.26for potential agent orchestration - Integration Patterns: Compatible with LangChain's agent framework
Potential LangChain Enhancements:
- Agent Orchestration: LangGraph for complex multi-agent workflows
- Memory Systems: Conversation memory for content context
- Tool Integration: External tool calling for image search, data retrieval
- Chain Composition: Sophisticated prompt chaining and conditional logic
๐ Performance Characteristics
AI Processing Metrics:
- Content Analysis: ~2-3 seconds per message
- Scene Generation: ~3-5 seconds per message
- Enhancement Cycles: ~2-4 seconds per retry
- Total Processing: ~5-15 seconds end-to-end
Scalability Features:
- Async Processing: Non-blocking I/O throughout pipeline
- Singleton Clients: Resource-efficient client management
- Configurable Limits: Adjustable retry counts and timeouts
- Error Isolation: Failed messages don't block pipeline
nx-editor8 implements a sophisticated AI agents pipeline using LangChain and LiteLLM for intelligent content transformation and video scene generation! ๐คโจ
Related Documents
Demo Video Script - Kinetic Ledger
**Duration:** 3-5 minutes
Demo Video Script (30-60 Seconds)
- **Loom** (free) - loom.com
CodeForge AI - Hackathon Demo Script
**[Fade in: Dark background with CodeForge AI logo animating in]**
Prompt Craft Reference
Production-quality prompt engineering for HeyGen Video Agent. Combines official HeyGen guidance with patterns validated across 80+ test videos.