dbt Documentation and Lineage
A documentation site that cannot lie
dbt generates a live documentation site from your models: descriptions from YAML, lineage from ref() and source(), and test results. The docs never drift from the code because they are compiled from it.
What you will learn
- Describe descriptions and columns in YAML
- Generate and serve the docs site
- Read the lineage graph to trace dependencies
What is this?
dbt docs build an HTML catalog from the project: every model and source with its YAML descriptions, every column with its docs and tests, and a lineage graph drawn from ref()/source() relationships. Running dbt docs generate recompiles the catalog — it is generated documentation, so it matches the code by construction.
Why do you need it?
- Documentation generated from code cannot drift into fiction.
- A searchable catalog is the onboarding ramp for new analysts.
- Lineage turns impact analysis of any change into a glance.
Mental model
A map that redraws itself whenever roads change
dbt lineage and docs
dbt docs generate re-renders the catalog every run, so the map always matches the warehouse being described.
How it works
- Document models and columns in schema YAML.
- dbt docs generate introspects the project and builds catalog.json.
- The docs UI renders descriptions, tests, and the lineage graph.
- Serve the same manifest to data catalogs and BI tool explorers.
YAML descriptions and refs compile into a living catalog.
In production
- Onboarding: analysts read the docs site instead of reverse-engineering tables.
- Impact analysis: before renaming a column, lineage shows every affected model.
- Self-serve: BI teams check metric definitions and owners in the catalog.
Best practices
- Document every mart and every column that needs a decision (units, definitions).
- Run docs generate in CI and upload the manifest to your data catalog.
- Include owners and refresh cadence in the model's meta so questions route somewhere.
Common mistakes
- Documenting in a wiki instead of the YAML so the docs rot.
- Descriptions that rename the column without stating the definition.
- Never refreshing docs after model changes, then trusting an old catalog.
Debugging tips
- If a model is missing from the catalog, its YAML name or path does not match the model.
- If lineage misses an edge, the model probably references a table by name instead of ref().
Interview checkpoint
Quick quiz
dbt docs are generated from
To publish docs that stay fresh, run