--- title: Autonomous Data Analyst emoji: ๐Ÿค– colorFrom: blue colorTo: purple sdk: docker app_port: 7860 pinned: false --- # ๐Ÿค– Autonomous Data Analyst An AI-Powered, End-to-End Data Science Platform that automates data cleaning, exploratory data analysis, machine learning, and business insight generation โ€” powered by LLMs (Gemini, OpenAI, Anthropic). [![Python](https://img.shields.io/badge/Python-3.10%2B-blue?logo=python)](https://python.org) [![FastAPI](https://img.shields.io/badge/FastAPI-0.100%2B-009688?logo=fastapi)](https://fastapi.tiangolo.com) [![Streamlit](https://img.shields.io/badge/Streamlit-1.x-FF4B4B?logo=streamlit)](https://streamlit.io) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) --- ## ๐ŸŒŸ Features | Feature | Description | |---|---| | ๐Ÿ“ฅ **Data Ingestion** | Upload CSV, Excel, or JSON files via UI or API | | ๐Ÿงน **Intelligent Cleaning** | Auto-handles missing values, outliers, encoding & scaling | | ๐Ÿ“Š **Automated EDA** | Rich Plotly dashboards, correlation matrices, distribution plots | | ๐Ÿค– **AutoML Pipeline** | Auto-detects classification/regression, trains & compares multiple models | | ๐Ÿ’ก **AI Insights** | LLM-powered business insight generation (Gemini / OpenAI) | | ๐Ÿ’ฌ **Chat with Data** | Natural language querying via LangChain code-generation | | ๐Ÿ“„ **Report Generation** | Auto-generated PDF/HTML analysis reports | | ๐Ÿ”Œ **REST API** | Full FastAPI backend for programmatic access | --- ## ๐Ÿ—๏ธ Architecture ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Streamlit Frontend (app.py) โ”‚ โ”‚ Upload โ†’ EDA โ†’ AutoML โ†’ Insights โ†’ Chat โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ HTTP โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ FastAPI Backend (app/backend/) โ”‚ โ”‚ /upload /eda /automl /insights /chat โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ app/utils app/eda app/automl app/insights (cleaning) (plots) (PyCaret) (LangChain) (Gemini/GPT) ``` --- ## ๐Ÿš€ Quickstart ### Prerequisites - Python 3.10+ - A Gemini API Key (free at [aistudio.google.com](https://aistudio.google.com)) or OpenAI API Key ### 1. Clone the Repository ```bash git clone https://github.com//autonomous-data-analyst.git cd autonomous-data-analyst ``` ### 2. Create a Virtual Environment ```bash python -m venv venv # Windows .\venv\Scripts\activate # macOS / Linux source venv/bin/activate ``` ### 3. Install Dependencies ```bash pip install -r requirements.txt ``` ### 4. Configure Environment Variables ```bash cp .env.example .env ``` Edit `.env` and add your API key: ```env GEMINI_API_KEY=your-gemini-api-key # Or use OpenAI: # OPENAI_API_KEY=your-openai-api-key ``` ### 5. Run the Application **Option A โ€” Streamlit UI only:** ```bash streamlit run app.py ``` Open [http://localhost:8501](http://localhost:8501) **Option B โ€” With FastAPI Backend:** ```bash # Terminal 1 uvicorn app.backend.main:app --reload # Terminal 2 streamlit run app.py ``` - UI: [http://localhost:8501](http://localhost:8501) - API Docs: [http://localhost:8000/docs](http://localhost:8000/docs) ### 6. Run the Demo Pipeline ```bash python demo_pipeline.py ``` --- ## ๐Ÿณ Docker Compose ```bash docker-compose up --build ``` - UI: `http://localhost:8501` - API: `http://localhost:8000/docs` --- ## ๐Ÿ“ Project Structure ``` autonomous-data-analyst/ โ”œโ”€โ”€ app.py # Streamlit frontend entrypoint โ”œโ”€โ”€ demo_pipeline.py # End-to-end demo script โ”œโ”€โ”€ requirements.txt โ”œโ”€โ”€ docker-compose.yml โ”œโ”€โ”€ .env.example โ”‚ โ”œโ”€โ”€ app/ โ”‚ โ”œโ”€โ”€ backend/ # FastAPI routes & API logic โ”‚ โ”‚ โ””โ”€โ”€ api/ # Endpoint modules (automl, eda, etc.) โ”‚ โ”œโ”€โ”€ automl/ # AutoML engine (PyCaret wrapper) โ”‚ โ”œโ”€โ”€ eda/ # EDA report generation โ”‚ โ”œโ”€โ”€ insights/ # LLM insight generation (LangChain) โ”‚ โ”œโ”€โ”€ llm/ # LLM provider abstraction (Gemini/OpenAI) โ”‚ โ”œโ”€โ”€ models/ # Saved ML model artifacts โ”‚ โ”œโ”€โ”€ reports/ # Report generation logic โ”‚ โ”œโ”€โ”€ ui/ # Streamlit UI components โ”‚ โ”œโ”€โ”€ utils/ # Data ingestion, cleaning helpers โ”‚ โ””โ”€โ”€ visualization/ # Plotly chart builders โ”‚ โ”œโ”€โ”€ configs/ # YAML configuration files โ”œโ”€โ”€ datasets/ # Sample datasets โ”œโ”€โ”€ notebooks/ # Exploration notebooks โ””โ”€โ”€ tests/ # Unit & integration tests ``` --- ## ๐Ÿ› ๏ธ Tech Stack | Layer | Technology | |---|---| | **Frontend** | Streamlit | | **Backend** | FastAPI | | **AutoML** | PyCaret, Scikit-learn | | **LLM / AI** | LangChain, Google Gemini, OpenAI | | **Visualizations** | Plotly, Matplotlib, Seaborn | | **Data** | Pandas, NumPy | | **Containerization** | Docker, Docker Compose | --- ## ๐Ÿ“ License This project is licensed under the MIT License โ€” see the [LICENSE](LICENSE) file for details. "# Autonomous-Data-Analyst"