Nutri
My inspiration for Nutri
When shopping for food at the grocery store, people rarely read complex biochemical lab reports or manufacturing logs. Instead, they look at an FDA Nutrition Facts panel that condenses calories, macro-nutrients, daily percentage values, and allergen warnings into a clear, standardized label.
Data engineers, analysts, and AI agents face a similar problem when evaluating datasets in modern data platforms. Determining whether a dataset is safe to use requires asking several questions:
- Is this table fresh or stale?
- Are the columns properly documented?
- Are data quality tests passing?
- Is there an owner assigned if something breaks?
Checking all of this in DataHub usually means clicking through five different tabs for schema, lineage, quality assertions, ownership, and governance terms, then manually piecing the answer together.
Nutri was built to solve this problem. It generates a standardized Data Nutrition Facts label for any dataset, dbt model, or dashboard in DataHub, pairing a 0–100 Trust Score with clear sub-scores that anyone can evaluate in a few seconds.
What it does
Nutri transforms DataHub metadata into a standardized health label for catalog entities across platforms including Snowflake, dbt, PostgreSQL, Tableau, Looker, and PowerBI.
Key capabilities include:
Deterministic Trust Score (0–100): Computes a reproducible score using four weighted sub-scores (% Daily Value):
- Freshness: Evaluates age decay against expected refresh cadence and staleness limits.
- Completeness: Measures column documentation coverage along with ownership, domain, and glossary term presence.
- Lineage Depth: Checks upstream and downstream edge connectivity and cross-platform lineage diversity.
- Test Coverage: Tracks the presence and historical pass rates of DataHub data quality assertions.
LLM Verdict and Anti-Hallucination Guardrails: Powered by Google Gemini 2.5 Flash (
@google/genai), Nutri generates a one-sentence summary highlighting dataset strengths and score bottlenecks. Undocumented columns are explicitly marked asUndocumented / Needs Descriptionrather than inventing false descriptions.Warning Banner: Automatically flags critical risk factors such as failing assertions, unowned assets, PII tags, or stale data in a visual callout banner.
DataHub Write-Back Pipeline: Sends GraphQL mutations to DataHub GMS to store five structured properties (
nutriTrustScore,nutriFreshnessScore,nutriCompletenessScore,nutriLineageScore,nutriTestCoverageScore) and applies thenutri:needs-attentiontag whenever a score falls below 70.Flexible Interfaces:
- Interactive Web App: Next.js catalog explorer with real-time scoring weight customization.
- Embedded UI Mode: Lightweight card designed for embedding inside external catalogs or internal documentation.
- DataHub MCP Server: Exposes Model Context Protocol tools for AI coding assistants.
- CLI Tool and CI/CD Quality Gate: Enables automated score checks in terminal environments and build pipelines.
- Talk-to-Data SQL Analytics Agent: AI agent that verifies data health before generating schema-grounded SQL queries.
DataHub Technologies Used
Nutri leverages multiple components of the DataHub platform ecosystem:
DataHub OSS / Core Platform: Integrates directly with DataHub GMS via GraphQL (
/api/graphql) to fetch catalog metadata, assertion run events, glossary terms, and lineage graphs. It performs bi-directional sync by writing back 5 structured properties (nutriTrustScore,nutriFreshnessScore,nutriCompletenessScore,nutriLineageScore,nutriTestCoverageScore) and auto-tagging entities withnutri:needs-attention.DataHub MCP Server: Implements a standalone Model Context Protocol server (scripts/mcp-server.ts) exposing tools like
get_data_nutrition_facts,explain_score,write_trust_score, andgenerate_remediation_patchfor AI tools and coding assistants.DataHub Agent Context Kit: Features a context kit module (src/services/context-kit.ts) that packages schema definitions, quality warnings, score breakdowns, and governance rules into prompt context packets for LLMs.
DataHub Skills: Packaged custom agent instructions in .agents/skills/data-nutrition-facts/SKILL.md that allow AI coding assistants to evaluate dataset health, run CI/CD quality gate audits, and output dbt schema remediation patches.
Analytics Agent: Built the Nutri Analytics Agent and Talk-to-Data Engine (src/services/agent.ts) that provides automated metadata diagnosis, SQL query generation grounded in schema definitions, and data quality risk banners.
How I built it
Nutri was built as a full-stack metadata platform and AI agent toolkit:
- Frontend and Design System: Developed with Next.js 14 (App Router), React 18, Tailwind CSS, Radix UI, and custom CSS (src/styles/nutri-label.css) tailored to recreate the layout and typography of an FDA nutrition label.
- Scoring Engine: Written in pure TypeScript (src/engine/scoring.ts) with externalized scoring weights (src/config/nutri-config.json) for deterministic, reproducible results.
- DataHub GraphQL Integration: Implemented a GraphQL service (src/services/datahub.ts) to query catalog entities, assertion results, and lineage graphs, as well as execute structured property mutations.
- AI & Context Enrichment: Integrated Google Gemini 2.5 Flash via
@google/genaiand builtDataHubContextKit(src/services/context-kit.ts) to prepare structured prompt context for the LLM. - Developer Tooling & MCP: Built a Model Context Protocol server (scripts/mcp-server.ts), a command-line utility (scripts/nutri-cli.ts), and a custom DataHub skill (.agents/skills/data-nutrition-facts/SKILL.md).
- Testing Suite: Added unit and integration tests using Vitest (src/services/tests/).
Challenges I ran into
Designing a Fair Scoring Model:
- Challenge: Building a scoring system that reflects dataset quality fairly without favoring a specific data warehouse or data platform.
- Solution: Structured the model around four balanced pillars (Freshness, Completeness, Lineage, and Test Coverage) normalized from 0 to 100%. Externalized weight configurations so teams can tailor the scoring math to their specific priorities.
Preventing LLM Hallucinations in Schema Documentation:
- Challenge: Large language models tend to invent plausible descriptions when column metadata is missing.
- Solution: Added strict prompt guardrails in
DataHubContextKitthat force the model to label missing metadata asUndocumented / Needs Description, keeping the generated summaries accurate.
Traversing Cross-Platform Lineage Graphs:
- Challenge: Catalogs span heterogenous entities from Snowflake tables to dbt transformation models and BI dashboards, each with different metadata shapes.
- Solution: Wrote graph traversal logic over GraphQL that calculates lineage depth and platform diversity across connected nodes.
Handling GraphQL Synchronization Gracefully:
- Challenge: Keeping live DataHub GMS write-backs responsive without causing UI latency or failing during offline demonstrations.
- Solution: Combined optimistic UI updates with a fallback catalog dataset (showcase-catalog.ts), allowing the app to work seamlessly in both live and offline modes.
Accomplishments that I'm proud of
- Fully Auditable Scoring Engine: The scoring logic is completely rules-based and open source, so anyone can inspect the exact formulas in the codebase.
- Bi-Directional DataHub Integration: Nutri does not just read catalog data; it writes back structured properties and tags low-trust assets with
nutri:needs-attentiondirectly in DataHub GMS. - Native AI Agent Integration: Exposed Nutri functionality through MCP tools, CLI quality gates, and agent skills so downstream AI code generators can check data health before running queries.
- Production Web Deployment: Delivered a responsive Next.js web application deployed on Vercel, supporting standalone browsing and embedded card views.
What I learned
- DataHub GMS Architecture: Gained a deeper understanding of DataHub GraphQL schemas, URN conventions, ownership aspects, assertion events, and structured property mutations.
- Effective Metadata Context for AI: Learned how supplying structured metadata context via
DataHubContextKiteliminates SQL generation hallucinations and improves summary quality. - Building MCP Servers: Explored how the Model Context Protocol standard enables AI tools like Claude, Gemini, and coding agents to interact directly with enterprise data catalogs.
What's next for Nutri
- Automated dbt Remediation Pull Requests: Generating 1-click GitHub Pull Requests containing dbt
schema.ymlpatches to fill in missing column descriptions and tests. - Lineage Degradation Tracing: Adding step-by-step lineage views that highlight exactly where a trust score drops along a pipeline from warehouse to dashboard.
- Event-Driven Webhook Triggers: Re-evaluating scores automatically when DataHub receives new schema or quality ingestion events via Kafka or webhooks.
- Domain and Team Scorecards: Aggregating nutrition facts across entire business domains or engineering teams to monitor overall data governance health.
Log in or sign up for Devpost to join the conversation.