RimaAlaya/CineRAG
๐ฌCineRAG - Cinema Secrets Encyclopedia
Beyond IMDB: A RAG system for true cinema lovers with behind-the-scenes secrets, production trivia, and insider stories.
  
๐ Live Demo | ๐น Video Demo | ๐ Technical Details
๐ฏ The Problem
Movie databases give you the basics - who directed it, who starred in it, what it's about.
But cinema fans want more:
- How did Heath Ledger prepare for the Joker?
- What went wrong during Titanic's filming?
- Why was the Inception hallway scene so hard to film?
- Did the cast of your favorite movie take anything from the set?
This information is scattered across Reddit threads, Wikipedia trivia sections, YouTube videos, and fan forums.
CineRAG solves this by aggregating behind-the-scenes secrets, production stories, and insider trivia into one searchable system.
โจ What Makes This Different
Traditional Movie Database:
Q: "Tell me about Inception" A: "Inception (2010) directed by Christopher Nolan. Stars Leonardo DiCaprio. A thief who steals corporate secrets..."
CineRAG:
Q: "What secrets are there about Inception?" A: "Nolan wrote Inception over 10 years. The rotating hallway fight? They actually built a rotating corridor - no CGI. Joseph Gordon-Levitt did his own stunts and got seriously dizzy filming those sequences."
This is what cinema fans get excited about.
๐ฅ Features
- ๐ฌ Cinema Secrets: 252 movies with behind-the-scenes content
- ๐ Hybrid Search: BM25 + Semantic (85.7% Recall@3)
- ๐ค AI Answers: Groq's Mixtral for natural responses
- โก Fast: <1 second per query
- ๐ Comprehensive: 466 movies, 3,000+ chunks
๐ Quick Start
Installation
# Clone
git clone https://github.com/RimaAlaya/CineRAG.git
cd CineRAG
# Install dependencies
pip install -r requirements.txt
# Setup API keys
cp .env.example .env
# Add your GROQ_API_KEY and TMDB_API_KEYRun the App
streamlit run app.pyVisit http://localhost:8501
๐ก Example Queries
Basic Movie Info
- "Who directed Inception?"
- "What is The Matrix about?"
- "Leonardo DiCaprio movies"
Cinema Secrets ๐ฌ
- "What secrets are there about Inception?"
- "Behind the scenes of The Dark Knight"
- "Tell me trivia about Titanic filming"
- "Production stories from The Matrix"
๐๏ธ Architecture
User Query
โ
Hybrid Search Engine
โโ Semantic Search (FAISS + embeddings)
โโ BM25 Keyword Search
โ
Score Fusion (0.5 + 0.5)
โ
Top K Relevant Chunks
โ
Groq LLM (Mixtral-8x7b)
โ
Natural Answer + SourcesData Pipeline
TMDB API โ Movies Basic Info (466 movies)
โ
Wikipedia Scraping โ Behind-the-Scenes Secrets (252 movies)
โ
Smart Chunking โ 3,000+ Searchable Chunks
โโ plot
โโ cast
โโ crew
โโ metadata
โโ secrets (production, filming, casting, reception)
โ
Dual Indexing
โโ FAISS (semantic)
โโ BM25 (keyword)๐ Technical Details
Performance Metrics
Key Insight: Hybrid search dramatically improved cross-reference queries (e.g., "Leonardo DiCaprio movies") through exact keyword matching.
Tech Stack
- Vector Search: FAISS + sentence-transformers (all-MiniLM-L6-v2)
- Keyword Search: BM25 (rank-bm25)
- LLM: Groq (Mixtral-8x7b-32768)
- Orchestration: LangChain
- Data Sources: TMDB API + Wikipedia
- UI: Streamlit
- Language: Python 3.12+
Dataset
- Movies: 466 from TMDB
- Movies with Secrets: 252
- Total Chunks: ~3,000
- Secret Chunks: 800+
- Chunk Types: plot, cast, crew, metadata, secretsproduction, secretsfilming, secretscasting, secretsreception
๐ Project Structure
CineRAG/
โโโ app.py # Streamlit web interface
โโโ cinema_secrets_rag.py # Main RAG system with Groq
โโโ hybrid_rag.py # Baseline hybrid search
โโโ data_secrets_collector.py # Wikipedia scraper
โโโ chunking_secrets.py # Chunk creation with secrets
โโโ data/
โ โโโ movies_full.json # TMDB movie data
โ โโโ movie_secrets.json # Wikipedia secrets
โ โโโ movie_chunks_with_secrets.json
โ โโโ embeddings_with_secrets.npy
โ โโโ evaluation_dataset.json
โโโ requirements.txt
โโโ README.md๐ Why This Project Stands Out
1. Unique Value Proposition
Not another generic RAG system. Focuses on a specific niche (cinema secrets) that no one else addresses.
2. Technical Depth
- Hybrid search implementation (not just vector search)
- Systematic evaluation with 164 test questions
- Production-ready with proper error handling
- LangChain integration with Groq (cost-effective LLM)
3. Product Thinking
- Identified a gap: "IMDB doesn't have secrets"
- Built a solution: "Aggregate secrets into one place"
- Validated with user stories: "Cinema fans want behind-the-scenes content"
4. Execution Quality
- Clean, documented code
- Deployed and working
- Performance metrics tracked
- Iterative improvement (baseline โ hybrid โ LLM)
๐ฎ Future Improvements
- [ ] More Sources: Add Reddit (r/MovieDetails), YouTube transcripts
- [ ] Actor/Director Profiles: Dedicated pages for people
- [ ] Cross-Encoder Reranking: Improve top result accuracy
- [ ] Conversation Memory: Multi-turn dialogue
- [ ] User Feedback Loop: Learn from interactions
- [ ] Multi-modal: Add movie posters, stills
๐ค Contributing
Want to add more secrets? Improve the prompts? PRs welcome!
Areas for contribution:
- Add more data sources (Reddit, YouTube, IMDb trivia)
- Improve secret extraction quality
- Add more evaluation metrics
- Enhance UI/UX
๐ License
MIT License - Free to use for personal or commercial projects.
๐จโ๐ป Built By
Rima Alaya AI/ML Engineer passionate about cinema and intelligent systems
๐ง Contact
Questions? Ideas? Want to collaborate?
๐ง rimaalaya76@gmail.com ๐ผ LinkedIn ๐ GitHub
Made with โค๏ธ for cinema lovers and built with cutting-edge AI technology
If you love movies and technology, star this repo โญ
