AI-Driven Documentation Generation for dbt Data Models

loblaw_digital · E-commerce · 2023 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Analytics engineering documentation

Loblaw Digital needed dbt model and column documentation to stay complete and useful across thousands of data models without forcing engineers to manually maintain repetitive descriptions.

Constraints:

Architecture

Loblaw Digital used dbt-documentor as a metadata-only documentation pipeline: it ingests dbt manifest schema information, calls Vertex AI to draft model and column descriptions, and publishes the result into dbt documentation without reading the underlying data.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  dbt-manifest-metadata["dbt manifest metadata"]
  dbt-documentor["dbt-documentor"]
  vertex-ai-generator["Vertex AI generator"]
  security-boundary["Security boundary"]
  dbt-documentation-site["dbt documentation site"]
  dbt-manifest-metadata --> dbt-documentor
  dbt-documentor --> vertex-ai-generator
  security-boundary --> dbt-manifest-metadata
  security-boundary --> vertex-ai-generator
  dbt-documentor --> dbt-documentation-site
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
dbt manifest metadata Provides model, column, and relationship structure without exposing raw data. dbt-documentor
dbt-documentor Reads dbt schema metadata and orchestrates prompt calls for documentation generation. Vertex AI generator, dbt documentation site
Vertex AI generator Generates model and column descriptions from schema and relationship context. dbt-documentor
Security boundary Keeps the workflow limited to metadata so actual data remains unread. dbt manifest metadata, Vertex AI generator
dbt documentation site Publishes generated descriptions for engineers and business users. dbt-documentor

Data flow

The documentation pipeline starts from dbt manifest metadata, sends schema structure to an LLM, and returns generated model and column descriptions into the dbt documentation surface.

“the dbt documentor ingests the dbt model schema directly from a manifest.json file. From there, the LLMs generate comprehensive documentation”article, stated

Why this architecture

The metadata-only design addresses documentation debt while keeping raw business data out of the LLM path.

“Importantly, this is achieved without reading actual data, thereby ensuring that the integrity and security of the data remain intact.”article, stated

Models used: Vertex AI LLMs

Scale

Alternatives considered (roads not taken)

Manual documentation across dbt files and metadata

Rejected because: The team automated relation-aware documentation because manual cross-referencing was cumbersome and error-prone.

“This innovative approach automates the otherwise cumbersome workflow and utilizes relation information generated by dbt, eliminating the need to manually cross-reference multiple files and metadata”article, stated

Sending actual table data to the LLM

Rejected because: Loblaw kept the input to schema and manifest metadata so data integrity and security remained intact.

“Importantly, this is achieved without reading actual data, thereby ensuring that the integrity and security of the data remain intact.”article, stated

Leaving descriptions optional for each model author

Rejected because: The source says description sections were often omitted across thousands of models, so the system automates the repetitive documentation path.

“This information needs to be manually written down when developing each model, and with thousands of models across different lines of businesses, the description section of the documentation is often omitted.”article, stated

Patterns

structured-output-contract (data-documentation)

The LLM writes structured model and column descriptions from dbt schema metadata rather than free-form ad hoc documentation.

“the dbt documentor ingests the dbt model schema directly from a manifest.json file. From there, the LLMs generate comprehensive documentation”article, stated

privacy-preserving-processing (data-governance)

The documentation generator uses schema and relation metadata without reading the underlying business data.

“Importantly, this is achieved without reading actual data, thereby ensuring that the integrity and security of the data remain intact.”article, stated

Tradeoffs

What data to expose to the documentation LLM.

Chose dbt manifest and relation metadata over actual production data.

Rationale: Metadata gives enough structure to generate useful descriptions while avoiding unnecessary data exposure.

“Leveraging on the ML platform, like Vertex AI, the dbt documentor ingests the dbt model schema directly from a manifest.json file.”article, stated

Gotchas (what bit them)

Documentation debt made dbt models confusing for business users.

Root cause: Manual model and column descriptions were often omitted as the number of models grew across lines of business.

Resolution: Generate descriptions from compiled dbt metadata so documentation coverage can scale with the model graph.

“This information needs to be manually written down when developing each model, and with thousands of models across different lines of businesses, the description section of the documentation is often omitted.”article, stated

Evaluation

The post demonstrates generated dbt documentation and focuses on workflow efficiency rather than a formal quantitative benchmark.

Metrics: documentation coverage · manual cross-reference reduction · business-user clarity

“This innovative approach automates the otherwise cumbersome workflow and utilizes relation information generated by dbt, eliminating the need to manually cross-reference multiple files and metadata”article, stated

Outcomes

Non-agentic LLM automation case; valuable for pattern extraction but not an autonomous agent deployment.

“documentation in the data engineering world is often regarded as a “necessary evil” — crucial for data integrity, compliance, and collaboration, yet burdened by manual processes that are slow and error-prone.”article, implied