How nagasai60150/data-analytics-agent works
This repository implements a tabular-data analytics agent: a user supplies a CSV and question, the graph inspects the dataset, plans Python analysis, executes it, and turns the evidence into a natural-language answer. The graph’s four-stage order is explicit in build_graph.py; sampled prompts describe the planner’s E2B execution contract and evidence-grounded interpretation. Several node implementations and the executor are not sampled, so their internal calls and optional integrations are not detailed.
Main entry points: analysis_planner_node.py Analysis planner · result_interpreter_node.py Result interpreter · data_inspector_node.py Dataset inspector · plan_executor_node.py Plan executor
Components 16
Analysis workflow
- Workflow graph
backend/scr/agent/graph/build_graph.py - Dataset inspector
backend/scr/agent/node/data_inspector_node.py - Analysis planner
backend/scr/agent/node/analysis_planner_node.py - Plan executor
backend/scr/agent/node/plan_executor_node.py - Result interpreter
backend/scr/agent/node/result_interpreter_node.py
Evidence preparation
- Dataset context
backend/scr/agent/tools/dataset_context_builder.py - Execution context
backend/scr/agent/tools/execution_context_builder.py - Result normalizer
backend/scr/agent/tools/result_normalizer.py
Language models
- Analysis prompt
backend/scr/agent/prompts/analysis_prompt.py - Answer prompt
backend/scr/agent/prompts/result_interpreter_prompt.py - Chat model
backend/scr/agent/service/llm.py
Code execution
- Python executor
backend/scr/agent/tools/code_executor.py - E2B runtime
Other components
- User
- CSV dataset
- Answer
Connections 17
- User → Workflow graph: submits question
- CSV dataset → Workflow graph: provides dataset path
- Workflow graph → Dataset inspector: starts workflow
- Dataset inspector → Analysis planner: next stage
- Analysis planner → Plan executor: next stage
- Plan executor → Result interpreter: next stage
- Result interpreter → Answer: produces answer
- Analysis planner → Python executor: delegates execution
- Plan executor → Python executor: executes code
- Python executor → E2B runtime: runs Python
- Dataset inspector → Dataset context: formats metadata
- Analysis planner → Analysis prompt: builds prompt
- Analysis prompt → Chat model: guides generation
- Result interpreter → Execution context: formats evidence
- Execution context → Result normalizer: uses normalized result
- Result interpreter → Answer prompt: builds prompt
- Answer prompt → Chat model: guides answer