This project implements a Retrieval-Augmented Generation (RAG) assistant focused on climate change. It allows users to ask questions about climate change, retrieves relevant information from a collection of climate change research papers, and uses a large language model (Google Gemini) to generate coherent answers based on the retrieved context.
- Retrieves relevant information from climate change papers using vector embeddings and ChromaDB.
- Uses the Google Generative AI API (Gemini 3.8 Flash) for generating answers.
- Provides a simple interactive interface for testing the assistant.
- Includes a Streamlit application for a more user-friendly web interface.
- Python 3.7 or higher
- pip (Python package installer)
- Git (for cloning the repository, if applicable)
- Clone this repository (if hosted on GitHub) or ensure you have
app.py,requirements.txt, and thearxiv_climate_papersfolder on your local machine. - Navigate to the project directory in your terminal.
- Install the required libraries:
pip install -r requirements.txt
-
Obtain a Google Generative AI API key from Google AI Studio.
-
Set your API key as an environment variable named
GOOGLE_API_KEY. Replace'YOUR_API_KEY'with your actual key.- For macOS and Linux:
export GOOGLE_API_KEY='YOUR_API_KEY'
- For Windows Command Prompt:
set GOOGLE_API_KEY='YOUR_API_KEY'
- For Windows PowerShell:
$env:GOOGLE_API_KEY='YOUR_API_KEY'
- For a more permanent solution, you can add this line to your shell's profile file (e.g.,
.bashrc,.zshrc,config.fish) and restart your terminal.
- For macOS and Linux:
Answer generation uses gemini-3.8-flash, the current stable Gemini Flash model. Set GEMINI_MODEL to use a different model:
export GEMINI_MODEL='gemini-3.8-flash'- Ensure you have the
arxiv_climate_papersfolder containing the downloaded PDF files in the same directory asapp.py. - Run the Streamlit application from your terminal:
streamlit run app.py
- This will open the RAG Assistant in your web browser.
The RAG assistant uses climate change research papers downloaded from arXiv using the arxiv Python library. The text content is extracted from the PDF files and stored as embeddings in a ChromaDB vector database.
Once the Streamlit application is running, simply type your question about climate change into the input box and press Enter. The assistant will retrieve relevant information from the loaded papers and provide an answer generated by the Gemini model.
- Implement persistent storage for the ChromaDB collection.
- Add support for more data sources (e.g., web articles, reports).
- Improve the UI/UX of the Streamlit application.
- Incorporate more advanced text processing and embedding techniques.
- Allow users to upload their own documents. """