Skip to content

This RAG Application is a web-based tool that allows users to ask questions about the Mission Impossible film franchise and receive detailed, contextually relevant answers. By combining retrieval-based methods with generative AI, the application ensures that responses are both accurate and engaging.

License

Notifications You must be signed in to change notification settings

iamrahulreddy/mission-impossible-rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mission: Impossible RAG Application

Welcome to the Mission: Impossible RAG (Retrieval-Augmented Generation) Application! This project is a labor of love, inspired by my deep admiration for the Mission: Impossible film franchise. Whether you're a die-hard fan or just curious about the intricate world of espionage, this application is designed to provide you with insightful and engaging information about the characters and plots from the Mission: Impossible universe.

Live Demo

Check out the live demo of the Mission: Impossible RAG application at miapp.neuralnets.dev to experience it in action!

Table of Contents

Introduction

The Mission: Impossible RAG Application is a web-based tool that allows users to ask questions about the Mission: Impossible film franchise and receive detailed, contextually relevant answers. By combining retrieval-based methods with generative AI, the application ensures that responses are both accurate and engaging.

Features

  • Document Retrieval: The application loads and processes documents related to the Mission: Impossible franchise, breaking them down into manageable chunks for efficient retrieval.
  • Semantic Embedding: Utilizes advanced embedding techniques to understand the semantic meaning of both the documents and user queries.
  • Generative Responses: Generates comprehensive and user-friendly responses based on the retrieved information, ensuring a conversational tone.
  • User-Friendly Interface: A sleek and intuitive interface that makes it easy for users to input their queries and receive answers.
  • Self-Destructing Messages: A fun countdown timer that adds a touch of espionage flair, simulating the self-destructing messages from the films.

Technology Stack

  • Backend: Flask
  • Frontend: HTML, CSS (Tailwind CSS), JavaScript (jQuery)
  • Embedding and Generation: Google Generative AI
  • Data Handling: Pandas, NumPy
  • Similarity Measurement: Scikit-learn (Cosine Similarity)

Installation

To set up the Mission: Impossible RAG Application on your local machine, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/iamrahulreddy/mission-impossible-rag.git
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Set Up Environment Variables: Create a .env file in the root directory and add your Google Generative AI API key:

    API_KEY=your_api_key_here

    You can get your Gemini API key here.

  4. Run the Application:

    python app.py
  5. Access the Application: Open your browser and navigate to http://127.0.0.1:5000/.

Note 📝

I have only used Mission: Impossible film data for embedding and retrieving content, so this terminal only contains data specifically from Mission: Impossible films. Inquiries outside this scope cannot be answered.

Usage

  1. Enter Your Query: Type your question about the Mission: Impossible franchise in the input box.
  2. Submit: Click the "Execute Mission Protocol" button to submit your query.
  3. Receive Response: Wait for the application to process your query and display the response. You can adjust the self-destruct timer (in seconds) for the response in template/index.html. Once the countdown finishes, the message will be destroyed. If you want to see the message again, you will need to submit a new query. Since LLMs (Large Language Models) are probabilistic, you may receive a slightly different but still relevant response.

Screenshots

1. Try asking about the character - who is Benji?

Screenshot 1

2. If you want to know more about a specific film in the franchise - like Fallout here.

Screenshot 2

3. Asking a fact related to Tom Cruise

Screenshot 3

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

Deployment

To deploy the Mission: Impossible RAG application to a production server, follow these general steps:

  1. Clone the Repository:

    git clone https://github.com/your-username/mission-impossible-rag.git
  2. Install Dependencies: Install the required Python packages:

    pip install -r requirements.txt
  3. Set Up Environment Variables: Create a .env file in the root directory and add your API key and other environment variables:

    API_KEY=your_api_key_here
  4. Set Up Gunicorn to Run the Flask Application: Install gunicorn if you haven't yet, and run it:

    gunicorn --workers 3 --bind unix:/tmp/yourapp.sock app:app
  5. Configure Nginx as a Reverse Proxy: Set up Nginx to reverse proxy requests to Gunicorn via the Unix socket.

    • Create a new Nginx configuration file:

      sudo nano /etc/nginx/sites-available/your-domain.com

      Add the following content (replace your-domain.com with your actual domain):

      server {
          listen 80;
          server_name your-domain.com www.your-domain.com;
      
          location / {
              include proxy_params;
              proxy_pass http://unix:/tmp/yourapp.sock;
          }
      }
  6. Enable the Nginx Site Configuration: Create a symbolic link from the sites-available directory to sites-enabled:

    sudo ln -s /etc/nginx/sites-available/your-domain.com /etc/nginx/sites-enabled/
  7. Restart Nginx: Apply the changes by restarting the Nginx service:

    sudo systemctl restart nginx
  8. Set Up SSL with Certbot (Optional but Recommended): If you'd like to serve your application over HTTPS, use Certbot to obtain an SSL certificate for your domain:

    sudo certbot --nginx -d your-domain.com -d www.your-domain.com

    Follow the instructions provided by Certbot to complete the SSL configuration.

  9. Verify the Deployment: After everything is set up, visit your domain (e.g., http://your-domain.com or https://your-domain.com if you set up SSL) to see the live app.

License

This project is licensed under the MIT License. See the LICENSE file for details.

References


Thank you for checking out the Mission: Impossible RAG Application! I hope you enjoy exploring the world of Ethan Hunt and his team as much as I enjoyed creating this project. 🕵️‍♂️🎬

About

This RAG Application is a web-based tool that allows users to ask questions about the Mission Impossible film franchise and receive detailed, contextually relevant answers. By combining retrieval-based methods with generative AI, the application ensures that responses are both accurate and engaging.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published