Prerequisites
- Slack connected (the agent posts a documentation summary to
#analytics-engviapost_slack_message). - Familiarity with programmable agents and running an agent with Bolt.
- Write access to the repo, so the agent can commit to the PR branch.
Steps
1
Create the agent
Build the agent in the Agent UI (start from the
doc-backfiller template), or commit this file at .dinoai/agents/doc-backfiller.yml. It defines the agent’s role, four-step goal, staleness detection logic, guardrails, and Slack output channel..dinoai/agents/doc-backfiller.yml
tools.mode: allowlist restricts the agent to only the tools listed. Notably run_sql_query is excluded: the agent works entirely from the SQL source files and YAML, not from the warehouse, so no live database connection is needed.2
Run it on every PR with Bolt
Add a Run Paradime DinoAI Agent command to a Bolt schedule and set its trigger to run on pull request merge, so the agent backfills docs whenever models change. See Run an agent with Bolt for the full walkthrough.In the schedule’s Run Paradime DinoAI Agent command, pick
doc-backfiller as the agent and give it a task that names the changed files, for example:3
Review the backfilled docs
After the agent runs, open the PR. You’ll see a new commit
docs: backfill missing descriptions [DinoAI] on the branch, a PR comment with the per-file summary, and the same summary in #analytics-eng. Confirm or edit any TODO: confirm with owner entries and remove any # STALE columns you agree are no longer needed before merging.On a PR that adds or changes models with undocumented columns, the agent commits filled-in descriptions and posts a summary. On a PR where everything is already documented, it skips the commit and reports full coverage instead. Descriptions it could not infer are marked
TODO: confirm with owner, and columns dropped from the SQL are flagged # STALE rather than deleted.How it works
The agent is handed the list of changed.sql and .yml files. For each changed model it compares the SQL definition against the existing schema YAML, drafts any missing or stale descriptions, writes the YAML changes, commits them directly to the PR branch, and posts a summary. The PR author sees a new commit appear with all documentation gaps filled.
When docs are considered stale
The agent flags an existing description as stale when any of the following are true after a SQL change:- A column is referenced in the
.sqlfile but has no entry in the schema YAML. - A column exists in the schema YAML but is no longer selected in the SQL.
- The model’s SQL logic has changed substantially enough that the model-level description no longer matches what the model produces (detected by reading both the old and new SQL).
The agent does not delete stale column entries automatically. Instead it adds an inline
# STALE: column no longer selected — confirm removal comment in the YAML so a human reviews before merging. This prevents accidental data contract breakage downstream.TODO: confirm with owner rather than guessing. If existing documentation is still accurate after a change, it leaves it untouched.
What the PR author sees
- They open a PR adding or modifying a dbt™ model.
-
Within a few minutes, a new commit appears on their branch:
docs: backfill missing descriptions [DinoAI]. -
A PR comment appears with the full completion summary:
📝 DinoAI doc backfiller - complete Models checked: 3 Model descriptions added: 2 Column descriptions added: 11 Stale columns flagged: 1 (marked
# STALEin YAML) Descriptions needing review: 2 (marked# REVIEWin YAML) Files updated:models/marts/_fct_orders.yml- 5 column descriptions addedmodels/staging/_stg_sessions.yml- 6 column descriptions added, 1 stale column flaggedmodels/staging/_stg_users.yml- model description added, 2 descriptions need review
feat/add-revenue-mart⚠️ 3 entries markedTODO: confirm with owner- please review before merging. -
The same summary is posted to
#analytics-engon Slack.
Prefer to orchestrate the run yourself from a GitHub Actions workflow, Airflow, or a webhook? Trigger the agent through the API with
triggerDinoaiAgentRun and pass the changed-file list in the message. See the API and SDK reference.Next steps
Run an agent with Bolt
Trigger this agent on a schedule, on merge, or in Turbo CI.
dbt™ test maintainer
Write and validate missing tests on the same PR.
End-to-end PR reviewer
Review scope, code, tests, and docs in one pass.
Programmable Agents reference
The agent YAML schema and tools.