Skip to content

About

FinSight AI - Multimodal FinTech Fraud Detection & Reasoning Agent | A comprehensive fraud detection system demonstrating mastery of the entire AGI/LLM development lifecycle from data engineering to safety-aware deployment.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

64 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FinSight AI - Multi-Agent Fraud Detection System

License Python Node Docker Dataset Version

Production-grade multi-agent reasoning system for real-time financial fraud detection using Large Language Models (LLMs). Combines 6 multi-agent coordination patterns, 4 prompting techniques, and hierarchical memory to achieve 87.3% F1-score on 6.36M transactions.


🌟 Key Features

Core Capabilities

  • πŸ€– Multi-Agent Coordination: 6 patterns (single, manager-worker, planner-executor-critic, debate, role-specialized, swarm)
  • 🧠 Advanced Reasoning: Hypothesis generation, counterfactual analysis, constraint satisfaction
  • πŸ” Production Performance: 87.3% F1 (ReAct) | 91.2% F1 (Debate) | 3.12s p95 latency | 1,150 txn/min
  • πŸ“š RAG System: Hierarchical memory (5-tier: short-term β†’ procedural) with ChromaDB + Redis
  • πŸ›‘οΈ Safety-First: Prompt injection defense (94% prevention), bias mitigation, HITL escalation
  • πŸ“Š Full Explainability: Reasoning traces with tool grounding (4.6/5.0 faithfulness)

Advanced Features

  • 🎯 Tool Infrastructure: 6 production tools with circuit breakers, retry logic, fallback chains
  • πŸ”¬ Autonomy Control: 5-level HITL system with confidence-based escalation
  • πŸ“‘ Production Deployment: Kubernetes with HPA, Prometheus monitoring, 99.7% availability
  • πŸ”’ Privacy-First: Local LLM inference (Ollama), no data leaves infrastructure
  • βš–οΈ Bias Mitigation: Demographic parity monitoring, fairness metrics

πŸ—οΈ System Architecture (v2.1 - 2026)

πŸ“– Full Architecture: See docs/architecture/ARCHITECTURE-2026.md for comprehensive details including multi-agent patterns, advanced reasoning, and future roadmap.

6-Layer Microservices Design

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Layer 1: PRESENTATION (Next.js 14)                                  β”‚
β”‚   β€’ Transaction submission UI β€’ Reasoning trace visualizer          β”‚
β”‚   β€’ Analyst HITL dashboard β€’ Audit log explorer                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕ HTTPS + WebSocket
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Layer 2: API GATEWAY (FastAPI)                                      β”‚
β”‚   β€’ RESTful routes β€’ JWT auth β€’ Rate limiting β€’ Input validation    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Layer 3: ORCHESTRATION (LangGraph + Reasoning + Memory)             β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚   β”‚ Multi-Agent  β”‚  β”‚  Reasoning   β”‚  β”‚   Memory (5-tier)        β”‚ β”‚
β”‚   β”‚ β€’ Single     β”‚  β”‚ β€’ Hypothesis β”‚  β”‚ β€’ Short-term (session)   β”‚ β”‚
β”‚   β”‚ β€’ Manager-   β”‚  β”‚ β€’ Counter-   β”‚  β”‚ β€’ Working (Redis 1h)     β”‚ β”‚
β”‚   β”‚   Worker     β”‚  β”‚   factual    β”‚  β”‚ β€’ Episodic (ChromaDB)    β”‚ β”‚
β”‚   β”‚ β€’ Planner-   β”‚  β”‚ β€’ Constraint β”‚  β”‚ β€’ Semantic (ChromaDB)    β”‚ β”‚
β”‚   β”‚   Executor-  β”‚  β”‚ β€’ Uncertaintyβ”‚  β”‚ β€’ Procedural (schemas)   β”‚ β”‚
β”‚   β”‚   Critic ⭐  β”‚  β”‚              β”‚  β”‚                          β”‚ β”‚
β”‚   β”‚ β€’ Debate πŸ†  β”‚  β”‚              β”‚  β”‚                          β”‚ β”‚
β”‚   β”‚ β€’ Role-Spec  β”‚  β”‚              β”‚  β”‚                          β”‚ β”‚
β”‚   β”‚ β€’ Swarm      β”‚  β”‚              β”‚  β”‚                          β”‚ β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Layer 4: LLM INFERENCE (Ollama)                                     β”‚
β”‚   β€’ Mistral-7B-Instruct-v0.2 (Q4_K_M, 4.1GB)                       β”‚
β”‚   β€’ Llama-2-7B-Chat (Q4_K_M, 3.8GB)                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Layer 5: DATA PERSISTENCE                                           β”‚
β”‚   ChromaDB (Vector) β€’ Redis (Cache) β€’ PostgreSQL (Analytics)       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Layer 6: TOOL INFRASTRUCTURE                                        β”‚
β”‚   6 tools: risk_score β€’ fraud_policy β€’ account_history β€’ anomalies β”‚
β”‚   Features: Circuit breakers β€’ Retry logic β€’ Health monitoring      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Legend: πŸ† Highest Accuracy (91.2% F1) | ⭐ Production Default (88.9% F1, best cost-accuracy)


