This project is a Retrieval-Augmented Generation (RAG) system that allows users to upload PDF documents and ask questions about the content, with responses generated using OpenAI's GPT model.
- Upload PDF files and retrieve information from them.
- Ask questions based on the uploaded documents.
- Responses are generated in real-time using OpenAI’s
gpt-3.5-turbo
model.
- Python 3.8+
- OpenAI API Key (instructions below on how to obtain one)
- Docker (optional for containerization)
- Clone the repository:
git clone https://github.com/EzioDEVio/RAG-project.git cd RAG-project
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
fe0da40 (Save local changes before rebase)
- Install required packages:
pip install -r requirements.txt
- Set up environment variables:
Create a .env file in the root of your project:
OPENAI_API_KEY=your_openai_api_key_here
- Get your OpenAI API Key:
Go to OpenAI API and create an API key. Save this key in the .env file as shown above.
- Run the Application:
streamlit run app.py
or
python -m streamlit run app.py
The app will start on http://localhost:8501.
- Build the Docker Image:
docker build -t ezio_rag_app .
- Run the Docker Container:
docker run -p 8501:8501 --env-file .env ezio_rag_app
💡 Tip: You can make notes more noticeable with emojis.
If you'd like to pass the API key directly as an environment variable when running the Docker container, you can omit the --env-file .env option and instead use the -e flag to specify the API key directly. Here’s how you can do it:
docker run -p 8501:8501 -e OPENAI_API_KEY=your_openai_api_key_here ezio_rag_app
🔥 Important: Don't forget to check your configuration settings!
Ensure that .env is listed in .gitignore to avoid exposing the API key in the repository. The app uses Streamlit for the UI and OpenAI for text generation.
venv/ pycache/
.env
.streamlit/
*.dockerignore