A LangGraph-based, agentic AI data analyst for Excel-driven exploratory analysis, reasoning, and reporting
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.
- 📂 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
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.
- Upload an Excel file
- Describe the dataset context in simple terms
- The agent:
- profiles the data
- identifies key parameters
- performs baseline EDA
- Ask reasoning-based questions via chatbot
- Generate a structured PDF report
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.
- Python
- Streamlit – Interactive UI
- LangGraph – Agent orchestration
- Pandas / NumPy – Data processing
- Matplotlib – Visualizations
- LLMs (via Ollama) – Reasoning & Q&A
- ReportLab – PDF report generation
git clone https://github.com/AmritaPanjwani/contextlens-agentic-analyst.git
cd contextlens-agentic-analystpython -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtollama pull llama3streamlit run app.pyOpen the URL shown in the terminal to access the UI.
- “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.”
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.
- Performs exploratory analysis, not predictive modeling
- Insights should be validated by domain experts
- Not intended for automated decision-making
- Multi-agent orchestration (planner + specialist agents)
- Domain-specific extensions
- Database / SQL connectors
- Auto-generated executive summaries
- Report template customization
This project is licensed under the MIT License.
Feel free to use, modify, and extend it.
Inspired by modern agentic AI design patterns and the open-source ecosystems around LangGraph, Streamlit, and Python data tools.
