Skip to content

Harikishan-AI/Analyzer-GPT

Repository files navigation

📊 Analyzer GPT – Digital Data Analyzer

Turn any CSV file into insights, code, and charts using LLM-powered agents, Docker, and a Streamlit UI.


✨ What This Project Does

  • Lets you upload a CSV file and ask natural language questions about your data.
  • Uses a Data Analyzer agent to plan the analysis and generate Python code.
  • Uses a Python Code Executor agent running inside Docker to safely execute the code.
  • Streams back:
    • Explanations and intermediate reasoning.
    • Final insights in text form.
    • Generated visualizations as PNG images.
  • Provides both:
    • A Streamlit web app for interactive exploration.
    • A CLI demo via main.py for quick testing.

🏗️ High-Level Architecture

LangGraph-style Overview

flowchart LR
    U[User 🧑‍💻] --> S[Streamlit UI<br/>streamlit_app.py]
    S -->|task + CSV path| T[RoundRobinGroupChat Team 🤝]

    subgraph Team
        A[Data_Analyzer_Agent 🤖] <--> C[Python_Code_Executor 🐍<br/>DockerCommandLineCodeExecutor]
    end

    T --> A
    T --> C

    C -->|PNG charts, console output| FS[(temp/ directory)]
    A -->|text insights + STOP| S
    FS -->|PNG images| S
Loading

🔧 Tech Stack

  • Language: Python 3.12
  • UI: Streamlit
  • LLM Orchestration: autogen-agentchat, autogen-core, autogen-ext
  • Code Execution: Docker via DockerCommandLineCodeExecutor
  • Model Provider: OpenRouter

🖥️ Running the Streamlit App

From the project root:

streamlit run streamlit_app.py

Then open the URL shown in the terminal (usually http://localhost:8501).

Typical Flow in the UI

  1. Upload CSV
    • Use the “Upload a CSV file” widget to select your dataset.
  2. Describe Your Task
    • In the chat input, type something like:
      • “Give me summary statistics of all numeric columns.”
      • “Plot a histogram of sepal.length grouped by variety.”
  3. Watch the Conversation
    • The app shows:
      • User messages 👤
      • Data Analyzer agent messages 🤖
      • Code executor outputs 👨‍💻
  4. View Generated Visualizations
    • Any PNGs saved into temp/ by the code executor are displayed under Generated Visualizations.

Session state keeps:

  • messages – the full chat history.
  • autogen_team_state – serialized agent team state to resume conversations.
  • images_shown – images that have already been displayed.

🧩 How the Agents Work Together

  • Data_Analyzer_Agent

    • Receives your natural-language request and the context that a CSV is available.
    • Produces:
      • A short plan.
      • A single Python code block that:
        • Loads and analyzes the CSV.
        • Installs any missing packages via pip install ... if needed.
        • Saves plots to PNG files (e.g. plt.savefig('temp/some_plot.png')).
      • Post-analysis explanation, ending with STOP as a termination signal.
  • Python_Code_Executor

    • Runs the code produced by the Data Analyzer inside Docker.
    • Uses WORK_DIR_DOCKER = "temp" as the working directory.
    • Produces console logs and PNG files consumed by the UI.
  • RoundRobinGroupChat Team

    • Alternates between agents up to max_turns=10.
    • Uses a TextMentionTermination("STOP") condition to know when to stop.

About

Interactive CSV data analyst powered by multi‑agent LLMs, Streamlit, and Docker‑based code execution, enabling automated data exploration, analysis, and visualization with good insights.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages