Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataAnalystAgent

A lightweight orchestration layer that chains two existing LangGraph projects into a single pipeline:

  1. data-cleaning-agent: LLM-driven data cleaning
  2. eda-workflow: automated first-pass exploratory data analysis

Flow: raw CSV → PII guardrail → clean data → EDA report

Why this project exists

DataAnalystAgent demonstrates agent-to-agent orchestration without rewriting either sub-project. The parent graph handles state passing, input guardrails (PII detection), and conditional routing (e.g. blocking the pipeline when PII is found, or skipping EDA when cleaning fails).

Setup

Prerequisites

  • Python 3.10 or 3.11
  • Poetry
  • OpenAI API key

Install

From this folder:

poetry install

Copy the example environment file and fill in your key:

cp .env.example .env

Then edit .env and set your OpenAI API key:

OPENAI_API_KEY=sk-your-key-here

Run example

poetry run python example_usage.py

Project structure

data-analyst-agent/
├── data_analyst_agent/
│   ├── __init__.py
│   ├── guardrails.py
│   ├── orchestrator.py
│   └── orchestrator_reference.py
├── .env.example
├── example_usage.py
├── pyproject.toml
└── README.md
  • orchestrator.py — Student version with TODOs to complete.
  • orchestrator_reference.py — Complete solution for reference.
  • guardrails.py — PII column detection guardrail.

Graph visualization

Running example_usage.py saves three graph diagrams by default:

File Graph
graph.png Parent orchestration graph
cleaning_graph.png data-cleaning-agent package
eda_graph.png eda-workflow package

Use DataAnalystAgent.save_graph_diagrams() to control which diagrams are written. Pass None for any filename to skip it:

agent.save_graph_diagrams(
    orchestrator_filename="graph.png",
    cleaning_filename="cleaning_graph.png",
    eda_filename=None,  # skip EDA diagram
)

Set xray=True to expand nested subgraph internals in the orchestrator diagram.

LangSmith (optional)

To enable tracing, set the LangSmith variables in your .env file. If they are not set, the pipeline runs normally without tracing.

Notes

  • Both sub-projects (data-cleaning-agent and eda-workflow) are linked as local path dependencies in pyproject.toml. This means they are expected to live in sibling directories (e.g. ../data-cleaning-agent and ../eda-workflow). When you run poetry install, Poetry resolves them from those local paths rather than from PyPI.
  • A PII guardrail runs before any LLM call and blocks the pipeline if sensitive columns are detected.
  • If cleaning fails, EDA is skipped.

About

Repository for the datascience bootcamp in June/July 2026

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages