AI-powered system that determines if a movie is appropriate for children aged 5-10
Built with LangChain, FAISS, and Groq — a complete RAG system with an AI Agent for complex queries.
| Feature | Description |
|---|---|
| RAG Classification | Semantic search to retrieve relevant safety rules |
| AI Agent | Answers complex questions using 3 tools |
| Interactive CLI | Chat-style interface for movie safety queries |
| Batch Processing | Classify multiple movies at once |
| Movie Database | 30+ movies with details |
| Knowledge Base | 80+ safety Q&A pairs |
USER INTERFACE
[ Interactive CLI ]
[ Batch Mode ]
[ Agent ]
Retriever
(FAISS)
→
(FAISS)
Context
(Top-5 Q&A)
→
(Top-5 Q&A)
LLM
(Groq)
(Groq)
Knowledge Base
(80+ Q&A pairs)
(80+ Q&A pairs)
Movie Database (CSV)
(30 movies with details)
(30 movies with details)
User → RAG Chain (Retriever → Context → LLM) → Data Layer (KB + Movies)
Flow: Query → Embedding → FAISS Search → Top-5 Q&A → LLM → Classification
- Python 3.10+
- Groq API key (free) — Get it here
git clone https://github.com/YOUR_USERNAME/movie-content-safety.git
cd movie-content-safety
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtCreate a .env file in the project root:
GROQ_API_KEY=your_api_key_here
GROQ_MODEL=openai/gpt-oss-20bNote: Get your free Groq API key from console.groq.com
python src/vector_store.pypython src/main.pyExample Interaction:
🎬 Enter movie title (or command): The Lion King
📖 Found 'The Lion King' in CSV database!
📝 Year: 1994 | Rating: 8.5 | Genres: Animation, Adventure, Drama
📌 Result:
Classification: Safe for children
Explanation: The movie is animated, family-friendly, and contains no adult content.
python src/main.py --batch --limit 5python src/agent.pyExample Questions:
- "Can you find me a movie like The Lion King that is appropriate for a 5-year-old?"
- "Is Jurassic Park safe for children?"
- "What are the best family movies in the database?"
💭 Your question: What movies are safe for children?
📌 Response:
Here are some movies that are safe for children aged 5-10:
| Movie | Rating | Why it's safe |
|-------|--------|---------------|
| Toy Story | G | Animated, no violence, positive messages |
| Finding Nemo | G | Light-hearted adventure, no scary content |
| Frozen | PG | Positive themes of sisterhood and self-acceptance |
| The Lion King | G | Strong moral lessons, no graphic violence |
🎬 Enter movie title (or command): The Conjuring
📖 Found 'The Conjuring' in CSV database!
📝 Year: 2013 | Rating: 7.5 | Genres: Horror, Mystery, Thriller
📌 Result:
Classification: Not safe for children
Explanation: The Conjuring is a horror film with a rating of 7.5 (R). It contains supernatural terror, frightening imagery, and intense suspense typical of the horror genre, making it unsuitable for children aged 5-10.
movie-content-safety/
├── data/
│ ├── knowledge_base.csv # 80+ Q&A safety rules
│ ├── imdb_movies.csv # 30 movies with details
│ └── faiss_index/ # FAISS vector index
│ ├── index.faiss
│ └── index.pkl
├── src/
│ ├── config.py # Configuration & API keys
│ ├── vector_store.py # Build FAISS index
│ ├── rag_chain.py # RAG pipeline with Groq
│ ├── main.py # Interactive CLI
│ └── agent.py # AI Agent for complex queries
├── .env # Environment variables
├── requirements.txt # Python dependencies
└── README.md # This file
| Technology | Purpose |
|---|---|
| LangChain | LLM orchestration framework |
| FAISS | Vector similarity search |
| Groq | Fast, free LLM inference |
| HuggingFace | Embedding models (all-MiniLM-L6-v2) |
| Python | Core programming language |
| Pandas | CSV data handling |
langchain>=0.3.0
langchain-community>=0.3.0
langchain-core>=0.3.0
langchain-groq>=0.1.0
langchain-huggingface
faiss-cpu
sentence-transformers
pandas
python-dotenv- Add web interface (Gradio/Streamlit)
- Add evaluation framework (evals)
- Deploy to production
- Expand knowledge base to 500+ movies
- Add user feedback loop
If you found this project interesting, feel free to reach out!