Obayemi Oluwafemi
Back to Projects
AI AgentFull-StackIn development

DataPilot

A ReAct data agent that turns natural-language asks into validated SQL/transform DAGs — with self-correction when intermediate checks fail.

01 / Problem

The gap

Analysts still burn most of their week on mechanical ETL: clean the CSV, join the tables, drop test accounts, compute the monthly rollup. BI tools break when schemas drift. Chat-to-SQL demos look clever until a join is wrong and nobody notices. What is missing is an agent that plans a DAG, validates each step, and repairs itself before it ships a wrong number.

02 / Solution

What I built

DataPilot accepts a natural-language instruction, decomposes it into atomic data ops (ingest → validate → transform → aggregate → report), executes against PostgreSQL, and scores intermediate outputs against schema + business constraints. On failure it revises the plan (ReAct loop) instead of returning a confident lie. A Next.js UI shows the live DAG and conversation.

03 / Architecture

How it fits together

FastAPI orchestration with a ReAct planning loop. Atomic ops are pure functions with typed I/O contracts. PostgreSQL as the system of record; intermediate frames stay queryable. Constraint checks after every node (null rates, PK uniqueness, expected columns). Confidence score on the final report based on validation coverage.
04 / Decisions

Technical choices

  • DAG-first planning — the model proposes nodes; the runtime owns execution order and retries.
  • Validate every hop — never trust a single end-to-end SQL generation.
  • Keep ops inspectable in SQL — every intermediate is a named relation, not a black-box dataframe.
05 / Capabilities

System features

  • NL → executable DAG

    Instructions become a graph of typed data ops, not one opaque mega-query.

  • Self-correcting loop

    Failed constraint checks feed back into the planner before the final report.

  • Live DAG view

    Conversational UI streams node status so you see what the agent is doing.

  • Schema-aware checks

    Null rates, keys, and column contracts gate every transform.

06 / Stack

Technologies

PythonFastAPIPostgreSQLNext.jsLangChain
Inspect the codebaseView on GitHub →