home
diamond Go Premium
Data Engineering Path  ·  Data & AI

LLM-Based Data Cataloging & Metadata Generation

+-----------------------------------------------------------------------+
|                    AUTOMATED METADATA ENRICHMENT                      |
+-----------------------------------------------------------------------+
|  Table Schema + Sample 100 Rows  -> LLM Cataloger -> Rich Markdown Docs|
|                                                          |            |
|                                                          v            |
|  dbt docs / DataHub / Atlan      <- Verified Docs <- Review Dashboard |
+-----------------------------------------------------------------------+

The Data Catalog Problem

Over 80% of enterprise data warehouse tables lack documentation, descriptions, or ownership tags. Data engineers simply don't have the time to manually write docstrings for thousands of staging and mart tables.

LLMs can inspect:

  1. Column names and data types.
  2. Distinct value profiles and statistical samples.
  3. Upstream and downstream lineage. And automatically synthesize crystal-clear, business-ready column descriptions.

Generating dbt schema.yml Automatically

import pandas as pd
from openai import OpenAI

client = OpenAI()

def generate_dbt_documentation(table_name: str, sample_df: pd.DataFrame) -> str:
    summary_info = {
        "table": table_name,
        "columns": {}
    }
    for col in sample_df.columns:
        summary_info["columns"][col] = {
            "dtype": str(sample_df[col].dtype),
            "sample_values": sample_df[col].dropna().head(3).tolist(),
            "null_count": int(sample_df[col].isnull().sum()),
            "unique_count": int(sample_df[col].nunique())
        }

    prompt = f"""
Generate a production dbt schema.yml file documenting this table and its columns.
Write concise, professional descriptions for each column and recommend appropriate dbt tests (e.g. not_null, unique, accepted_values).

TABLE PROFILE:
{summary_info}
"""
    res = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": prompt}],
        temperature=0.2
    )
    return res.choices[0].message.content
Find this content helpful? ☕ Buy me a coffee

Entity Details

Create New Item

help

Submit Technical Query

Have a question or run into an issue? Describe it below, upload an optional screenshot, and our engineering team will answer it!

image Attach image (optional)

Submit Feedback

build Free Developer Utility Free Tool
gavel

Privacy & Legal Disclaimer

1. Client-Side Browser Processing

All utility tools on DeepEngineerHub (including Image to PDF, Text Formatters, JSON Converters, and Encryptors) execute 100% locally within your client browser using WebAssembly and JavaScript. No uploaded images, text, or documents are transmitted, collected, or stored on remote servers.

2. Limitation of Liability ("As-Is" Provision)

Tools and services are provided free of charge for convenience and educational purposes "as-is" without warranties of any kind. DeepEngineerHub shall not be held liable for any data loss, formatting inconsistencies, or indirect damages resulting from tool usage.

3. Open Source & Third-Party Software

Certain utilities utilize open-source client libraries (such as jsPDF, Mermaid.js, Pyodide) licensed under MIT, Apache, or BSD open licenses. All intellectual property remains with their respective copyright holders.