- Python environment with
uvpackage manager installed - Internet connection to download the dataset
- OpenAI API key
- Pinecone API key
-
Download the IMDB dataset from Kaggle:
- IMDB Dataset of 50K Movie Reviews
- You'll need a Kaggle account to download the dataset
- Place the downloaded
IMDB Dataset.csvfile in thedatafolder
-
Configure API Keys:
- Rename
.env.exampleto.env - Fill in your API keys:
OPENAI_API_KEY=your_openai_key OPENAI_MODEL=your_preferred_model PINECONE_KEY=your_pinecone_key - Rename
Your project structure should look like this:
.
├── config.py
├── data
│ └── IMDB Dataset.csv
├── embed_and_store.py
├── preprocess_imdb.py
├── main.py
├── .env
└── README.md
Execute the preprocessing script:
uv run preprocess_imdb.pyThis script prepares the IMDB reviews for analysis and creates processed_reviews.json in the data folder.
Execute the embedding script:
uv run embed_and_store.pyThis script converts the preprocessed reviews into vectors and stores them in Pinecone.
Execute the RAG (Retrieval-Augmented Generation) pipeline:
uv run main.pyThis will process the vectorized data using the RAG architecture.
Example of interaction with RAG App
Check out examples of interaction
Make sure all dependencies are installed and API keys are properly configured before running the scripts.
