Skip to main content

Metadata Enrichment

The metadata enrichment pipeline uses LLMs to automatically generate descriptions, classifications, and data quality rule suggestions for profiled data assets. This transforms raw schema information into rich, governed metadata that helps data teams understand and trust their data.

What Gets Enriched

Enrichment Pipeline

The enrichment workflow is orchestrated by Prefect and uses the OpenAI API for LLM-powered analysis:
1

Input preparation

The workflow gathers schema information and profiling results for the target tables. Schema context (all tables and relationships) is assembled using prepare_tables_and_schema() to give the LLM full database context.
2

LLM enrichment

Schema and profiling data are sent to the LLM with structured prompts. The LLM generates metadata enrichments based on:
  • Column names and types
  • Profiling statistics (completeness, uniqueness, patterns)
  • Table relationships and foreign keys
  • Cross-table context (schema_info for understanding relationships)
3

Validation

Generated metadata is validated against the schema. PII classifications are cross-checked with column patterns and profiling data.
4

Storage

Enriched metadata is stored in the Data Governance database, linked to the corresponding data asset records.

Schema Context for Better Enrichment

The enrichment pipeline provides full schema context to the LLM for higher-quality results:
Providing full schema context allows the LLM to understand foreign key relationships and generate more accurate business descriptions. For example, it can identify that customer_id in the orders table references the customers table and generate appropriate descriptions.

Concurrency Control

Enrichment workflows use the same hybrid concurrency model as profiling: The task-level semaphore is particularly important for enrichment to avoid hitting LLM API rate limits:

LLM Configuration

The enrichment pipeline uses LiteLLM and is provider-agnostic — defaults to Vertex AI but works with any LiteLLM-supported provider:
Enrichment prompts include database schema information and profiling statistics. Ensure your LLM provider’s data handling policies are compatible with the sensitivity level of your data. For Restricted data, consider using self-hosted LLMs.

DQ Rule Generation

As part of enrichment, the LLM suggests data quality (DQ) rules for each column: Generated rules are stored as structured metadata and can be used by the DQ monitoring system to track quality over time.

Enrichment Results

Access enrichment results via the Data Governance API:

Next Steps

Data Profiling

Profile your data before enrichment to provide statistical context.

Workflows

Learn about the Prefect orchestration system that runs enrichment.

GDPR Compliance

Understand PII classification in the context of GDPR.

Data Classification

Review how enrichment outputs map to data classification levels.