cd /news/artificial-intelligence/building-an-agent-that-turns-datahub… · home topics artificial-intelligence article
[ARTICLE · art-111429] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Building an Agent That Turns DataHub Metadata Into Airflow DAGs

A developer and their teammate built a tool for DataHub's 'Build with DataHub: The Agent Hackathon' that generates Airflow DAGs from DataHub metadata. The tool walks lineage graphs, reads tags and glossary terms, and maps them to tasks, with an LLM producing a structured plan that a deterministic renderer converts into code. It supports agent and script modes, with the LLM never writing code directly to avoid arbitrary code in production.

read1 min views10 publishedAug 26, 2026

Built this with my teammate for DataHub's "Build with DataHub: The Agent Hackathon." The hackathon has wrapped up, but we're continuing to develop it.

The problem

If you're using DataHub, you already have lineage, freshness SLAs, PII tags, and glossary terms sitting there. But turning that into an actual Airflow DAG still means doing it by hand. What it does

Give it a table name, and it:

Walks the lineage graph backwards to find every upstream dependency

Reads tags (pii, daily_refresh) and glossary terms (FreshnessSLA, EmptyLoad) on each table

Maps signals to tasks, pii → audit task, FreshnessSLA → freshness check

Topologically sorts and reduces the graph, then renders a clean, deterministic Airflow 3 DAG

Can optionally open a GitHub PR with a lineage summary

How it's built

Two modes: an agent mode, where an LLM (Claude, or any model via OpenRouter) explores the DataHub graph through the MCP protocol and produces a plan, and a script mode that skips the LLM entirely for CI use.

The design decision I'd love feedback on: the LLM never writes code directly. It only outputs a structured plan, and a separate deterministic renderer turns that into the actual Airflow task code. Felt like the right boundary between "useful agent" and "don't let an LLM generate arbitrary code that ends up scheduled in prod."

Still rough around the edges

No dbt or Spark operator support yet (just shell task stubs), no schema drift detection, and it's mostly only been tested against the DataHub NYC Taxi sample dataset so far.

Try it

GitHub: [github.com/tdm291104/datahub-dag-generator](//github.com/tdm291104/datahub-dag-generator)

Devpost: [devpost.com/software/datahub-dag-generator](//devpost.com/software/datahub-dag-generator)

Demo: [youtube.com/watch?v=2f0uNNmSBfc](//youtube.com/watch?v=2f0uNNmSBfc)

Feedback and contributions welcome, and if you find it useful, a star on the repo goes a long way!!!

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @datahub 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-an-agent-th…] indexed:0 read:1min 2026-08-26 ·