Multi-Agent AI Data Analysis Platform
DataScribe is an autonomous, multi-agent data science assistant. Upload a dataset (CSV/Excel/Parquet), ask a question in plain English, and watch a team of specialized AI agents plan, generate code, execute it in a secure sandbox, critique the results, and produce a polished report with interactive charts β all streamed live to your browser.
- 6-agent LangGraph workflow β Conversation agent β Initialize β Supervisor agent β Planner agent β Programmer agent β Executor β Critic agent β Reporter agent
- Live SSE streaming β Every agent step, code snippet, execution output, and report token streams in real time
- Secure code execution β Generated Python runs inside an isolated E2B sandbox with AST-based guardrails
- Interactive visualizations β Plotly HTML charts and static PNG charts rendered inline with fullscreen & download support
- Self-correcting loop β The Critic agent reviews results and can request the Programmer to retry with feedback
- Report export β Download reports as PDF or self-contained interactive HTML
- LangSmith integration β Prompt management, tracing, and a full evaluation framework
- Dark / light theme with a gold-accented design system
| Agent | Role |
|---|---|
| Conversation Agent | Classifies the user query β routes to the full analysis workflow, answers directly, or rejects |
| Initialize Node | Loads the uploaded dataset, extracts schema (dtypes, null counts, memory usage) |
| Supervisor Agent | Decides the next high-level action: plan more analysis, generate a report, or end |
| Planner Agent | Breaks the request into analysis, visualization, and statistical tasks with an execution order |
| Programmer Agent | Generates Python code (pandas, matplotlib, seaborn, plotly) to fulfill the plan |
| Executor Node | Runs the code in an E2B sandbox, collects charts and output, downloads artifacts |
| Critic Agent | Reviews execution results β passes, fails (triggers retry), or aborts |
| Reporter Agent | Assembles the final markdown report with embedded charts and memory updates |
- Python 3.12
- Node.js 20+
- A Groq API key (groq.com)
- An E2B API key (e2b.dev) for sandbox code execution
- A LangSmith API key (smith.langchain.com) for prompt management, observability and Evaluation
git clone https://github.com/Noore-hira/DataScribe.git
cd DataScribe# Install Python dependencies
pip install -r requirements.txt
# Configure environment
cp .env
# Edit .env with your Groq, E2B, and LangSmith API keys
# Run the API server
uvicorn Backend.main:app --reload --port 8000The API will be available at http://localhost:8000 with auto-generated docs at /docs.
cd frontend
npm install
npm run devOpen http://localhost:5173 in your browser.
docker build -t datascribe .
docker run -p 8000:8000 --env-file .env datascribeDataScribe includes a GitHub Actions workflow (.github/workflows/deploy.yml) that automatically builds and deploys the Docker image on every push to main:
| Step | Description |
|---|---|
| Trigger | Runs on push to the main branch |
| Build | Builds the Docker image from the Dockerfile |
| Push | Pushes the image to AWS ECR (us-east-1 region, repository: datascribe-backend) |
| Secrets | Requires AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY configured in GitHub repository secrets |
To set up the CI/CD pipeline, add the following secrets to your GitHub repository:
- Go to Settings β Secrets and variables β Actions
- Add
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYwith permissions to push to ECR
- Enter your Groq API key in the Settings panel (stored locally in your browser only).
- Upload a dataset β drag & drop or click the attachment button. Supports CSV, Excel, and Parquet (max 25 MB).
- Ask a question in plain English, e.g.:
- "What's the average salary by department?"
- "Create a bar chart of sales by region and a correlation heatmap."
- "Run a t-test on the two groups and summarize the findings."
- Watch the agents work in real time via the Agent Monitor panel β see code generation, execution output, and chart previews as they happen.
- Review the report in the Reports tab. Export as PDF or interactive HTML.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Health check |
POST |
/api/upload |
Upload a dataset (multipart form, max 25 MB) |
GET |
/api/chat/stream |
SSE stream for agent workflow execution |
GET |
/api/report/{filename} |
Download a generated report file |
DELETE |
/api/session/{thread_id} |
Clear all files for a session |
GET |
/storage/{path} |
Serve uploaded files |
GET |
/charts/{path} |
Serve generated chart artifacts |
DataScribe includes a comprehensive LangSmith-based evaluation framework that assesses both individual agents and the complete end-to-end workflow. Each evaluation uses an LLM judge (Groq llama-3.3-70b-versatile) to score outputs on a 1β5 scale across multiple metrics, rewarding semantic equivalence rather than exact textual matches.
| Script | Agent(s) Evaluated | Dataset | Metrics |
|---|---|---|---|
evaluate_conversation.py |
Conversation router | conversation_test.csv (120 cases) |
Route correctness (exact match) |
evaluate_planner.py |
Planner | planner_dataset.csv (7 cases) |
Correctness, Completeness, Relevance |
evaluate_programmer.py |
Programmer | programmer_dataset.csv (7 cases) |
Correctness, Executability |
evaluate_workflow.py |
Full 8-agent workflow | workflow_dataset.csv (5 cases) |
Routing, Planning, Execution, Reporting, Overall |
# Evaluate the conversation router (120 test cases)
python evaluation/evaluate_conversation.py
# Evaluate the planner (7 test cases)
python evaluation/evaluate_planner.py
# Evaluate the programmer (7 test cases)
python evaluation/evaluate_programmer.py
# Evaluate the complete end-to-end workflow (5 test cases)
python evaluation/evaluate_workflow.py- Datasets β Each evaluator pulls test cases from a LangSmith dataset. Datasets are also mirrored as CSV files in
evaluation/datasets/for local inspection and manual upload. - Target function β Each script defines a target function that invokes the corresponding agent node (or the full LangGraph
app) with the dataset inputs, returning the agent's output. - LLM judge β A Groq LLM judge, configured with a structured output schema, scores each result against the expected reference on a 1β5 scale. Judges are designed to reward semantically equivalent solutions and ignore wording, formatting, and variable-name differences.
- Results β LangSmith records per-example scores, comments, and aggregate metrics in the
DataScribeproject, viewable in the LangSmith UI.
| Dataset | File | Test Cases | Description |
|---|---|---|---|
| Conversation Agent Evaluation | conversation_test.csv |
120 | Routes user queries to answer, initialize, or reject across 10 categories (Greeting, Politeness, Identity, Capability, Memory, Analysis, Statistics, Visualization, Advanced, Off-topic) |
| Planner Evaluation | planner_dataset.csv |
7 | Plans for insights, filtering, classification metrics, latency, EDA, correlation heatmaps, and sales analysis |
| Programmer Evaluation | programmer_dataset.csv |
7 | Reference Python code for the same 7 planning tasks |
| Workflow Evaluation | workflow_dataset.csv |
5 | End-to-end workflow runs with expected routes, plan keywords, execution status, chart counts/types, report keywords, critic verdicts, and retry counts |
Custom evaluators live in evaluation/evaluators/ and define the scoring logic for each agent:
| Evaluator | File | Metrics |
|---|---|---|
route_evaluator |
conversation_evaluators.py |
Exact-match route correctness |
evaluate_plan_metrics |
planner_evaluators.py |
Correctness, Completeness, Relevance (1β5) |
evaluate_code_metrics |
programmer_evaluators.py |
Correctness, Executability (1β5) |
evaluate_workflow_metrics |
workflow_evaluators.py |
Routing, Planning, Execution, Reporting, Overall (1β5) |
- A LangSmith API key β set
LANGSMITH_API_KEYinevaluation/.env - A Groq API key β set
GROQ_API_KEYinevaluation/.env(used by the LLM judges) - Datasets must be uploaded to LangSmith (or created from the CSV files) with the names referenced in each script (e.g.,
Conversation Agent Evaluation,Planner Evaluation,Programmer Evaluation,Workflow Evaluation)
DataScribe/
βββ Backend/
β βββ main.py # FastAPI app entry point
β βββ app/
β βββ api/ # REST + SSE endpoints
β β βββ chat.py # SSE streaming endpoint
β β βββ upload.py # Dataset upload
β β βββ health.py # Health check
β β βββ report.py # Report download
β β βββ session.py # Session cleanup
β βββ services/
β β βββ graph_service.py # LangGraph execution runner
β β βββ stream_service.py # SSE event processing & heartbeat
β βββ src/
β βββ config.py # LLM factory (Groq, per-user key)
β βββ data_frame.py # Dataset loading (CSV/Excel/Parquet)
β βββ agents/ # 8 LangGraph agent nodes
β β βββ conversation_node.py
β β βββ initialize_node.py
β β βββ supervisor_node.py
β β βββ planner_node.py
β β βββ programmer_node.py
β β βββ executor_node.py
β β βββ critic_node.py
β β βββ reporter_node.py
β βββ graph/
β β βββ graph_workflow.py # Workflow definition & routing
β β βββ state.py # TypedDict state schema
β β βββ state_utils.py # State accessors
β βββ memory/
β β βββ memory_manager.py # Session summary & compression
β βββ utils/
β β βββ code_executor.py # Code extraction & execution
β β βββ safe_execution.py # AST-based code guardrails
β βββ logs/
β βββ logger.py # Structured logging
β
βββ frontend/
β βββ src/
β β βββ App.tsx # Root component (routes, providers)
β β βββ main.tsx # React entry point
β β βββ pages/ # ChatPage, ReportsPage, SettingsPage
β β βββ components/
β β β βββ layout/ # Sidebar, Header, RightPanel
β β β βββ chat/ # ChatMessage, ChatInput
β β β βββ upload/ # UploadCard
β β β βββ workflow/ # WorkflowEvents, AgentMonitor
β β β βββ report/ # ReportViewer
β β β βββ agents/ # AgentCard, AgentMonitor
β β β βββ settings/ # ApiKeyInput, ModelSelector, ThemeToggle
β β β βββ common/ # Logo, AnimatedBackground, StatusBadge
β β βββ contexts/ # Settings, Session, Workflow contexts
β β βββ services/ # api.ts, sse.ts
β β βββ hooks/ # use-toast, use-connection-status
β β βββ types/ # TypeScript type definitions
β β βββ lib/ # Utility functions
β βββ public/
βββ evaluation/ # LangSmith evaluation framework
β βββ evaluate_conversation.py # Conversation router evaluation
β βββ evaluate_planner.py # Planner evaluation
β βββ evaluate_programmer.py # Programmer evaluation
β βββ evaluate_workflow.py # End-to-end workflow evaluation
β βββ evaluators/ # Custom LangSmith evaluators
β β βββ conversation_evaluators.py
β β βββ planner_evaluators.py
β β βββ programmer_evaluators.py
β β βββ workflow_evaluators.py
β βββ datasets/ # Evaluation test-case CSVs
β βββ conversation_test.csv
β βββ planner_dataset.csv
β βββ programmer_dataset.csv
β βββ workflow_dataset.csv
βββ Dockerfile
βββ langgraph.json
βββ pyproject.toml
βββ requirements.txt
βββ .env
βββ workflow_diagram.png
| Variable | Description |
|---|---|
GROQ_API_KEY |
Groq API key (also provided per-request from the frontend) |
E2B_API_KEY |
E2B sandbox API key for code execution |
LANGSMITH_API_KEY |
LangSmith API key for prompt management & tracing |
LANGSMITH_PROJECT |
LangSmith project name (default: DataScribe) |
LANGSMITH_TRACING_V2 |
Enable LangSmith V2 tracing (true to enable) |
llama-3.3-70b-versatile(default)llama-3.1-8b-instantopenai/gpt-oss-120b
- Per-user API keys β The Groq API key is provided by the user at request time; no server-side key storage.
- E2B sandbox β All generated Python code executes in an isolated, ephemeral sandbox.
- AST guardrails β Generated code is validated before execution: dangerous builtins, filesystem APIs, and network calls are blocked.
- CSP headers β Strict Content-Security-Policy on API routes; relaxed CSP only for interactive chart iframes.
- File upload limits β 25 MB max, restricted to CSV/Excel/Parquet.
Apache License 2.0 β see LICENSE.
- LangGraph β Multi-agent workflow orchestration
- LangChain β LLM abstractions and prompt management
- Groq β Fast LLM inference
- E2B β Secure cloud sandboxes for code execution
- LangSmith β Prompt management, tracing, and evaluation
- Plotly & Seaborn β Data visualization
- FastAPI β Backend web framework
- React + Vite + Tailwind CSS β Frontend stack

