Mint governed dbt Semantic Layer metrics from the SQL your organization already runs. QueryMint reads institutional query history from DataHub, clusters recurring SQL patterns with sqlglot, compiles dbt Semantic Layer YAML, validates every column against live catalog schema (fail-closed), and writes semantic specs back so the next agent inherits official metric definitions.
Track: Build with DataHub - Metadata-Aware Code Generation · License: Apache-2.0
Judges - start here (no Docker):
pip install -e ".[dev]"
querymint demo && querymint verifyInteractive demo: War room · Examples viewer · 60-second judge guide
Headline: Eval 18/18 grounded · 18/18 VERIFIED write-backs · 176 tests · 92% coverage · dual dataset (orders + customers)
Local war room (from repo root):
cd demo-ui && npm install && npm run devGitHub Pages: enable Settings → Pages → Deploy from branch main → /docs. Or use the Actions workflow (requires Settings → Pages → Source: GitHub Actions).
Your semantic layer is already written - in BI dashboards, analyst notebooks, and ad-hoc SQL that runs against production every day. The dbt Semantic Layer wants YAML. Manually translating institutional SQL is slow, and LLMs hallucinate column names that look plausible but are not in the catalog.
| Ungrounded codegen | QueryMint (catalog-grounded) | |
|---|---|---|
| Column picks correct (18 cases) | 0 / 18 | 18 / 18 |
| Schema gate (orders demo run) | - | 10 / 10 artifacts passed |
| Schema gate (customers demo run) | - | 8 / 8 artifacts passed |
| Write-back protocol | - | 18 / 18 VERIFIED |
Ungrounded baseline simulates typical LLM column hallucination. Full protocol: docs/eval.md.
get_dataset_queries (DataHub)
→ sqlglot intent extraction
→ structural hash clustering
→ Jinja compile → semantic_models + metrics + staging SQL
→ fail-closed schema gate (catalog allow-list)
→ write-back: document + semantic-layer-candidate tag
→ next agent inherits validated metric definitions
Visual diagrams (open in browser):
| Diagram | Description |
|---|---|
| Solution architecture (light) | Clean 3:2 overview for slides / Devpost |
| How we built it (story) | Problem → idea → build → proof |
| Full architecture (dark) | Detailed component map |
- Mine - institutional SQL from DataHub query history
- Extract - SELECT / GROUP BY / aggregations via sqlglot
- Cluster - dedupe recurring patterns by structural hash
- Compile - dbt Semantic Layer YAML + staging models
- Validate - reject any column not in catalog schema (fail-closed)
- Write-back - attach spec to dataset for downstream agents
| Step | DataHub capability | API / tool |
|---|---|---|
| Mine SQL | Institutional query history | get_dataset_queries |
| Validate | Schema field allow-list | schema metadata read |
| Write-back | Next agent inherits metric spec | document + tags + description |
QueryMint reads context from DataHub, validates against it, and writes back semantic-layer candidates. Without query history there is nothing to mine; without schema metadata there is no fail-closed gate.
Details: docs/architecture.md
git clone https://github.com/HawaleShailesh004/querymint-app.git
cd querymint-app
pip install -e ".[dev]"
querymint demo
pytest -qInspect sealed artifacts in examples/. Step-by-step: docs/quickstart.md.
Live DataHub setup
Requires Docker and a running DataHub GMS. See docs/datahub-setup.md.
pip install -e ".[datahub,dev]"
export DATAHUB_GMS_URL=http://localhost:18080 # or :8080
querymint run --write-back --no-fixture
querymint verify --no-fixture --urn "urn:li:dataset:(urn:li:dataPlatform:dbt,showcase_ecommerce.orders,PROD)"| Command | Description |
|---|---|
querymint demo |
Full offline pipeline + eval |
querymint verify |
Verify sealed bundle + dbt lint/parse |
querymint mine --no-fixture |
Show get_dataset_queries output (video/live demo) |
querymint run --write-back --no-fixture |
Live pipeline + PENDING→VERIFIED write-back |
querymint eval |
Regenerate eval table |
Full reference: docs/cli-reference.md
| Path | Purpose |
|---|---|
examples/scenario_walkthrough.md |
Side-by-side ungrounded vs QueryMint |
examples/validation_report.json |
Schema gate - all_passed |
examples/generated/ |
Semantic YAML + dbt SQL |
examples/eval/EVAL.md |
Honest eval |
examples/next_agent_flip/ |
Write-back changes next-agent answers |
| Capability | Status |
|---|---|
Offline demo (querymint demo) |
Wired |
| Fail-closed schema gate | Wired |
Sealed examples/ bundle |
Wired |
| Live DataHub write-back | Wired - needs running GMS |
| Official MCP stdio subprocess | Wired - QUERYMINT_TRANSPORT=mcp |
| Custom web UI | War Room + examples viewer |
| Guide | Description |
|---|---|
| Judges — 60 sec | Fast reproduce path + proof table |
| Quick start | Install, demo, verify |
| Architecture | Pipeline design + diagrams |
| DataHub setup | Docker, ports, seeding queries |
| Evaluation | Grounded vs ungrounded methodology |
| CLI reference | All commands and flags |
| Upstream skill RFC | Proposal for datahub-skills |
176 tests, 92% line coverage (CI enforces ≥85%).
pytest -q --cov=querymint --cov-fail-under=85
python scripts/verify_submission.pydatahub-skills PR #140 — adds the datahub-query-to-semantic skill (open).
- Ready-to-PR bundle:
contributions/datahub-skills/ - Draft skill:
skills/datahub-query-to-semantic/SKILL.md - Open PR guide:
contributions/OPEN_UPSTREAM_PR.md
Apache-2.0 - see LICENSE.