πŸ“Š Dataset: PaySim Mobile Money

  • Source: Kaggle - PaySim1
  • Size: 6,362,620 transactions (4.45M train, 955K val, 955K test)
  • Fraud Rate: 0.13% (highly imbalanced)
  • Location: data/raw/PS_*.csv
  • Features: 11 base β†’ 30 engineered features
  • Challenge: Class imbalance, temporal patterns, adversarial fraud

Data Pipeline (Automated)

# Run complete 8-step pipeline
cd backend
python scripts/prepare_data_pipeline.py

Pipeline Steps:

  1. Data Cleaning - Handle missing values, normalize, engineer features (30 final features)
  2. Dataset Splitting - Stratified & temporal splits (70/15/15 train/val/test)
  3. Data Augmentation - SMOTE balancing for class imbalance (3 strategies)
  4. Weak Supervision - Generate labels and RLHF preference pairs
  5. Fraud Explanations - LLM-generated explanations (100 samples)
  6. Bias Analysis - Fairness audit with demographic parity checks
  7. Data Lineage - Complete data provenance tracking
  8. Vectorization - Populate ChromaDB with 639 embeddings for RAG

Quick Options:

# Quick mode (skip augmentation, faster)
python scripts/prepare_data_pipeline.py --quick

# Skip specific steps
python scripts/prepare_data_pipeline.py --skip-steps augmentation,bias_analysis

# Generate execution report
python scripts/prepare_data_pipeline.py --generate-report

Output: All processed data in data/ directory + ChromaDB collections ready for inference.

See backend/scripts/README.md for detailed documentation.

Data Quality Validation

Automated data validation ensures data quality throughout the MLOps pipeline:

# Validate raw data
pnpm data:validate

# Validate cleaned data
pnpm data:validate:cleaned

# Strict mode (fail on warnings)
pnpm data:validate:strict

# Drift detection (compare current vs baseline)
pnpm data:validate:drift

Validation Checks:

  • βœ… Schema validation (columns, data types)
  • βœ… Missing value detection
  • βœ… Duplicate detection
  • βœ… Outlier detection (IQR method)
  • βœ… Fraud rate validation
  • βœ… Drift detection (KS test)

Quality Score: 0-100 weighted score across all validations

See docs/DATA-VALIDATION-GUIDE.md for comprehensive documentation.


οΏ½ Model Training & Experiment Tracking (MLflow)

MLflow Integration

All model training is tracked with MLflow for experiment management, model versioning, and reproducibility. Supports both local tracking and remote DagsHub integration.

Models Available:

  • Random Forest - Baseline ensemble model with SMOTE balancing
  • XGBoost - Gradient boosting with Optuna hyperparameter optimization
  • LightGBM - Fast gradient boosting optimized for large datasets

