Repository: jaume-camps-dea/UBSLauzHack2025
Primary language: HTML

# Data Insights & Fraud Detection Platform

A powerful, containerized web application that transforms your data into actionable intelligence. This platform provides automated daily briefings, a conversational AI assistant for deep data exploration, and integrated visual tools for fraud analysis.

## Overview
<img width="1356" height="681" alt="image" src="https://github.com/user-attachments/assets/08cd6326-8fe9-4452-b46e-aa48961391c2" />

## 🚀 Features

### 📊 Daily Briefing Dashboard
Get an immediate pulse on your key metrics. The dashboard automatically surfaces:
- **Weekly Performance:** Track critical KPIs and trends over the past week.
- **Historical Analysis:** View long-term data patterns and comparisons to identify significant changes and opportunities.

### 🤖 Conversational AI Data Assistant
Go beyond predefined reports. Ask questions in plain English and get intelligent answers.
- **Natural Language to SQL:** Our LangChain-powered AI agent understands your intent, translates your question into an optimized SQL query, and executes it directly on your database.
- **Intelligent Response Generation:** The raw query results are sent to another LLM to generate a clear, human-readable summary, highlighting the most important data points relevant to your query.
- **User-Centric Deep Dives:** When your conversation pertains to a specific user, the system automatically generates relevant KPIs and visualizations for that entity.

### 🔍 Future Integration Fraud Detection (next steps)
- **Visual Fraud Analysis:** The user-specific visualizations generated by the AI assistant are designed to empower analysts to spot anomalies and potential fraudulent activities quickly.
- **Proactive Monitoring:** By making individual user data easily accessible and visual, the platform facilitates rapid investigation and risk assessment.

## 🛠️ Tech Stack

| Component | Technology |
|-----------|------------|
| **Backend & API** | Python, Flask |
| **AI & NLP Engine** | LangChain, OpenAI / Gemini / Local LLM |
| **Frontend** | HTML + CSS |
| **Database** | **Google BigQuery** |
| **Visualization** | Plotly, Matplotlib, Chart.js  |

**Access the Application**
    Open your web browser and navigate to `http://localhost:5000` to see the app running!


## 💬 Using the AI Assistant

1.  Navigate to the "AI Assistant" tab in the web interface.
2.  Type your question. For example:
    - *"Send me the single user that has performed the most number of transaction in Panama"*
    - *"Show me a single user that has at least 50 outgoing transactions"*
3.  The agent will:
    - Understand the context of your question.
    - Generate and run a query on BigQuery.
    - Return a concise summary with key figures.
    - If relevant, automatically display charts related to the user in question for visual analysis.

## 🔧 Development

1.  **Create a Python Virtual Environment**
    ```bash
    python -m venv venv
    source venv/bin/activate  # On Windows: `venv\Scripts\activate`
    ```

2.  **Install Dependencies**
    ```bash
    pip install -r requirements.txt
    ```

3.  **Run the Application**
    ```bash
    python app.py
    ```

## 📈 Future Enhancements

- [ ] Automated alerting system for detected anomalies.
- [ ] User authentication and role-based access control (RBAC).
- [ ] Pre-defined report scheduling and email delivery.
- [ ] Support for additional data sources (e.g., PostgreSQL, Snowflake).

## 👥 Contributing

Jaume Camps Romaguera
Marcel Fernández Serrano
Marti Oms Graells
Bruno Manzano Clotet
---

**Happy Analyzing!** 🎉