Building Cinemind-AI 🎬 | My First AI Movie Chatbot with Flask, Gemini & MongoDB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyrinNew
    Senior Member
    • Feb 2024
    • 5168

    #1

    Building Cinemind-AI 🎬 | My First AI Movie Chatbot with Flask, Gemini & MongoDB

    🎬 Cinemind-AI

    I recently built my own AI chatbot called Cinemind-AI β€” a movie-focused assistant that answers questions about films, actors, and directors.


    This project helped me understand how real AI applications work behind the scenes.





    πŸš€ What is Cinemind-AI?

    Cinemind-AI is a movie-only chatbot that:
    • Answers questions about movies πŸŽ₯
    • Stores chat history πŸ“‚
    • Works like ChatGPT πŸ’¬
    • Uses AI for intelligent responses 🧠





    πŸ—οΈ Architecture

    Here’s how the system works:






    Frontend (HTML + JavaScript)
    ↓
    Backend (Flask API)
    ↓
    AI Model (Google Gemini)
    ↓
    Database (MongoDB)










    βš™οΈ Technologies Used

    • Python 🐍
    • Flask 🌐
    • Google Gemini API πŸ€–
    • MongoDB πŸ—„οΈ
    • HTML, CSS, JavaScript πŸ’»





    πŸ”₯ Key Features

    πŸ’¬ ChatGPT-like Interface

    Users can chat naturally like they do with AI assistants.


    πŸŽ₯ Movie Domain Restriction

    The chatbot only answers movie-related questions.


    If a user asks something else:






    ⚠ Please ask only movie related questions.







    πŸ“‚ Chat History

    All chats are stored in MongoDB and can be reopened later.


    🧠 AI-Powered Responses

    Using Gemini API, the chatbot generates smart answers.





    🧩 How It Works

    1. User Sends Message





    polisodu telugu movie







    2. Flask Backend Receives It





    data = request.get_json()
    message = data["message"]







    3. Domain Filter Applied





    if "movie" not in message:
    return "Only movie questions allowed"







    4. AI Generates Response





    response = model.generate_content(message)







    5. Stored in MongoDB





    {
    "role": "user",
    "message": "polisodu telugu movie"
    }










    πŸ§ͺ Challenges I Faced

    • API rate limits (Gemini quota hit πŸ’€)
    • JSON parsing errors in frontend
    • Handling Markdown formatting in responses
    • Managing chat sessions correctly





    πŸ’‘ What I Learned

    • How frontend talks to backend (fetch API)
    • How Flask APIs work
    • How AI models are integrated
    • How databases store chat data
    • Real-world debugging skills πŸ˜„





    πŸš€ Future Improvements

    • Streaming AI responses (typing effect)
    • Chat titles like ChatGPT
    • Movie posters integration
    • Better UI design





    🎯 Final Thoughts

    Building Cinemind-AI made me realize how modern AI apps are structured.


    This is not just a chatbot β€” it's a full-stack AI project.





    πŸ‘¨β€πŸ’» About Me

    I'm Nagu, a Cyber Security Engineering student exploring AI + Web Development πŸš€





    GITHUB REPO .




    ⭐ If You Like This

    Give your feedback or suggestions!


    And if you're building something similar, let’s connect πŸ”₯




    More...
Working...