Skip to content

SabhyataVerma/Fintech_latency_analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•΅οΈ AI-Powered Predictive Root-Cause Analytics Portal

An enterprise-grade AI-driven observability platform that transforms raw transactional logs into actionable intelligence using Large Language Models, in-memory SQL analytics, and automated root-cause diagnostics.

Designed for high-frequency financial systems, this platform automatically understands unknown log schemas, generates optimized SQL queries using Google Gemini, performs ultra-fast analytics with SQLite, and produces executive-ready incident reportsβ€”all without manual preprocessing.


✨ Overview

Traditional monitoring systems require predefined schemas, custom ETL pipelines, and significant engineering effort before meaningful analytics can be performed.

This platform eliminates those limitations by leveraging LLM-powered schema understanding, allowing users to upload any transactional CSV log while the AI dynamically determines how to query the data.

The result is an intelligent observability pipeline capable of:

  • Understanding unknown datasets
  • Generating SQL automatically
  • Detecting latency bottlenecks
  • Computing operational KPIs
  • Producing AI-generated executive diagnostics

πŸš€ Core Features

πŸ€– AI-Powered Dynamic SQL Generation

  • Upload any transactional CSV file
  • Google Gemini 3.5 Flash analyzes column names
  • Automatically generates optimized SQLite queries
  • No manual column mapping
  • No hardcoded schemas

⚑ High-Speed In-Memory Analytics

Instead of writing to disk, the application creates a temporary SQLite database inside RAM.

Benefits include:

  • Extremely fast query execution
  • Zero disk I/O overhead
  • Real-time KPI computation
  • Lightweight deployment

πŸ“Š Executive KPI Dashboard

Automatically computes operational metrics including:

  • Average Processing Latency
  • Peak Latency
  • Success Rate
  • Failed Transactions
  • Total Transactions
  • Processing Volume

All metrics are generated instantly after upload.


🚨 Intelligent Incident Desk

The platform automatically identifies the Top 25 worst-performing transactions ranked by latency.

Each incident includes information such as:

  • Transaction ID
  • Asset Class
  • Channel
  • Region
  • Transaction Value
  • Status
  • Processing Time

This allows engineers to prioritize the most critical bottlenecks immediately.


🧠 AI Root-Cause Diagnostics

Instead of simply displaying slow transactions, the platform sends incident metadata back to Gemini.

Gemini performs pattern recognition across multiple variables and generates an executive report containing:

  • Bottleneck correlations
  • Probable infrastructure failures
  • Engineering recommendations
  • System optimization suggestions

Example:

🧠 Executive Root Cause Report

β€’ 82% of latency spikes originate from Debit transactions
  processed through ATM channels.

β€’ Root Cause:
  Database connection pool contention during synchronous
  ledger validation.

β€’ Recommendation:
  Introduce asynchronous processing using Kafka and
  optimize indexing on balance lookup tables.

πŸ”„ Complete Intelligent Pipeline

                Upload CSV
                     β”‚
                     β–Ό
         Pandas DataFrame Processing
                     β”‚
                     β–Ό
      Google Gemini Schema Analysis
                     β”‚
                     β–Ό
      AI-Generated SQLite Query
                     β”‚
                     β–Ό
      In-Memory SQLite Analytics
                     β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                      β–Ό
    KPI Computation       Incident Ranking
          β”‚                      β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β–Ό
      Gemini Root-Cause Diagnostics
                     β”‚
                     β–Ό
      Executive Incident Report

πŸ›  Tech Stack

Category Technology
Frontend Streamlit
Programming Language Python 3.9+
AI Engine Google Gemini API
LLM Model Gemini 3.5 Flash
Database SQLite (:memory:)
Data Processing Pandas
Numerical Computing NumPy
Regex Parsing Python Regex
Environment Management python-dotenv

πŸ“‚ Project Structure

latency-analytics-portal/
β”‚
β”œβ”€β”€ app.py
β”‚     Main Streamlit dashboard
β”‚
β”œβ”€β”€ generate_csv.py
β”‚     Generates synthetic financial telemetry logs
β”‚
β”œβ”€β”€ requirements.txt
β”‚     Project dependencies
β”‚
β”œβ”€β”€ .env
β”‚     Gemini API credentials
β”‚
β”œβ”€β”€ sample_logs.csv
β”‚     Example transaction dataset
β”‚
└── README.md

βš™οΈ Installation

1. Clone Repository

git clone https://github.com/SabhyataVerma/latency-analytics-portal.git

cd latency-analytics-portal

2. Create Virtual Environment

macOS / Linux

python3 -m venv .venv

source .venv/bin/activate

Windows

python -m venv .venv

.venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file:

GEMINI_API_KEY=YOUR_API_KEY

5. Generate Sample Dataset

python3 generate_csv.py

6. Launch Application

streamlit run app.py

🧠 Application Workflow

                Transaction CSV
                      β”‚
                      β–Ό
         Upload through Streamlit UI
                      β”‚
                      β–Ό
           Pandas DataFrame Creation
                      β”‚
                      β–Ό
      Google Gemini Column Inspection
                      β”‚
                      β–Ό
      AI-Generated SQL Query Creation
                      β”‚
                      β–Ό
      In-Memory SQLite Query Execution
                      β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                         β–Ό
   KPI Aggregation         Incident Detection
         β”‚                         β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
       Gemini Executive Diagnostics
                      β”‚
                      β–Ό
        Root Cause Investigation Report

πŸ“Š Example Dashboard

Executive KPI Cards

  • Total Transactions
  • Average Latency
  • Peak Latency
  • Success Rate
  • Failure Percentage

Incident Desk

Transaction Channel Asset Region Latency
TXN-10091 ATM Debit Tokyo 915 ms
TXN-81232 POS Credit London 842 ms
TXN-72611 Mobile Debit Singapore 801 ms

AI Executive Report

🧠 Predictive Root Cause Analysis

β€’ 84% of severe latency incidents originate from Debit
  transactions processed through ATM channels.

β€’ Database thread contention during synchronous
  ledger updates is the primary contributor.

β€’ Introduce asynchronous processing with Apache Kafka,
  optimize database indexes,
  and increase connection-pool capacity.

🎯 Why This Project?

Eliminates Manual ETL

No predefined schemas.

The AI understands uploaded datasets automatically.


Accelerates Root Cause Analysis

Reduces investigation time from hours to seconds through automated diagnostics.


AI + SQL Hybrid Architecture

Combines the reliability of relational databases with the reasoning capabilities of Large Language Models.


Enterprise Ready

Designed with concepts commonly used in:

  • Application Performance Monitoring (APM)
  • Financial Technology
  • Infrastructure Observability
  • Incident Management
  • Intelligent Automation

πŸ“ˆ Future Enhancements

  • Interactive Plotly dashboards
  • Live streaming analytics using Apache Kafka
  • Multi-file comparative analysis
  • PDF and Markdown export
  • OAuth 2.0 Authentication
  • Cloud deployment on AWS
  • Historical trend forecasting
  • AI anomaly alert notifications

πŸ“œ License

This project is licensed under the MIT License.


πŸ‘©β€πŸ’» Author

Sabhyata Verma

Pre-final Year B.Tech Student
Electronics and Computer Engineering (ECM)
Vellore Institute of Technology (VIT), Chennai

GitHub

https://github.com/SabhyataVerma


⭐ If you found this project interesting, consider giving it a star!

About

An enterprise-grade fintech APM pipeline that integrates the Gemini 3.5 API and an in-memory SQLite engine to ingest transaction logs, dynamically generate custom database schema queries, and deliver automated executive root-cause analysis reports on high-frequency processing bottlenecks.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages