Skip to content

Latest commit

 

History

History
139 lines (109 loc) · 4.87 KB

File metadata and controls

139 lines (109 loc) · 4.87 KB

UN WebTV Analysis Platform - Development Progress

Session Date: October 21, 2025

✅ Completed Tasks

  1. Project Setup

    • Initialized git repository (main branch)
    • Created professional project structure
    • Set up virtual environment (untv)
    • Configured .gitignore for Python project
  2. Architecture & Documentation

    • Comprehensive ARCHITECTURE.md with full technical specification
    • Cost analysis showing 79% savings ($450 → $96/month)
    • Database schema design (Cosmos DB + Azure AI Search)
    • Processing workflow documentation
    • README with installation instructions
  3. Data Models (backend/models/session.py)

    • SessionMetadata - UN session information
    • Transcript - Full transcript with segments
    • TranscriptSegment - Individual speaker segments with timestamps
    • EntityExtraction - Extracted entities (speakers, countries, SDGs, etc.)
    • Speaker - Speaker information
    • SDGReference - SDG mentions with context
    • Chat - Chat session model
    • ChatMessage - Individual chat messages
    • VectorSegment - Vectorized segments for semantic search
    • ProcessingProgress - Real-time progress tracking
  4. Core Services

    • UNTVScraper (backend/services/untv_scraper.py)

      • Extract Kaltura Entry ID from URL
      • Scrape session metadata (title, date, duration, location, etc.)
      • Parse broadcasting entity, languages, categories
      • Extract session type and description
    • AzureOpenAIClient (backend/services/azure_openai_client.py)

      • Transcription with speaker diarization (GPT-4o-transcribe-diarize)
      • Entity extraction using GPT-4o with structured output
      • Executive summary generation
      • Embedding generation (batch processing)
      • RAG-powered chat completion
  5. Configuration (config/settings.py)

    • Pydantic-based settings with environment variable loading
    • Azure OpenAI configuration (all 5 models)
    • Azure Speech Services configuration
    • Database settings (Cosmos DB, Blob Storage, AI Search)
    • Processing limits and parameters
    • Logging configuration

🔄 In Progress

  • Installing Python dependencies (Python 3.13 compatible versions)

📋 Next Steps

  1. Audio Processing Service

    • Download video/audio from UN WebTV
    • Extract audio track
    • Upload to Azure Blob Storage (temporary)
  2. Azure Resources Setup

    • Create Cosmos DB database and containers
    • Set up Azure Blob Storage containers
    • Configure Azure AI Search index with vector search
  3. Entity Extraction Pipeline

    • Implement speakers identification
    • Extract countries, organizations, treaties
    • Identify SDG references
    • Extract topics and key decisions
  4. Vector Database Integration

    • Generate embeddings for transcript segments
    • Store in Azure AI Search
    • Implement semantic search
  5. FastAPI Backend

    • Session processing endpoint (POST /sessions)
    • Session retrieval endpoint (GET /sessions/{id})
    • Chat endpoint (POST /sessions/{id}/chat)
    • Catalog endpoint (GET /sessions)
    • Export endpoints
  6. Streamlit Frontend

    • Session upload page with URL input
    • Real-time progress tracking
    • Session catalog with search/filter
    • Chat interface with RAG
    • Export buttons (transcript, chat)

🏗️ Architecture Decisions Made

  1. Premium Version First: Start with full-featured version, then optimize for cost
  2. Two-Database Approach: Cosmos DB (metadata) + Azure AI Search (vectors)
  3. Speaker Diarization: Use GPT-4o-transcribe-diarize for best quality
  4. Structured Output: Single GPT-4o call with JSON mode for entity extraction
  5. Async Processing: FastAPI async endpoints for concurrent operations
  6. Session Deduplication: Check database before processing to save costs

💰 Cost Optimization Strategy

Current Target: ~$250-450/month (premium version) Optimized Target: ~$96/month (79% savings)

Key Optimizations Available:

  • PostgreSQL + pgvector instead of Azure AI Search (-$60-75/month)
  • Whisper instead of GPT-4o-transcribe (-$50-175/month)
  • GPT-4o-mini for entity extraction (-$15-75/month)
  • Smaller embedding model (-$5-15/month)

🔧 Technology Stack

  • Language: Python 3.13
  • Framework: FastAPI + Streamlit
  • AI Services: Azure OpenAI (5 models configured)
  • Databases: Azure Cosmos DB, Azure AI Search
  • Storage: Azure Blob Storage
  • Video Processing: yt-dlp, pydub, ffmpeg
  • Version Control: Git

📝 Git Commits

  1. db74b0b - Initial project setup: architecture, models, and scraper

🎯 Success Metrics Targets

  • Processing time per session: < 15 minutes
  • Chat response time: < 5 seconds
  • Cost per session: < $7 (premium) or < $2 (optimized)
  • Session reuse rate: > 40%

Project Status: Foundation complete, ready for implementation phase Estimated Completion: Phase 1 MVP in 2-3 weeks