CoolFace
Apppublic

aamanlamba/Lineage-graph-accelerator

sourceHugging Facemitupdated 10mo agoView on Hugging Face
1likes
App README

Lineage Graph Accelerator πŸ”₯

AI-powered data lineage extraction and visualization for modern data platforms

![HuggingFace Space](https://huggingface.co/spaces/aamanlamba/Lineage-graph-accelerator) ![License: MIT](https://opensource.org/licenses/MIT) ![Gradio](https://gradio.app)

πŸŽ‰ Built for the Gradio Agents & MCP Hackathon - Winter 2025 πŸŽ‰ Celebrating MCP's 1st Birthday! This project demonstrates the power of MCP integration for enterprise data governance.

🌟 What is Lineage Graph Accelerator?

Lineage Graph Accelerator is an AI-powered tool that helps data teams:

  • β€”Extract data lineage from dbt, Airflow, BigQuery, Snowflake, and more
  • β€”Visualize complex data dependencies with interactive Mermaid diagrams
  • β€”Export lineage to enterprise data catalogs (Collibra, Microsoft Purview, Alation)
  • β€”Integrate with MCP servers for enhanced AI-powered processing

Why Data Lineage Matters

Understanding where your data comes from and where it goes is critical for:

  • β€”Data Quality: Track data transformations and identify issues
  • β€”Compliance: Document data flows for GDPR, CCPA, and other regulations
  • β€”Impact Analysis: Understand downstream effects of schema changes
  • β€”Data Discovery: Help analysts find and trust data assets

🎯 Key Features

Multi-Source Support

SourceStatusDescription
dbt Manifestβœ…Parse dbt's manifest.json for model dependencies
Airflow DAGβœ…Extract task dependencies from DAG definitions
SQL DDLβœ…Parse CREATE statements for table lineage
BigQueryβœ…Query INFORMATION_SCHEMA for metadata
Custom JSONβœ…Flexible node/edge format for any source
SnowflakeπŸ”„Coming via MCP integration

Export to Data Catalogs

CatalogStatusFormat
OpenLineageβœ…Universal open standard
Collibraβœ…Data Intelligence Platform
Microsoft Purviewβœ…Azure Data Governance
Alationβœ…Data Catalog
Apache AtlasπŸ”„Coming soon

Visualization Options

  • β€”Mermaid Diagrams: Interactive, client-side rendering
  • β€”Subgraph Grouping: Organize by data layer (raw, staging, marts)
  • β€”Color-Coded Nodes: Distinguish sources, tables, models, reports
  • β€”Edge Labels: Show transformation types

πŸš€ Quick Start

Try Online (HuggingFace Space)

  1. 1.Visit Lineage Graph Accelerator on HuggingFace
  2. 2.Click "Load Sample" to load example data
  3. 3.Click "Extract Lineage" to see the visualization
  4. 4.Explore the Demo Gallery for more examples

Run Locally

bash
# Clone the repository
git clone https://github.com/YOUR_REPO/lineage-graph-accelerator.git
cd lineage-graph-accelerator

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the app
python app.py

Open http://127.0.0.1:7860 in your browser.


πŸ“– Usage Guide

1. Text/File Metadata Tab

Paste your metadata directly:

json
{
  "nodes": [
    {"id": "source_db", "type": "source", "name": "Source Database"},
    {"id": "staging", "type": "table", "name": "Staging Table"},
    {"id": "analytics", "type": "table", "name": "Analytics Table"}
  ],
  "edges": [
    {"from": "source_db", "to": "staging"},
    {"from": "staging", "to": "analytics"}
  ]
}

2. Sample Data

Load pre-built samples to explore different scenarios:

  • β€”Simple JSON: Basic node/edge lineage
  • β€”dbt Manifest: Full dbt project with 15+ models
  • β€”Airflow DAG: ETL pipeline with 15 tasks
  • β€”Data Warehouse: Snowflake-style multi-layer architecture
  • β€”ETL Pipeline: Complex multi-source pipeline
  • β€”Complex Demo: 50+ node e-commerce platform

3. Export to Data Catalogs

  1. 1.Extract lineage from your metadata
  2. 2.Expand "Export to Data Catalog"
  3. 3.Select format (OpenLineage, Collibra, Purview, Alation)
  4. 4.Click "Generate Export"
  5. 5.Copy the JSON for import into your catalog

πŸ”Œ MCP Integration

Connect to MCP (Model Context Protocol) servers for enhanced processing:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Lineage Graph  │────▢│   MCP Server    │────▢│   AI Model      β”‚
β”‚   Accelerator   β”‚     β”‚  (HuggingFace)  β”‚     β”‚   (Claude)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Configuration

  1. 1.Expand "MCP Server Configuration" in the UI
  2. 2.Enter your MCP server URL
  3. 3.Add API key (if required)
  4. 4.Click "Test Connection"

Run Local MCP Server

bash
uvicorn mcp_example.server:app --reload --port 9000

Then use http://localhost:9000/mcp as your server URL.


πŸ—οΈ Architecture

mermaid
flowchart TD
    A[User Interface - Gradio] --> B[Input Parser]
    B --> C{Source Type}
    C -->|dbt| D[dbt Parser]
    C -->|Airflow| E[Airflow Parser]
    C -->|SQL| F[SQL Parser]
    C -->|JSON| G[JSON Parser]
    D & E & F & G --> H[LineageGraph]
    H --> I[Mermaid Generator]
    H --> J[Export Engine]
    I --> K[Visualization]
    J --> L[OpenLineage]
    J --> M[Collibra]
    J --> N[Purview]
    J --> O[Alation]

    subgraph Optional
        P[MCP Server] --> H
    end

Project Structure

lineage-graph-accelerator/
β”œβ”€β”€ app.py                 # Main Gradio application
β”œβ”€β”€ exporters/             # Data catalog exporters
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ base.py           # Base classes
β”‚   β”œβ”€β”€ openlineage.py    # OpenLineage format
β”‚   β”œβ”€β”€ collibra.py       # Collibra format
β”‚   β”œβ”€β”€ purview.py        # Microsoft Purview format
β”‚   └── alation.py        # Alation format
β”œβ”€β”€ samples/               # Sample data files
β”‚   β”œβ”€β”€ sample_metadata.json
β”‚   β”œβ”€β”€ dbt_manifest_sample.json
β”‚   β”œβ”€β”€ airflow_dag_sample.json
β”‚   β”œβ”€β”€ sql_ddl_sample.sql
β”‚   β”œβ”€β”€ warehouse_lineage_sample.json
β”‚   β”œβ”€β”€ etl_pipeline_sample.json
β”‚   └── complex_lineage_demo.json
β”œβ”€β”€ mcp_example/          # Example MCP server
β”‚   └── server.py
β”œβ”€β”€ tests/                # Unit tests
β”‚   └── test_app.py
β”œβ”€β”€ memories/             # Agent configuration
β”œβ”€β”€ USER_GUIDE.md         # Comprehensive user guide
β”œβ”€β”€ BUILD_PLAN.md         # Development roadmap
└── requirements.txt

πŸ§ͺ Testing

bash
# Activate virtual environment
source .venv/bin/activate

# Run unit tests
python -m unittest tests.test_app -v

# Run setup validation
python test_setup.py

πŸ“‹ Requirements

  • β€”Python 3.9+
  • β€”Gradio 5.49.1+
  • β€”See requirements.txt for full dependencies

πŸŽ–οΈ Competition Submission

Track: Track 2 - MCP in Action (Productivity)

Team Members:

Judging Criteria Alignment

CriteriaImplementation
UI/UX DesignClean, professional interface with tabs, accordions, and color-coded visualizations
FunctionalityFull MCP integration, multiple input formats, 5 export formats
CreativityNovel approach to data lineage visualization with AI-powered parsing
DocumentationComprehensive README, USER_GUIDE.md, inline comments
Real-world ImpactSolves critical enterprise need for data governance and compliance

Demo Video

πŸ“Ί YouTube: Watch the Demo πŸŽ₯ Loom: Alternative Link

Highlights:

  • β€”AI Assistant with Google Gemini generating lineage from natural language
  • β€”MCP Integration with Local Demo server
  • β€”Demo Gallery with 50+ node complex pipelines
  • β€”Export to Collibra, Purview, and Apache Atlas
  • β€”Interactive Mermaid visualizations with zoom and download

Social Media Post

πŸ“± LinkedIn: View the announcement post


πŸ”œ Roadmap

  • β€”[x] Gradio 6 upgrade for enhanced UI components
  • β€”[x] Agentic chatbot for natural language queries (Google Gemini)
  • β€”[x] Apache Atlas export support
  • β€”[ ] File upload functionality
  • β€”[x] Graph export as PNG/SVG
  • β€”[ ] Batch processing API
  • β€”[ ] Column-level lineage

🀝 Contributing

Contributions welcome! Please:

  1. 1.Fork the repository
  2. 2.Create a feature branch
  3. 3.Make your changes
  4. 4.Submit a pull request

See CONTRIBUTING.md for guidelines.


πŸ“„ License

MIT License - see LICENSE for details.


πŸ™ Acknowledgments

  • β€”Anthropic - MCP Protocol and Claude
  • β€”Gradio Team - Amazing UI framework
  • β€”HuggingFace - Hosting and community
  • β€”dbt Labs - Inspiration for metadata standards
  • β€”OpenLineage - Open lineage specification

πŸ“ž Support


<p align="center"> Built with ❀️ by <a href="https://aamanlamba.com"><strong>Aaman Lamba</strong></a> for the <strong>Gradio Agents & MCP Hackathon - Winter 2025</strong> <br> Celebrating MCP's 1st Birthday! πŸŽ‚ </p>