Movie Agent Demo
Production-ready Flask web application providing comprehensive REST API and interactive UI for the Movie Agent Service. Features intelligent movie discovery through natural language queries, real-time chat interface with conversation history, movie poster image analysis using computer vision, interactive movie quizzes, and formatted statistics display. Implements encrypted API key storage with local configuration management, session-based memory isolation for multi-user support, and automatic query classification for seamless routing.
Technology Stack
Flask
Python
REST API
HTML/CSS
JavaScript
Encrypted Storage
Session Management
Web UI
File Upload
Multipart Form Data
JSON API
AJAX
Template Engine
Key Results
Three main endpoints: POST /chat (natural language queries), POST /poster (image analysis), POST /reset-config (configuration management)
Api Endpoints
Natural language movie search, similarity search, year-specific queries, recommendations, actor/director searches with intelligent filtering and deduplication
Chat Features
Upload movie posters to identify titles, analyze visual mood/themes, infer genres, and get confidence scores using BLIP model
Poster Analysis
Interactive chat interface with message history, image upload support, quiz interactions, and statistics visualization
Web Ui
Encrypted configuration storage with master key encryption, preventing API key exposure in logs or responses
Security
Flask sessions provide unique session IDs, conversation history, quiz state, and poster context isolation per browser session
Session Management
Automatic routing to movie_search, get_similar_movies, get_movie_statistics, and other tools based on query intent
Query Classification
Formatted output for top-rated movies, highest/lowest ratings, average ratings with counts, and genre distributions
Statistics Display
Automatic exclusion of original movie when finding similar movies, using actual database genres for accurate matching
Similarity Search
First-time configuration wizard for choosing LLM provider (Groq/OpenAI) and entering API keys securely
Setup Wizard
Challenges & Solutions
- Integrating Movie Agent Service core library with Flask web framework for seamless communication
- Designing RESTful API endpoints (/chat, /poster, /reset-config) with proper error handling and status codes
- Implementing secure encrypted API key storage using local configuration files (config.encrypted, .master_key)
- Creating session-based state management for conversation history, quiz state, and poster context per user
- Building interactive chat UI with real-time message display and conversation history preservation
- Handling file uploads for movie poster images (JPG, PNG, JPEG) with validation and processing
- Implementing automatic query classification to route natural language queries to appropriate agent tools
- Formatting statistics responses (top-rated movies, genre distributions, rating comparisons) for web display
- Managing quiz state and interactive question-answer flow with score tracking
- Ensuring configuration files remain gitignored and never exposed in logs or API responses
Project Stats
1
Team Member
1
Month