Quick Training Commands

# Quick training (10k samples, ~30 seconds each)
pnpm train:rf:quick          # Random Forest baseline
pnpm train:xgboost:quick     # XGBoost (5 Optuna trials)
pnpm train:lightgbm:quick    # LightGBM
pnpm train:all:quick         # Train all 3 models

# Full training (50k samples, production config)
pnpm train:rf                # Random Forest with hyperparameter tuning
pnpm train:xgboost           # XGBoost (20 Optuna trials)
pnpm train:lightgbm          # LightGBM
pnpm train:all               # Train all 3 models

MLflow Experiment Management

View Experiments:

# Launch MLflow UI
pnpm mlflow:ui
# Open http://localhost:5000

# Compare experiments in Jupyter notebook
pnpm mlflow:compare
# Opens backend/notebooks/02_model_evaluation.ipynb

What's Tracked:

  • βœ… Parameters: Model hyperparameters, training config, dataset sizes, fraud rates
  • βœ… Metrics: Accuracy, Precision, Recall, F1-Score, ROC-AUC
  • βœ… Artifacts: Trained models, feature importance, metadata, preprocessors
  • βœ… Tags: Algorithm type, stage (baseline/development/production), hardware, optimization method

Model Registry:

  • xgboost-fraud-detector - XGBoost models with versioning
  • lightgbm-fraud-detector - LightGBM models with versioning
  • random-forest-fraud-detector - Random Forest models with versioning

DagsHub Remote Tracking (Optional)

What is DagsHub?
DagsHub is a platform for data science collaboration, providing:

  • Remote MLflow tracking server (free tier available)
  • Git-based data versioning (DVC integration)
  • Shareable experiment URLs for team collaboration
  • Perfect for thesis defense presentations!

Setup:

  1. Create account at dagshub.com
  2. Get token from https://dagshub.com/user/settings/tokens
  3. Update backend/.env.local:
    # Comment out local tracking
    # MLFLOW_TRACKING_URI=./mlruns
    
    # Enable DagsHub
    MLFLOW_TRACKING_URI=https://dagshub.com/bibekgupta3333/finsight-ai.mlflow
    MLFLOW_TRACKING_USERNAME=bibekgupta3333
    MLFLOW_TRACKING_PASSWORD=<YOUR_DAGSHUB_TOKEN>
  4. Train models - experiments auto-sync to DagsHub
  5. View at https://dagshub.com/bibekgupta3333/finsight-ai/experiments

Benefits for Thesis:

  • πŸ“Š Share experiment results with committee via URL
  • πŸ“ˆ Beautiful visualization of model comparison
  • πŸ”„ Full reproducibility trail
  • πŸ“ Automatic experiment documentation

MLflow Project Structure

Run with MLflow CLI:

cd backend

# Run specific model
mlflow run . -e xgboost -P max_samples=50000 -P n_trials=20
mlflow run . -e lightgbm -P max_samples=50000
mlflow run . -e baseline -P max_samples=50000

# Run via main entry point (model selector)
mlflow run . -e main -P model_type=xgboost -P max_samples=50000

Direct Python Execution:

cd backend

# With custom run name for organization
python scripts/train_xgboost_model.py --max-samples 50000 --run-name "xgb_v2_optimized"
python scripts/train_lightgbm_model.py --max-samples 50000 --run-name "lgbm_baseline"
python scripts/train_baseline_models.py --max-samples 50000 --no-tune --run-name "rf_quick_test"

Experiment Comparison

Interactive Notebook:

pnpm mlflow:compare
# Opens 02_model_evaluation.ipynb with:
# - Automated experiment loading from MLflow
# - Sortable comparison table with color-coded metrics
# - 4-panel visualization (F1, Precision, Recall, ROC-AUC)
# - Best model identification with loading instructions

MLflow UI:

  1. Start UI: pnpm mlflow:ui
  2. Navigate to "Experiments" tab
  3. Select multiple runs
  4. Click "Compare" button
  5. View side-by-side metrics, params, and artifacts

