A powerful AI-driven analysis platform featuring YouTube video processing and the DannyTrades Agent for automated stock market analysis and trading insights.
- Single video upload and analysis
- Multiple videos batch processing with sequential queue
- YouTube playlist support
- Automatic transcription and content extraction
- File upload API for direct video uploads
- Intelligent video processing queue management
- Multi-LLM Support: Claude, OpenAI, Gemini, Ollama, Groq, Mistral
- Stock Data Processing: Automated analysis of stock market data
- Notion Integration: Seamless MCP-based database updates
- Real-time Monitoring: Live performance metrics and activity tracking
- Web Dashboard: Modern UI with Shadcn components
- Provider Management: Dynamic LLM provider switching
- Performance Analytics: Request tracking, success rates, response times
- Advanced language model integration
- Vector-based similarity search
- Intelligent content summarization
- Context-aware chat interface
- Modern, responsive web interface
- Real-time processing status updates
- Enhanced console log with scroll, color coding, and timestamps
- Interactive chat with processed content
- Video processing queue status monitoring
- Easy-to-use upload forms
- DannyTrades Agent dashboard with live metrics
- Automated file cleanup service (janitor) with cron scheduling
- Configurable retention policies
- Background maintenance tasks
- Queue management and monitoring
- RESTful API for video upload and analysis
- DannyTrades Agent endpoints for stock processing
- Queue management endpoints
- File cleanup management
- Real-time status monitoring
- Python 3.8 or higher
- UV package manager (recommended) or pip
- Node.js and npm (for MCP servers)
- YouTube Data API key (optional, for enhanced playlist features)
- API keys for LLM providers (OpenAI, Anthropic, etc.) for DannyTrades Agent
- Notion API key and database setup for DannyTrades integration
- Clone the repository:
git clone https://github.com/yourusername/video-analyzer.git
cd video-analyzer- Install dependencies using UV (recommended):
# Install UV if not already installed
pip install uv
# Install project dependencies
uv sync
# Activate the virtual environment
source .venv/bin/activate # On Linux/Mac
# OR
.venv\Scripts\activate # On WindowsAlternatively, use pip:
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Linux/Mac or .venv\Scripts\activate on Windows
# Install dependencies
pip install -r requirements.txt- Configure environment variables:
# Copy the example environment file
cp .env.example .env
# Edit .env with your API keys and configuration
# Required for DannyTrades Agent:
# - OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.
# - NOTION_API_KEY and NOTION_DATABASE_ID- Install MCP servers (for DannyTrades Agent):
# Install the official Notion MCP server
npm install -g @modelcontextprotocol/server-notion
# Or install locally in your project
npm install @modelcontextprotocol/server-notion- Start the server:
# Using UV
uv run python main.py
# Or with standard Python
python main.py
⚠️ Important: Always run the server from the project root directory, not from within theappdirectory.
- Paste a YouTube video URL in the single video form
- Click "Upload Video"
- Monitor processing status in real-time
- Once complete, use the chat interface to interact with the video content
- Enter a YouTube playlist URL in the playlist form
- Click "Upload Playlist"
- Track progress of individual videos
- Chat with content from all processed videos
- Enter multiple YouTube URLs (one per line)
- Click "Upload Videos"
- Monitor batch processing status in the enhanced console
- Videos are processed sequentially to avoid rate limits
- Interact with combined content through chat
Access the DannyTrades Agent dashboard at http://localhost:8000 and navigate to the "DannyTrades" tab.
- LLM Provider Setup: Configure your preferred AI provider (Claude, OpenAI, Gemini, etc.)
- MCP Server Setup: The agent uses the official Notion MCP server via stdio transport
- Environment Variables: Ensure all required API keys are configured
The DannyTrades Agent supports flexible MCP server configuration:
# Default configuration uses official Notion MCP server
mcp_servers = [
{
"name": "notion",
"transport_type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-notion"],
"env": {
"NOTION_API_KEY": "your_notion_api_key",
"NOTION_DATABASE_ID": "your_database_id"
}
}
]You can also use:
- Alternative MCP servers: Any MCP-compatible server
- MCP Proxy servers: For advanced routing and management
- SSE Transport: For server-sent events based communication
# Process stock data via API
curl -X POST "http://localhost:8000/api/dannytrades/process" \
-H "Content-Type: application/json" \
-d '{
"symbol": "AAPL",
"price": 150.25,
"volume": 1000000,
"sentiment": "bullish"
}'- View live performance metrics in the dashboard
- Monitor processing activities and success rates
- Track LLM provider performance and costs
- Monitor MCP server connections and tool availability
Upload video files directly via API:
curl -X POST "http://localhost:8000/api/upload-video" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "video_file=@your_video.mp4" \
-F "title=My Video" \
-F "description=Video description" \
-F "priority=1"-
FastAPI Backend
- RESTful API endpoints
- Async video processing
- WebSocket support for real-time updates
- Static file serving
- DannyTrades Agent API endpoints
-
DannyTrades Agent System
- Multi-LLM provider support (Claude, OpenAI, Gemini, Ollama, Groq, Mistral)
- Agno AI framework integration
- MCP (Model Context Protocol) tools for Notion
- Performance monitoring and analytics
- Real-time activity tracking
- Async processing with retry mechanisms
-
Video Processing Pipeline
- YouTube video download
- Audio extraction
- Transcription processing
- Content analysis
-
Vector Store
- Efficient similarity search
- Content embedding storage
- Fast query processing
-
LLM Service
- Context-aware responses
- Content summarization
- Natural language understanding
The system is configured via config.yaml. Key configuration sections:
janitor:
enabled: true
schedule: "0 1 * * *" # Daily at 1:00 AM (cron syntax)
cleanup_paths:
- "downloads"
- "temp"
- "transcripts"
file_patterns:
- "*.mp4"
- "*.wav"
- "*.txt"
- "*.json"
retention_hours: 168 # 7 days
dry_run: false
max_file_size_mb: null # Optional file size limit
exclude_patterns: [] # Files to exclude from cleanup
log_deletions: true # Log each file deletion
preserve_recent_files: true # Keep files from last 24h regardless of retentionstorage:
base_path: "./storage"
downloads_path: "downloads"
transcripts_path: "transcripts"api:
host: "0.0.0.0"
port: 8000
cors_origins:
- "http://localhost:3000"
- "http://127.0.0.1:3000"Access the interactive API documentation at:
http://localhost:8000/docs
POST /analyze: Process single videoPOST /analyze-playlist: Process YouTube playlistPOST /api/upload-video: Upload and analyze video filePOST /api/analyze-url: Analyze video from URLPOST /chat: Interact with processed contentGET /status/{video_id}: Check processing status
GET /api/queue/status: Get video processing queue statusGET /api/queue/video/{video_id}: Get specific video queue info
GET /api/janitor/status: Get service status and configurationPOST /api/janitor/config: Update runtime configurationPOST /api/janitor/cleanup/manual: Trigger manual cleanupGET /api/janitor/cleanup/preview: Preview cleanup without deletionPOST /api/janitor/start: Start the janitor servicePOST /api/janitor/stop: Stop the janitor service
The web interface now includes an enhanced console log with:
- Scrollable output: 300px height with smooth scrolling
- Color-coded log levels: INFO (blue), SUCCESS (green), WARNING (yellow), ERROR (red), DEBUG (purple)
- Timestamps: ISO format timestamps for all entries
- Auto-scroll toggle: Enable/disable auto-scrolling to latest entries
- Clear console: Button to clear all log entries
- Queue monitoring: Real-time queue status display
- Memory management: Automatic cleanup of old entries (max 1000)
Videos are now processed sequentially to avoid:
- Rate limiting issues
- System resource bottlenecks
- Parallel processing conflicts
Queue features:
- Priority processing: Higher priority videos processed first
- Status tracking: Real-time status updates for each video
- Error handling: Failed videos don't block the queue
- Progress monitoring: Track position and processing time
The janitor service automatically manages storage with advanced features:
- Cron-based scheduling: Configurable cleanup schedules using cron syntax
- Smart file filtering: Exclusion patterns, size limits, and recent file preservation
- Retention policies: Keep files for configurable time periods
- Web UI management: Full control panel with real-time status and configuration
- Preview mode: Safe cleanup preview before actual deletion
- Runtime configuration: Update settings without restarting the service
- Detailed logging: Comprehensive deletion tracking and error reporting
- Manual triggers: API endpoints for on-demand cleanup
- Service Controls: Start/stop service with one click
- Configuration Panel: Adjust retention hours, file size limits, and cleanup schedule
- Cleanup Options: Preview what would be deleted or run manual cleanup
- Status Display: Real-time service status and last cleanup results
- Results Visualization: Detailed statistics showing files deleted, space freed, and errors
Direct file upload capabilities:
- Multi-format support: Accept various video file formats
- API integration: RESTful endpoints for programmatic uploads
- Priority queuing: Set processing priority for uploaded files
- Metadata support: Add titles and descriptions during upload
video-analyzer/
├── app/
│ ├── static/
│ │ ├── index.html
│ │ └── app.js
│ ├── services/
│ │ ├── video_processor.py
│ │ ├── llm_service.py
│ │ ├── vector_store.py
│ │ └── model_manager.py
│ └── main.py
├── requirements.txt
├── config.yaml
└── README.md
- Create feature branch:
git checkout -b feature/your-feature-name- Implement changes
- Update tests
- Submit pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- OpenAI for language model support
- FastAPI for the web framework
- CopilotKit for enhanced chat capabilities