This application was developed during a climate hackathon focused on leveraging AI agents to mitigate risks associated with energy projects. The AI Counterparty Risk Dashboard uses Gemini Flash 2.0 model to analyze risks associated with companies and their contracts.
- Market-Based Financial Risk Analysis: Analyzes the risk associated with a company based on news articles and financial data fetched from the News API and Yahoo Finance API.
- Contractual Risk Analysis: Specifically analyzes Power Purchase Agreements (PPAs) uploaded as PDFs and uses the Gemini API to identify potential risks within the contract.
- Streamlit: For building the interactive web application.
- Google Gemini API: For AI-based risk analysis.
- News API: For fetching news articles related to the company.
- Yahoo Finance API: For fetching financial data.
- PyPDF: For reading and processing PDF documents.
- Sentence Transformers and FAISS: For text embedding and similarity search.
- Fetch Financial Data: The application fetches financial data for a given company symbol using the Yahoo Finance API.
- Fetch News Articles: News articles related to the company are fetched using the News API.
- Analyze Sentiment: The sentiment of the news articles is analyzed using the Gemini API.
- Calculate Risk Scores: Financial risk scores are calculated based on the fetched data and analyzed sentiment.
- Display Results: The results are displayed in an interactive dashboard with charts and gauges.
- Upload PPA Document: Users can upload a PPA document in PDF format.
- Load and Process Document: The document is processed and split into chunks for analysis.
- Analyze Risks: The Gemini API is used to analyze the document for potential risks.
- Generate Risk Report: A detailed risk report is generated and saved as a JSON file.
- Display Results: The results are displayed in an interactive dashboard.
- Python 3.9 or higher
- Streamlit
- Google Gemini API Key
- News API Key
- Yahoo Finance API
-
Clone the repository:
git clone https://github.com/yourusername/climate-hackathon.git cd climate-hackathon -
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Update .env with your API keys
-
Start the Streamlit application:
streamlit run app.py
-
Open your web browser and navigate to
http://localhost:8501.
- Market-Based Financial Risk Analysis: Enter the company symbol and click "Fetch Data" to analyze the financial risk.
- Contractual Risk Analysis: Upload a PPA document in PDF format and click "Analyze Document" to generate a risk report.