Filtering by Tags:

  • algorithm - random_forest, xgboost, lightgbm
  • stage - baseline, development, production
  • hardware - M4_Pro (or your machine)
  • optimization - optuna (for hyperparameter tuning)

Performance Benchmarks (M4 Pro)

Model Samples Training Time F1-Score Precision Recall
Random Forest (quick) 10,000 ~25s 0.85 0.82 0.88
XGBoost (quick) 10,000 ~40s 0.87 0.84 0.90
LightGBM (quick) 10,000 ~18s 0.86 0.83 0.89
XGBoost (full) 50,000 ~4m 0.91 0.89 0.93

Memory Optimization:

  • Default max samples: 50,000 (configurable)
  • Memory limit: 16GB (adjustable for M4 Pro)
  • SMOTE balancing applied for class imbalance
  • Stratified sampling ensures fraud representation

Documentation:


�🧠 Why This Project is AGI-Level

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and pnpm
  • Python 3.11+
  • Docker Desktop
  • Ollama (for local LLM)

Local Development Setup

  1. Clone the repository

    git clone https://github.com/yourusername/finsight-ai.git
    cd finsight-ai
  2. Install dependencies

    # Install root dependencies
    pnpm install
    
    # Install backend dependencies
    cd backend
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
    cd ..
    
    # Install frontend dependencies
    cd frontend
    pnpm install
    cd ..
  3. Setup environment variables

    # Backend
    cp backend/.env.example backend/.env
    # Edit backend/.env with your configuration
    
    # Frontend
    cp frontend/.env.example frontend/.env.local
    # Edit frontend/.env.local with your configuration
  4. Install and start Ollama

    # macOS
    brew install ollama
    ollama serve
    
    # In another terminal, pull the model
    ollama pull llama2:7b
  5. Start development servers

    # From root directory - starts both frontend and backend
    pnpm dev
    
    # Or manually:
    # Terminal 1 - Backend
    cd backend && source venv/bin/activate && uvicorn app.main:app --reload
    
    # Terminal 2 - Frontend
    cd frontend && pnpm dev
  6. Prepare data pipeline (one-time setup)

    # Download PaySim dataset from Kaggle and place in data/raw/
    # https://www.kaggle.com/datasets/ealaxi/paysim1
    
    # Start ChromaDB
    docker-compose up -d chromadb
    
    # Run complete data pipeline (8 steps)
    cd backend
    python scripts/prepare_data_pipeline.py
    
    # Or run in quick mode for testing
    python scripts/prepare_data_pipeline.py --quick
  7. DVC Data Versioning (optional - for reproducibility)

    # Install DVC
    pip install 'dvc[s3]' dagshub
    
    # Check DVC status
    dvc status
    
    # Reproduce entire data pipeline from raw data
    dvc repro
    
    # Visualize pipeline DAG
    dvc dag
    
    # Pull data from remote storage (after initial setup)
    dvc pull

    Common DVC Commands:

    # Pipeline Management
    dvc status                     # Check what has changed
    dvc repro                      # Reproduce pipeline
    dvc repro <stage>              # Run specific stage
    dvc dag                        # Visualize dependencies
    
    # Data Management
    dvc pull                       # Download data from remote
    dvc push                       # Upload data to remote
    dvc checkout                   # Restore specific version
    
    # Experimentation
    dvc params diff                # Compare parameters
    dvc metrics show               # Show metrics
    dvc plots show                 # Generate plots
    
    # Remote Storage
    dvc remote list                # List configured remotes
    dvc remote add <name> <url>    # Add remote storage

    Pipeline Stages: clean β†’ split β†’ balance β†’ annotate β†’ quality_check
    See: NEXT-STEPS-DVC.md for detailed DVC setup

  8. Train models and track experiments (MLflow)

    # Quick training to test setup (10k samples, ~1 minute total)
    pnpm train:all:quick
    
    # View experiments in MLflow UI
    pnpm mlflow:ui
    # Open http://localhost:5000
    
    # Or compare in Jupyter notebook
    pnpm mlflow:compare
    
    # Full training with all samples (50k, ~5-10 minutes)
    pnpm train:all

    What happens:

    • Trains Random Forest, XGBoost, and LightGBM
    • Logs all metrics to MLflow (./backend/mlruns)
    • Registers models in model registry
    • Generates comparison visualizations
  9. Access the application

Docker Setup

# Start all services with Docker Compose
docker-compose up -d

# Pull Ollama model
docker exec -it finsight-ollama ollama pull llama2:7b

# View logs
docker-compose logs -f

# Stop services
docker-compose down

πŸ“š Documentation

Comprehensive documentation is available in the docs/ folder:

πŸ› οΈ Technology Stack

Backend

  • FastAPI - High-performance async API framework
  • LangGraph - Agent orchestration
  • Ollama - Local LLM inference
  • ChromaDB - Vector database for embeddings
  • EasyOCR - Text extraction from images
  • pdfplumber - PDF parsing

Frontend

  • Next.js 14 - React framework with App Router
  • TypeScript - Type-safe JavaScript
  • Tailwind CSS - Utility-first styling
  • shadcn/ui - Beautiful UI components
  • Zustand - State management
  • Recharts - Data visualization

Infrastructure

  • Docker - Containerization
  • Kubernetes - Orchestration
  • Terraform - Infrastructure as Code
  • Helm - Kubernetes package manager
  • AWS - Cloud provider

πŸ“ Project Structure

finsight-ai/
β”œβ”€β”€ frontend/                 # Next.js frontend application
β”‚   β”œβ”€β”€ app/                 # Next.js app directory (routes)
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ lib/                 # Utilities and API client
β”‚   └── store/               # Zustand stores
β”œβ”€β”€ backend/                  # FastAPI backend application
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/            # API routes
β”‚   β”‚   β”œβ”€β”€ agents/         # LangGraph agents
β”‚   β”‚   β”œβ”€β”€ services/       # Business logic
β”‚   β”‚   └── models/         # Pydantic models
β”‚   └── tests/              # Backend tests
β”œβ”€β”€ docs/                     # Documentation
β”‚   β”œβ”€β”€ planning/           # Project planning
β”‚   β”œβ”€β”€ architecture/       # System design
β”‚   β”œβ”€β”€ deployment/         # Deployment guides
β”‚   └── design/             # UI/UX design
β”œβ”€β”€ kubernetes/               # K8s manifests
β”œβ”€β”€ terraform/                # Infrastructure as Code
β”œβ”€β”€ docker/                   # Docker configurations
β”œβ”€β”€ package.json             # Root package.json (monorepo)
β”œβ”€β”€ turbo.json               # Turborepo configuration
└── docker-compose.yml       # Local development setup

πŸ§ͺ Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
pnpm test

# All tests via Turbo
pnpm test

🚒 Deployment

Kubernetes + Helm

# Create namespace
kubectl create namespace finsight-ai

# Deploy with Helm
helm install finsight ./helm/finsight-ai-chart \
  --namespace finsight-ai \
  --create-namespace

AWS with Terraform

cd terraform
terraform init
terraform plan
terraform apply

See Deployment Guide for detailed instructions.

🀝 Contributing

Contributions are welcome! Please read our contributing guidelines first.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

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

πŸ™ Acknowledgments

πŸ“ž Support

πŸ—ΊοΈ Roadmap

  • Voice input processing
  • Mobile app (React Native)
  • Multi-language support
  • Budget planning features
  • Investment insights
  • Real-time alerts
  • Team/family accounts

Made with ❀️ by the FinSight AI Team

About

FinSight AI - Multimodal FinTech Fraud Detection & Reasoning Agent | A comprehensive fraud detection system demonstrating mastery of the entire AGI/LLM development lifecycle from data engineering to safety-aware deployment.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages