How shenbageshwaran/data-analysis-agent works
This repository is a CSV question-answering agent with two runtime variants: a Streamlit dashboard backed by a LangChain agent with session-scoped conversation memory, and an earlier command-line OpenAI Responses API loop. In both, the model selects among six predefined EDA tools; Python functions perform the calculations and return results for the model to explain. The dashboard loads the uploaded CSV and passes it to the agent. The README documents all six analysis capabilities; the examples agent and sample CSV are peripheral. Connections to framework-managed dispatch are shown only where the excerpts support them.
Main entry points: data_analysis_agent.py Responses API Loop · data_analysis_agent_langchain_v2.py Tool Adapters · app.py Streamlit Dashboard · data_analysis_agent_functions.py Dataset Inspection
Components 18
User Interfaces
- Streamlit Dashboard
app.py - Dataset and Chat State
app.py
Agent Orchestration
- LangChain Agent
data_analysis_agent_langchain_v2.py - Conversation Memory
data_analysis_agent_langchain_v2.py - Tool Adapters
data_analysis_agent_langchain_v2.py
EDA Tools
- Dataset Inspection
data_analysis_agent_functions.py - Variable Summaries
data_analysis_agent_functions.py - Distribution Plots
data_analysis_agent_functions.py - Pair Correlation
data_analysis_agent_functions.py - Correlation Matrix
data_analysis_agent_functions.py - Grouped Summaries
data_analysis_agent_functions.py
First Version
- Responses API Loop
data_analysis_agent.py - Function Schemas
da_tools_schema.py - Toy Agent Example
examples/agent.py
Other components
- Analyst
- Uploaded CSV
- OpenAI Model
- OpenAI Responses API
Connections 21
- Analyst → Streamlit Dashboard: asks questions
app.py - Uploaded CSV → Streamlit Dashboard: uploads
app.py - Streamlit Dashboard → Dataset and Chat State: loads and tracks
app.py - Streamlit Dashboard → LangChain Agent: sets data, runs
app.py - LangChain Agent → OpenAI Model: invokes
data_analysis_agent_langchain_v2.py - LangChain Agent → Conversation Memory: configures checkpoint
data_analysis_agent_langchain_v2.py - LangChain Agent → Tool Adapters: registers tools
data_analysis_agent_langchain_v2.py - Tool Adapters → Dataset Inspection: calls
data_analysis_agent_langchain_v2.py - Tool Adapters → Variable Summaries: calls
data_analysis_agent_langchain_v2.py - Tool Adapters → Distribution Plots: calls
data_analysis_agent_langchain_v2.py - Tool Adapters → Pair Correlation: calls
data_analysis_agent_langchain_v2.py - Tool Adapters → Correlation Matrix: calls
data_analysis_agent_langchain_v2.py - Tool Adapters → Grouped Summaries: calls
data_analysis_agent_langchain_v2.py - Responses API Loop → Function Schemas: supplies definitions
data_analysis_agent.py - Responses API Loop → OpenAI Responses API: requests responses
data_analysis_agent.py - Responses API Loop → Dataset Inspection: dispatches
data_analysis_agent.py - Responses API Loop → Variable Summaries: dispatches
data_analysis_agent.py - Responses API Loop → Distribution Plots: dispatches
data_analysis_agent.py - Responses API Loop → Pair Correlation: dispatches
data_analysis_agent.py - Responses API Loop → Correlation Matrix: dispatches
data_analysis_agent.py - Responses API Loop → Grouped Summaries: dispatches
data_analysis_agent.py