# ๐Ÿ“Š DataVision AI - Product Requirements Document (PRD) **Document Version:** 1.0 **Last Updated:** January 2025 **Product Name:** DataVision AI **Tagline:** *"Your data doesn't need dashboards. It needs intelligence."* --- ## ๐Ÿ“‹ Table of Contents 1. [Executive Summary](#1-executive-summary) 2. [Product Vision & Mission](#2-product-vision--mission) 3. [Target Audience & User Personas](#3-target-audience--user-personas) 4. [Core Features & Capabilities](#4-core-features--capabilities) 5. [Technical Architecture](#5-technical-architecture) 6. [API Reference](#6-api-reference) 7. [AI/ML Capabilities](#7-aiml-capabilities) 8. [User Journeys & Flows](#8-user-journeys--flows) 9. [Security & Compliance](#9-security--compliance) 10. [Success Metrics & KPIs](#10-success-metrics--kpis) 11. [Roadmap & Future Enhancements](#11-roadmap--future-enhancements) --- ## 1. Executive Summary ### 1.1 Product Overview **DataVision AI** is an autonomous AI-powered business intelligence platform that transforms raw data into actionable executive insights. It combines state-of-the-art **AutoML** (Automated Machine Learning), **natural language AI chat**, and **intelligent reporting** into a unified "Business Analyst in a Box" experience. ### 1.2 Problem Statement Traditional business intelligence tools require: - Technical expertise to build dashboards and reports - Data science knowledge for predictive modeling - SQL skills for data querying - Weeks of implementation time **Result:** 73% of enterprise data goes unanalyzed, and business users remain dependent on technical teams. ### 1.3 Solution DataVision AI democratizes data analysis by providing: | Capability | Traditional BI | DataVision AI | |------------|----------------|---------------| | Dashboard Creation | Manual, hours | AI-generated, seconds | | Predictive Models | Data science team | Zero-code AutoML | | Data Queries | SQL required | Natural language | | Reports | Manual creation | AI-automated | | Time to Insight | Days/weeks | Minutes | ### 1.4 Key Differentiators 1. **Zero-Code AutoML** - Train production ML models without writing code 2. **Autonomous Dashboards** - AI designs the entire dashboard automatically 3. **7 AI Modes** - Different reasoning approaches for different analytical needs 4. **Real-time Prediction Playground** - Interactive predictions with instant results 5. **Multi-Agent System** - 40+ specialized AI agents for comprehensive analysis 6. **Advanced RAG System** - 3-tier retrieval for accurate, context-aware answers 7. **Enterprise-Ready** - Security, audit trails, scheduled reports --- ## 2. Product Vision & Mission ### 2.1 Vision Statement > *"To make every business user a data-powered decision maker by removing technical barriers between humans and their data."* ### 2.2 Mission Empower organizations to: - **Analyze** data instantly through natural language - **Predict** future outcomes with production-ready ML models - **Automate** reporting and dashboard generation - **Democratize** data science across all business functions ### 2.3 Core Value Propositions | For Business Users | For Data Teams | For Executives | |-------------------|----------------|----------------| | Ask questions in plain English | Focus on complex problems | Instant executive summaries | | Get instant visualizations | Reduce ad-hoc requests by 80% | AI-designed KPI dashboards | | Make predictions without code | Production-ready model exports | Scheduled automated reports | | Self-service analytics | Maintain data governance | Real-time business insights | --- ## 3. Target Audience & User Personas ### 3.1 Primary User Personas #### ๐Ÿ‘ค Persona 1: Business Analyst (Sarah) | Attribute | Details | |-----------|---------| | **Role** | Senior Business Analyst at mid-size company | | **Technical Level** | Low (knows Excel, no SQL/Python) | | **Pain Points** | Dependent on data team, slow report turnaround | | **Goals** | Self-service analytics, faster insights | | **Primary Features** | AI Chat, Reports, Dashboard | | **Success Metric** | Reduce time-to-insight from days to minutes | #### ๐Ÿ‘ค Persona 2: Data Scientist (Alex) | Attribute | Details | |-----------|---------| | **Role** | Data Scientist at tech company | | **Technical Level** | High (Python, ML frameworks) | | **Pain Points** | Repetitive modeling tasks, stakeholder requests | | **Goals** | Rapid prototyping, model comparison | | **Primary Features** | AutoML, ML Predictions, Feature Engineering | | **Success Metric** | Reduce model development time by 10x | #### ๐Ÿ‘ค Persona 3: Executive (Michael) | Attribute | Details | |-----------|---------| | **Role** | VP of Operations at enterprise | | **Technical Level** | None | | **Pain Points** | Outdated reports, no real-time visibility | | **Goals** | Real-time KPIs, predictive insights | | **Primary Features** | Executive Reports, Autonomous Dashboard | | **Success Metric** | Data-driven decision making | #### ๐Ÿ‘ค Persona 4: Product Manager (Priya) | Attribute | Details | |-----------|---------| | **Role** | Product Manager at SaaS startup | | **Technical Level** | Medium (can read data, limited SQL) | | **Pain Points** | Understanding user trends, forecasting | | **Goals** | User segmentation, feature impact analysis | | **Primary Features** | Forecasting, Anomaly Detection, Chat | | **Success Metric** | Identify growth opportunities | ### 3.2 Key Use Cases | Use Case | Description | User Persona | |----------|-------------|--------------| | **Quick Data Analysis** | Drop CSV โ†’ Get instant insights | Business Analyst | | **Predictive Modeling** | Train ML models without code | Data Scientist | | **Automated Reporting** | Generate executive reports on demand | Executive | | **Conversational Analytics** | Ask natural language questions | All | | **Revenue Forecasting** | Predict future metrics | Product Manager | | **Anomaly Detection** | Find outliers and unusual patterns | Operations | | **Customer Segmentation** | Auto-cluster users/customers | Marketing | | **Root Cause Analysis** | Understand "why" metrics changed | Analyst | --- ## 4. Core Features & Capabilities ### 4.1 Data Management (DataHub) The central hub for all data operations. | Feature | Description | Status | |---------|-------------|--------| | **Multi-format Upload** | CSV, Excel (.xlsx, .xls), JSON, PDF, DOCX, TXT, Images | โœ… Live | | **Auto Data Quality Fix** | One-click data cleaning (missing values, outliers, duplicates) | โœ… Live | | **Smart Column Detection** | Automatic target column detection for ML | โœ… Live | | **Google Sheets Import** | Direct import from Google Sheets URLs | โœ… Live | | **Multi-file Training** | Combine multiple files for unified training | โœ… Live | | **Upload Cancellation** | Cancel in-progress uploads with cleanup | โœ… Live | | **File Size Limit** | 100MB per file | โœ… Live | | **Data Profiling** | Automatic statistical summaries | โœ… Live | | **Currency Detection** | Auto-detect INR, USD, EUR, GBP, etc. | โœ… Live | ### 4.2 AutoML Training System Production-ready machine learning without code. #### Training Modes | Mode | Algorithms | Duration | Use Case | |------|------------|----------|----------| | **Fast Mode** | 7 algorithms | 30-60 seconds | Quick prototyping | | **Ultra Mode** | 20+ algorithms | 2-10 minutes | Production models | #### Supported Algorithms **Classification (15+ algorithms):** - XGBoost Classifier - LightGBM Classifier - CatBoost Classifier - Random Forest Classifier - Extra Trees Classifier - Gradient Boosting Classifier - AdaBoost Classifier - Logistic Regression - Support Vector Machine (SVM) - K-Nearest Neighbors (KNN) - Neural Network (MLP) - Naive Bayes (Gaussian, Multinomial) - Decision Tree Classifier - Bagging Classifier **Regression (15+ algorithms):** - XGBoost Regressor - LightGBM Regressor - CatBoost Regressor - Random Forest Regressor - Extra Trees Regressor - Gradient Boosting Regressor - Ridge Regression - Lasso Regression - ElasticNet - Bayesian Ridge - Huber Regressor - Poisson Regressor - Quantile Regressor - Neural Network (MLP) **Clustering:** - K-Means - DBSCAN - Agglomerative Clustering - Spectral Clustering - Gaussian Mixture Model - MeanShift #### AutoML Features | Feature | Description | |---------|-------------| | **Auto Task Detection** | Classification, Regression, Clustering auto-detection | | **Feature Engineering** | 50+ synthetic features generation | | **Hyperparameter Optimization** | Bayesian optimization with Optuna | | **Ensemble Methods** | Stacking, Voting, Blending | | **GPU Acceleration** | Auto GPU/CPU detection (CUDA, ROCm, Metal) | | **Class Imbalance Handling** | SMOTE, class weights | | **NLP Pipeline** | TF-IDF, Sentiment, Text Stats for text columns | | **Cross-Validation** | Stratified K-Fold for robust evaluation | | **Training Stop** | Cancel training mid-process | ### 4.3 ML Predictions & Analysis Interactive prediction and model analysis tools. | Feature | Description | |---------|-------------| | **Prediction Playground** | Interactive sliders for real-time predictions | | **Batch Predictions** | Predict on entire datasets | | **Model Explainability** | SHAP values and feature contributions | | **Confusion Matrix** | Classification performance visualization | | **ROC/PR Curves** | Model performance curves | | **Feature Importance** | Visual ranking of predictive features | | **What-If Analysis** | Scenario planning with predictions | | **Model History** | Version control with rollback | | **Model Persistence** | Save, load, delete trained models | ### 4.4 Autonomous Dashboard AI-designed dashboards that build themselves. | Feature | Description | |---------|-------------| | **AI-Designed Layout** | LLM decides KPIs, charts, colors automatically | | **15+ Chart Types** | Bar, Line, Pie, Scatter, Heatmap, Sunburst, Treemap, etc. | | **Dynamic KPIs** | Auto-calculated business metrics | | **Domain Detection** | Auto-detect data domain (sales, finance, HR, etc.) | | **Real-time Updates** | Dashboard refreshes when data changes | | **Multiple Views** | Grid and List display modes | | **Chart Interactions** | Hover, zoom, expand capabilities | ### 4.5 AI Analyst Chat Conversational analytics powered by LLMs. | Feature | Description | |---------|-------------| | **Natural Language Queries** | Ask anything about your data | | **7 AI Modes** | Analyst, DeepThink, Vision, Predict, Agent, RAG, MCP | | **ChatGPT-style Typing** | Word-by-word response animation | | **Interactive Charts** | Plotly charts generated from queries | | **Voice Input** | Microphone support for queries | | **File Attachments** | Attach files directly in chat | | **Conversation History** | Per-user conversation memory | | **Smart Suggestions** | Follow-up question recommendations | | **Confidence Scoring** | Answer reliability indicators | #### AI Chat Modes | Mode | Icon | Description | Best For | |------|------|-------------|----------| | **Analyst** | ๐Ÿ“Š | Business analyst-style insights | General analysis | | **DeepThink** | ๐Ÿง  | Multi-step chain-of-thought reasoning | Complex questions | | **Vision** | ๐Ÿ‘๏ธ | Data visualization focus | Charts and graphs | | **Predict** | ๐Ÿ”ฎ | ML predictions and forecasts | Future predictions | | **Agent** | ๐Ÿค– | Autonomous multi-agent orchestration | Complex tasks | | **RAG** | ๐Ÿ“š | Retrieval-augmented generation | Document Q&A | | **MCP** | ๐Ÿ”— | Model Context Protocol | Tool integration | ### 4.6 Reports Generation Automated, AI-powered business reports. | Report Type | Description | Output | |-------------|-------------|--------| | **Metrics Analysis** | Numeric data trends and patterns | Text + Charts | | **Data Breakdown** | Category distributions and segments | Text + Charts | | **Executive Summary** | High-level insights for leadership | PDF/Text | | **Predictive Report** | ML forecasts (requires trained model) | Text + Charts | | **Anomaly Report** | Outlier and unusual pattern detection | Text + Charts | **Export Options:** - PDF Export (branded, formatted) - Text Export (downloadable) - Multi-currency formatting (INR, USD, EUR, GBP) ### 4.7 Advanced RAG System Three-tier retrieval-augmented generation for accurate answers. | Tier | Features | |------|----------| | **Tier 1 (Standard)** | Query decomposition, MMR reranking, answer evaluation | | **Tier 2 (Advanced)** | HyDE, Corrective RAG, Self-Reflection | | **Tier 3 (Agentic)** | Tool-using agents, Multi-source retrieval, RRF fusion | **RAG Components:** - FAISS Vector Store for semantic search - Knowledge Graph for relationship mapping - Semantic query caching - Context window optimization --- ## 5. Technical Architecture ### 5.1 System Architecture ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ FRONTEND (React 18) โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ DataHub โ”‚ โ”‚ AutoML โ”‚ โ”‚ Dashboardโ”‚ โ”‚ AI Chat โ”‚ โ”‚ Reports โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ API GATEWAY (FastAPI) โ”‚ โ”‚ Rate Limiting | Auth โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Data Service โ”‚ โ”‚ ML Engine โ”‚ โ”‚ AI Agent System โ”‚ โ”‚ RAG Core โ”‚ โ”‚ - Ingestion โ”‚ โ”‚ - AutoML โ”‚ โ”‚ - 40+ Specialized โ”‚ โ”‚ - FAISS โ”‚ โ”‚ - Quality โ”‚ โ”‚ - Train โ”‚ โ”‚ Agents โ”‚ โ”‚ - Graph โ”‚ โ”‚ - Transform โ”‚ โ”‚ - Predict โ”‚ โ”‚ - Orchestrator โ”‚ โ”‚ - Cache โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ File Store โ”‚ โ”‚ Models โ”‚ โ”‚ Supabase โ”‚ โ”‚ /storage/data โ”‚ โ”‚ /models โ”‚ โ”‚ PostgreSQL โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### 5.2 Technology Stack | Layer | Technologies | |-------|-------------| | **Frontend** | React 18, Vite, TypeScript, Tailwind CSS, Framer Motion | | **UI Components** | Radix UI, Headless UI, Lucide Icons | | **Charts** | Plotly.js, Recharts, ApexCharts | | **Backend** | FastAPI, Python 3.11+, Uvicorn, Pydantic | | **ML Framework** | Scikit-learn, XGBoost, LightGBM, CatBoost, Optuna | | **AI/LLM** | OpenAI GPT-4, Groq, Claude, OpenRouter | | **Vector DB** | FAISS | | **Database** | Supabase (PostgreSQL) | | **Authentication** | Supabase Auth (JWT) | | **Email** | Resend API | | **Deployment** | Docker, HuggingFace Spaces | | **File Processing** | Pandas, PyMuPDF, python-docx, Pillow | ### 5.3 Backend Structure ``` backend/ โ”œโ”€โ”€ main.py # FastAPI application entry point โ”œโ”€โ”€ api/ โ”‚ โ””โ”€โ”€ v1/ โ”‚ โ””โ”€โ”€ endpoints/ # All API endpoint handlers โ”œโ”€โ”€ agents/ # 40+ AI agents โ”‚ โ”œโ”€โ”€ orchestrator.py # Multi-agent coordinator โ”‚ โ”œโ”€โ”€ universal_agent.py # Query router โ”‚ โ”œโ”€โ”€ forecast_agent.py # Forecasting โ”‚ โ”œโ”€โ”€ memory_agent.py # Conversation memory โ”‚ โ””โ”€โ”€ ... โ”œโ”€โ”€ core/ # Business logic engines โ”‚ โ”œโ”€โ”€ autonomous_data_ops.py โ”‚ โ”œโ”€โ”€ export_engine.py โ”‚ โ”œโ”€โ”€ data_grounding.py โ”‚ โ””โ”€โ”€ ... โ”œโ”€โ”€ ml/ # ML pipeline components โ”‚ โ”œโ”€โ”€ automl_engine.py โ”‚ โ”œโ”€โ”€ feature_engineer.py โ”‚ โ””โ”€โ”€ ... โ”œโ”€โ”€ graph/ # Knowledge graph โ”œโ”€โ”€ vector/ # FAISS vector store โ”œโ”€โ”€ ingestion/ # Data ingestion pipeline โ”œโ”€โ”€ services/ # External services (email, etc.) โ”œโ”€โ”€ scheduler/ # Scheduled reports โ””โ”€โ”€ utils/ # Utility functions ``` ### 5.4 Frontend Structure ``` frontend/ โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ pages/ # 18 main pages โ”‚ โ”‚ โ”œโ”€โ”€ Landing.tsx # Landing page โ”‚ โ”‚ โ”œโ”€โ”€ DataHub.tsx # Data management โ”‚ โ”‚ โ”œโ”€โ”€ AutoML.tsx # ML training โ”‚ โ”‚ โ”œโ”€โ”€ MLPredictions.tsx โ”‚ โ”‚ โ”œโ”€โ”€ AutonomousDashboard.tsx โ”‚ โ”‚ โ”œโ”€โ”€ AnalystChat.tsx โ”‚ โ”‚ โ”œโ”€โ”€ Reports.tsx โ”‚ โ”‚ โ””โ”€โ”€ ... โ”‚ โ”œโ”€โ”€ components/ # Reusable UI components โ”‚ โ”œโ”€โ”€ services/ # API client โ”‚ โ”œโ”€โ”€ store/ # Zustand state management โ”‚ โ”œโ”€โ”€ contexts/ # React contexts โ”‚ โ””โ”€โ”€ lib/ # Utilities โ””โ”€โ”€ public/ # Static assets ``` --- ## 6. API Reference ### 6.1 Authentication APIs | Endpoint | Method | Description | |----------|--------|-------------| | `/api/v1/email-prefs/auth/request-password-reset` | POST | Request password reset email | | `/api/v1/email-prefs/auth/update-password-with-token` | POST | Update password with token | ### 6.2 Data Management APIs | Endpoint | Method | Description | |----------|--------|-------------| | `/api/v1/upload/` | POST | Upload files | | `/api/v1/files/` | GET | List user files | | `/api/v1/files/{filename}` | DELETE | Delete file | | `/api/v1/files/cancel-upload` | POST | Cancel upload | | `/api/v2/data/quality-check` | POST | Check data quality | | `/api/v2/data/auto-fix` | POST | Auto-fix data issues | | `/api/v1/upload/google-sheets` | POST | Import from Google Sheets | ### 6.3 Analytics APIs | Endpoint | Method | Description | |----------|--------|-------------| | `/api/v1/analytics/overview` | GET | Get analytics overview | | `/api/v1/unified-analytics/` | POST | Unified analytics engine | | `/api/v1/universal/` | POST | Universal AI agent | | `/api/v1/chat/` | POST | AI chat endpoint | | `/api/v1/autonomous/dashboard` | POST | Generate dashboard | | `/api/v1/autonomous/auto-analyze` | POST | Auto-analyze file | ### 6.4 AutoML APIs (v2) | Endpoint | Method | Description | |----------|--------|-------------| | `/api/v2/automl/train` | POST | Fast mode training | | `/api/v2/automl/ultra-train` | POST | Ultra mode training | | `/api/v2/automl/predict` | POST | Make predictions | | `/api/v2/automl/batch-predict` | POST | Batch predictions | | `/api/v2/automl/charts` | GET | Get ML charts | | `/api/v2/automl/stop` | POST | Stop training | | `/api/v2/automl/models` | GET | List models | | `/api/v2/automl/models/{id}` | DELETE | Delete model | | `/api/v2/automl/rollback` | POST | Rollback model | ### 6.5 Prediction Playground APIs | Endpoint | Method | Description | |----------|--------|-------------| | `/api/v2/playground/config` | GET | Get playground config | | `/api/v2/playground/predict` | POST | Playground prediction | | `/api/v2/playground/shap` | POST | SHAP explanation | ### 6.6 Reports APIs | Endpoint | Method | Description | |----------|--------|-------------| | `/api/v1/reports/generate` | POST | Generate report | | `/api/v1/reports/export/pdf` | POST | Export PDF | | `/api/v1/reports/scheduled` | POST | Schedule report | ### 6.7 Storage APIs | Endpoint | Method | Description | |----------|--------|-------------| | `/api/v1/autonomous/models/{user_id}` | GET | List user models | | `/api/v1/autonomous/models/{user_id}` | DELETE | Delete all models | --- ## 7. AI/ML Capabilities ### 7.1 AI Agent System DataVision AI employs a sophisticated multi-agent architecture with 40+ specialized agents. #### Core Agents | Agent | File | Purpose | |-------|------|---------| | **Universal Agent** | `universal_agent.py` | NLU query routing and intent detection | | **Orchestrator** | `orchestrator.py` | Multi-agent coordination | | **Query Classifier** | `query_classifier.py` | Intent classification | | **Query Dispatcher** | `query_dispatcher.py` | Route to appropriate handler | | **Response Enhancer** | `response_enhancer.py` | Answer quality improvement | | **Confidence Scorer** | `confidence_scorer.py` | Answer reliability scoring | | **Memory Agent** | `memory_agent.py` | Conversation context management | #### Analytics Agents | Agent | File | Purpose | |-------|------|---------| | **Forecast Agent** | `forecast_agent.py` | Revenue and metric forecasting | | **Deep Research Agent** | `core/deep_research_agent.py` | Multi-step research | | **Data Quality Agent** | `data_quality.py` | Data validation and cleaning | | **Visualization Agent** | `visualization.py` | Chart generation | #### ML Pipeline Agents | Agent | File | Purpose | |-------|------|---------| | **Feature Engineer** | `feature_engineer.py` | Feature creation | | **Model Strategy Agent** | `model_strategy.py` | Algorithm selection | | **Hyperparameter Agent** | `hyperparam.py` | Optimization | | **Training Validator** | `training_validator.py` | Training validation | | **Evaluation Agent** | `evaluation.py` | Model evaluation | | **Deployment Agent** | `deployment.py` | Production preparation | #### Chart Agents | Agent | File | Purpose | |-------|------|---------| | **Chart Gatekeeper** | `chart_gatekeeper.py` | Chart validation | | **Smart Chart** | `smart_chart.py` | LLM-driven chart generation | | **Premium Charts** | `premium_charts.py` | Advanced visualizations | | **Autonomous Charts** | `autonomous_charts.py` | Auto dashboard charts | ### 7.2 LLM Integration | Provider | Models | Use Case | |----------|--------|----------| | **OpenAI** | GPT-4, GPT-4-turbo, GPT-3.5-turbo | Primary inference | | **Groq** | Llama 3, Mixtral | Fast inference | | **Claude** | Claude 3, Claude 3.5 | Complex reasoning | | **OpenRouter** | Multi-model routing | Fallback and routing | ### 7.3 ML Model Performance Targets | Task | Metric | Target | Notes | |------|--------|--------|-------| | Classification | Accuracy | >85% | With hyperparameter tuning | | Classification | F1-Score | >0.80 | For imbalanced datasets | | Regression | Rยฒ | >0.75 | For well-structured data | | Regression | RMSE | <15% of range | Normalized | | Clustering | Silhouette | >0.5 | For clear clusters | --- ## 8. User Journeys & Flows ### 8.1 New User Onboarding Flow ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Landing โ”‚โ”€โ”€โ”€โ–ถโ”‚ Signup โ”‚โ”€โ”€โ”€โ–ถโ”‚ Confirm โ”‚ โ”‚ Page โ”‚ โ”‚ Page โ”‚ โ”‚ Email โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ DataHub โ”‚โ—€โ”€โ”€โ”€โ”‚ Tutorial โ”‚โ—€โ”€โ”€โ”€โ”‚ Login โ”‚ โ”‚ (Upload CSV) โ”‚ โ”‚ (Optional) โ”‚ โ”‚ Page โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### 8.2 Data Analysis Flow ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Upload โ”‚โ”€โ”€โ”€โ–ถโ”‚ Quality โ”‚โ”€โ”€โ”€โ–ถโ”‚ Auto-Fix โ”‚ โ”‚ File โ”‚ โ”‚ Check โ”‚ โ”‚ (Optional) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ–ผ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AI Chat โ”‚ โ”‚ AutoML โ”‚ โ”‚ Analysis โ”‚ โ”‚ Training โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ–ผ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Reports โ”‚ โ”‚ Predictions โ”‚ โ”‚ Generation โ”‚ โ”‚ Playground โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### 8.3 AutoML Training Flow ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Select โ”‚โ”€โ”€โ”€โ–ถโ”‚ Choose โ”‚โ”€โ”€โ”€โ–ถโ”‚ Configure โ”‚ โ”‚ File โ”‚ โ”‚ Target โ”‚ โ”‚ Mode โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Model โ”‚โ—€โ”€โ”€โ”€โ”‚ Training โ”‚โ—€โ”€โ”€โ”€โ”‚ Start โ”‚ โ”‚ Results โ”‚ โ”‚ Progress โ”‚ โ”‚ Training โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ–ผ โ–ผ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Playground โ”‚ โ”‚ Charts โ”‚ โ”‚ Predictions โ”‚ โ”‚ Prediction โ”‚ โ”‚ (ROC/CM) โ”‚ โ”‚ Batch โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### 8.4 Dashboard Generation Flow ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Select โ”‚โ”€โ”€โ”€โ–ถโ”‚ AI โ”‚โ”€โ”€โ”€โ–ถโ”‚ Display โ”‚ โ”‚ File โ”‚ โ”‚ Analyzes โ”‚ โ”‚ Dashboard โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ Auto-generates: โ”œโ”€โ”€ KPI Cards โ”œโ”€โ”€ Chart Types โ”œโ”€โ”€ Color Schemes โ””โ”€โ”€ Layout ``` --- ## 9. Security & Compliance ### 9.1 Authentication & Authorization | Feature | Implementation | |---------|---------------| | **User Authentication** | Supabase Auth with JWT | | **Password Policy** | Minimum 8 characters | | **Password Reset** | Custom branded email flow | | **Session Management** | JWT with refresh tokens | | **Rate Limiting** | Per-user request limits | ### 9.2 Data Security | Feature | Implementation | |---------|---------------| | **Data Isolation** | Per-user file and model storage | | **File Sanitization** | Filename sanitization, path traversal prevention | | **Input Validation** | Pydantic models for all inputs | | **Secure Headers** | XSS, CSRF protection | | **AI Security** | Prompt injection detection | ### 9.3 Data Privacy | Aspect | Approach | |--------|----------| | **Data Storage** | User files stored in isolated directories | | **Data Retention** | User-controlled deletion | | **Data Processing** | In-memory processing, no permanent storage of analysis | | **Model Storage** | User-isolated model directories | ### 9.4 Enterprise Security Features | Feature | Description | |---------|-------------| | **Audit Logging** | Action tracking for compliance | | **Secure Exports** | Validated export endpoints | | **File Type Validation** | Whitelist-based file type checking | | **Size Limits** | 100MB per file upload | --- ## 10. Success Metrics & KPIs ### 10.1 Product Metrics | Metric | Description | Target | |--------|-------------|--------| | **Time to First Insight** | Time from upload to first analysis | < 2 minutes | | **Model Training Time (Fast)** | Fast mode training duration | < 60 seconds | | **Model Training Time (Ultra)** | Ultra mode training duration | < 10 minutes | | **Dashboard Generation Time** | Time to generate dashboard | < 30 seconds | | **Chat Response Time** | AI response latency | < 3 seconds | ### 10.2 Quality Metrics | Metric | Description | Target | |--------|-------------|--------| | **ML Model Accuracy** | Classification accuracy | > 85% | | **Chat Answer Quality** | User satisfaction score | > 4.0/5.0 | | **Report Completeness** | Coverage of key insights | > 90% | | **Dashboard Relevance** | Chart appropriateness score | > 85% | ### 10.3 Usage Metrics | Metric | Description | Tracking | |--------|-------------|----------| | **DAU/MAU** | Active users | Analytics | | **Files Uploaded** | Data engagement | Database | | **Models Trained** | ML adoption | Database | | **Reports Generated** | Reporting usage | Database | | **Chat Queries** | AI engagement | Logs | ### 10.4 Business Metrics | Metric | Description | Target | |--------|-------------|--------| | **User Retention (D7)** | 7-day retention | > 40% | | **User Retention (D30)** | 30-day retention | > 25% | | **Feature Adoption** | % using AutoML | > 30% | | **Session Duration** | Average session time | > 10 minutes | --- ## 11. Roadmap & Future Enhancements ### 11.1 Current State (v1.0) โœ… | Feature | Status | |---------|--------| | Data Upload & Management | โœ… Complete | | AutoML (Fast/Ultra) | โœ… Complete | | ML Predictions & Playground | โœ… Complete | | Autonomous Dashboard | โœ… Complete | | AI Analyst Chat (7 Modes) | โœ… Complete | | Reports Generation | โœ… Complete | | User Authentication | โœ… Complete | | Dark/Light Theme | โœ… Complete | ### 11.2 Near-term Roadmap (Q1-Q2 2025) | Feature | Priority | Description | |---------|----------|-------------| | **Database Connectors** | High | Direct SQL/PostgreSQL/MySQL connections | | **API Data Sources** | High | REST API data ingestion | | **Collaborative Workspaces** | Medium | Team sharing and collaboration | | **Custom Dashboards** | Medium | User-designed dashboard layouts | | **Scheduled Reports** | Medium | Email reports on schedule | | **Model API Export** | Medium | REST API for trained models | ### 11.3 Mid-term Roadmap (Q3-Q4 2025) | Feature | Priority | Description | |---------|----------|-------------| | **Real-time Data Streams** | High | Kafka/streaming data support | | **Advanced Forecasting** | High | Prophet, ARIMA, neural forecasting | | **Natural Language to SQL** | Medium | Text-to-SQL queries | | **Embedded Analytics** | Medium | Embed dashboards in other apps | | **White-label Solution** | Low | Custom branding options | ### 11.4 Long-term Vision (2026+) | Feature | Description | |---------|-------------| | **AutoML v3** | Neural architecture search, AutoML for deep learning | | **Real-time Anomaly Alerts** | Streaming anomaly detection | | **Predictive Actions** | Auto-trigger actions based on predictions | | **Multi-tenant Enterprise** | Full enterprise deployment | | **On-premise Deployment** | Self-hosted enterprise version | --- ## 12. Appendix ### 12.1 Glossary | Term | Definition | |------|------------| | **AutoML** | Automated Machine Learning - auto model selection and tuning | | **RAG** | Retrieval-Augmented Generation - AI with document context | | **SHAP** | SHapley Additive exPlanations - model interpretability | | **KPI** | Key Performance Indicator | | **LLM** | Large Language Model | | **FAISS** | Facebook AI Similarity Search - vector database | ### 12.2 Technical Requirements **Minimum Server Requirements:** - CPU: 4 cores - RAM: 8GB (16GB recommended) - Storage: 50GB SSD - Python: 3.11+ - Node.js: 18+ **Supported Browsers:** - Chrome 90+ - Firefox 90+ - Safari 14+ - Edge 90+ ### 12.3 Contact & Support | Resource | Link | |----------|------| | **Production URL** | https://killerkumar-ai-business-analyst.hf.space | | **Documentation** | This PRD | | **Support Email** | insights@ai20insights.tech | --- **Document History:** | Version | Date | Author | Changes | |---------|------|--------|---------| | 1.0 | January 2025 | DataVision Team | Initial PRD | --- *ยฉ 2025 DataVision AI. All rights reserved.*