Skip to content

Jaga0001/atom

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Atom Logo

ATOM

AI-Powered Pre-Incident Detection & Predictive Reliability Platform

Python Flutter Firebase CrewAI License


๐ŸŽฏ Problem Statement

Modern infrastructure teams are stuck in reactive modeโ€”waiting for alerts, dashboards to turn red, or users to complain before taking action. Traditional monitoring tools excel at telling you what broke, but fail at predicting what's about to break.

ATOM shifts the paradigm from reactive alerting to predictive reliability intelligence, enabling teams to prevent incidents before they impact users.


๐Ÿ’ก Solution Overview

ATOM is an end-to-end predictive observability platform that:

  • Collects real-time system metrics (CPU, memory, latency, error rates)
  • Analyzes trends using statistical methods and anomaly detection
  • Forecasts future metric behavior using ARIMA time-series models
  • Predicts risk scores with AI-powered agentic reasoning
  • Alerts proactively with actionable recommendations
Shift

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                              ATOM Platform                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”‚
โ”‚  โ”‚  Prometheus โ”‚โ”€โ”€โ”€โ–ถโ”‚   Metrics   โ”‚โ”€โ”€โ”€โ–ถโ”‚  Firebase   โ”‚                 โ”‚
โ”‚  โ”‚   (Source)  โ”‚    โ”‚  Collector  โ”‚    โ”‚  Firestore  โ”‚                 โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ”‚
โ”‚                                               โ”‚                         โ”‚
โ”‚                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚                     โ”‚                         โ–ผ                     โ”‚   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚   โ”‚
โ”‚  โ”‚   CrewAI    โ”‚โ—€โ”€โ”€โ”€โ”ผโ”€โ”€โ”‚  Forecast   โ”‚  โ”‚ Flutter  โ”‚               โ”‚   โ”‚
โ”‚  โ”‚  SQL Agent  โ”‚    โ”‚  โ”‚  Pipeline   โ”‚  โ”‚Dashboard โ”‚               โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚  โ”‚  (ARIMA)    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚   โ”‚
โ”‚         โ”‚           โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ–ฒ                     โ”‚   โ”‚
โ”‚         โ–ผ           โ”‚         โ”‚              โ”‚                     โ”‚   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                     โ”‚   โ”‚
โ”‚  โ”‚  SQLite DB  โ”‚    โ”‚       Real-time Updates                      โ”‚   โ”‚
โ”‚  โ”‚  (Metrics)  โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                        โ”‚
โ”‚                                                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœจ Key Features

Feature Description
๐Ÿ“Š Real-time Monitoring Live metrics visualization with interactive charts
๐Ÿ”ฎ AI Forecasting ARIMA-based prediction of CPU, memory, latency & error rates
โš ๏ธ Risk Scoring Dynamic risk assessment with 0-100 scale
๐Ÿค– Agentic Chat Natural language queries via CrewAI-powered SQL agent
๐Ÿ“ˆ Trend Analysis Slope detection for latency, memory & error patterns
๐ŸŽฏ Actionable Insights Contextual recommendations based on system state
โฑ๏ธ Hourly Forecasts Automated pipeline generating 50-point predictions

๐Ÿ› ๏ธ Tech Stack

Backend

  • Python 3.10+ - Core runtime
  • Flask - REST API server
  • Firebase Admin SDK - Firestore integration
  • Prometheus Client - Metrics collection
  • ARIMA (pmdarima) - Time-series forecasting
  • CrewAI - Agentic AI framework
  • Groq - LLM inference (Llama 3.3)

Frontend

  • Flutter 3.0+ - Cross-platform dashboard
  • fl_chart - Data visualization
  • Cloud Firestore - Real-time data sync
  • Google Fonts - Typography

Infrastructure

  • Firebase Firestore - Metrics & forecast storage
  • Prometheus - Metrics source (optional)
  • SQLite - Local metrics database for SQL agent

๐Ÿ“ Project Structure

Atom/
โ”œโ”€โ”€ server/                    # Backend services
โ”‚   โ”œโ”€โ”€ app.py                 # Flask API server
โ”‚   โ”œโ”€โ”€ metrics_collector.py   # Prometheus โ†’ Firestore collector
โ”‚   โ”œโ”€โ”€ forecast_pipeline.py   # ARIMA forecasting engine
โ”‚   โ”œโ”€โ”€ models/                # Pre-trained ARIMA models
โ”‚   โ”‚   โ”œโ”€โ”€ latency_arima_model.pkl
โ”‚   โ”‚   โ”œโ”€โ”€ cpu_arima_model.pkl
โ”‚   โ”‚   โ”œโ”€โ”€ memory_arima_model.pkl
โ”‚   โ”‚   โ”œโ”€โ”€ error_rate_arima_model.pkl
โ”‚   โ”‚   โ””โ”€โ”€ risk_score_arima_model.pkl
โ”‚   โ””โ”€โ”€ key.json               # Firebase service account
โ”‚
โ”œโ”€โ”€ sql_agent/                 # CrewAI SQL Agent
โ”‚   โ””โ”€โ”€ src/sql_agent/
โ”‚       โ”œโ”€โ”€ main.py            # Agent entry point
โ”‚       โ”œโ”€โ”€ crew.py            # CrewAI crew definition
โ”‚       โ”œโ”€โ”€ db.py              # SQLite database interface
โ”‚       โ”œโ”€โ”€ schema.py          # Database schema loader
โ”‚       โ””โ”€โ”€ tools/
โ”‚           โ””โ”€โ”€ custom_tool.py # SQL execution tools
โ”‚
โ”œโ”€โ”€ dashboard/                 # Flutter frontend
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ main.dart          # App entry point
โ”‚   โ”‚   โ”œโ”€โ”€ firebase_options.dart
โ”‚   โ”‚   โ””โ”€โ”€ pages/
โ”‚   โ”‚       โ”œโ”€โ”€ dashboard_page.dart  # Main dashboard
โ”‚   โ”‚       โ””โ”€โ”€ analytics_page.dart  # Advanced analytics
โ”‚   โ””โ”€โ”€ assets/
โ”‚       โ””โ”€โ”€ logo.png
โ”‚
โ””โ”€โ”€ data/                      # Data files
    โ””โ”€โ”€ metrics.db             # SQLite metrics database

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.10+
  • Flutter 3.0+
  • Firebase project with Firestore enabled
  • Groq API key (for LLM features)

1. Clone the Repository

git clone https://github.com/your-team/atom.git
cd atom

2. Backend Setup

cd server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install flask flask-cors groq firebase-admin prometheus-client numpy pandas pmdarima

# Configure Firebase
# Place your Firebase service account key as key.json

# Set environment variables
export GROQ_API_KEY=your_groq_api_key

# Run the server
python app.py

3. SQL Agent Setup

cd sql_agent

# Install with uv (recommended)
uv sync

# Or with pip
pip install crewai groq

# Set environment variables
export GROQ_API_KEY=your_groq_api_key

# Run the agent
python -m sql_agent.main "What is the average latency?"

4. Dashboard Setup

cd dashboard

# Get Flutter dependencies
flutter pub get

# Configure Firebase
flutterfire configure

# Run the app
flutter run -d chrome  # For web
flutter run -d windows # For desktop

๐Ÿ”ง Configuration

Environment Variables

Variable Description Required
GROQ_API_KEY Groq API key for LLM inference Yes
PROMETHEUS_URL Prometheus server URL Optional

Firebase Setup

  1. Create a Firebase project at console.firebase.google.com
  2. Enable Firestore Database
  3. Generate a service account key (Project Settings โ†’ Service Accounts)
  4. Save as server/key.json
  5. Run flutterfire configure in the dashboard directory

๐Ÿ“Š API Endpoints

Endpoint Method Description
/chat POST Chat with AI assistant
/metrics GET Fetch latest metrics
/forecast GET Get latest forecast
/forecast/run POST Trigger manual forecast

Example: Chat Request

curl -X POST http://localhost:5000/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "What is the current risk score?"}'

๐Ÿ“ธ Screenshots

Dashboard
Main Dashboard
Analytics
Advanced Analytics
Forecasting
Risk Forecasting
AI Chat
AI Assistant

๐Ÿงช How It Works

1. Metrics Collection

The MetricsCollector queries Prometheus (or generates synthetic data) every 10 minutes, computing:

  • Raw metrics: CPU, memory, latency, error rate
  • Derived metrics: slopes, trends, anomaly flags
  • Risk score: weighted combination of all factors

2. Forecasting Pipeline

Hourly, the ForecastPipeline:

  • Loads pre-trained ARIMA models for each metric
  • Generates 50-point forecasts (8+ hours ahead)
  • Stores predictions in Firestore for real-time dashboard updates

3. Risk Scoring Algorithm

risk_score = 0
risk_score += 30 if latency_anomaly else 0
risk_score += min(error_rate * 10, 30)
risk_score += min((memory / 100) * 20, 20)
risk_score += min(abs(memory_slope) * 10, 20)
return min(risk_score, 100)

4. Agentic SQL Queries

The CrewAI SQL Agent allows natural language queries:

User: "Show me the top 5 highest latency events"
Agent: SELECT * FROM metrics ORDER BY latency DESC LIMIT 5

๐Ÿ‘ฅ Team

Member Role
Jagavantha PA Full Stack Developer
Pranov JB & Karunakaran M ML Engineer
Yuva Krishna I Frontend Developer

๐Ÿ† BeachHack 2025

This project was built during BeachHack 2025 hackathon.

Problem Statement: Pre-Incident Detection AI
Track: AI/ML & DevOps


๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with โค๏ธ for predictive reliability
Shifting from reactive alerts to proactive intelligence

About

Official starter template repository for BeachHack hackathon participants.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 87.2%
  • Dart 7.8%
  • Python 1.8%
  • C++ 1.6%
  • CMake 1.3%
  • Swift 0.1%
  • Other 0.2%