Skip to content

AmritaPanjwani/ContextLens-Agentic-Analyst

Repository files navigation

🧠 ContextLens Agentic Analyst

A LangGraph-based, agentic AI data analyst for Excel-driven exploratory analysis, reasoning, and reporting

Python LangGraph Streamlit EDA License


🚀 Project Overview

ContextLens Agentic Analyst is a context-aware, agentic AI system that transforms raw Excel spreadsheets into meaningful insights.
Built using LangGraph, it models how a human data analyst thinks — understanding context, deciding what analysis to run, answering reasoning-based questions, and generating business-ready reports.

This is not just automation — it’s an agentic analytical workflow.


✨ Key Capabilities

  • 📂 Excel Ingestion (single or multiple sheets)
  • 🧭 Context Understanding (plain-English dataset description)
  • 📊 Automated Exploratory Data Analysis (EDA)
    • distributions, boxplots, trends, correlations
  • 💬 Reasoning-Based Q&A Chatbot
    • ask analytical questions in layman language
  • 📄 PDF Report Generation
    • charts + concise explanations
  • 🧠 Agentic Workflow
    • stateful, explainable, extensible

🤖 Why This Is an Agentic System

Unlike scripts or dashboards, this system:

  • Maintains state across steps
  • Interprets user intent from context and questions
  • Selects analyses dynamically instead of running everything blindly
  • Separates ingestion, analysis, reasoning, and reporting as agent steps

Powered by LangGraph, the workflow mirrors how a real analyst operates.


🧩 How It Works (High-Level)

  1. Upload an Excel file
  2. Describe the dataset context in simple terms
  3. The agent:
    • profiles the data
    • identifies key parameters
    • performs baseline EDA
  4. Ask reasoning-based questions via chatbot
  5. Generate a structured PDF report

Architecture Overview

ContextLens Agentic Analyst Architecture


📁 Sample Data

The repository includes a synthetic Excel file to help you get started instantly:

  • Multiple sheets
  • Numeric & categorical columns
  • Missing values and outliers
  • Time-based data

⚠️ No real client or sensitive data is included.


🛠️ Tech Stack

  • Python
  • Streamlit – Interactive UI
  • LangGraph – Agent orchestration
  • Pandas / NumPy – Data processing
  • Matplotlib – Visualizations
  • LLMs (via Ollama) – Reasoning & Q&A
  • ReportLab – PDF report generation

▶️ Installation & Setup

1️⃣ Clone the repository

git clone https://github.com/AmritaPanjwani/contextlens-agentic-analyst.git
cd contextlens-agentic-analyst

2️⃣ Create virtual environment

python -m venv venv
source venv/bin/activate   # macOS/Linux
venv\Scripts\activate      # Windows

3️⃣ Install dependencies

pip install -r requirements.txt

4️⃣ Install and run Ollama

ollama pull llama3

▶️ Run the App

streamlit run app.py

Open the URL shown in the terminal to access the UI.

💬 Example Questions You Can Ask

  • “Tell me about the distribution of key numeric variables.”
  • “Are there any outliers in this dataset?”
  • “How do the main metrics behave over time?”
  • “Which variables are most correlated?”
  • “Summarize the most important patterns you see.”

📄 Report Generation

The app can generate a PDF report containing:

  • Dataset summary
  • Key charts
  • Short explanations below each graph
  • Contextual notes

This report is intended as a baseline analytical artifact, not a final decision document.


⚠️ Limitations & Disclaimer

  • Performs exploratory analysis, not predictive modeling
  • Insights should be validated by domain experts
  • Not intended for automated decision-making

🧭 Roadmap

  • Multi-agent orchestration (planner + specialist agents)
  • Domain-specific extensions
  • Database / SQL connectors
  • Auto-generated executive summaries
  • Report template customization

📜 License

This project is licensed under the MIT License.
Feel free to use, modify, and extend it.


🙌 Acknowledgements

Inspired by modern agentic AI design patterns and the open-source ecosystems around LangGraph, Streamlit, and Python data tools.

About

ContextLens Agentic Analyst is a LangGraph-based, context-aware AI data analyst for Excel. It performs automated EDA, visualizations, reasoning-based Q&A, and report generation. Built with Python, Streamlit, Pandas, and LLMs to enable agentic, explainable analytics from spreadsheets.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages