Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Climate Change RAG Assistant

Description

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.

Features

  • 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.

Setup

Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)
  • Git (for cloning the repository, if applicable)

Installation

  1. Clone this repository (if hosted on GitHub) or ensure you have app.py, requirements.txt, and the arxiv_climate_papers folder on your local machine.
  2. Navigate to the project directory in your terminal.
  3. Install the required libraries:
    pip install -r requirements.txt

API Key Setup

  1. Obtain a Google Generative AI API key from Google AI Studio.

  2. 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.

Model

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'

Running the Application

  1. Ensure you have the arxiv_climate_papers folder containing the downloaded PDF files in the same directory as app.py.
  2. Run the Streamlit application from your terminal:
    streamlit run app.py
  3. This will open the RAG Assistant in your web browser.

Data

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.

Usage

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.

Future Enhancements

  • 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. """

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages